Skip to content
Snippets Groups Projects
Commit b362fac7 authored by System User's avatar System User
Browse files

fix bug ccn_pck

parent 567bd435
No related branches found
No related tags found
No related merge requests found
......@@ -86,8 +86,11 @@ architecture rtl of ccn_pack is
-- Packet Rate Counter
signal pps_detect : std_logic_vector(1 downto 0);
signal is_pps : std_logic;
signal pkt_rt_cnt : unsigned(18 downto 0);
signal pkt_rt_cnt_v : std_logic_vector(18 downto 0);
signal pkt_rt_cnt_ena : std_logic;
signal pkt_cnt_incr : std_logic;
-- Frame counter
signal frame_counter : unsigned(31 downto 0);
......@@ -213,7 +216,7 @@ begin
-------------------------
-- PPS PULSE DETECTION --
-------------------------
is_pps <= pps_detect[0] and not(pps_detect[1])
is_pps <= pps_detect(0) and not(pps_detect(1));
p_pps_dtc:process(aclk, aresetn)
begin
......@@ -221,8 +224,8 @@ begin
pps_detect <= (others => '0');
elsif rising_edge(aclk) then
pps_detect[1] <= pps_detect[0];
pps_detect[0] <= pps;
pps_detect(1) <= pps_detect(0);
pps_detect(0) <= pps;
end if;
end process p_pps_dtc;
......@@ -231,6 +234,8 @@ begin
-------------------------
pkt_cnt_incr <= reg_tvalid and pkt_reg_tready; -- same conditions as for pkt decounter
-- pkt_rt_cnt_zero <= '1' when is_pps = 1 else '0';-- unused
-- pkt_rate_cnt <= std_logic_vector(resize(unsigned(pkt_rt_cnt),pkt_rate_cnt'length)) when is_pps = '1'; -- save packet rate cnt value in RO reg
pkt_rate_cnt <= pkt_rt_cnt_v;
p_pkt_rt_cnt:process(aclk, aresetn) -- counter process
begin
......@@ -239,7 +244,7 @@ begin
elsif rising_edge(aclk) then
if is_pps = '1' then
pkt_rt_cnt <= std_logic_vector(unsigned(pkt_rt_cnt)); -- save packet rate cnt value in RO reg
pkt_rt_cnt_v <= std_logic_vector(resize(unsigned(pkt_rt_cnt),pkt_rate_cnt'length));
pkt_rt_cnt <= (others => '0'); -- reset packet rate value
else
if pkt_rt_cnt_ena = '1' and pkt_cnt_incr = '1' then
......@@ -467,6 +472,7 @@ begin
load_pkt_cnt_ena <= '0';
pass <= '0';
frame_error <= '1';
pkt_rt_cnt_ena <= '0';-- pkt_rt counter disable
--
fsm_state_next <= STANDBY;
......@@ -475,6 +481,7 @@ begin
load_pkt_cnt_ena <= '1';
pass <= '0';
frame_error <= '0';
pkt_rt_cnt_ena <= '0';-- pkt_rt counter disable
--
fsm_state_next <= STANDBY;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment