Skip to content

Commit 963115c

Browse files
thomasahleclaude
andcommitted
Rename tb sum→result to avoid duplicate waveform signal names
The VCD dumper records both the tb-level wire and the dut port by name. When both are called 'sum' it looks like a confusing duplicate; renaming the tb wire to 'result' makes the two hierarchy levels distinct. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5d45c06 commit 963115c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • src/lessons/sv/modules-and-ports
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
module tb;
2-
logic [7:0] a, b, sum; // stimulus signals
2+
logic [7:0] a, b;
3+
logic [7:0] result; // tb-level wire to capture the output
34

45
// Instantiate the design under test, connecting ports by name
5-
adder dut(.a(a), .b(b), .sum(sum));
6+
adder dut(.a(a), .b(b), .sum(result));
67

78
initial begin
8-
a = 8'd10; b = 8'd32; // apply inputs
9-
#1 $display("sum = %0d", sum); // wait 1 time unit, then print result
9+
a = 8'd10; b = 8'd32; // apply inputs
10+
#1 $display("sum = %0d", result); // wait 1 time unit, then print result
1011
end
1112
endmodule

0 commit comments

Comments
 (0)