From eb9b2396547070f69343dc30d1eb1861790548c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Bron=C3=A8s?= <romain.brones@synchrotron-soleil.fr> Date: Tue, 11 Jul 2023 14:44:36 +0200 Subject: [PATCH] fix(thresh): Fix lower thresh and reset stuck * typo: Enable bit also drove reset... * use a NOR rather than a OR -> real thresh --- hdl/lvl_threshold.vhd | 6 +++--- hdl/top_corr_matrix.vhd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hdl/lvl_threshold.vhd b/hdl/lvl_threshold.vhd index b39b334..ca6ab61 100644 --- a/hdl/lvl_threshold.vhd +++ b/hdl/lvl_threshold.vhd @@ -28,13 +28,13 @@ architecture rtl of lvl_threshold is signal sign : std_logic; signal thresh_and : std_logic; - signal thresh_or : std_logic; + signal thresh_nor : std_logic; begin sign <= s_axis_tdata_cor(C_W_COR-1); thresh_and <= and_reduce(s_axis_tdata_cor(C_W_COR-2 downto C_W_COR-G_N_BTH-1)); - thresh_or <= or_reduce(s_axis_tdata_cor(C_W_COR-2 downto C_W_COR-G_N_BTH-1)); + thresh_nor <= not or_reduce(s_axis_tdata_cor(C_W_COR-2 downto C_W_COR-G_N_BTH-1)); p_main:process(clk, rst_n) begin @@ -49,7 +49,7 @@ begin if s_axis_tvalid = '1' and enable_thresh = '1' then if sign = '1'then -- negative - if thresh_or = '1' then + if thresh_nor = '1' then thresh_reached <= '1'; end if; else diff --git a/hdl/top_corr_matrix.vhd b/hdl/top_corr_matrix.vhd index 4f00557..ea44d02 100644 --- a/hdl/top_corr_matrix.vhd +++ b/hdl/top_corr_matrix.vhd @@ -233,7 +233,7 @@ begin s_axis_tvalid => ser_tvalid, enable_thresh => mm_a2l.CONTROL.ENABLE_THRESH.data(0), - rst_thresh => mm_a2l.CONTROL.ENABLE_THRESH.data(0), + rst_thresh => mm_a2l.CONTROL.RST_THRESH.data(0), thresh_reached => thresh_reached ); -- GitLab