w11 - vhd  0.72
W11 CPU core and support modules
 All Classes Namespaces Files Functions Variables
tst_fx2looplib.vhd
Go to the documentation of this file.
1 -- $Id: tst_fx2looplib.vhd 649 2015-02-21 21:10:16Z mueller $
2 --
3 -- Copyright 2011-2012 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 --
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.
8 --
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.
13 --
14 ------------------------------------------------------------------------------
15 -- Package Name: tst_fx2looplib
16 -- Description: Definitions for tst_fx2loop records and helpers
17 --
18 -- Dependencies: -
19 -- Tool versions: xst 13.3-14.7; ghdl 0.29-0.31
20 -- Revision History:
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 ------------------------------------------------------------------------------
25 
26 library ieee;
27 use ieee.std_logic_1164.all;
28 
29 use work.slvtypes.all;
30 use work.fx2lib.all;
31 
32 package tst_fx2looplib is
33 
34  constant c_ctltyp_2fifo_as : integer := 0; -- fx2ctl type: 2fifo_as
35  constant c_ctltyp_2fifo_ic : integer := 1; -- fx2ctl type: 2fifo_ic
36  constant c_ctltyp_3fifo_ic : integer := 2; -- fx2ctl type: 3fifo_ic
37 
38  constant c_mode_idle : slv2 := "00"; -- mode: idle (no tx activity)
39  constant c_mode_rxblast : slv2 := "01"; -- mode: rxblast (check rx activity)
40  constant c_mode_txblast : slv2 := "10"; -- mode: txblast (saturate tx)
41  constant c_mode_loop : slv2 := "11"; -- mode: loop (rx->tx loop-back)
42 
43  type hio_cntl_type is record -- humanio controls
44  mode : slv2; -- mode (idle,(tx|tx)blast,loop)
45  tx2blast : slbit; -- enable tx2 blast
46  throttle : slbit; -- enable 1 msec tx throttling
47  end record hio_cntl_type;
48 
49  constant hio_cntl_init : hio_cntl_type := (
50  c_mode_idle, -- mode
51  '0','0' -- tx2blast,throttle
52  );
53 
54  type hio_stat_type is record -- humanio status
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
62  end record hio_stat_type;
63 
64  constant hio_stat_init : hio_stat_type := (
65  '0','0','0', -- rxhold,txbusy,tx2busy
66  (others=>'0'), -- rxsecnt
67  (others=>'0'), -- rxcnt
68  (others=>'0'), -- txcnt
69  (others=>'0') -- tx2cnt
70  );
71 
72 -- -------------------------------------
73 
74 component tst_fx2loop is -- tester for serport components
75  port (
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
91  );
92 end component;
93 
94 component tst_fx2loop_hiomap is -- default human I/O mapper
95  port (
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
106  );
107 end component;
108 
109 end package tst_fx2looplib;
slv2 :="11" c_mode_loop
out TXENAslbit
Definition: tst_fx2loop.vhd:55
in FX2_MONIfx2ctl_moni_type
Definition: tst_fx2loop.vhd:50
out HIO_STAThio_stat_type
Definition: tst_fx2loop.vhd:49
in CLKslbit
Definition: tst_fx2loop.vhd:45
in HIO_STAThio_stat_type
slv2 :="00" c_mode_idle
integer :=1 c_ctltyp_2fifo_ic
integer :=2 c_ctltyp_3fifo_ic
in RXDATAslv8
Definition: tst_fx2loop.vhd:51
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 CE_MSECslbit
Definition: tst_fx2loop.vhd:47
in RESETslbit
Definition: tst_fx2loop.vhd:46
in TXBUSYslbit
Definition: tst_fx2loop.vhd:56
in RXVALslbit
Definition: tst_fx2loop.vhd:52
in TX2BUSYslbit
Definition: tst_fx2loop.vhd:59
out TX2ENAslbit
Definition: tst_fx2loop.vhd:58
out RXHOLDslbit
Definition: tst_fx2loop.vhd:53
in FX2_MONIfx2ctl_moni_type
in HIO_CNTLhio_cntl_type
Definition: tst_fx2loop.vhd:48
mode:slv2 # tx2blast:slbit # throttle:slbit # hio_cntl_typerecordmode:slv2%#%%tx2blast:slbit%#%throttle:slbit%#
slv2 :="01" c_mode_rxblast
out TXDATAslv8
Definition: tst_fx2loop.vhd:54
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
out TX2DATAslv8
Definition: tst_fx2loop.vhd:57