1 -- $Id: tst_fx2loop_hiomap.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 -- Module Name: tst_fx2loop_hiomap - syn
16 -- Description: default human I/O mapper
21 -- Target Devices: generic
22 -- Tool versions: xst 13.3-14.7; ghdl 0.29-0.31
25 -- Date Rev Version Comment
26 -- 2012-01-15 453 1.0.2 re-arrange DP,DSP usage
27 -- 2012-01-03 449 1.0.1 use new fx2ctl_moni layout
28 -- 2011-12-26 445 1.0 Initial version
29 ------------------------------------------------------------------------------
31 -- Usage of Switches, Buttons, LEDs:
33 -- BTN(3) -- unused --
36 -- (0) reset state [!! decoded by top level design !!]
38 -- SWI(7:5) select display
47 -- LED(7) MONI.fifo_ep4
50 -- (4) MONI.flag_ep4_empty
51 -- (3) MONI.flag_ep4_almost
52 -- (2) MONI.flag_ep6_full
53 -- (1) MONI.flag_ep6_almost
54 -- (0) rxsecnt > 0 (sequence error)
56 -- DSP data as selected by SWI(7:5)
58 -- 001 -> -- unused -- (display ffff)
66 -- DP(3) FX2_TXBUSY (shows tx back preasure)
67 -- (2) FX2_MONI.slwr (shows tx activity)
68 -- (1) FX2_RXHOLD (shows rx back preasure)
69 -- (0) FX2_MONI.slrd (shows rx activity)
73 use ieee.std_logic_1164.
all;
80 -- ----------------------------------------------------------------------------
84 CLK : in slbit;
-- clock
86 HIO_CNTL : out hio_cntl_type;
-- tester controls from hio
87 HIO_STAT : in hio_stat_type;
-- tester status to diaplay by hio
88 FX2_MONI : in fx2ctl_moni_type;
-- fx2ctl monitor to display by hio
89 SWI : in slv8;
-- switch settings
90 BTN : in slv4;
-- button settings
91 LED : out slv8;
-- led data
93 DSP_DP : out slv4 -- display decimal points
95 end tst_fx2loop_hiomap;
100 dspdat : slv16;
-- display data
101 dummy : slbit;
-- <remove when 2nd signal added...>
105 (others=>'0'), -- dspdat
117 if rising_edge(CLK) then
132 variable icntl : hio_cntl_type := hio_cntl_init;
133 variable iled : slv8 := (others=>'0');
134 variable idat : slv16 := (others=>'0');
135 variable idp : slv4 := (others=>'0');
142 icntl := hio_cntl_init;
143 iled := (others=>'0');
144 idat := (others=>'0');
145 idp := (others=>'0');
147 -- setup tester controls
149 icntl.mode := SWI(1 downto 0);
150 icntl.tx2blast := SWI(2);
151 icntl.throttle := SWI(3);
158 iled(3) := FX2_MONI.flag_ep4_almost;
160 iled(1) := FX2_MONI.flag_ep6_almost;
161 if (HIO_STAT.rxsecnt) > 0 then iled(0) := '1';
end if;
163 -- setup display data
165 case SWI(7 downto 5) is
166 when "000" => idat := HIO_STAT.rxsecnt;
167 when "001" => idat := (others=>'1');
168 when "010" => idat := HIO_STAT.rxcnt(15 downto 0);
169 when "011" => idat := HIO_STAT.rxcnt(31 downto 16);
170 when "100" => idat := HIO_STAT.txcnt(15 downto 0);
171 when "101" => idat := HIO_STAT.txcnt(31 downto 16);
172 when "110" => idat := HIO_STAT.tx2cnt(15 downto 0);
173 when "111" => idat := HIO_STAT.tx2cnt(31 downto 16);
178 -- setup display decimal points
180 idp(3) := HIO_STAT.txbusy;
-- tx back preasure
181 idp(2) := FX2_MONI.slwr;
-- tx activity
182 idp(1) := HIO_STAT.rxhold;
-- rx back preasure
183 idp(0) := FX2_MONI.slrd;
-- rx activity
dspdat:slv16 # dummy:slbit # regs_typerecorddspdat:slv16%#%%dummy:slbit%#
regs_type := ( ( others =>'0' ) ,'0' ) regs_init
out HIO_CNTLhio_cntl_type
regs_type :=regs_init N_REGS
regs_type :=regs_init R_REGS
proc_nextR_REGS,HIO_STAT,FX2_MONI,SWI,BTN
in FX2_MONIfx2ctl_moni_type