CONSTANTc_fifo_fill_margin:NATURAL:=g_fifo_af_margin+2;-- add +2 extra margin, with tb_dp_fifo_fill it follows that +1 is also enough to avoid almost full when fifo is operating near g_fifo_fill level
-- The FIFO filling relies on framed data, so contrary to dp_fifo_sc the sop and eop need to be used.
CONSTANTc_use_ctrl:BOOLEAN:=TRUE;
-- Define t_state as slv to avoid Modelsim warning "Nonresolved signal 'nxt_state' may have multiple sources". Due to that g_fifo_rl = 0 or 1 ar both supported.
--TYPE t_state IS (s_idle, s_fill, s_output, s_xoff);