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

View File

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

View File

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