aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_step.sail
diff options
context:
space:
mode:
authorRobert Norton <rmn30@cam.ac.uk>2019-06-26 17:33:16 +0100
committerRobert Norton <rmn30@cam.ac.uk>2019-06-26 17:33:16 +0100
commit57694dc5a53d84a0d9299b59c45676eacf121bc7 (patch)
tree60aec2beba1e0e5f03e483e60afca4349bcb1d02 /model/riscv_step.sail
parentc4260c12c978866d8701156695140cfaf7c6dc68 (diff)
downloadsail-riscv-57694dc5a53d84a0d9299b59c45676eacf121bc7.zip
sail-riscv-57694dc5a53d84a0d9299b59c45676eacf121bc7.tar.gz
sail-riscv-57694dc5a53d84a0d9299b59c45676eacf121bc7.tar.bz2
Add command line option in c_emulator for disabling tracing. Add builtins for getting values of config_print_xxx variables to speed up emulation when not tracing.
Diffstat (limited to 'model/riscv_step.sail')
-rw-r--r--model/riscv_step.sail8
1 files changed, 6 insertions, 2 deletions
diff --git a/model/riscv_step.sail b/model/riscv_step.sail
index 4b5c1c5..12c8522 100644
--- a/model/riscv_step.sail
+++ b/model/riscv_step.sail
@@ -31,7 +31,9 @@ function step(step_no) = {
/* non-error cases: */
F_RVC(h) => {
let ast = decodeCompressed(h);
- print_instr("[" ^ string_of_int(step_no) ^ "] [" ^ cur_privilege ^ "]: " ^ BitStr(PC) ^ " (" ^ BitStr(h) ^ ") " ^ ast);
+ if get_config_print_instr() then {
+ print_instr("[" ^ string_of_int(step_no) ^ "] [" ^ cur_privilege ^ "]: " ^ BitStr(PC) ^ " (" ^ BitStr(h) ^ ") " ^ ast);
+ };
/* check for RVC once here instead of every RVC execute clause. */
if haveRVC() then {
nextPC = PC + 2;
@@ -43,7 +45,9 @@ function step(step_no) = {
},
F_Base(w) => {
let ast = decode(w);
- print_instr("[" ^ string_of_int(step_no) ^ "] [" ^ cur_privilege ^ "]: " ^ BitStr(PC) ^ " (" ^ BitStr(w) ^ ") " ^ ast);
+ if get_config_print_instr() then {
+ print_instr("[" ^ string_of_int(step_no) ^ "] [" ^ cur_privilege ^ "]: " ^ BitStr(PC) ^ " (" ^ BitStr(w) ^ ") " ^ ast);
+ };
nextPC = PC + 4;
(execute(ext_post_decode_hook(ast)), true)
}