Add an option (-l) to display a log of execution in non-interactive mode.
[riscv-isa-sim.git] / riscv / sim.cc
index eb31f12d3b3a288c2311987959fecc1f550132aa..66bebb3b8cbf7bffe61ddba9fd226cf63bd9a7bc 100644 (file)
@@ -71,6 +71,8 @@ reg_t sim_t::get_scr(int which)
 
 int sim_t::run()
 {
+  if (!debug && log)
+    set_procs_debug(true);
   while (htif->tick())
   {
     if (debug || ctrlc_pressed)
@@ -123,6 +125,11 @@ void sim_t::set_debug(bool value)
   debug = value;
 }
 
+void sim_t::set_log(bool value)
+{
+  log = value;
+}
+
 void sim_t::set_histogram(bool value)
 {
   histogram_enabled = value;