1
0

Merge pull request #1186 from edcote/patch-1

Update TestDriver module to support FSDB
This commit is contained in:
Henry Cook 2018-03-11 11:40:25 -07:00 committed by GitHub
commit e07b37c7ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@ module TestDriver;
reg [63:0] max_cycles = 0; reg [63:0] max_cycles = 0;
reg [63:0] dump_start = 0; reg [63:0] dump_start = 0;
reg [63:0] trace_count = 0; reg [63:0] trace_count = 0;
reg [1023:0] fsdbfile = 0;
reg [1023:0] vcdplusfile = 0; reg [1023:0] vcdplusfile = 0;
reg [1023:0] vcdfile = 0; reg [1023:0] vcdfile = 0;
int unsigned rand_value; int unsigned rand_value;
@ -50,7 +51,19 @@ module TestDriver;
`ifdef VCS `ifdef VCS
$vcdplusfile(vcdplusfile); $vcdplusfile(vcdplusfile);
`else `else
$fdisplay(stderr, "Error: +vcdplusfile is VCS-only; use +vcdfile instead"); $fdisplay(stderr, "Error: +vcdplusfile is VCS-only; use +vcdfile instead or recompile with VCS=1");
$fatal;
`endif
end
if ($value$plusargs("fsdbfile=%s", fsdbfile))
begin
`ifdef FSDB
$fsdbDumpfile(fsdbfile);
$fsdbDumpvars("+all");
//$fsdbDumpSVA;
`else
$fdisplay(stderr, "Error: +fsdbfile is FSDB-only; use +vcdfile/+vcdplus instead or recompile with FSDB=1");
$fatal; $fatal;
`endif `endif
end end
@ -60,7 +73,11 @@ module TestDriver;
$dumpfile(vcdfile); $dumpfile(vcdfile);
$dumpvars(0, testHarness); $dumpvars(0, testHarness);
end end
`ifdef VCS
`ifdef FSDB
`define VCDPLUSON $fsdbDumpon;
`define VCDPLUSCLOSE $fsdbDumpoff;
`elsif VCS
`define VCDPLUSON $vcdpluson(0); $vcdplusmemon(0); `define VCDPLUSON $vcdpluson(0); $vcdplusmemon(0);
`define VCDPLUSCLOSE $vcdplusclose; $dumpoff; `define VCDPLUSCLOSE $vcdplusclose; $dumpoff;
`else `else
@ -72,9 +89,9 @@ module TestDriver;
`define VCDPLUSON `define VCDPLUSON
`define VCDPLUSCLOSE `define VCDPLUSCLOSE
if ($test$plusargs("vcdplusfile=") || $test$plusargs("vcdfile=")) if ($test$plusargs("vcdplusfile=") || $test$plusargs("vcdfile=") || $test$plusargs("fsdbfile="))
begin begin
$fdisplay(stderr, "Error: +vcdfile or +vcdplusfile requested but compile did not have +define+DEBUG enabled"); $fdisplay(stderr, "Error: +vcdfile, +vcdplusfile, or +fsdbfile requested but compile did not have +define+DEBUG enabled");
$fatal; $fatal;
end end