I have dedicated testbench module for printing/tracing information about the DUT in my testbench. I would like to avoid having to wire all the interesting (internal) signals down into the tb module.
As an example let's say I have an internal signal a in my DUT. How can I access it in printer.sv without having to create a matching input? Sketch:
/---- TB.sv -----------------------------------------\
| |
| /--dut.sv--\ /--printer.sv-------------\ |
| | wire a; | -> | always @(posedge clk) | |
| | | | $display("a is %d", a); | |
| \----------/ \-------------------------/ |
| |
\----------------------------------------------------/
I have been looking at the bind keyword to see if it could help me, but I don't understand it.
The number of signals needed by the printer.vs is large, so I would really like to avoid having to declare everything as inputs, it's very tedious.
Is there some way to pass in a hierarchical reference to the instantiated dut module?