-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate_cpp
More file actions
37 lines (32 loc) · 737 Bytes
/
template_cpp
File metadata and controls
37 lines (32 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "VXXXXX_tb.h"
#include "verilated.h"
#include "verilated_vcd_c.h"
#include <iostream>
int main(int argc, char **argv)
{
Verilated::commandArgs(argc, argv);
VXXXXX_tb* mod = new VXXXXX_tb;
Verilated::traceEverOn(true);
VerilatedVcdC* tfp = new VerilatedVcdC;
vluint64_t hcycle;
int result = 0;
mod->trace(tfp, 99);
mod->p_reset = 1;
tfp->open("XXXXX.vcd");
while(!Verilated::gotFinish())
{
hcycle++;
mod->m_clock = mod->m_clock ? 0 : 1;
mod->eval();
tfp->dump(hcycle * 10);
if(mod->error)
{
result = mod->error_num;
goto finish;
}
}
finish:
tfp->close();
delete mod;
return result;
}