From 795a9d29166925266c9fb9db0caa22b2cd96a52a Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Thu, 8 Jun 2023 16:13:32 +0100 Subject: [PATCH] Fix `genWave` output glitches --- rtl/genWave.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtl/genWave.sv b/rtl/genWave.sv index 6f8fab2..fe26e01 100644 --- a/rtl/genWave.sv +++ b/rtl/genWave.sv @@ -127,8 +127,8 @@ always_comb shift = wv_cnt_1[6] ? 3'd7 : wv_cnt_1[0] ? 3'd1 : 3'd0; -logic [23:0] samples_sum; -always_comb samples_sum = samples_long[63] >> shift; // Shift output sample right to get normalised output +logic [23:0] samples_sum; // Shift output sample right to get normalised output +always_ff @(posedge i_clk48) samples_sum <= samples_long[63] >> shift; always_comb o_sample = samples_sum[15:0]; // Output sample is 16 bits