1616
1717from pathlib import Path
1818from vunit import VUnit
19- from subprocess import call
20-
21-
22- def post_run (results ):
23- results .merge_coverage (file_name = "coverage_data" )
24- if VU .get_simulator_name () == "ghdl" :
25- if results ._simulator_if ._backend == "gcc" :
26- call (["gcovr" , "coverage_data" ])
27- else :
28- call (["gcovr" , "-a" , "coverage_data/gcovr.json" ])
29- elif VU .get_simulator_name () == "nvc" :
30- call (["nvc" , "--cover-report" , "coverage_data.ncdb" , "-o" , "output_coverage" ])
31-
3219
3320VU = VUnit .from_argv ()
3421VU .add_vhdl_builtins ()
@@ -40,13 +27,4 @@ def post_run(results):
4027VU .add_library ("uart_lib" ).add_source_files (SRC_PATH / "*.vhd" )
4128VU .add_library ("tb_uart_lib" ).add_source_files (SRC_PATH / "test" / "*.vhd" )
4229
43- VU .set_sim_option ("enable_coverage" , True )
44-
45- VU .set_sim_option ("nvc.elab_flags" , ["--cover=branch,statement" ])
46- VU .set_compile_option ("rivierapro.vcom_flags" , ["-coverage" , "bs" ])
47- VU .set_compile_option ("rivierapro.vlog_flags" , ["-coverage" , "bs" ])
48- VU .set_compile_option ("modelsim.vcom_flags" , ["+cover=bs" ])
49- VU .set_compile_option ("modelsim.vlog_flags" , ["+cover=bs" ])
50- VU .set_compile_option ("enable_coverage" , True )
51-
52- VU .main (post_run = post_run )
30+ VU .main ()
0 commit comments