1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-17 20:02:53 +08:00
oh/emmu/dv/emmu.cpp
Olof Kindgren c91c7abbbc emmu: Refactor and add verilator testbench
Testbench is split between the synthesizable transactors and
non-synthesizable parts to allow reuse of transactors in the newly
added verilator test bench
2015-04-10 15:30:54 +02:00

35 lines
651 B
C++

#include <verilated.h>
#include <verilated_vcd_c.h>
#include "Vdv_emmu__Syms.h"
int main(int argc, char **argv, char **env)
{
Verilated::commandArgs(argc, argv);
uint64_t t;
//VCD stuff
Verilated::traceEverOn(true);
VerilatedVcdC* tfp = new VerilatedVcdC;
//char *vcdFileName;
Vdv_emmu* top = new Vdv_emmu;
top->trace(tfp, 99);
tfp->open("test.vcd"/*vcdFileName*/);
//Init values
top->clk = 0;
top->reset = 1;
top->go = 0;
while(t<100000) {
if (t==100) top->reset = 0;
if (t==10000) top->go = 1;
top->eval();
top->clk = !top->clk;
tfp->dump((vluint64_t)t);
t++;
}
tfp->close();
}