20use ieee.std_logic_1164.
all;
21use ieee.numeric_std.
all;
22use ieee.std_logic_textio.
all;
126 constant offset : Delay_length := 200 ns;
127 constant halfperiod_7
: Delay_length := 16700 ps;
128 constant halfperiod_6
: Delay_length := 16600 ps;
136 wait for halfperiod_7;
138 wait for halfperiod_7;
140 wait for halfperiod_6;
142 wait for halfperiod_7;
144 wait for halfperiod_7;
146 wait for halfperiod_6;
149 end process proc_ifclk;
153 variable rxbuf_rind : natural := 0;
154 variable rxbuf_wind : natural := 0;
155 variable rxbuf_nbyt : natural := 0;
158 variable txbuf_rind : natural := 0;
159 variable txbuf_wind : natural := 0;
160 variable txbuf_nbyt : natural := 0;
162 variable oline : line;
166 if rising_edge(CLK30) then
175 rxbuf_wind := (rxbuf_wind + 1) mod bufsize;
176 rxbuf_nbyt := rxbuf_nbyt + 1;
186 txbuf_rind := (txbuf_rind + 1) mod bufsize;
187 txbuf_nbyt := txbuf_nbyt - 1;
192 if rxbuf_nbyt > 0 then
193 rxbuf_rind := (rxbuf_rind + 1) mod bufsize;
194 rxbuf_nbyt := rxbuf_nbyt - 1;
196 write(oline, string'("fx2_2fifo_core: SLRD_N=0 when rxbuf empty"));
197 writeline(output, oline);
200 R_DATA <= rxbuf(rxbuf_rind);
205 txbuf(txbuf_wind) := DATA;
206 txbuf_wind := (txbuf_wind + 1) mod bufsize;
207 txbuf_nbyt := txbuf_nbyt + 1;
209 write(oline, string'("fx2_2fifo_core: SLWR_N=0 when txbuf full"));
210 writeline(output, oline);
219 if rxbuf_nbyt < 4 then
235 if rxbuf_nbyt = 0 then
252 end process proc_state;
260 DATA <= (others=>'Z');
264 end process proc_data;
out DO slv( DWIDTH- 1 downto 0)
in DI slv( DWIDTH- 1 downto 0)
out SIZER slv( AWIDTH- 1 downto 0)
out SIZEW slv( AWIDTH- 1 downto 0)
natural := 0 R_txbuf_nbyt
natural := 0 R_txbuf_wind
slv8 :=( others => '0') TXFIFO_DI
slv2 := c_fifo_ep4 c_rxfifo
integer := 1 c_flag_tx_ff
natural := 0 R_rxbuf_rind
integer := 3 c_flag_tx2_ff
slv8 :=( others => '0') R_DATA
natural := 0 R_rxbuf_wind
slv(DATA) :=( others => '0') datzero
slv8 :=( others => '0') RXFIFO_DO
slv2 := c_fifo_ep6 c_txfifo
( 0 to bufsize- 1) slv(DATA) buf_type
integer := 2 c_flag_rx_ef
slv4 :=( others => '0') R_FLAG
natural := 0 R_rxbuf_nbyt
natural := 0 R_txbuf_rind
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 7 downto 0) slv8
std_logic_vector( 1 downto 0) slv2