verilator/test_regress/t/t_trace_dumpvars_cpptop2.cpp

37 lines
895 B
C++
Raw Normal View History

// -*- mode: C++; c-file-style: "cc-mode" -*-
//
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
2026-03-24 00:36:39 +01:00
// SPDX-FileCopyrightText: 2026 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
#include <verilated.h>
#include <memory>
#include VM_PREFIX_INCLUDE
unsigned long long main_time = 0;
double sc_time_stamp() { return (double)main_time; }
int main(int argc, char** argv) {
Verilated::debug(0);
Verilated::traceEverOn(true);
Verilated::commandArgs(argc, argv);
// Name the top module "cpptop" instead of default "TOP"
std::unique_ptr<VM_PREFIX> top{new VM_PREFIX{"cpptop"}};
top->clk = 0;
while (!Verilated::gotFinish()) {
top->eval();
++main_time;
top->clk = !top->clk;
}
top->final();
top.reset();
printf("*-* All Finished *-*\n");
return 0;
}