Skip to content

Commit

Permalink
emu: fix the range of dump-ref-trace (#178)
Browse files Browse the repository at this point in the history
It should follow the region specified by `-b` and `-e`.
  • Loading branch information
poemonsense authored Sep 28, 2023
1 parent 556dc4c commit abd34bc
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions src/test/csrc/verilator/emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ static inline void print_help(const char *file) {
#endif
printf(" --flash the flash bin file for simulation\n");
printf(" --sim-run-ahead let a fork of simulator run ahead of commit for perf analysis\n");
printf(" --ref-trace print reference trace\n");
printf(" --wave-path=FILE dump waveform to a specified PATH\n");
printf(" --ram-size=SIZE simulation memory size, for example 8GB / 128MB\n");
printf(" --enable-fork enable folking child processes to debug\n");
Expand Down Expand Up @@ -135,7 +134,6 @@ inline EmuArgs parse_args(int argc, const char *argv[]) {
{ "wave-path", 1, NULL, 0 },
{ "ram-size", 1, NULL, 0 },
{ "sim-run-ahead", 0, NULL, 0 },
{ "ref-trace", 0, NULL, 0 },
{ "dump-db", 0, NULL, 0 },
{ "dump-select-db", 1, NULL, 0 },
{ "dump-coverage", 0, NULL, 0 },
Expand Down Expand Up @@ -192,35 +190,34 @@ inline EmuArgs parse_args(int argc, const char *argv[]) {
printf("[WARN] runahead is not enabled at compile time, ignore --sim-run-ahead\n");
#endif
continue;
case 11: args.enable_ref_trace = true; continue;
#ifdef ENABLE_CHISEL_DB
case 12: args.dump_db = true; continue;
case 13:
case 11: args.dump_db = true; continue;
case 12:
args.dump_db = true;
args.select_db = optarg;
continue;
#else
case 11:
case 12:
case 13:
printf("[WARN] chisel db is not enabled at compile time, ignore --dump-db\n");
continue;
#endif
case 14:
case 13:
#if VM_COVERAGE == 1
args.dump_coverage = true;
#else
printf("[WARN] coverage is not enabled at compile time, ignore --dump-coverage\n");
#endif // VM_COVERAGE
continue;
case 15: args.enable_ref_trace = true; continue;
case 16: args.enable_commit_trace = true; continue;
case 17: args.trace_name = optarg; args.trace_is_read = true; continue;
case 18: args.trace_name = optarg; args.trace_is_read = false; continue;
case 19: args.footprints_name = optarg; continue;
case 20: args.image_as_footprints = true; continue;
case 21: args.linearized_name = optarg; continue;
case 22: args.enable_waveform = true; args.enable_waveform_full = true; continue;
case 23: args.overwrite_nbytes = atoll_strict(optarg, "overwrite_nbytes"); continue;
case 14: args.enable_ref_trace = true; continue;
case 15: args.enable_commit_trace = true; continue;
case 16: args.trace_name = optarg; args.trace_is_read = true; continue;
case 17: args.trace_name = optarg; args.trace_is_read = false; continue;
case 18: args.footprints_name = optarg; continue;
case 19: args.image_as_footprints = true; continue;
case 20: args.linearized_name = optarg; continue;
case 21: args.enable_waveform = true; args.enable_waveform_full = true; continue;
case 22: args.overwrite_nbytes = atoll_strict(optarg, "overwrite_nbytes"); continue;
}
// fall through
default:
Expand Down Expand Up @@ -661,18 +658,6 @@ int Emulator::tick() {
}
#endif

#ifndef CONFIG_NO_DIFFTEST
// if ref trace is enabled in co-sim args
// let simulator print debug info
if (args.enable_ref_trace) {
RefProxyConfig ref_config;
ref_config.debug_difftest = true;
for (int i = 0; i < NUM_CORES; i++) {
difftest[i]->proxy->update_config(&ref_config);
}
}
#endif // CONFIG_NO_DIFFTEST

if (args.enable_fork && is_fork_child() && cycles != 0) {
if (cycles == lightsss->get_end_cycles()) {
FORK_PRINTF("checkpoint has reached the main process abort point: %lu\n", cycles)
Expand Down

0 comments on commit abd34bc

Please sign in to comment.