1
0

Add +dump-start=N option to VCS

Starts dumping waveform on cycle N.

Can control stop cycle with +max-cycles.
This commit is contained in:
Andrew Waterman 2017-03-31 11:37:37 -07:00 committed by Andrew Waterman
parent 54820e094d
commit 2faf8ea239

View File

@ -16,6 +16,7 @@ module TestDriver;
reg verbose = 1'b0; reg verbose = 1'b0;
wire printf_cond = verbose && !reset; wire printf_cond = verbose && !reset;
reg [63:0] max_cycles = 0; reg [63:0] max_cycles = 0;
reg [63:0] dump_start = 0;
reg [63:0] trace_count = 0; reg [63:0] trace_count = 0;
reg [1023:0] vcdplusfile = 0; reg [1023:0] vcdplusfile = 0;
reg [1023:0] vcdfile = 0; reg [1023:0] vcdfile = 0;
@ -23,6 +24,7 @@ module TestDriver;
initial initial
begin begin
void'($value$plusargs("max-cycles=%d", max_cycles)); void'($value$plusargs("max-cycles=%d", max_cycles));
void'($value$plusargs("dump-start=%d", dump_start));
verbose = $test$plusargs("verbose"); verbose = $test$plusargs("verbose");
// do not delete the lines below. // do not delete the lines below.
@ -47,8 +49,6 @@ module TestDriver;
begin begin
`ifdef VCS `ifdef VCS
$vcdplusfile(vcdplusfile); $vcdplusfile(vcdplusfile);
$vcdpluson(0);
$vcdplusmemon(0);
`else `else
$fdisplay(stderr, "Error: +vcdplusfile is VCS-only; use +vcdfile instead"); $fdisplay(stderr, "Error: +vcdplusfile is VCS-only; use +vcdfile instead");
$fatal; $fatal;
@ -59,15 +59,17 @@ module TestDriver;
begin begin
$dumpfile(vcdfile); $dumpfile(vcdfile);
$dumpvars(0, testHarness); $dumpvars(0, testHarness);
$dumpon;
end end
`ifdef VCS `ifdef VCS
`define VCDPLUSON $vcdpluson(0); $vcdplusmemon(0);
`define VCDPLUSCLOSE $vcdplusclose; $dumpoff; `define VCDPLUSCLOSE $vcdplusclose; $dumpoff;
`else `else
`define VCDPLUSON $dumpon;
`define VCDPLUSCLOSE $dumpoff; `define VCDPLUSCLOSE $dumpoff;
`endif `endif
`else `else
// No +define+DEBUG // No +define+DEBUG
`define VCDPLUSON
`define VCDPLUSCLOSE `define VCDPLUSCLOSE
if ($test$plusargs("vcdplusfile=") || $test$plusargs("vcdfile=")) if ($test$plusargs("vcdplusfile=") || $test$plusargs("vcdfile="))
@ -96,6 +98,10 @@ module TestDriver;
$fdisplay(stderr, "C: %10d", trace_count); $fdisplay(stderr, "C: %10d", trace_count);
end end
`endif `endif
if (trace_count == dump_start)
begin
`VCDPLUSON
end
trace_count = trace_count + 1; trace_count = trace_count + 1;
if (!reset) if (!reset)