w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tb_tst_serloop2_n4d.vhd
Go to the documentation of this file.
1-- $Id: tb_tst_serloop2_n4d.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2017-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: tb_tst_serloop2_n4d - sim
7-- Description: Test bench for sys_tst_serloop2_n4d
8--
9-- Dependencies: simlib/simclk
10-- xlib/sfs_gsim_core
11-- sys_tst_serloop2_n4d [UUT]
12-- tb/tb_tst_serloop
13--
14-- To test: sys_tst_serloop2_n4d
15--
16-- Target Devices: generic
17--
18-- Revision History:
19-- Date Rev Version Comment
20-- 2018-11-03 1064 1.0.1 use sfs_gsim_core
21-- 2017-01-04 838 1.0 Initial version (cloned from tb_tst_serloop2_n4)
22------------------------------------------------------------------------------
23
24library ieee;
25use ieee.std_logic_1164.all;
26use ieee.numeric_std.all;
27use ieee.std_logic_textio.all;
28use std.textio.all;
29
30use work.slvtypes.all;
31use work.xlib.all;
32use work.simlib.all;
33use work.sys_conf.all;
34
37
38architecture sim of tb_tst_serloop2_n4d is
39
40 signal CLK100 : slbit := '0';
41
42 signal CLKS : slbit := '0';
43 signal CLKH : slbit := '0';
44
45 signal I_RXD : slbit := '1';
46 signal O_TXD : slbit := '1';
47 signal O_RTS_N : slbit := '0';
48 signal I_CTS_N : slbit := '0';
49 signal I_SWI : slv16 := (others=>'0');
50 signal I_BTN : slv5 := (others=>'0');
51
52 signal RXD : slbit := '1';
53 signal TXD : slbit := '1';
54 signal RTS_N : slbit := '0';
55 signal CTS_N : slbit := '0';
56 signal SWI : slv16 := (others=>'0');
57 signal BTN : slv5 := (others=>'0');
58
59 constant clock_period : Delay_length := 10 ns;
60 constant clock_offset : Delay_length := 200 ns;
61 constant delay_time : Delay_length := 2 ns;
62
63begin
64
65 SYSCLK : simclk
66 generic map (
69 port map (
70 CLK => CLK100
71 );
72
73 GEN_CLKSYS : sfs_gsim_core
74 generic map (
75 VCO_DIVIDE => sys_conf_clksys_vcodivide,
76 VCO_MULTIPLY => sys_conf_clksys_vcomultiply,
77 OUT_DIVIDE => sys_conf_clksys_outdivide)
78 port map (
79 CLKIN => CLK100,
80 CLKFX => CLKH,
81 LOCKED => open
82 );
83
84 GEN_CLKSER : sfs_gsim_core
85 generic map (
86 VCO_DIVIDE => sys_conf_clkser_vcodivide,
87 VCO_MULTIPLY => sys_conf_clkser_vcomultiply,
88 OUT_DIVIDE => sys_conf_clkser_outdivide)
89 port map (
90 CLKIN => CLK100,
91 CLKFX => CLKS,
92 LOCKED => open
93 );
94
95 UUT : entity work.sys_tst_serloop2_n4d
96 port map (
98 I_RXD => I_RXD,
99 O_TXD => O_TXD,
100 O_RTS_N => O_RTS_N,
101 I_CTS_N => I_CTS_N,
102 I_SWI => I_SWI,
103 I_BTN => I_BTN,
104 I_BTNRST_N => '1',
105 O_LED => open,
106 O_RGBLED0 => open,
107 O_RGBLED1 => open,
108 O_ANO_N => open,
109 O_SEG_N => open
110 );
111
112 GENTB : entity work.tb_tst_serloop
113 port map (
114 CLKS => CLKS,
115 CLKH => CLKH,
116 P0_RXD => RXD,
117 P0_TXD => TXD,
118 P0_RTS_N => RTS_N,
119 P0_CTS_N => CTS_N,
120 P1_RXD => open, -- port 1 unused for n4d !
121 P1_TXD => '0',
122 P1_RTS_N => '0',
123 P1_CTS_N => open,
124 SWI => SWI(7 downto 0),
125 BTN => BTN(3 downto 0)
126 );
127
128 I_RXD <= RXD after delay_time;
129 TXD <= O_TXD after delay_time;
130 RTS_N <= O_RTS_N after delay_time;
131 I_CTS_N <= CTS_N after delay_time;
132
133 I_SWI <= SWI after delay_time;
134 I_BTN <= BTN after delay_time;
135
136end sim;
VCO_DIVIDE positive := 1
OUT_DIVIDE positive := 1
in CLKIN slbit
VCO_MULTIPLY positive := 1
out LOCKED slbit
out CLKFX slbit
out CLK slbit
Definition: simclk.vhd:33
OFFSET Delay_length := 200 ns
Definition: simclk.vhd:31
PERIOD Delay_length := 20 ns
Definition: simclk.vhd:30
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
Delay_length := 2 ns delay_time
Delay_length := 10 ns clock_period
slv16 :=( others => '0') SWI
Delay_length := 200 ns clock_offset
slv5 :=( others => '0') I_BTN
slv5 :=( others => '0') BTN
slv16 :=( others => '0') I_SWI
out P0_RXD slbit
in P1_RTS_N slbit
in P1_TXD slbit
in P0_TXD slbit
out P0_CTS_N slbit
out P1_RXD slbit
in P0_RTS_N slbit
out P1_CTS_N slbit
Definition: xlib.vhd:35