Wave files grow with scope and time. Dumping a full design for a long run slows simulation and buries the event.
Dump the suspect hierarchy, and only for runs that need waves. Heavy dumping stays behind a plusarg or a compile define.
The gate below dumps nothing by default. Adding +WAVE_ON to the command line enables the dump without recompiling.
// snippet
`timescale 1ns/1ps
initial begin
if ($test$plusargs("WAVE_ON")) begin
$dumpfile("trig_cnt.vcd");
$dumpvars(0, tb_trig_cnt);
end
endRare errors drown in long logs. A trigger watches a protocol condition and prints a snapshot when it fires.
The testbench below arms a trigger on count 10 and prints one line. The trigger reads the DUT's count port; a hierarchical reference such as dut.count would also work, but only in testbench code, never in synthesizable RTL.
No. Dumps stay off by default and turn on with +WAVE_ON for the failing seed only. Always-on dumps slow every run and fill disks.
The condition is too broad, often a level instead of an exact value. The testbench counts firings so a noisy trigger fails loudly.
A counter with a trigger at count 10. With +WAVE_ON, dump activity is enabled only from count 8 through count 12, preserving two cycles of context on each side. This is a deterministic replay window: first reproduce/log the failure cycle, then rerun with a window starting before it. An unpredictable first-run trigger needs simulator circular/pre-trigger capture or retained transaction history; $dumpon cannot recover events from the past.
Read the timeline left to right along the count axis. The shaded band is the only stretch written to the wave file.
Counts 0 to 7: $dumpoff keeps the file to its header.
Counts 8 to 12: $dumpon records two counts of context before and after the event.
Count 10: the trigger prints one snapshot; the bench fails if it fires more than once.
`timescale 1ns/1ps
module trig_cnt (
input logic clk, rst_n,
output logic [7:0] count
);
always_ff @(posedge clk) begin
if (!rst_n) count <= 8'd0;
else count <= count + 8'd1;
end
endmodule