common: Add levels parameter to DUMP

This adds a levels parameter to DUMP, allowing dumping just the
top-level signals, instead of the whole hierarchy. This is helpful for
post-synthesis simulation, where all sub-modules are primitives (with
their inputs and outputs already available at the top level).

Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2022-08-06 15:55:51 -04:00
parent 5e1dabf601
commit 6d7847c35f
3 changed files with 5 additions and 5 deletions

View File

@ -7,14 +7,14 @@
`define COMMON_VH
`ifdef SYNTHESIS
`define DUMP
`define DUMP(levels)
`else
`define DUMP \
`define DUMP(levels) \
reg [4096:0] vcdfile; \
initial begin \
if ($value$plusargs("vcd=%s", vcdfile)) begin \
$dumpfile(vcdfile); \
$dumpvars; \
$dumpvars(levels); \
end \
end
`endif

View File

@ -92,7 +92,7 @@ module pcs (
assign col = transmitting && receiving;
assign crs = transmitting || receiving;
`DUMP
`DUMP(0)
endmodule

View File

@ -225,6 +225,6 @@ module pmd (
end
`endif
`DUMP
`DUMP(0)
endmodule