未验证 提交 a9749791 编写于 作者: W William Wang 提交者: GitHub

emu: add --force-dump-result option (#791)

* emu: add --no-perf-counter option

Now perf counter result print will no longer be controlled by
--log-begin / --log-end

* emu: add --force-dump-result option

This option will override log_end to -1 when simulation finishs.
--no-perf-counter option is removed.
上级 9d5a2027
......@@ -20,7 +20,7 @@ object XSPerfAccumulate {
counter := Mux(perfClean, 0.U, next_counter)
when (perfDump) {
XSLog(XSLogLevel.PERF)(true, true.B, p"$perfName, $next_counter\n")
XSPerfPrint(p"$perfName, $next_counter\n")
}
}
}
......@@ -66,7 +66,7 @@ object XSPerfHistogram {
}
when (perfDump) {
XSLog(XSLogLevel.PERF)(true, true.B, p"${perfName}_${binRangeStart}_${binRangeStop}, $counter\n")
XSPerfPrint(p"${perfName}_${binRangeStart}_${binRangeStop}, $counter\n")
}
}
}
......@@ -88,7 +88,7 @@ object XSPerfMax {
max := Mux(perfClean, 0.U, next_max)
when (perfDump) {
XSLog(XSLogLevel.PERF)(true, true.B, p"${perfName}_max, $next_max\n")
XSPerfPrint(p"${perfName}_max, $next_max\n")
}
}
}
......@@ -118,3 +118,9 @@ object TransactionLatencyCounter
(stop, next_counter)
}
}
object XSPerfPrint {
def apply(pable: Printable)(implicit p: Parameters): Any = {
XSLog(XSLogLevel.PERF)(true, true.B, pable)
}
}
\ No newline at end of file
......@@ -21,6 +21,7 @@ static inline void print_help(const char *file) {
printf(" -i, --image=FILE run with this image file\n");
printf(" -b, --log-begin=NUM display log from NUM th cycle\n");
printf(" -e, --log-end=NUM stop display log at NUM th cycle\n");
printf(" --force-dump-result force dump performance counter result in the end\n");
printf(" --load-snapshot=PATH load snapshot from PATH\n");
printf(" --no-snapshot disable saving snapshots\n");
printf(" --dump-wave dump waveform when log is enabled\n");
......@@ -34,20 +35,21 @@ inline EmuArgs parse_args(int argc, const char *argv[]) {
int long_index = 0;
extern const char *difftest_ref_so;
const struct option long_options[] = {
{ "load-snapshot", 1, NULL, 0 },
{ "dump-wave", 0, NULL, 0 },
{ "no-snapshot", 0, NULL, 0 },
{ "diff", 1, NULL, 0 },
{ "seed", 1, NULL, 's' },
{ "max-cycles", 1, NULL, 'C' },
{ "max-instr", 1, NULL, 'I' },
{ "warmup-instr", 1, NULL, 'W' },
{ "stat-cycles", 1, NULL, 'D' },
{ "image", 1, NULL, 'i' },
{ "log-begin", 1, NULL, 'b' },
{ "log-end", 1, NULL, 'e' },
{ "help", 0, NULL, 'h' },
{ 0, 0, NULL, 0 }
{ "load-snapshot", 1, NULL, 0 },
{ "dump-wave", 0, NULL, 0 },
{ "no-snapshot", 0, NULL, 0 },
{ "force-dump-result", 0, NULL, 0 },
{ "diff", 1, NULL, 0 },
{ "seed", 1, NULL, 's' },
{ "max-cycles", 1, NULL, 'C' },
{ "max-instr", 1, NULL, 'I' },
{ "warmup-instr", 1, NULL, 'W' },
{ "stat-cycles", 1, NULL, 'D' },
{ "image", 1, NULL, 'i' },
{ "log-begin", 1, NULL, 'b' },
{ "log-end", 1, NULL, 'e' },
{ "help", 0, NULL, 'h' },
{ 0, 0, NULL, 0 }
};
int o;
......@@ -59,7 +61,8 @@ inline EmuArgs parse_args(int argc, const char *argv[]) {
case 0: args.snapshot_path = optarg; continue;
case 1: args.enable_waveform = true; continue;
case 2: args.enable_snapshot = false; continue;
case 3: difftest_ref_so = optarg; continue;
case 3: args.force_dump_result = true; continue;
case 4: difftest_ref_so = optarg; continue;
}
// fall through
default:
......@@ -359,6 +362,9 @@ inline void Emulator::save_coverage(time_t t) {
void Emulator::trigger_stat_dump() {
dut_ptr->io_perfInfo_dump = 1;
if(get_args().force_dump_result) {
dut_ptr->io_logCtrl_log_end = -1;
}
single_cycle();
}
......
......@@ -19,6 +19,7 @@ struct EmuArgs {
const char *snapshot_path;
bool enable_waveform;
bool enable_snapshot;
bool force_dump_result;
EmuArgs() {
seed = 0;
......@@ -32,6 +33,7 @@ struct EmuArgs {
image = NULL;
enable_waveform = false;
enable_snapshot = true;
force_dump_result = false;
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册