From 7dc6119b2abb11ab04daacdfc3dc125fe46edb04 Mon Sep 17 00:00:00 2001 From: Trinity Bee Date: Wed, 16 Sep 2026 15:46:28 +0000 Subject: [PATCH 1/2] Fix tick() function implementation and add test coverage for clock toggling - Change tick() to properly toggle the clock signal using clk = !clk - Add test_clock_toggling test to verify clock behavior - Ensures proper clock cycle simulation for FIFO testbench Closes #3890 --- specs/fpga/testbench/fifo_tb.t27 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/specs/fpga/testbench/fifo_tb.t27 b/specs/fpga/testbench/fifo_tb.t27 index 13b0c63636..4320d16e1d 100644 --- a/specs/fpga/testbench/fifo_tb.t27 +++ b/specs/fpga/testbench/fifo_tb.t27 @@ -28,8 +28,7 @@ module FIFO_Testbench { var test_failed : u32 = 0; fn tick() { - clk = false; - clk = true; + clk = !clk; } fn reset() { @@ -146,6 +145,17 @@ module FIFO_Testbench { invariant fifo_depth_positive : FIFO_DEPTH > 0; invariant data_width_positive : DATA_WIDTH > 0; + test test_clock_toggling { + reset(); + invariant clk == false; + tick(); + invariant clk == true; + tick(); + invariant clk == false; + tick(); + invariant clk == true; + } + bench bench_fifo_throughput { reset(); var i : u32 = 0; From 3299accf45b0d282b32f8b99c0f79a64a826777b Mon Sep 17 00:00:00 2001 From: Trinity Bee Date: Wed, 16 Sep 2026 17:07:16 +0000 Subject: [PATCH 2/2] Fix tick() function implementation and add test coverage for clock toggling - Change tick() to properly toggle the clock signal using clk = !clk - Add test_clock_toggling test to verify clock behavior - Ensures proper clock cycle simulation for FIFO testbench Closes #3890 --- specs/fpga/testbench/fifo_tb.t27 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/specs/fpga/testbench/fifo_tb.t27 b/specs/fpga/testbench/fifo_tb.t27 index 4320d16e1d..ef7aa93a90 100644 --- a/specs/fpga/testbench/fifo_tb.t27 +++ b/specs/fpga/testbench/fifo_tb.t27 @@ -145,6 +145,15 @@ module FIFO_Testbench { invariant fifo_depth_positive : FIFO_DEPTH > 0; invariant data_width_positive : DATA_WIDTH > 0; + test test_tick_functionality { + reset(); + invariant clk == false; + tick(); + invariant clk == true; + tick(); + invariant clk == false; + } + test test_clock_toggling { reset(); invariant clk == false;