ivtest: Add the dumpfile.v test
Add a regression test to show that the proper dumpfile is selected, by noting in the output from the vvp command what file name it is creating. To make this work, I also needed to add some capabilities to the vvp_reg.py regression test rig.
This commit is contained in:
parent
29ac33493e
commit
50722494b9
|
|
@ -77,3 +77,17 @@ iverilog-args (optional)
|
|||
|
||||
If this is specified, it is a list of strings that are passed as arguments to
|
||||
the iverilog command line.
|
||||
|
||||
vvp-args (optional)
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If this is specified, it is a list of strings that are passed as arguments to
|
||||
the vvp command. These arguments go before the vvp input file that is to be
|
||||
run.
|
||||
|
||||
vvp-args-extended (optional)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If this is specified, it is a lost of strings that are passed as arguments to
|
||||
the vvp command. These are extended arguments, and are placed after the vvp
|
||||
input file that is being run. This is where you place things like plusargs.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
VCD info: dumpfile foo.vcd opened for output.
|
||||
ivltests/dumpfile.v:11: $finish called at 30 (1s)
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
// Github Issue #202
|
||||
|
||||
module main;
|
||||
reg clk = 0;
|
||||
|
||||
initial begin
|
||||
//$dumpfile("foo"); // We really want to test the command line flag
|
||||
$dumpvars(0, main);
|
||||
#10 clk <= 1;
|
||||
#10 clk <= 0;
|
||||
#10 $finish;
|
||||
|
||||
end
|
||||
|
||||
endmodule // main
|
||||
|
|
@ -20,6 +20,7 @@ dffsynth8 vvp_tests/dffsynth8.json
|
|||
dffsynth9 vvp_tests/dffsynth9.json
|
||||
dffsynth10 vvp_tests/dffsynth10.json
|
||||
dffsynth11 vvp_tests/dffsynth11.json
|
||||
dumpfile vvp_tests/dumpfile.json
|
||||
macro_str_esc vvp_tests/macro_str_esc.json
|
||||
memsynth1 vvp_tests/memsynth1.json
|
||||
struct_packed_write_read vvp_tests/struct_packed_write_read.json
|
||||
|
|
|
|||
|
|
@ -18,7 +18,10 @@ def assemble_iverilog_cmd(source: str, it_dir: str, args: list) -> list:
|
|||
|
||||
|
||||
def assemble_vvp_cmd(args: list = [], plusargs: list = []) -> list:
|
||||
res = ["vvp", os.path.join("work", "a.out")]
|
||||
res = ["vvp"]
|
||||
res = res + args
|
||||
res.append(os.path.join("work", "a.out"))
|
||||
res = res + plusargs
|
||||
return res
|
||||
|
||||
|
||||
|
|
@ -130,6 +133,8 @@ def do_run_normal(options : dict, expected_fail : bool) -> list:
|
|||
it_key = options['key']
|
||||
it_dir = options['directory']
|
||||
it_iverilog_args = options['iverilog_args']
|
||||
it_vvp_args = options['vvp_args']
|
||||
it_vvp_args_extended = options['vvp_args_extended']
|
||||
it_gold = options['gold']
|
||||
it_diff = options['diff']
|
||||
|
||||
|
|
@ -144,7 +149,7 @@ def do_run_normal(options : dict, expected_fail : bool) -> list:
|
|||
return [1, "Failed - Compile failed"]
|
||||
|
||||
# run the vvp command
|
||||
vvp_cmd = assemble_vvp_cmd()
|
||||
vvp_cmd = assemble_vvp_cmd(it_vvp_args, it_vvp_args_extended)
|
||||
vvp_res = subprocess.run(vvp_cmd, capture_output=True)
|
||||
log_results(it_key, "vvp", vvp_res);
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,9 @@ def process_test(item: list) -> str:
|
|||
'source' : it_dict['source'],
|
||||
'modulename' : None,
|
||||
'gold' : it_dict.get('gold', None),
|
||||
'diff' : None
|
||||
'diff' : None,
|
||||
'vvp_args' : it_dict.get('vvp-args', [ ]),
|
||||
'vvp_args_extended' : it_dict.get('vvp-args-extended', [ ])
|
||||
}
|
||||
|
||||
if it_type == "NI":
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"type" : "normal",
|
||||
"source" : "dumpfile.v",
|
||||
"gold" : "dumpfile",
|
||||
"vvp-args-extended" : [ "-vcd", "-dumpfile=foo" ]
|
||||
}
|
||||
Loading…
Reference in New Issue