Tests: Add TEST_DUMPFILE define

This commit is contained in:
Wilson Snyder 2022-11-20 09:40:02 -05:00
parent 6297650fef
commit 278d532368
7 changed files with 12 additions and 5 deletions

View File

@ -688,6 +688,7 @@ sub new {
$self->{top_shell_filename} = "$self->{obj_dir}/$self->{VM_PREFIX}__top.v";
}
$self->{pli_filename} ||= $self->{name} . ".cpp";
return $self;
}
@ -964,6 +965,11 @@ sub compile {
compile_vlt_cmd(%param);
my $define_opt = defineOpt($self->{xsim});
if (join(' ', @{$self->{v_flags}}) !~ /TEST_DUMPFILE/) {
push @{$self->{v_flags}}, ($define_opt . "TEST_DUMPFILE=" . $self->trace_filename);
}
if (!$param{make_top_shell}) {
$param{top_shell_filename}
= $self->{top_shell_filename} = "";

View File

@ -36,7 +36,7 @@ module t (/*AUTOARG*/
//`define WAVES
`ifdef WAVES
initial begin
$dumpfile({`STRINGIFY(`TEST_OBJ_DIR),"/simx.vcd"});
$dumpfile(`STRINGIFY(`TEST_DUMPFILE));
$dumpvars(12, t);
end
`endif

View File

@ -16,6 +16,7 @@
`define SV_COV_STOP 1
`define SV_COV_TOGGLE 23
`define SYSTEMVERILOG 1
`define TEST_DUMPFILE obj_vlt/t_preproc_defines/simx.vcd
`define TEST_OBJ_DIR obj_vlt/t_preproc_defines
`define VERILATOR 1
`define WITH_ARG(a) (a)(a)

View File

@ -18,7 +18,7 @@ module t;
logic d;
initial begin
$dumpfile({`STRINGIFY(`TEST_OBJ_DIR),"/simx.vcd"});
$dumpfile(`STRINGIFY(`TEST_DUMPFILE));
$dumpvars;
forever clk = #CLK_HALF_PERIOD ~clk;
end

View File

@ -10,7 +10,7 @@ module t(/*AUTOARG*/);
int sig;
initial begin
sig = 10;
$dumpfile({`STRINGIFY(`TEST_OBJ_DIR),"/simx.vcd"});
$dumpfile(`STRINGIFY(`TEST_DUMPFILE));
$dumpvars();
#20;
sig = 20;

View File

@ -12,7 +12,7 @@ module t #(
) (/*AUTOARG*/);
initial begin
$dumpfile({`STRINGIFY(`TEST_OBJ_DIR),"/simx.vcd"});
$dumpfile(`STRINGIFY(`TEST_DUMPFILE));
$dumpvars;
$write("*-* All Finished *-*\n");

View File

@ -14,7 +14,7 @@ module t(/*AUTOARG*/);
logic clk;
initial begin
$dumpfile({`STRINGIFY(`TEST_OBJ_DIR),"/simx.vcd"});
$dumpfile(`STRINGIFY(`TEST_DUMPFILE));
$dumpvars;
end