};
struct session_list_s *sesslist=NULL;
+struct event_base *base=NULL;
static int litex_sim_initialize_all(void **dut, void *base)
{
tv.tv_usec = 0;
int i;
-
for(i = 0; i < 1000; i++)
{
for(s = sesslist; s; s=s->next)
}
}
+ if (litex_sim_got_finish())
+ event_base_loopbreak(base);
+
if (!evtimer_pending(ev, NULL)) {
event_del(ev);
evtimer_add(ev, &tv);
int main()
{
void *vdut=NULL;
- struct event_base *base=NULL;
struct timeval tv;
int ret;
tv.tv_usec = 0;
ev = event_new(base, -1, EV_PERSIST, cb, vdut);
event_add(ev, &tv);
-
event_base_dispatch(base);
+#if VM_COVERAGE
+ litex_sim_coverage_dump();
+#endif
out:
return ret;
}
tfp->dump(ticks++);
}
+extern "C" int litex_sim_got_finish()
+{
+ return Verilated::gotFinish();
+}
+
+#if VM_COVERAGE
+extern "C" void litex_sim_coverage_dump()
+{
+ VerilatedCov::write("dut.cov");
+}
+#endif
vluint64_t main_time = 0;
double sc_time_stamp()
extern "C" void litex_sim_eval(void *vdut);
extern "C" void litex_sim_init_tracer(void *vdut);
extern "C" void litex_sim_tracer_dump();
+extern "C" int litex_sim_got_finish();
+#if VM_COVERAGE
+extern "C" void litex_sim_coverage_dump();
+#endif
#else
void litex_sim_eval(void *vdut);
void litex_sim_init_tracer(void *vdut);
void litex_sim_tracer_dump();
+int litex_sim_got_finish();
+#if VM_COVERAGE
+void litex_sim_coverage_dump();
+#endif
#endif
#endif
if r != 0:
raise OSError("Subprocess failed")
except:
- if sys.platform != "win32":
- termios.tcsetattr(sys.stdin.fileno(), termios.TCSAFLUSH, termios_settings)
+ pass
+ if sys.platform != "win32":
+ termios.tcsetattr(sys.stdin.fileno(), termios.TCSAFLUSH, termios_settings)
class SimVerilatorToolchain: