Skip to content

Commit 16200ed

Browse files
htfaburish
authored andcommitted
fix(examples): fix reset in stripes & checkers
`@(posedge vsync)` doesn't happen while in reset, so the `if (~rst_n)` branch is never active
1 parent 4ca9062 commit 16200ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/examples/checkers/project.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module tt_um_vga_example(
1818
);
1919
// increase couner every frame (vsync happens once per frame)
2020
reg [9:0] counter;
21-
always @(posedge vsync) begin
21+
always @(posedge vsync, negedge rst_n) begin
2222
if (~rst_n) begin
2323
counter <= 0;
2424
end else begin

src/examples/stripes/project.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module tt_um_vga_example(
5555
assign G = video_active ? {moving_x[6], pix_y[2]} : 2'b00;
5656
assign B = video_active ? {moving_x[7], pix_y[5]} : 2'b00;
5757

58-
always @(posedge vsync) begin
58+
always @(posedge vsync, negedge rst_n) begin
5959
if (~rst_n) begin
6060
counter <= 0;
6161
end else begin

0 commit comments

Comments
 (0)