33 lines
571 B
C++
33 lines
571 B
C++
|
#include <cstdlib>
|
||
|
#include <iostream>
|
||
|
#include <verilated.h>
|
||
|
#include <verilated_vcd_c.h>
|
||
|
#include "Vtop.h"
|
||
|
|
||
|
constexpr vluint64_t MAX_SIM_TIME = 100000;
|
||
|
vluint64_t sim_time = 0;
|
||
|
|
||
|
int main(int argc, char** argv, char** env)
|
||
|
{
|
||
|
Vtop* dut = new Vtop;
|
||
|
|
||
|
Verilated::traceEverOn(true);
|
||
|
VerilatedVcdC* m_trace = new VerilatedVcdC;
|
||
|
dut->trace(m_trace, 5);
|
||
|
m_trace->open("waveform.vcd");
|
||
|
|
||
|
while (sim_time < MAX_SIM_TIME)
|
||
|
{
|
||
|
dut->clk ^= 1;
|
||
|
dut->eval();
|
||
|
m_trace->dump(sim_time);
|
||
|
|
||
|
sim_time++;
|
||
|
}
|
||
|
|
||
|
m_trace->close();
|
||
|
delete m_trace;
|
||
|
delete dut;
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|