1 -- $Id: tst_fx2looplib.vhd 649 2015-02-21 21:10:16Z mueller $
3 -- Copyright 2011-2012 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 -- Package Name: tst_fx2looplib
16 -- Description: Definitions for tst_fx2loop records and helpers
19 -- Tool versions: xst 13.3-14.7; ghdl 0.29-0.31
21 -- Date Rev Version Comment
22 -- 2012-01-15 453 1.1 drop pecnt, add rxhold,(tx|tx2)busy in hio_stat
23 -- 2011-12-26 445 1.0 Initial version
24 ------------------------------------------------------------------------------
27 use ieee.std_logic_1164.
all;
38 constant c_mode_idle : slv2 := "00";
-- mode: idle (no tx activity)
41 constant c_mode_loop : slv2 := "11";
-- mode: loop (rx->tx loop-back)
44 mode : slv2;
-- mode (idle,(tx|tx)blast,loop)
45 tx2blast : slbit;
-- enable tx2 blast
46 throttle : slbit;
-- enable 1 msec tx throttling
51 '0','0' -- tx2blast,throttle
55 rxhold : slbit;
-- rx hold
56 txbusy : slbit;
-- tx busy
57 tx2busy : slbit;
-- tx2 busy
58 rxsecnt : slv16;
-- rx sequence error counter
59 rxcnt : slv32;
-- rx word counter
60 txcnt : slv32;
-- tx word counter
61 tx2cnt : slv32;
-- tx2 word counter
65 '0','0','0', -- rxhold,txbusy,tx2busy
66 (others=>'0'), -- rxsecnt
67 (others=>'0'), -- rxcnt
68 (others=>'0'), -- txcnt
69 (others=>'0') -- tx2cnt
72 -- -------------------------------------
76 CLK :
in slbit;
-- clock
77 RESET :
in slbit;
-- reset
78 CE_MSEC :
in slbit;
-- msec pulse
79 HIO_CNTL :
in hio_cntl_type;
-- humanio controls
80 HIO_STAT :
out hio_stat_type;
-- humanio status
81 FX2_MONI :
in fx2ctl_moni_type;
-- fx2ctl monitor
82 RXDATA :
in slv8;
-- receiver data out
83 RXVAL :
in slbit;
-- receiver data valid
84 RXHOLD :
out slbit;
-- receiver data hold
85 TXDATA :
out slv8;
-- transmit data in
86 TXENA :
out slbit;
-- transmit data enable
87 TXBUSY :
in slbit;
-- transmit busy
88 TX2DATA :
out slv8;
-- transmit 2 data in
89 TX2ENA :
out slbit;
-- transmit 2 data enable
90 TX2BUSY :
in slbit
-- transmit 2 busy
96 CLK :
in slbit;
-- clock
97 RESET :
in slbit;
-- reset
98 HIO_CNTL :
out hio_cntl_type;
-- tester controls from hio
99 HIO_STAT :
in hio_stat_type;
-- tester status to display by hio
100 FX2_MONI :
in fx2ctl_moni_type;
-- fx2ctl monitor to display by hio
101 SWI :
in slv8;
-- switch settings
102 BTN :
in slv4;
-- button settings
103 LED :
out slv8;
-- led data
104 DSP_DAT :
out slv16;
-- display data
105 DSP_DP :
out slv4
-- display decimal points
109 end package tst_fx2looplib;
in FX2_MONIfx2ctl_moni_type
out HIO_STAThio_stat_type
integer :=1 c_ctltyp_2fifo_ic
integer :=2 c_ctltyp_3fifo_ic
hio_stat_type := ( '0','0','0',( others =>'0' ) ,( others =>'0' ) ,( others =>'0' ) ,( others =>'0' ) ) hio_stat_init
out HIO_CNTLhio_cntl_type
hio_cntl_type := ( c_mode_idle,'0','0' ) hio_cntl_init
in FX2_MONIfx2ctl_moni_type
mode:slv2 # tx2blast:slbit # throttle:slbit # hio_cntl_typerecordmode:slv2%#%%tx2blast:slbit%#%throttle:slbit%#
slv2 :="01" c_mode_rxblast
rxhold:slbit # txbusy:slbit # tx2busy:slbit # rxsecnt:slv16 # rxcnt:slv32 # txcnt:slv32 # tx2cnt:slv32 # hio_stat_typerecordrxhold:slbit%#%%txbusy:slbit%#%tx2busy:slbit%#%rxsecnt:slv16%#%rxcnt:slv32%#%txcnt:slv32%#%tx2cnt:slv32%#
integer :=0 c_ctltyp_2fifo_as
slv2 :="10" c_mode_txblast