2024-03-11 15:25:23 +00:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <cassert>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <verilated.h>
|
|
|
|
#include <verilated_vcd_c.h>
|
2024-03-12 07:28:19 +00:00
|
|
|
#include <VFlow.h>
|
|
|
|
#define MAX_SIM_TIME 100
|
2024-03-12 07:29:29 +00:00
|
|
|
#define VERILATOR_TRACE
|
2024-03-11 15:25:23 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv, char **env) {
|
|
|
|
int sim_time = 0;
|
|
|
|
Verilated::commandArgs(argc, argv);
|
|
|
|
|
2024-03-12 07:28:19 +00:00
|
|
|
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();
|
2024-03-13 03:24:57 +00:00
|
|
|
top->clock = !top->clock;
|
2024-03-12 07:28:19 +00:00
|
|
|
#ifdef VERILATOR_TRACE
|
|
|
|
m_trace->dump(sim_time);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#ifdef VERILATOR_TRACE
|
|
|
|
m_trace->close();
|
|
|
|
#endif
|
|
|
|
delete top;
|
2024-03-11 15:25:23 +00:00
|
|
|
exit(EXIT_SUCCESS);
|
|
|
|
}
|