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
67 VerilatedVcdC *tfp =
nullptr;
72 tfp =
new VerilatedVcdC();
73 Verilated::traceEverOn(
true);
75 tfp->open(waveformFile);
76 std::cout <<
"[driver] Writing trace to " << waveformFile << std::endl;
79 <<
"[driver] Warning: waveform file specified, but not a debug build"
84 std::cout <<
"[driver] Starting simulation" << std::endl;
118 std::this_thread::sleep_for(std::chrono::milliseconds(debugPeriod));
129 std::cout <<
"[driver] Ending simulation at tick #" <<
timeStamp << std::endl;