From b0e17846ef4ff7c8e663919efc77b644620ad092 Mon Sep 17 00:00:00 2001 From: uvok Date: Sun, 28 Dec 2025 15:47:17 +0100 Subject: s2p: count read bytes no idea for what purpose. --- ser_to_par.v | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ser_to_par.v') diff --git a/ser_to_par.v b/ser_to_par.v index 0a8c4c4..f690780 100644 --- a/ser_to_par.v +++ b/ser_to_par.v @@ -19,6 +19,8 @@ module ser_to_par #( output dat_valid_o ); +reg [$clog2(SHIFT_WIDTH) - 1 : 0] count = {$clog2(SHIFT_WIDTH){1'b0}}; + always @(posedge clk_i or negedge rst_i) begin if (!rst_i) begin dat_o <= 8'b0; @@ -26,7 +28,10 @@ always @(posedge clk_i or negedge rst_i) begin // shift into highest bit first, so it is subsequently shifted down dat_o[SHIFT_WIDTH - 1] <= dat_i; dat_o[(SHIFT_WIDTH - 2):0] <= dat_o[(SHIFT_WIDTH - 1):1]; + count <= count + 1; end end +assign dat_valid_o = count == 0; + endmodule -- cgit v1.2.3