File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,11 +93,13 @@ begin
9393 out_available_o <= to_integer (out_available);
9494 in_free_o <= to_integer (in_free);
9595
96- packet_counter_proc: process (reset_n_i, clock_i ) is
96+ packet_counter_proc: process (clock_i, reset_n_i ) is
9797 variable out_v : master_t;
9898 variable inc, dec: boolean ;
9999 begin
100- if rising_edge (clock_i(0 )) then
100+ if reset_n_i = '0' then
101+ pkt_counter <= (others => '0' );
102+ elsif rising_edge (clock_i(0 )) then
101103 out_v := vector_unpack(config_c, fifo_elements_c, out_data_s);
102104 inc := is_valid(config_c, in_i) and is_last(config_c, in_i);
103105 dec := out_data_valid_s = '1' and is_last(config_c, out_v) and is_ready(config_c, out_i);
@@ -107,10 +109,6 @@ begin
107109 pkt_counter <= pkt_counter - 1 ;
108110 end if ;
109111 end if ;
110-
111- if reset_n_i = '0' then
112- pkt_counter <= (others => '0' );
113- end if ;
114112 end process ;
115113 out_pkt_available <= to_integer (pkt_counter);
116114 end generate ;
You can’t perform that action at this time.
0 commit comments