File tree 2 files changed +19
-0
lines changed
lib/Dialect/ESI/runtime/cosim_dpi_server
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,10 @@ int main(int argc, char **argv) {
63
63
<< std::endl;
64
64
}
65
65
66
+ #ifdef TRACE
66
67
VerilatedVcdC *tfp = nullptr ;
68
+ #endif
69
+
67
70
if (waveformFile) {
68
71
#ifdef TRACE
69
72
tfp = new VerilatedVcdC ();
@@ -93,8 +96,10 @@ int main(int argc, char **argv) {
93
96
for (timeStamp = 0 ; timeStamp < 8 && !Verilated::gotFinish (); timeStamp++) {
94
97
dut.eval ();
95
98
dut.clk = !dut.clk ;
99
+ #ifdef TRACE
96
100
if (tfp)
97
101
tfp->dump (timeStamp);
102
+ #endif
98
103
}
99
104
100
105
// Take simulation out of reset.
@@ -104,17 +109,22 @@ int main(int argc, char **argv) {
104
109
for (; !Verilated::gotFinish () && !stopSimulation; timeStamp++) {
105
110
dut.eval ();
106
111
dut.clk = !dut.clk ;
112
+
113
+ #ifdef TRACE
107
114
if (tfp)
108
115
tfp->dump (timeStamp);
116
+ #endif
109
117
if (debugPeriod)
110
118
std::this_thread::sleep_for (std::chrono::milliseconds (debugPeriod));
111
119
}
112
120
113
121
// Tell the simulator that we're going to exit. This flushes the output(s) and
114
122
// frees whatever memory may have been allocated.
115
123
dut.final ();
124
+ #ifdef TRACE
116
125
if (tfp)
117
126
tfp->close ();
127
+ #endif
118
128
119
129
std::cout << " [driver] Ending simulation at tick #" << timeStamp << std::endl;
120
130
return 0 ;
Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ int main(int argc, char **argv) {
53
53
auto &dut = *new Vtop ();
54
54
char *waveformFile = getenv (" SAVE_WAVE" );
55
55
56
+ #ifdef TRACE
56
57
VerilatedVcdC *tfp = nullptr ;
58
+ #endif
59
+
57
60
if (waveformFile) {
58
61
#ifdef TRACE
59
62
tfp = new VerilatedVcdC ();
@@ -78,8 +81,10 @@ int main(int argc, char **argv) {
78
81
for (timeStamp = 0 ; timeStamp < 8 && !Verilated::gotFinish (); timeStamp++) {
79
82
dut.eval ();
80
83
dut.clk = !dut.clk ;
84
+ #ifdef TRACE
81
85
if (tfp)
82
86
tfp->dump (timeStamp);
87
+ #endif
83
88
}
84
89
85
90
// Take simulation out of reset.
@@ -92,15 +97,19 @@ int main(int argc, char **argv) {
92
97
timeStamp++) {
93
98
dut.eval ();
94
99
dut.clk = !dut.clk ;
100
+ #ifdef TRACE
95
101
if (tfp)
96
102
tfp->dump (timeStamp);
103
+ #endif
97
104
}
98
105
99
106
// Tell the simulator that we're going to exit. This flushes the output(s) and
100
107
// frees whatever memory may have been allocated.
101
108
dut.final ();
109
+ #ifdef TRACE
102
110
if (tfp)
103
111
tfp->close ();
112
+ #endif
104
113
105
114
std::cout << " [driver] Ending simulation at tick #" << timeStamp << std::endl;
106
115
return 0 ;
You can’t perform that action at this time.
0 commit comments