sim: microblaze: enable some basic trace points

Message ID 20210427033131.24798-1-vapier@gentoo.org
State New
Headers show
Series
  • sim: microblaze: enable some basic trace points
Related show

Commit Message

Wei-min Pan via Gdb-patches April 27, 2021, 3:31 a.m.
This isn't super complete, but it's useful enough as-is.
---
 sim/microblaze/interp.c       | 2 ++
 sim/microblaze/microblaze.isa | 1 +
 2 files changed, 3 insertions(+)

-- 
2.30.2

Patch

diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index 129291895d1c..bff73279d263 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -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"
diff --git a/sim/microblaze/microblaze.isa b/sim/microblaze/microblaze.isa
index a7ac0d4562bb..1d96e8fc1c7c 100644
--- a/sim/microblaze/microblaze.isa
+++ b/sim/microblaze/microblaze.isa
@@ -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)