35use ieee.std_logic_1164.
all;
36use ieee.numeric_std.
all;
67 MONI : out fx2ctl_moni_type;
176 signal R_MONI_C : fx2ctl_moni_type := fx2ctl_moni_init;
177 signal R_MONI_S : fx2ctl_moni_type := fx2ctl_moni_init;
184 report "assert((RXAEMPTY|TXAFULL|TX2AFULL)_THRES <= 2**(RX|TX)FAWIDTH)-1"
264 RXFIFO :
fifo_2c_dram -- input fifo,
2 clock, dram based
283 TXFIFO :
fifo_2c_dram -- output fifo,
2 clock, dram based
302 TX2FIFO :
fifo_2c_dram -- output
2 fifo,
2 clock, dram based
332 end process proc_regs;
340 variable ififo_ce : slbit := '0';
341 variable ififo : slv2 := "00";
343 variable irxfifo_ena : slbit := '0';
344 variable itxfifo_hold : slbit := '0';
345 variable itx2fifo_hold : slbit := '0';
347 variable islrd : slbit := '0';
348 variable islwr : slbit := '0';
349 variable isloe : slbit := '0';
350 variable ipktend : slbit := '0';
352 variable idata_cei : slbit := '0';
353 variable idata_ceo : slbit := '0';
354 variable idata_oe : slbit := '0';
355 variable idata_do : slv8 := (others=>'0');
357 variable slrxok : slbit := '0';
358 variable sltxok : slbit := '0';
359 variable sltx2ok : slbit := '0';
360 variable pipeok : slbit := '0';
361 variable rxfifook : slbit := '0';
363 variable cc_clr : slbit := '0';
364 variable cc_cnt : slbit := '0';
365 variable cc_done : slbit := '0';
377 itx2fifo_hold := '1';
401 if unsigned(r.ccnt) = 0 then
411 if slrxok='1' and rxfifook='1' then
414 n.state := s_rxprep1;
415 elsif sltxok='1' and (TXFIFO_VAL='1' or r.pepend='1')then
418 n.state := s_txprep1;
419 elsif sltx2ok='1' and (TX2FIFO_VAL='1' or r.pe2pend='1')then
422 n.state := s_tx2prep1;
428 n.state := s_rxprep1;
432 n.state := s_rxprep2;
441 if cc_done='1' and sltxok='1' and (TXFIFO_VAL='1' or r.pepend='1') then
442 if r.rxpipe1='1' or r.rxpipe2='1' then
445 n.state := s_txprep0;
448 elsif cc_done='1' and sltx2ok='1' and (TX2FIFO_VAL='1' or r.pe2pend='1')
450 if r.rxpipe1='1' or r.rxpipe2='1' then
453 n.state := s_tx2prep0;
456 elsif slrxok='1' and rxfifook='1' then
468 if r.rxpipe1='1' or r.rxpipe2='1' then
477 n.state := s_rxprep2;
482 n.state := s_txprep1;
486 n.state := s_txprep2;
493 if cc_done='1' and sltx2ok='1' and (TX2FIFO_VAL='1' or r.pe2pend='1')
495 n.state := s_tx2prep0;
497 elsif cc_done='1' and slrxok='1' and rxfifook='1' then
498 n.state := s_rxprep0;
500 elsif sltxok = '1' and r.pepend = '1' then
516 n.state := s_txprep1;
526 n.state := s_tx2prep1;
530 n.state := s_tx2prep2;
533 n.state := s_tx2disp;
537 if cc_done='1' and slrxok='1' and rxfifook='1' then
538 n.state := s_rxprep0;
540 elsif cc_done='1' and sltxok='1' and (TXFIFO_VAL='1' or r.pepend='1')
542 n.state := s_txprep0;
544 elsif sltx2ok = '1' and r.pe2pend = '1' then
552 itx2fifo_hold := '0';
558 n.state := s_tx2disp;
560 n.state := s_tx2prep1;
571 idata_cei := r.rxpipe1;
572 n.rxpipe2 := r.rxpipe1;
573 irxfifo_ena := r.rxpipe2;
577 n.ccnt := (others=>'1');
578 elsif cc_cnt='1' and unsigned(r.ccnt) > 0 then
579 n.ccnt := slv(unsigned(r.ccnt) - 1);
587 n.petocnt := (others=>'1');
589 if unsigned(r.petocnt) /= 0 then
590 n.petocnt := slv(unsigned(r.petocnt) - 1);
591 if unsigned(r.petocnt) = 1 then
597 n.pe2tocnt := (others=>'1');
599 if unsigned(r.pe2tocnt) /= 0 then
600 n.pe2tocnt := slv(unsigned(r.pe2tocnt) - 1);
601 if unsigned(r.pe2tocnt) = 1 then
607 n.moni_ep4_sel := '0';
608 n.moni_ep6_sel := '0';
609 n.moni_ep8_sel := '0';
610 if r.state = s_rxdisp or r.state = s_rxpipe then
611 n.moni_ep4_sel := '1';
613 elsif r.state = s_txdisp then
614 n.moni_ep6_sel := '1';
616 elsif r.state = s_tx2disp then
617 n.moni_ep8_sel := '1';
640 end process proc_next;
645 if rising_edge(CLK) then
664 when s_idle => R_MONI_C.fsm_idle <= '1';
685 end process proc_moni;
711 end process proc_almost;
slv( TXFAWIDTH- 1 downto 0) :=( others => '0') TX2SIZE_USR
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
slv( TXFAWIDTH- 1 downto 0) :=( others => '0') TX2SIZE_FX2
slbit := '0' TX2FIFO_HOLD
integer := 3 c_flag_tx2_ff
slv8 :=( others => '0') FX2_DATA_DO
regs_type := regs_init N_REGS
slv8 :=( others => '0') TXFIFO_DO
slv8 :=( others => '0') TX2FIFO_DO
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
slv2 := c_fifo_ep8 c_tx2fifo
regs_type :=( s_idle, petocnt_init, petocnt_init, '0', '0', '0', '0', ccnt_init, '0', '0', '0', '0', '0', '0') regs_init
fx2ctl_moni_type := fx2ctl_moni_init R_MONI_S
(s_idle,s_rxprep0,s_rxprep1,s_rxprep2,s_rxdisp,s_rxpipe,s_txprep0,s_txprep1,s_txprep2,s_txdisp,s_tx2prep0,s_tx2prep1,s_tx2prep2,s_tx2disp) state_type
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
TX2AFULL_THRES natural := 1
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