verilator/test_regress/t/t_trace_dumpvars_cpptop.v

40 lines
823 B
Systemverilog

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2026 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
`define STRINGIFY(x) `"x`"
module t(
input clk
);
int cyc;
sub #(10) sub_a(.*);
sub #(20) sub_b(.*);
always @(posedge clk) begin
cyc <= cyc + 1;
if (cyc == 5) begin
$write("*-* All Finished *-*\n");
$finish;
end
end
initial begin
$dumpfile(`STRINGIFY(`TEST_DUMPFILE));
// cpptop is defined in the C++ testbench as the root of the trace hierarchy, so $dumpvars(0, cpptop) should dump everything.
$dumpvars(0, cpptop, cpptop.t);
end
endmodule
module sub #(
parameter int ADD
)(
input int cyc
);
int value;
always_comb value = cyc + ADD;
endmodule