w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
sys_tst_serloop_s3.vhd
Go to the documentation of this file.
1-- $Id: sys_tst_serloop_s3.vhd 1369 2023-02-08 18:59: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-- Module Name: sys_tst_serloop_s3 - syn
7-- Description: Serial link tester design for s3board
8--
9-- Dependencies: vlib/xlib/dcm_sfs
10-- genlib/clkdivce
11-- bpgen/bp_rs232_2l4l_iob
12-- bpgen/sn_humanio
13-- tst_serloop_hiomap
14-- vlib/serport/serport_1clock
15-- tst_serloop
16-- s3board/s3_sram_dummy
17--
18-- Test bench: -
19--
20-- Target Devices: generic
21-- Tool versions: xst 13.1-14.7; ghdl 0.29-0.31
22--
23-- Synthesized (xst):
24-- Date Rev ise Target flop lutl lutm slic t peri
25-- 2011-11-16 426 13.1 O40d xc3s1000-4 424 602 64 476 t 13.6
26-- 2011-11-13 425 13.1 O40d xc3s1000-4 421 586 64 466 t 13.6
27--
28-- Revision History:
29-- Date Rev Version Comment
30-- 2011-12-09 437 1.0.2 rename serport stat->moni port
31-- 2011-11-17 426 1.0.1 use dcm_sfs now
32-- 2011-11-12 423 1.0 Initial version
33-- 2011-10-25 419 0.5 First draft
34------------------------------------------------------------------------------
35--
36
37library ieee;
38use ieee.std_logic_1164.all;
39use ieee.numeric_std.all;
40
41use work.slvtypes.all;
42use work.xlib.all;
43use work.genlib.all;
44use work.bpgenlib.all;
45use work.tst_serlooplib.all;
46use work.serportlib.all;
47use work.s3boardlib.all;
48use work.sys_conf.all;
49
50-- ----------------------------------------------------------------------------
51
52entity sys_tst_serloop_s3 is -- top level
53 port (
54 I_CLK50 : in slbit; -- 50 MHz board clock
55 I_RXD : in slbit; -- receive data (board view)
56 O_TXD : out slbit; -- transmit data (board view)
57 I_SWI : in slv8; -- s3 switches
58 I_BTN : in slv4; -- s3 buttons
59 O_LED : out slv8; -- s3 leds
60 O_ANO_N : out slv4; -- 7 segment disp: anodes (act.low)
61 O_SEG_N : out slv8; -- 7 segment disp: segments (act.low)
62 O_MEM_CE_N : out slv2; -- sram: chip enables (act.low)
63 O_MEM_BE_N : out slv4; -- sram: byte enables (act.low)
64 O_MEM_WE_N : out slbit; -- sram: write enable (act.low)
65 O_MEM_OE_N : out slbit; -- sram: output enable (act.low)
66 O_MEM_ADDR : out slv18; -- sram: address lines
67 IO_MEM_DATA : inout slv32; -- sram: data lines
68 O_FUSP_RTS_N : out slbit; -- fusp: rs232 rts_n
69 I_FUSP_CTS_N : in slbit; -- fusp: rs232 cts_n
70 I_FUSP_RXD : in slbit; -- fusp: rs232 rx
71 O_FUSP_TXD : out slbit -- fusp: rs232 tx
72 );
74
75architecture syn of sys_tst_serloop_s3 is
76
77 signal CLK : slbit := '0';
78 signal RESET : slbit := '0';
79
80 signal CE_USEC : slbit := '0';
81 signal CE_MSEC : slbit := '0';
82
83 signal RXD : slbit := '0';
84 signal TXD : slbit := '0';
85 signal CTS_N : slbit := '0';
86 signal RTS_N : slbit := '0';
87
88 signal SWI : slv8 := (others=>'0');
89 signal BTN : slv4 := (others=>'0');
90 signal LED : slv8 := (others=>'0');
91 signal DSP_DAT : slv16 := (others=>'0');
92 signal DSP_DP : slv4 := (others=>'0');
93
94 signal HIO_CNTL : hio_cntl_type := hio_cntl_init;
95 signal HIO_STAT : hio_stat_type := hio_stat_init;
96
97 signal RXDATA : slv8 := (others=>'0');
98 signal RXVAL : slbit := '0';
99 signal RXHOLD : slbit := '0';
100 signal TXDATA : slv8 := (others=>'0');
101 signal TXENA : slbit := '0';
102 signal TXBUSY : slbit := '0';
103
104 signal SER_MONI : serport_moni_type := serport_moni_init;
105
106begin
107
108 DCM : dcm_sfs
109 generic map (
110 CLKFX_DIVIDE => 5,
111 CLKFX_MULTIPLY => 6,
112 CLKIN_PERIOD => 20.0)
113 port map (
114 CLKIN => I_CLK50,
115 CLKFX => CLK,
116 LOCKED => open
117 );
118
119 CLKDIV : clkdivce
120 generic map (
121 CDUWIDTH => 6,
122 USECDIV => sys_conf_clkdiv_usecdiv, -- syn: 60 sim: 12
123 MSECDIV => sys_conf_clkdiv_msecdiv) -- syn: 1000 sim: 5
124 port map (
125 CLK => CLK,
126 CE_USEC => CE_USEC,
128 );
129
130 HIO : sn_humanio
131 generic map (
132 DEBOUNCE => sys_conf_hio_debounce)
133 port map (
134 CLK => CLK,
135 RESET => '0',
136 CE_MSEC => CE_MSEC,
137 SWI => SWI,
138 BTN => BTN,
139 LED => LED,
140 DSP_DAT => DSP_DAT,
141 DSP_DP => DSP_DP,
142 I_SWI => I_SWI,
143 I_BTN => I_BTN,
144 O_LED => O_LED,
145 O_ANO_N => O_ANO_N,
147 );
148
149 RESET <= BTN(0); -- BTN(0) will reset tester !!
150
151 HIOMAP : tst_serloop_hiomap
152 port map (
153 CLK => CLK,
154 RESET => RESET,
158 SWI => SWI,
159 BTN => BTN,
160 LED => LED,
161 DSP_DAT => DSP_DAT,
162 DSP_DP => DSP_DP
163 );
164
165 IOB_RS232 : bp_rs232_2l4l_iob
166 port map (
167 CLK => CLK,
168 RESET => '0',
169 SEL => SWI(0), -- port selection
170 RXD => RXD,
171 TXD => TXD,
172 CTS_N => CTS_N,
173 RTS_N => RTS_N,
174 I_RXD0 => I_RXD,
175 O_TXD0 => O_TXD,
180 );
181
182 SERPORT : serport_1clock
183 generic map (
184 CDWIDTH => 15,
185 CDINIT => sys_conf_uart_cdinit,
186 RXFAWIDTH => 5,
187 TXFAWIDTH => 5)
188 port map (
189 CLK => CLK,
190 CE_MSEC => CE_MSEC,
191 RESET => RESET,
192 ENAXON => HIO_CNTL.enaxon,
193 ENAESC => HIO_CNTL.enaesc,
194 RXDATA => RXDATA,
195 RXVAL => RXVAL,
196 RXHOLD => RXHOLD,
197 TXDATA => TXDATA,
198 TXENA => TXENA,
199 TXBUSY => TXBUSY,
200 MONI => SER_MONI,
201 RXSD => RXD,
202 TXSD => TXD,
203 RXRTS_N => RTS_N,
204 TXCTS_N => CTS_N
205 );
206
207 TESTER : tst_serloop
208 port map (
209 CLK => CLK,
210 RESET => RESET,
211 CE_MSEC => CE_MSEC,
215 RXDATA => RXDATA,
216 RXVAL => RXVAL,
217 RXHOLD => RXHOLD,
218 TXDATA => TXDATA,
219 TXENA => TXENA,
220 TXBUSY => TXBUSY
221 );
222
223 SRAM : s3_sram_dummy -- connect SRAM to protection dummy
224 port map (
225 O_MEM_CE_N => O_MEM_CE_N,
226 O_MEM_BE_N => O_MEM_BE_N,
227 O_MEM_WE_N => O_MEM_WE_N,
228 O_MEM_OE_N => O_MEM_OE_N,
229 O_MEM_ADDR => O_MEM_ADDR,
230 IO_MEM_DATA => IO_MEM_DATA
231 );
232
233end syn;
234
in RESET slbit := '0'
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
CLKFX_DIVIDE positive := 1
in CLKIN slbit
CLKFX_MULTIPLY positive := 1
out LOCKED slbit
CLKIN_PERIOD real := 20.0
out CLKFX slbit
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( 17 downto 0) slv18
Definition: slvtypes.vhd:51
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 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
in I_SWI slv( SWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:64
out O_SEG_N slv8
Definition: sn_humanio.vhd:69
out BTN slv( BWIDTH- 1 downto 0)
Definition: sn_humanio.vhd:60
in CLK slbit
Definition: sn_humanio.vhd:56
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
slv8 :=( others => '0') LED
hio_cntl_type := hio_cntl_init HIO_CNTL
slv8 :=( others => '0') SWI
serport_moni_type := serport_moni_init SER_MONI
slv8 :=( others => '0') RXDATA
hio_stat_type := hio_stat_init HIO_STAT
slv4 :=( others => '0') DSP_DP
slv4 :=( 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