-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDecoder_Sim.cpp
More file actions
39 lines (33 loc) · 758 Bytes
/
Decoder_Sim.cpp
File metadata and controls
39 lines (33 loc) · 758 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
38
39
#include <verilated.h>
#include <verilated_vcd_c.h>
#include "VDecoder.h"
using namespace std;
VDecoder* top;
VerilatedVcdC* tfp;
vluint64_t main_time = 0;
const vluint64_t sim_time = 1024;
int main(int argc, char **argv)
{
Verilated::commandArgs(argc, argv);
Verilated::traceEverOn(true);
top = new VDecoder;
tfp = new VerilatedVcdC;
top->trace(tfp, 99);
tfp->open("Decoder.vcd");
int count = 0;
while(!Verilated::gotFinish() && main_time < sim_time)
{
top->reset = 0;
top->S = count;
count++;
// cout << top->out << endl;
top->eval();
tfp->dump(main_time);
main_time++;
}
tfp->close();
delete top;
delete tfp;
exit(0);
return 0;
}