#define BRAM_DEBUG
#define TRIGGER_ENABLE
-#define TRIGGER_NIA 0xa580
-#define TRIGGER_INSN 0xe8628008
-#define TRIGGER_COUNTDOWN 200000
+#define TRIGGER_OCCURENCES 1
+#define TRIGGER_COUNTDOWN 10000
+//#define TERMINATE_AT_COUNTDOWN
+//#define TRIGGER_NIA 0xa580
+//#define TRIGGER_INSN 0xe8628008
+//#define TRIGGER_NIA 0x900
+//#define TRIGGER_INSN 0x7db243a6
+//define TRIGGER_NIA 0x603348
+//#define TRIGGER_INSN 0x7c842a14
+#define TRIGGER_NIA 0xc00000000042f788
+#define TRIGGER_INSN 0x7c0802a6
+//#define TRIGGER_NIA 0xc000000000077b90
+//#define TRIGGER_NIA 0xc0000000000cf600
+//#define TRIGGER_INSN 0x38210040
+//#define TRIGGER_INSN 0xb3be000a
//#define TRIGGER_NIA 0x335c
//#define TRIGGER_INSN 0x3c400001
// trace conditions
bool traceme = true;
int trigger_countdown = TRIGGER_COUNTDOWN;
+ int trigger_occurrences = TRIGGER_OCCURENCES;
#ifdef TRIGGER_ENABLE
traceme = false;
#endif
if (top->nia_req) {
#ifdef TRIGGER_ENABLE
if ((top->nia == TRIGGER_NIA) && (top->insn == TRIGGER_INSN)) {
- traceme = true;
- fprintf(dump, "trace trigger enabled\n");
+ if (trigger_occurrences == 1) {
+ traceme = true;
+ fprintf(dump, "trace trigger enabled\n");
+ }
+ if (trigger_occurrences != 0) {
+ --trigger_occurrences;
+ }
}
// tracing active for only TRIGGER_COUNTDOWN cycles
if (traceme) {
- trigger_countdown--;
+ --trigger_countdown;
if (trigger_countdown == 0) {
traceme = false;
+#ifdef TERMINATE_AT_COUNTDOWN
+ break;
+#endif
}
}
#endif
- fprintf(dump, "pc %8x insn %8x msr %16lx",
+ fprintf(dump, "pc %16lx insn %8x msr %16lx",
top->nia, top->insn, top->msr_o);
}
if (top->ldst_req) {
if (!top->nia_req) {
- fprintf(dump, "pc %-8s insn %-8s msr %-16s", "", "", "");
+ fprintf(dump, "pc %-16s insn %-8s msr %-16s", "", "", "");
}
fprintf(dump, " ldst %16lx", top->ldst_addr);
}