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

feat:Make error flags really sticky

* Set by HW, reset on SW access.
* Put swacc option in RDL.
parent 496e1685
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,12 @@ architecture rtl of top_ccn_packeter is
signal areset : std_logic;
-- Flags
signal s_err_timeout : std_logic;
signal f_err_timeout : std_logic;
signal s_err_seq : std_logic;
signal f_err_seq : std_logic;
begin
areset <= not aresetn;
......@@ -116,8 +122,8 @@ begin
timeref => timeref,
-- Status
status_err_seq => addrmap_i.packeter_error.seq.data(0),
status_err_timeout => addrmap_i.packeter_error.timeout.data(0),
status_err_seq => s_err_seq,
status_err_timeout => s_err_timeout,
status_frame_count => addrmap_i.packeter_count.count.data,
-- AXIS Packet input
......@@ -137,5 +143,31 @@ begin
);
------------------
-- STICKY FLAGS --
------------------
addrmap_i.packeter_error.timeout.data(0) <= f_err_timeout;
addrmap_i.packeter_error.seq.data(0) <= f_err_seq;
p_flags:process(aclk, aresetn)
begin
if areset = '0' then
f_err_timeout <= '0';
f_err_seq <= '0';
elsif rising_edge(aclk) then
if s_err_timeout = '1' then
f_err_timeout <= '1';
elsif addrmap_o.packeter_error.timeout.swacc = '1' then
f_err_timeout <= '0';
end if;
if s_err_seq = '1' then
f_err_seq <= '1';
elsif addrmap_o.packeter_error.seq.swacc = '1' then
f_err_seq <= '0';
end if;
end if;
end process;
end architecture;
......@@ -61,9 +61,9 @@ addrmap ccn_packeter {
reg {
desc="Error detected by the packeter. Cleared on read.";
field {hw=w; sw=r; rclr; sticky; desc="New FA sequence received before reaching expected number of BPM packets.";
field {hw=w; sw=r; swacc; desc="New FA sequence received before reaching expected number of BPM packets.";
} SEQ;
field {hw=w; sw=r; rclr; sticky; desc="Timeout waiting for a new BPM packet.";
field {hw=w; sw=r; swacc; desc="Timeout waiting for a new BPM packet.";
} TIMEOUT;
} PACKETER_ERROR;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment