From bcc0437a9cffe5e8487c4ca3f9b638142c8280de Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 23 Jan 2022 13:52:49 +0000 Subject: [PATCH] when TRIGGER_COUNTDOWN not enabled, make it on all the time --- verilator/microwatt-verilator.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/verilator/microwatt-verilator.cpp b/verilator/microwatt-verilator.cpp index 9e39055..8fe2973 100644 --- a/verilator/microwatt-verilator.cpp +++ b/verilator/microwatt-verilator.cpp @@ -126,9 +126,11 @@ static void mem_write(unsigned char *mem, } #define BRAM_DEBUG + +// sigh yes, all these should be runtime commandline options #define TRIGGER_ENABLE #define TRIGGER_OCCURENCES 1 -#define TRIGGER_COUNTDOWN 10000 +//#define TRIGGER_COUNTDOWN 10000 //#define TERMINATE_AT_COUNTDOWN //#define TRIGGER_NIA 0xa580 //#define TRIGGER_INSN 0xe8628008 @@ -255,11 +257,14 @@ int main(int argc, char **argv) // trace conditions bool traceme = true; - int trigger_countdown = TRIGGER_COUNTDOWN; int trigger_occurrences = TRIGGER_OCCURENCES; +#ifdef TRIGGER_COUNTDOWN + int trigger_countdown = TRIGGER_COUNTDOWN; +#else #ifdef TRIGGER_ENABLE traceme = false; #endif +#endif // TRIGGER_COUNTDOWN while(!Verilated::gotFinish()) { @@ -305,6 +310,7 @@ int main(int argc, char **argv) --trigger_occurrences; } } +#ifdef TRIGGER_COUNTDOWN // tracing active for only TRIGGER_COUNTDOWN cycles if (traceme) { --trigger_countdown; @@ -315,16 +321,19 @@ int main(int argc, char **argv) #endif } } -#endif +#endif // TRIGGER_COUNTDOWN +#endif // TRIGGER_ENABLE fprintf(dump, "pc %16lx insn %8x msr %16lx", top->nia, top->insn, top->msr_o); } +#ifdef LDST_DUMP if (top->ldst_req) { if (!top->nia_req) { fprintf(dump, "pc %-16s insn %-8s msr %-16s", "", "", ""); } fprintf(dump, " ldst %16lx", top->ldst_addr); } +#endif if (top->ldst_req || top->nia_req) { fprintf(dump, "\n"); } -- 2.30.2