15 #define TOP_MODULE ESI_Cosim_Top
23 #define STRINGIFY_MACRO(x) STR(x)
26 #define CONCAT3(n1, n2, n3) STRINGIFY_MACRO(EXPAND(n1)EXPAND(n2)EXPAND(n3))
27 #define TOKENPASTE(x, y) x ## y
28 #define CLASSNAME(x, y) TOKENPASTE(x, y)
30 #include CONCAT3(V,TOP_MODULE,.h)
33 #include "verilated_vcd_c.h"
48 int main(
int argc,
char **argv) {
52 Verilated::commandArgs(argc, argv);
56 char *waveformFile = getenv(
"SAVE_WAVE");
58 char *periodStr = getenv(
"DEBUG_PERIOD");
59 unsigned debugPeriod = 0;
61 debugPeriod = std::stoi(periodStr);
62 std::cout <<
"[driver] Setting debug period to " << debugPeriod
66 VerilatedVcdC *tfp =
nullptr;
69 tfp =
new VerilatedVcdC();
70 Verilated::traceEverOn(
true);
72 tfp->open(waveformFile);
73 std::cout <<
"[driver] Writing trace to " << waveformFile << std::endl;
76 <<
"[driver] Warning: waveform file specified, but not a debug build"
81 std::cout <<
"[driver] Starting simulation" << std::endl;
110 std::this_thread::sleep_for(std::chrono::milliseconds(debugPeriod));
119 std::cout <<
"[driver] Ending simulation at tick #" <<
timeStamp << std::endl;
int main(int argc, char **argv)
volatile bool stopSimulation