diff --git a/lib/emac/src/piso.vhd b/lib/emac/src/piso.vhd index 51152fa..037ff3f 100644 --- a/lib/emac/src/piso.vhd +++ b/lib/emac/src/piso.vhd @@ -88,8 +88,10 @@ begin if rising_edge(clk) then if rst = '1' then shift_cnt_pipe <= (others => '1'); + elsif (din_vld = '1' and din_vld_reg = '0') then + shift_cnt_pipe <= (others => '0'); elsif dout_en = '1' then - if (pre_fin = '1' and din_vld_reg = '1') or (din_vld = '1' and din_vld_reg = '0') then + if (pre_fin = '1' and din_vld_reg = '1') then shift_cnt_pipe <= (others => '0'); else shift_cnt_pipe <= shift_cnt_pipe(shift_cnt_pipe'left-1 downto 0) & '1';