w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
sys_tst_serloop1_b3.vhd
Go to the documentation of this file.
1-- $Id: sys_tst_serloop1_b3.vhd 1369 2023-02-08 18:59:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2023- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: sys_tst_serloop1_b3 - syn
7-- Description: Serial link tester design for basys3 (serport_1clock case)
8--
9-- Dependencies: vlib/xlib/s7_cmt_sfs
10-- vlib/genlib/clkdivce
11-- bpgen/bp_rs232_2line_iob
12-- bpgen/sn_humanio
13-- tst_serloop_hiomap
14-- vlib/serport/serport_1clock
15-- tst_serloop
16--
17-- Test bench: -
18--
19-- Target Devices: generic
20-- Tool versions: viv 2022.1; ghdl 2.0.0
21--
22-- Synthesized (viv):
23-- Date Rev viv Target flop lutl lutm bram slic
24-- 2023-02-07 1369 2022.1 xc7a35t-1 408 406 12 0.0 179
25--
26-- Revision History:
27-- Date Rev Version Comment
28-- 2023-02-07 1369 1.0 Initial version (derived from sys_tst_serloop1_n4)
29------------------------------------------------------------------------------
30--
31
32library ieee;
33use ieee.std_logic_1164.all;
34use ieee.numeric_std.all;
35
36use work.slvtypes.all;
37use work.xlib.all;
38use work.genlib.all;
39use work.bpgenlib.all;
40use work.tst_serlooplib.all;
41use work.serportlib.all;
42use work.sys_conf.all;
43
44-- ----------------------------------------------------------------------------
45
46entity sys_tst_serloop1_b3 is -- top level
47 -- implements basys3_aif
48 port (
49 I_CLK100 : in slbit; -- 100 MHz clock
50 I_RXD : in slbit; -- receive data (board view)
51 O_TXD : out slbit; -- transmit data (board view)
52 I_SWI : in slv16; -- b3 switches
53 I_BTN : in slv5; -- b3 buttons
54 O_LED : out slv16; -- b3 leds
55 O_ANO_N : out slv4; -- 7 segment disp: anodes (act.low)
56 O_SEG_N : out slv8 -- 7 segment disp: segments (act.low)
57 );
59
60architecture syn of sys_tst_serloop1_b3 is
61
62 signal CLK : slbit := '0';
63 signal RESET : slbit := '0';
64
65 signal CE_USEC : slbit := '0';
66 signal CE_MSEC : slbit := '0';
67
68 signal RXD : slbit := '0';
69 signal TXD : slbit := '0';
70
71 signal SWI : slv16 := (others=>'0');
72 signal BTN : slv5 := (others=>'0');
73 signal LED : slv16 := (others=>'0');
74 signal DSP_DAT : slv16 := (others=>'0');
75 signal DSP_DP : slv4 := (others=>'0');
76
77 signal HIO_CNTL : hio_cntl_type := hio_cntl_init;
78 signal HIO_STAT : hio_stat_type := hio_stat_init;
79
80 signal RXDATA : slv8 := (others=>'0');
81 signal RXVAL : slbit := '0';
82 signal RXHOLD : slbit := '0';
83 signal TXDATA : slv8 := (others=>'0');
84 signal TXENA : slbit := '0';
85 signal TXBUSY : slbit := '0';
86
87 signal SER_MONI : serport_moni_type := serport_moni_init;
88
89begin
90
91 GEN_CLKSYS : s7_cmt_sfs -- clock generator -------------------
92 generic map (
93 VCO_DIVIDE => sys_conf_clksys_vcodivide,
94 VCO_MULTIPLY => sys_conf_clksys_vcomultiply,
95 OUT_DIVIDE => sys_conf_clksys_outdivide,
96 CLKIN_PERIOD => 10.0,
97 CLKIN_JITTER => 0.01,
98 STARTUP_WAIT => false,
99 GEN_TYPE => sys_conf_clksys_gentype)
100 port map (
101 CLKIN => I_CLK100,
102 CLKFX => CLK,
103 LOCKED => open
104 );
105
106 CLKDIV : clkdivce
107 generic map (
108 CDUWIDTH => 7,
109 USECDIV => sys_conf_clksys_mhz,
110 MSECDIV => sys_conf_clkdiv_msecdiv)
111 port map (
112 CLK => CLK,
113 CE_USEC => open,
115 );
116
117 HIO : sn_humanio
118 generic map (
119 SWIDTH => 16,
120 BWIDTH => 5,
121 LWIDTH => 16,
122 DEBOUNCE => sys_conf_hio_debounce)
123 port map (
124 CLK => CLK,
125 RESET => '0',
126 CE_MSEC => CE_MSEC,
127 SWI => SWI,
128 BTN => BTN,
129 LED => LED,
130 DSP_DAT => DSP_DAT,
131 DSP_DP => DSP_DP,
132 I_SWI => I_SWI,
133 I_BTN => I_BTN,
134 O_LED => O_LED,
135 O_ANO_N => O_ANO_N,
137 );
138
139 RESET <= BTN(0); -- BTN(0) will reset tester !!
140
141 HIOMAP : tst_serloop_hiomap
142 port map (
143 CLK => CLK,
144 RESET => RESET,
148 SWI => SWI(7 downto 0),
149 BTN => BTN(3 downto 0),
150 LED => LED(7 downto 0),
151 DSP_DAT => DSP_DAT,
152 DSP_DP => DSP_DP
153 );
154
155 IOB_RS232 : bp_rs232_2line_iob
156 port map (
157 CLK => CLK,
158 RXD => RXD,
159 TXD => TXD,
160 I_RXD => I_RXD,
161 O_TXD => O_TXD
162 );
163
164 SERPORT : serport_1clock
165 generic map (
166 CDWIDTH => 12,
167 CDINIT => sys_conf_uart_cdinit,
168 RXFAWIDTH => 5,
169 TXFAWIDTH => 5)
170 port map (
171 CLK => CLK,
172 CE_MSEC => CE_MSEC,
173 RESET => RESET,
174 ENAXON => HIO_CNTL.enaxon,
175 ENAESC => HIO_CNTL.enaesc,
176 RXDATA => RXDATA,
177 RXVAL => RXVAL,
178 RXHOLD => RXHOLD,
179 TXDATA => TXDATA,
180 TXENA => TXENA,
181 TXBUSY => TXBUSY,
182 MONI => SER_MONI,
183 RXSD => RXD,
184 TXSD => TXD,
185 RXRTS_N => open,
186 TXCTS_N => '0'
187 );
188
189 TESTER : tst_serloop
190 port map (
191 CLK => CLK,
192 RESET => RESET,
193 CE_MSEC => CE_MSEC,
197 RXDATA => RXDATA,
198 RXVAL => RXVAL,
199 RXHOLD => RXHOLD,
200 TXDATA => TXDATA,
201 TXENA => TXENA,
202 TXBUSY => TXBUSY
203 );
204
205end syn;
out CE_MSEC slbit
Definition: clkdivce.vhd:39
USECDIV positive := 50
Definition: clkdivce.vhd:33
CDUWIDTH positive := 6
Definition: clkdivce.vhd:32
out CE_USEC slbit
Definition: clkdivce.vhd:37
MSECDIV positive := 1000
Definition: clkdivce.vhd:34
in CLK slbit
Definition: clkdivce.vhd:36
TXFAWIDTH natural := 5
CDWIDTH positive := 13
in ENAESC slbit
in ENAXON slbit
in TXCTS_N slbit
RXFAWIDTH natural := 5
CDINIT natural := 15
out RXRTS_N slbit
out MONI serport_moni_type
out RXDATA slv8
out RXVAL slbit
out TXSD slbit
in RXHOLD slbit
in CE_MSEC slbit
out TXBUSY slbit
std_logic_vector( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic_vector( 4 downto 0) slv5
Definition: slvtypes.vhd:37
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
in DSP_DP slv(( 2** DCWIDTH)- 1 downto 0)
Definition: sn_humanio.vhd:63
DEBOUNCE boolean := true
Definition: sn_humanio.vhd:54
out O_LED slv( LWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:66
in DSP_DAT slv( 4*( 2** DCWIDTH)- 1 downto 0)
Definition: sn_humanio.vhd:62
out SWI slv( SWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:59
in I_BTN slv( BWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:65
LWIDTH positive := 8
Definition: sn_humanio.vhd:52
in I_SWI slv( SWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:64
out O_SEG_N slv8
Definition: sn_humanio.vhd:69
SWIDTH positive := 8
Definition: sn_humanio.vhd:50
out BTN slv( BWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:60
in CLK slbit
Definition: sn_humanio.vhd:56
BWIDTH positive := 4
Definition: sn_humanio.vhd:51
out O_ANO_N slv(( 2** DCWIDTH)- 1 downto 0)
Definition: sn_humanio.vhd:67
in LED slv( LWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:61
in RESET slbit := '0'
Definition: sn_humanio.vhd:57
in CE_MSEC slbit
Definition: sn_humanio.vhd:58
slv16 :=( others => '0') DSP_DAT
hio_cntl_type := hio_cntl_init HIO_CNTL
slv16 :=( others => '0') SWI
serport_moni_type := serport_moni_init SER_MONI
slv8 :=( others => '0') RXDATA
hio_stat_type := hio_stat_init HIO_STAT
slv16 :=( others => '0') LED
slv4 :=( others => '0') DSP_DP
slv5 :=( others => '0') BTN
slv8 :=( others => '0') TXDATA
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
Definition: xlib.vhd:35