diff --git a/npc/csrc/Flow/main.cpp b/npc/csrc/Flow/main.cpp index 4728202..8a0f2ce 100644 --- a/npc/csrc/Flow/main.cpp +++ b/npc/csrc/Flow/main.cpp @@ -3,10 +3,30 @@ #include #include #include +#include +#define MAX_SIM_TIME 100 int main(int argc, char **argv, char **env) { int sim_time = 0; Verilated::commandArgs(argc, argv); + VFlow *top = new VFlow; + + Verilated::traceEverOn(true); + VerilatedVcdC *m_trace = new VerilatedVcdC; +#ifdef VERILATOR_TRACE + top->trace(m_trace, 5); + m_trace->open("waveform.vcd"); +#endif + for (sim_time = 0; sim_time < MAX_SIM_TIME; sim_time++) { + top->eval(); +#ifdef VERILATOR_TRACE + m_trace->dump(sim_time); +#endif + } +#ifdef VERILATOR_TRACE + m_trace->close(); +#endif + delete top; exit(EXIT_SUCCESS); }