diff --git a/lib/emac/src/emac_tx.vhd b/lib/emac/src/emac_tx.vhd index b21bd92..869334f 100644 --- a/lib/emac/src/emac_tx.vhd +++ b/lib/emac/src/emac_tx.vhd @@ -413,7 +413,6 @@ interframe_gap_counter: ifg_idle <= '0'; if reset_en = '1' or piso32_dout_vld = '1' then ifg_cnt <= ifg_cnt_t'high; - ifg_idle <= '1'; elsif ifg_cnt /= 0 then ifg_cnt <= ifg_cnt - 1; else @@ -494,13 +493,15 @@ xfer_state: xfer_sn <= xfer_idle; when xfer_idle => - if cmd_fifo_empty = '0' and piso32_din_rdy = '1' then + if cmd_fifo_empty = '0' then xfer_sn <= xfer_start; end if; when xfer_start => xfer_set <= '1'; - xfer_sn <= xfer_preamble0; + if cmd_fifo_empty = '0' and ifg_idle = '1' then + xfer_sn <= xfer_preamble0; + end if; when xfer_preamble0 => preamble_addr <= 0; @@ -523,8 +524,6 @@ xfer_state: piso32_din_vld <= xfer_bsy; xfer_en <= '1'; if xfer_bsy = '0' then - uncommit_en <= '1'; - xfer_free_en <= '1'; xfer_sn <= xfer_crc; end if; @@ -537,9 +536,9 @@ xfer_state: end if; when xfer_finish => - if ifg_idle = '0' then - xfer_sn <= xfer_idle; - end if; + uncommit_en <= '1'; + xfer_free_en <= '1'; + xfer_sn <= xfer_idle; when others => xfer_sn <= xfer_idle;