w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tst_serlooplib.vhd
Go to the documentation of this file.
1-- $Id: tst_serlooplib.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Package Name: tst_serlooplib
7-- Description: Definitions for tst_serloop records and helpers
8--
9-- Dependencies: -
10-- Tool versions: ise 13.1-14.7; viv 2014.7-2015.4; ghdl 0.29-0.33
11-- Revision History:
12-- Date Rev Version Comment
13-- 2011-12-10 438 1.0.2 add rxui(cnt|dat) fields in hio_stat_type
14-- 2011-12-09 437 1.0.1 rename serport stat->moni port
15-- 2011-10-14 416 1.0 Initial version
16------------------------------------------------------------------------------
17
18library ieee;
19use ieee.std_logic_1164.all;
20
21use work.slvtypes.all;
22use work.serportlib.all;
23
25
26 constant c_mode_idle : slv2 := "00"; -- mode: idle (no tx activity)
27 constant c_mode_rxblast : slv2 := "01"; -- mode: rxblast (check rx activity)
28 constant c_mode_txblast : slv2 := "10"; -- mode: txblast (saturate tx)
29 constant c_mode_loop : slv2 := "11"; -- mode: loop (rx->tx loop-back)
30
31 type hio_cntl_type is record -- humanio controls
32 mode : slv2; -- mode (idle,(tx|tx)blast,loop)
33 enaxon : slbit; -- enable xon/xoff handling
34 enaesc : slbit; -- enable xon/xoff escaping
35 enathrottle : slbit; -- enable 1 msec tx throttling
36 enaftdi : slbit; -- enable ftdi flush handling
37 end record hio_cntl_type;
38
40 c_mode_idle, -- mode
41 '0','0','0','0' -- enaxon,enaesc,enathrottle,enaftdi
42 );
43
44 type hio_stat_type is record -- humanio status
45 rxfecnt : slv16; -- rx frame error counter
46 rxoecnt : slv16; -- rx overrun error counter
47 rxsecnt : slv16; -- rx sequence error counter
48 rxcnt : slv32; -- rx char counter
49 txcnt : slv32; -- tx char counter
50 rxuicnt : slv8; -- rx unsolicited input counter
51 rxuidat : slv8; -- rx unsolicited input data
52 rxokcnt : slv16; -- rxok 1->0 transition counter
53 txokcnt : slv16; -- txok 1->0 transition counter
54 end record hio_stat_type;
55
57 (others=>'0'), -- rxfecnt
58 (others=>'0'), -- rxoecnt
59 (others=>'0'), -- rxsecnt
60 (others=>'0'), -- rxcnt
61 (others=>'0'), -- txcnt
62 (others=>'0'), -- rxuicnt
63 (others=>'0'), -- rxuidat
64 (others=>'0'), -- rxokcnt
65 (others=>'0') -- txokcnt
66 );
67
68-- -------------------------------------
69
70component tst_serloop is -- tester for serport components
71 port (
72 CLK : in slbit; -- clock
73 RESET : in slbit; -- reset
74 CE_MSEC : in slbit; -- msec pulse
75 HIO_CNTL : in hio_cntl_type; -- humanio controls
76 HIO_STAT : out hio_stat_type; -- humanio status
77 SER_MONI : in serport_moni_type; -- serport monitor
78 RXDATA : in slv8; -- receiver data out
79 RXVAL : in slbit; -- receiver data valid
80 RXHOLD : out slbit; -- receiver data hold
81 TXDATA : out slv8; -- transmit data in
82 TXENA : out slbit; -- transmit data enable
83 TXBUSY : in slbit -- transmit busy
84 );
85end component;
86
87component tst_serloop_hiomap is -- default human I/O mapper
88 port (
89 CLK : in slbit; -- clock
90 RESET : in slbit; -- reset
91 HIO_CNTL : out hio_cntl_type; -- tester controls from hio
92 HIO_STAT : in hio_stat_type; -- tester status to display by hio
93 SER_MONI : in serport_moni_type; -- serport monitor to display by hio
94 SWI : in slv8; -- switch settings
95 BTN : in slv4; -- button settings
96 LED : out slv8; -- led data
97 DSP_DAT : out slv16; -- display data
98 DSP_DP : out slv4 -- display decimal points
99 );
100end component;
101
102end package tst_serlooplib;
std_logic_vector( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic_vector( 31 downto 0) slv32
Definition: slvtypes.vhd:59
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40
std_logic_vector( 1 downto 0) slv2
Definition: slvtypes.vhd:34
in HIO_STAT hio_stat_type
in SER_MONI serport_moni_type
out HIO_CNTL hio_cntl_type
in TXBUSY slbit
Definition: tst_serloop.vhd:48
in RESET slbit
Definition: tst_serloop.vhd:37
in RXDATA slv8
Definition: tst_serloop.vhd:42
in SER_MONI serport_moni_type
Definition: tst_serloop.vhd:41
out TXDATA slv8
Definition: tst_serloop.vhd:45
in CLK slbit
Definition: tst_serloop.vhd:36
out HIO_STAT hio_stat_type
Definition: tst_serloop.vhd:40
out RXHOLD slbit
Definition: tst_serloop.vhd:44
in RXVAL slbit
Definition: tst_serloop.vhd:43
in HIO_CNTL hio_cntl_type
Definition: tst_serloop.vhd:39
out TXENA slbit
Definition: tst_serloop.vhd:46
in CE_MSEC slbit
Definition: tst_serloop.vhd:38
slv2 := "10" c_mode_txblast
slv2 := "11" c_mode_loop
hio_stat_type :=(( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0')) hio_stat_init
slv2 := "00" c_mode_idle
slv2 := "01" c_mode_rxblast
hio_cntl_type :=( c_mode_idle, '0', '0', '0', '0') hio_cntl_init