38use ieee.std_logic_1164.
all;
39use ieee.numeric_std.
all;
65 MONI : out fx2ctl_moni_type;
157 signal R_MONI_C : fx2ctl_moni_type := fx2ctl_moni_init;
158 signal R_MONI_S : fx2ctl_moni_type := fx2ctl_moni_init;
164 report "assert((RXAEMPTY|TXAFULL)_THRES <= 2**(RX|TX)FAWIDTH)-1"
244 RXFIFO :
fifo_2c_dram -- input fifo,
2 clock, dram based
263 TXFIFO :
fifo_2c_dram -- output fifo,
2 clock, dram based
293 end process proc_regs;
300 variable ififo_ce : slbit := '0';
301 variable ififo : slv2 := "00";
303 variable irxfifo_ena : slbit := '0';
304 variable itxfifo_hold : slbit := '0';
306 variable islrd : slbit := '0';
307 variable islwr : slbit := '0';
308 variable isloe : slbit := '0';
309 variable ipktend : slbit := '0';
311 variable idata_cei : slbit := '0';
312 variable idata_ceo : slbit := '0';
313 variable idata_oe : slbit := '0';
315 variable slrxok : slbit := '0';
316 variable sltxok : slbit := '0';
317 variable pipeok : slbit := '0';
318 variable rxfifook : slbit := '0';
320 variable cc_clr : slbit := '0';
321 variable cc_cnt : slbit := '0';
322 variable cc_done : slbit := '0';
355 if unsigned(r.ccnt) = 0 then
365 if slrxok='1' and rxfifook='1' then
368 n.state := s_rxprep1;
369 elsif sltxok='1' and (TXFIFO_VAL='1' or r.pepend='1')then
372 n.state := s_txprep1;
378 n.state := s_rxprep1;
382 n.state := s_rxprep2;
391 if cc_done='1' and sltxok='1' and (TXFIFO_VAL='1' or r.pepend='1') then
392 if r.rxpipe1='1' or r.rxpipe2='1' then
395 n.state := s_txprep0;
398 elsif slrxok='1' and rxfifook='1' then
410 if r.rxpipe1='1' or r.rxpipe2='1' then
419 n.state := s_rxprep2;
424 n.state := s_txprep1;
428 n.state := s_txprep2;
435 if cc_done='1' and slrxok='1' and rxfifook='1' then
436 n.state := s_rxprep0;
438 elsif sltxok = '1' and r.pepend = '1' then
453 n.state := s_txprep1;
464 idata_cei := r.rxpipe1;
465 n.rxpipe2 := r.rxpipe1;
466 irxfifo_ena := r.rxpipe2;
470 n.ccnt := (others=>'1');
471 elsif cc_cnt='1' and unsigned(r.ccnt) > 0 then
472 n.ccnt := slv(unsigned(r.ccnt) - 1);
480 n.petocnt := (others=>'1');
482 if unsigned(r.petocnt) /= 0 then
483 n.petocnt := slv(unsigned(r.petocnt) - 1);
484 if unsigned(r.petocnt) = 1 then
490 n.moni_ep4_sel := '0';
491 n.moni_ep6_sel := '0';
492 if r.state = s_rxdisp or r.state = s_rxpipe then
493 n.moni_ep4_sel := '1';
495 elsif r.state = s_txdisp then
496 n.moni_ep6_sel := '1';
517 end process proc_next;
522 if rising_edge(CLK) then
538 when s_idle => R_MONI_C.fsm_idle <= '1';
555 end process proc_moni;
575 end process proc_almost;
(s_idle,s_rxprep0,s_rxprep1,s_rxprep2,s_rxdisp,s_rxpipe,s_txprep0,s_txprep1,s_txprep2,s_txdisp) state_type
slv2 := c_fifo_ep4 c_rxfifo
slv( RXFAWIDTH- 1 downto 0) :=( others => '0') RXSIZE_USR
slv( TXFAWIDTH- 1 downto 0) :=( others => '0') TXSIZE_FX2
integer := 1 c_flag_tx_ff
slv( CCWIDTH- 1 downto 0) :=( others => '0') ccnt_init
integer := 3 c_flag_tx2_ff
regs_type := regs_init N_REGS
slv8 :=( others => '0') TXFIFO_DO
regs_type :=( s_idle, petocnt_init, '0', '0', '0', ccnt_init, '0', '0', '0', '0') regs_init
slbit := '1' FX2_PKTEND_N
fx2ctl_moni_type := fx2ctl_moni_init R_MONI_C
slv( TXFAWIDTH- 1 downto 0) :=( others => '0') TXSIZE_USR
regs_type := regs_init R_REGS
fx2ctl_moni_type := fx2ctl_moni_init R_MONI_S
slv2 :=( others => '0') FX2_FIFO
slv2 := c_fifo_ep6 c_txfifo
natural := 3 rxfifo_thres
integer := 2 c_flag_rx_ef
slbit := '0' FX2_DATA_CEO
slv( PETOWIDTH- 1 downto 0) :=( others => '0') petocnt_init
slv8 :=( others => '0') RXFIFO_DI
slv( RXFAWIDTH- 1 downto 0) :=( others => '0') RXSIZE_FX2
slv4 :=( others => '0') FX2_FLAG_N
slbit := '0' FX2_DATA_CEI
RXAEMPTY_THRES natural := 1
out MONI fx2ctl_moni_type
TXAFULL_THRES natural := 1
in PAD slv( DWIDTH- 1 downto 0)
out DI slv( DWIDTH- 1 downto 0)
inout PAD slv( DWIDTH- 1 downto 0)
in DO slv( DWIDTH- 1 downto 0)
out DI slv( DWIDTH- 1 downto 0)
out PAD slv( DWIDTH- 1 downto 0)
in DO slv( DWIDTH- 1 downto 0)
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 7 downto 0) slv8
std_logic_vector( 1 downto 0) slv2