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

fix(axireg): Change error flag behavior

* Uniformize error flags for packeter/unpacketer
* Sticky flags, set by logic error
* Now use a dedicated register bit to clear flags
parent 52ea996e
Branches
Tags
No related merge requests found
......@@ -156,17 +156,21 @@ begin
f_err_seq <= '0';
elsif rising_edge(aclk) then
if addrmap_o.reset_error.reset.data(0) = '1' then
f_err_timeout <= '0';
f_err_seq <= '0';
else
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 if;
end process;
......
......@@ -70,6 +70,17 @@ architecture struct of top_ccn_unpacketer is
signal areset : std_logic;
-- Error flags
signal f_err_pid : std_logic;
signal f_err_mac_len : std_logic;
signal f_err_mac_dst : std_logic;
signal f_err_mac_src : std_logic;
signal s_err_pid : std_logic;
signal s_err_mac_len : std_logic;
signal s_err_mac_dst : std_logic;
signal s_err_mac_src : std_logic;
begin
areset <= not aresetn;
......@@ -117,10 +128,10 @@ begin
mac_src => mac_src,
-- Status
err_pid => addrmap_i.unpack_error.err_pid.data(0),
err_mac_len => addrmap_i.unpack_error.err_mac_len.data(0),
err_mac_dst => addrmap_i.unpack_error.err_mac_dst.data(0),
err_mac_src => addrmap_i.unpack_error.err_mac_src.data(0),
err_pid => s_err_pid,
err_mac_len => s_err_mac_len,
err_mac_dst => s_err_mac_dst,
err_mac_src => s_err_mac_src,
pkt_mcts => open,
frame_counter => addrmap_i.frame_cnt.data.data,
......@@ -143,4 +154,49 @@ begin
);
------------------
-- STICKY FLAGS --
------------------
addrmap_i.unpack_error.err_pid.data(0) <= f_err_pid;
addrmap_i.unpack_error.err_mac_len.data(0) <= f_err_mac_len;
addrmap_i.unpack_error.err_mac_dst.data(0) <= f_err_mac_dst;
addrmap_i.unpack_error.err_mac_src.data(0) <= f_err_mac_src;
p_flags:process(aclk, aresetn)
begin
if areset = '0' then
f_err_pid <= '0';
f_err_mac_len <= '0';
f_err_mac_dst <= '0';
f_err_mac_src <= '0';
elsif rising_edge(aclk) then
if addrmap_o.reset_error.reset.data(0) = '1' then
f_err_pid <= '0';
f_err_mac_len <= '0';
f_err_mac_dst <= '0';
f_err_mac_src <= '0';
else
if s_err_pid = '1' then
f_err_pid <= '1';
end if;
if s_err_mac_len = '1' then
f_err_mac_len <= '1';
end if;
if s_err_mac_dst = '1' then
f_err_mac_dst <= '1';
end if;
if s_err_mac_src = '1' then
f_err_mac_src <= '1';
end if;
end if;
end if;
end process;
end architecture struct;
......@@ -67,10 +67,16 @@ addrmap ccn_packeter {
reg {
desc="Error detected by the packeter. Cleared on read.";
field {hw=w; sw=r; swacc; desc="New FA sequence received before reaching expected number of BPM packets.";
field {hw=w; sw=r; desc="New FA sequence received before reaching expected number of BPM packets.";
} SEQ;
field {hw=w; sw=r; swacc; desc="Timeout waiting for a new BPM packet.";
field {hw=w; sw=r; desc="Timeout waiting for a new BPM packet.";
} TIMEOUT;
} PACKETER_ERROR;
reg {
desc="Reset error flags";
default hw=r; default sw=rw;
field {desc="Start the BPM packeter.";} RESET;
} RESET_ERROR;
};
......@@ -52,17 +52,22 @@ addrmap ccn_unpacketer {
reg {
desc="Error detected by the packeter. Cleared on read.";
field {hw=w; sw=r; rclr; sticky; desc="Protocol ID mismatch.";
field {hw=w; sw=r; desc="Protocol ID mismatch.";
} ERR_PID;
field {hw=w; sw=r; rclr; sticky; desc="Incomming MAC frame length not expected.";
field {hw=w; sw=r; desc="Incomming MAC frame length not expected.";
} ERR_MAC_LEN;
field {hw=w; sw=r; rclr; sticky; desc="Incomming MAC source address not expected.";
field {hw=w; sw=r; desc="Incomming MAC source address not expected.";
} ERR_MAC_SRC;
field {hw=w; sw=r; rclr; sticky; desc="Incomming MAC destination address not expected.";
field {hw=w; sw=r; desc="Incomming MAC destination address not expected.";
} ERR_MAC_DST;
} UNPACK_ERROR;
reg {
desc="Reset error flags";
default hw=r; default sw=rw;
field {desc="Start the BPM packeter.";} RESET;
} RESET_ERROR;
reg {
desc="Unpacked frames counter.";
field {hw=rw; sw=r;} data[32];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment