aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam McSpaddden <bill@riscv.org>2023-06-12 11:29:22 -0500
committerWilliam McSpaddden <bill@riscv.org>2023-06-12 11:29:22 -0500
commit579f115bcd02f834d7827234a5fd222642a08fc9 (patch)
treee0fde07e33b69ca841b0d1e3c71fc6342543eb1b
parentbc937fa186fcd02bf8fa57c27e7c729804b4d362 (diff)
downloadsail-riscv-579f115bcd02f834d7827234a5fd222642a08fc9.zip
sail-riscv-579f115bcd02f834d7827234a5fd222642a08fc9.tar.gz
sail-riscv-579f115bcd02f834d7827234a5fd222642a08fc9.tar.bz2
fixed instruction count. test now appears to run correctly
-rw-r--r--c_emulator/platform/.riscv_events_example.c.swpbin16384 -> 0 bytes
-rw-r--r--c_emulator/platform/riscv_events_example.c2
-rw-r--r--model/riscv_step.sail2
3 files changed, 3 insertions, 1 deletions
diff --git a/c_emulator/platform/.riscv_events_example.c.swp b/c_emulator/platform/.riscv_events_example.c.swp
deleted file mode 100644
index d225b65..0000000
--- a/c_emulator/platform/.riscv_events_example.c.swp
+++ /dev/null
Binary files differ
diff --git a/c_emulator/platform/riscv_events_example.c b/c_emulator/platform/riscv_events_example.c
index 9d19c97..0e2f0c1 100644
--- a/c_emulator/platform/riscv_events_example.c
+++ b/c_emulator/platform/riscv_events_example.c
@@ -43,7 +43,7 @@ void signal_platform_events() {
uint64_t inst = zinstruction;
(void) inst;
- printf("%s, %d, %s: \n", __FILE__, __LINE__, __FUNCTION__);
+ printf("%s, %d, %s: inst: 0x%016lx\n", __FILE__, __LINE__, __FUNCTION__, inst);
// rs2 test
#define RS2_IDX 20
diff --git a/model/riscv_step.sail b/model/riscv_step.sail
index 8d19ebf..bfd99ad 100644
--- a/model/riscv_step.sail
+++ b/model/riscv_step.sail
@@ -99,6 +99,7 @@ function step(step_no : int) -> bool = {
/* non-error cases: */
F_RVC(h) => {
instbits = EXTZ(h);
+ instruction = EXTZ(h);
let ast = ext_decode_compressed(h);
if get_config_print_instr()
then {
@@ -115,6 +116,7 @@ function step(step_no : int) -> bool = {
},
F_Base(w) => {
instbits = EXTZ(w);
+ instruction = w;
let ast = ext_decode(w);
if get_config_print_instr()
then {