From 0a0c9d8fcb75949117b1afcb90c47374a515f8a3 Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Tue, 12 Mar 2024 15:28:19 +0800 Subject: [PATCH] =?UTF-8?q?>=20build=5Fflow=5FVFlow=20=20ysyx=5F22040000?= =?UTF-8?q?=20=E6=9D=8E=E5=BF=83=E6=9D=A8=20=20Linux=20calcite=206.6.19=20?= =?UTF-8?q?#1-NixOS=20SMP=20PREEMPT=5FDYNAMIC=20Fri=20Mar=20=201=2012:35:1?= =?UTF-8?q?1=20UTC=202024=20x86=5F64=20GNU/Linux=20=20=2015:28:19=20=20up?= =?UTF-8?q?=203=20days=20=206:18,=20=202=20users,=20=20load=20average:=203?= =?UTF-8?q?.01,=202.00,=201.71?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- npc/csrc/Flow/main.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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); }