1 -- $Id: tst_fx2loop.vhd 649 2015-02-21 21:10:16Z mueller $
3 -- Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
5 -- This program is free software; you may redistribute and/or modify it under
6 -- the terms of the GNU General Public License as published by the Free
7 -- Software Foundation, either version 2, or at your option any later version.
9 -- This program is distributed in the hope that it will be useful, but
10 -- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 -- for complete details.
14 ------------------------------------------------------------------------------
15 -- Module Name: tst_fx2loop - syn
16 -- Description: simple stand-alone tester for fx2lib components
18 -- Dependencies: comlib/byte2word
22 -- Target Devices: generic
23 -- Tool versions: xst 13.3-14.7; ghdl 0.29-0.31
26 -- Date Rev Version Comment
27 -- 2013-04-24 510 1.0.1 fix sensitivity list of proc_next
28 -- 2012-01-15 453 1.0 Initial version
29 -- 2011-12-26 445 0.5 First draft
30 ------------------------------------------------------------------------------
33 use ieee.std_logic_1164.
all;
41 -- ----------------------------------------------------------------------------
45 CLK : in slbit;
-- clock
48 HIO_CNTL : in hio_cntl_type;
-- humanio controls
49 HIO_STAT : out hio_stat_type;
-- humanio status
50 FX2_MONI : in fx2ctl_moni_type;
-- fx2ctl monitor
51 RXDATA : in slv8;
-- receiver data out
52 RXVAL : in slbit;
-- receiver data valid
53 RXHOLD : out slbit;
-- receiver data hold
54 TXDATA : out slv8;
-- transmit data in
55 TXENA : out slbit;
-- transmit data enable
58 TX2ENA : out slbit;
-- transmit 2 data enable
66 rxdata : slv16;
-- next rx word
67 txdata : slv16;
-- next tx word
68 tx2data : slv16;
-- next tx2 word
69 rxsecnt : slv16;
-- rx sequence error counter
70 rxcnt : slv32;
-- rx word counter
71 txcnt : slv32;
-- tx word counter
72 tx2cnt : slv32;
-- tx2 word counter
73 rxthrottle : slbit;
-- rx throttle flag
77 (others=>'0'), -- rxdata
78 (others=>'0'), -- txdata
79 (others=>'0'), -- tx2data
80 (others=>'0'), -- rxsecnt
81 (others=>'0'), -- rxcnt
82 (others=>'0'), -- txcnt
83 (others=>'0'), -- tx2cnt
104 signal RXHOLD_L : slbit := '0';
-- local copy of out port signal
105 signal TXENA_L : slbit := '0';
-- local copy of out port signal
106 signal TX2ENA_L : slbit := '0';
-- local copy of out port signal
155 if rising_edge(CLK) then
172 variable irxwhold : slbit := '1';
173 variable itxwena : slbit := '0';
174 variable itxwdata : slv16 := (others=>'0');
175 variable itx2wena : slbit := '0';
188 n.rxthrottle := not r.rxthrottle;
199 when c_mode_rxblast =>
200 if RXWVAL='1' and r.rxthrottle='0' then
203 n.rxsecnt := slv((r.rxsecnt) + 1);
208 when c_mode_txblast =>
233 if RXWVAL='1' and irxwhold='0' then
234 n.rxcnt := slv((r.rxcnt) + 1);
237 if itxwena = '1' then
238 n.txcnt := slv((r.txcnt) + 1);
241 if itx2wena = '1' then
242 n.tx2cnt := slv((r.tx2cnt) + 1);
in FX2_MONIfx2ctl_moni_type
regs_type :=regs_init R_REGS
out HIO_STAThio_stat_type
slv16 :=( others =>'0' ) RXWDATA
slv16 :=( others =>'0' ) TX2WDATA
proc_nextR_REGS,CE_MSEC,HIO_CNTL,FX2_MONI,RXWDATA,RXWVAL,TXWBUSY,TX2WBUSY,RXHOLD_L,TXBUSY,TX2BUSY
slv16 :=( others =>'0' ) TXWDATA
regs_type := ( ( others =>'0' ) ,( others =>'0' ) ,( others =>'0' ) ,( others =>'0' ) ,( others =>'0' ) ,( others =>'0' ) ,( others =>'0' ) ,'0' ) regs_init
rxdata:slv16 # txdata:slv16 # tx2data:slv16 # rxsecnt:slv16 # rxcnt:slv32 # txcnt:slv32 # tx2cnt:slv32 # rxthrottle:slbit # regs_typerecordrxdata:slv16%#%%txdata:slv16%#%tx2data:slv16%#%rxsecnt:slv16%#%rxcnt:slv32%#%txcnt:slv32%#%tx2cnt:slv32%#%rxthrottle:slbit%#
regs_type :=regs_init N_REGS