summaryrefslogtreecommitdiff
path: root/riscv/riscv_prelude.c
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/riscv_prelude.c')
-rw-r--r--riscv/riscv_prelude.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/riscv/riscv_prelude.c b/riscv/riscv_prelude.c
index c8145df4..16219137 100644
--- a/riscv/riscv_prelude.c
+++ b/riscv/riscv_prelude.c
@@ -1,4 +1,5 @@
#include "riscv_prelude.h"
+#include "riscv_config.h"
unit print_string(sail_string prefix, sail_string msg)
{
@@ -6,3 +7,26 @@ unit print_string(sail_string prefix, sail_string msg)
return UNIT;
}
+unit print_instr(sail_string s)
+{
+ if (config_print_instr) printf("%s\n", s);
+ return UNIT;
+}
+
+unit print_reg(sail_string s)
+{
+ if (config_print_reg) printf("%s\n", s);
+ return UNIT;
+}
+
+unit print_mem_access(sail_string s)
+{
+ if (config_print_mem_access) printf("%s\n", s);
+ return UNIT;
+}
+
+unit print_platform(sail_string s)
+{
+ if (config_print_platform) printf("%s\n", s);
+ return UNIT;
+}