Skip to content
Snippets Groups Projects
Commit eb9b2396 authored by BRONES Romain's avatar BRONES Romain
Browse files

fix(thresh): Fix lower thresh and reset stuck

* typo: Enable bit also drove reset...
* use a NOR rather than a OR -> real thresh
parent 4ce2c16d
No related branches found
Tags 1.1.0
No related merge requests found
...@@ -28,13 +28,13 @@ architecture rtl of lvl_threshold is ...@@ -28,13 +28,13 @@ architecture rtl of lvl_threshold is
signal sign : std_logic; signal sign : std_logic;
signal thresh_and : std_logic; signal thresh_and : std_logic;
signal thresh_or : std_logic; signal thresh_nor : std_logic;
begin begin
sign <= s_axis_tdata_cor(C_W_COR-1); 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_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) p_main:process(clk, rst_n)
begin begin
...@@ -49,7 +49,7 @@ begin ...@@ -49,7 +49,7 @@ begin
if s_axis_tvalid = '1' and enable_thresh = '1' then if s_axis_tvalid = '1' and enable_thresh = '1' then
if sign = '1'then if sign = '1'then
-- negative -- negative
if thresh_or = '1' then if thresh_nor = '1' then
thresh_reached <= '1'; thresh_reached <= '1';
end if; end if;
else else
......
...@@ -233,7 +233,7 @@ begin ...@@ -233,7 +233,7 @@ begin
s_axis_tvalid => ser_tvalid, s_axis_tvalid => ser_tvalid,
enable_thresh => mm_a2l.CONTROL.ENABLE_THRESH.data(0), 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 thresh_reached => thresh_reached
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment