sim: microblaze: enable some basic trace points
authorMike Frysinger <vapier@gentoo.org>
Tue, 27 Apr 2021 03:17:15 +0000 (23:17 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 5 May 2021 01:49:11 +0000 (21:49 -0400)
This isn't super complete, but it's useful enough as-is.

sim/microblaze/ChangeLog
sim/microblaze/interp.c
sim/microblaze/microblaze.isa

index 8300491731d6100b8a6076333299cd33ecba9a9c..c78e896f4c76e304f4a62f3821e55f330076be5b 100644 (file)
@@ -1,3 +1,9 @@
+2021-05-04  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_engine_run): Call TRACE_INSN.
+       (INSTRUCTION): Likewise.
+       * microblaze.isa (addi): Call TRACE_REGISTER.
+
 2021-05-04  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c: Include sim-syscall.h.
index 129291895d1cc9ed9089f85cd5cd0e152d84dc13..bff73279d2630f6cd2a3fb7a8b52360cab21c756 100644 (file)
@@ -168,6 +168,7 @@ sim_engine_run (SIM_DESC sd,
        {
          insts += 1;
          bonus_cycles++;
+         TRACE_INSN (cpu, "HALT (%i)", RETREG);
          sim_engine_halt (sd, NULL, NULL, NULL_CIA, sim_exited, RETREG);
        }
       else
@@ -176,6 +177,7 @@ sim_engine_run (SIM_DESC sd,
            {
 #define INSTRUCTION(NAME, OPCODE, TYPE, ACTION)                \
            case NAME:                                  \
+             TRACE_INSN (cpu, #NAME);                  \
              ACTION;                                   \
              break;
 #include "microblaze.isa"
index a7ac0d4562bb5c45ebb1f6bdb9e288c26e748d57..1d96e8fc1c7c06b883e048010c9a104b9bbfbbd8 100644 (file)
@@ -110,6 +110,7 @@ INSTRUCTION(addi,
            INST_TYPE_RD_RA_IMM,
             CARRY = C_calc(RA, IMM, 0);
            RD = RA + IMM;
+           TRACE_REGISTER (cpu, "r%i = r%i + %i", rd, ra, IMM);
            C_wr(CARRY);
            PC += INST_SIZE)