From 0bfaf06a4ace279f9369f60ad00ec990b8c76ea3 Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Thu, 10 Nov 2022 13:43:14 +0100 Subject: [PATCH] main.cpp add VEXRISCV_JTAG=yes --- src/test/cpp/regression/main.cpp | 29 +++++++++++++++++++++++++++++ src/test/cpp/regression/makefile | 4 ++++ 2 files changed, 33 insertions(+) diff --git a/src/test/cpp/regression/main.cpp b/src/test/cpp/regression/main.cpp index adf7b5b..0c3fdd3 100644 --- a/src/test/cpp/regression/main.cpp +++ b/src/test/cpp/regression/main.cpp @@ -3073,6 +3073,31 @@ public: #include "jtag.h" +#ifdef VEXRISCV_JTAG +class VexRiscvJtag : public SimElement{ +public: + Workspace *ws; + VVexRiscv* top; + + VexRiscvJtag(Workspace* ws){ + this->ws = ws; + this->top = ws->top; + } + + virtual void onReset(){ + top->debugReset = 1; + } + + virtual void preCycle(){ + + } + + virtual void postCycle(){ + top->debugReset = 0; + } +}; +#endif + void Workspace::fillSimELements(){ #ifdef IBUS_SIMPLE simElements.push_back(new IBusSimple(this)); @@ -3126,6 +3151,10 @@ void Workspace::fillSimELements(){ #ifdef RISCV_JTAG simElements.push_back(new Jtag(&top->jtag_tms, &top->jtag_tdi, &top->jtag_tdo, &top->jtag_tck, 4)); #endif + #ifdef VEXRISCV_JTAG + simElements.push_back(new Jtag(&top->jtag_tms, &top->jtag_tdi, &top->jtag_tdo, &top->jtag_tck, 4)); + simElements.push_back(new VexRiscvJtag(this)); + #endif } mutex Workspace::staticMutex; diff --git a/src/test/cpp/regression/makefile b/src/test/cpp/regression/makefile index 13bfbb3..e02f3b8 100644 --- a/src/test/cpp/regression/makefile +++ b/src/test/cpp/regression/makefile @@ -308,6 +308,10 @@ ifeq ($(RISCV_JTAG),yes) ADDCFLAGS += -CFLAGS -DRISCV_JTAG endif +ifeq ($(VEXRISCV_JTAG),yes) + ADDCFLAGS += -CFLAGS -DVEXRISCV_JTAG +endif + ifeq ($(REF),yes) ADDCFLAGS += -CFLAGS -DREF