48int 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;