From f0a004be9d875049dfaa6850a7cfa3bb295ce5c8 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Thu, 9 May 2024 13:42:16 +0200 Subject: [PATCH] adds information for debugging --- src/iss/arch/tgc5c.h | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/iss/arch/tgc5c.h b/src/iss/arch/tgc5c.h index cff086d..06d74de 100644 --- a/src/iss/arch/tgc5c.h +++ b/src/iss/arch/tgc5c.h @@ -76,7 +76,53 @@ template <> struct traits { static constexpr std::array reg_byte_offsets{ {0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,137,141,145,149,157,165,173,177}}; +/* +For easy lookup: +X0 (zero): 0x0000 +X1 (ra) : 0x0004 +X2 (sp) : 0x0008 +X3 (gp) : 0x000c +X4 (tp) : 0x0010 +X5 (t0) : 0x0014 +X6 (t1) : 0x0018 +X7 (t2) : 0x001c +X8 (s0/fp): 0x0020 +X9 (s1) : 0x0024 +X10 (a0) : 0x0028 +X11 (a1) : 0x002c +X12 (a2) : 0x0030 +X13 (a3) : 0x0034 +X14 (a4) : 0x0038 +X15 (a5) : 0x003c +X16 (a6) : 0x0040 +X17 (a7) : 0x0044 +X18 (s2) : 0x0048 +X19 (s3) : 0x004c +X20 (s4) : 0x0050 +X21 (s5) : 0x0054 +X22 (s6) : 0x0058 +X23 (s7) : 0x005c +X24 (s8) : 0x0060 +X25 (s9) : 0x0064 +X26 (s10) : 0x0068 +X27 (s11) : 0x006c +X28 (t3) : 0x0070 +X29 (t4) : 0x0074 +X30 (t5) : 0x0078 +X31 (t6) : 0x007c +PC : 0x0080 +NEXT_PC : 0x0084 +PRIV : 0x0085 +DPC : 0x0089 +trap_state : 0x008d +pending_trap : 0x0091 +icount : 0x0095 +cycle : 0x009d +instret : 0x00a5 +instruction : 0x00ad +last_branch : 0x00b1 +*/ static const uint64_t addr_mask = (reg_t(1) << (XLEN - 1)) | ((reg_t(1) << (XLEN - 1)) - 1); enum sreg_flag_e { FLAGS };