diff options
author | dave-estes-syzexion <53795406+dave-estes-syzexion@users.noreply.github.com> | 2019-09-18 14:14:56 -0400 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2019-09-18 11:14:56 -0700 |
commit | c171379c7828ae94d969846874a7ac542dbda2c3 (patch) | |
tree | 872b8242f3178d86c7371a1a1a10e960a98539a7 /riscv/execute.cc | |
parent | 6d15c93fd75db322981fe58ea1db13035e0f7add (diff) | |
download | spike-c171379c7828ae94d969846874a7ac542dbda2c3.zip spike-c171379c7828ae94d969846874a7ac542dbda2c3.tar.gz spike-c171379c7828ae94d969846874a7ac542dbda2c3.tar.bz2 |
Adds --log-commits commandline option. (#323)
* Adds --log-commits commandline option.
Similar to histogram support, the commit logging feature must be
enabled with a configure option: --enable-commitlog. However, unlike
that feature, there was no way to turn off the logging with a
commandline option once the functionality was built in. This (git)
commit provides that abilty.
* Changes addressing review feedback.
Diffstat (limited to 'riscv/execute.cc')
-rw-r--r-- | riscv/execute.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index 822d934..9183f68 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -77,7 +77,9 @@ static reg_t execute_insn(processor_t* p, reg_t pc, insn_fetch_t fetch) commit_log_stash_privilege(p); reg_t npc = fetch.func(p, fetch.insn, pc); if (npc != PC_SERIALIZE_BEFORE) { - commit_log_print_insn(p->get_state(), pc, fetch.insn); + if (p->get_log_commits()) { + commit_log_print_insn(p->get_state(), pc, fetch.insn); + } p->update_histogram(pc); } return npc; |