w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tb_tst_serloop2_n2.vhd
Go to the documentation of this file.
1-- $Id: tb_tst_serloop2_n2.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2011-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: tb_tst_serloop2_n2 - sim
7-- Description: Test bench for sys_tst_serloop2_n2
8--
9-- Dependencies: simlib/simclk
10-- vlib/xlib/dcm_sfs
11-- sys_tst_serloop2_n2 [UUT]
12-- tb/tb_tst_serloop
13--
14-- To test: sys_tst_serloop2_n2
15--
16-- Target Devices: generic
17--
18-- Revision History:
19-- Date Rev Version Comment
20-- 2016-09-03 805 1.2 remove CLK_STOP logic (simstop via report)
21-- 2011-12-23 444 1.1 use new simclk; remove clksys output hack
22-- 2011-11-23 432 1.0.2 update O_FLA_CE_N usage
23-- 2011-11-17 426 1.0.1 use dcm_sfs now
24-- 2011-11-13 424 1.0 Initial version
25------------------------------------------------------------------------------
26
27library ieee;
28use ieee.std_logic_1164.all;
29use ieee.numeric_std.all;
30use ieee.std_logic_textio.all;
31use std.textio.all;
32
33use work.slvtypes.all;
34use work.xlib.all;
35use work.simlib.all;
36
39
40architecture sim of tb_tst_serloop2_n2 is
41
42 signal CLK50 : slbit := '0';
43
44 signal CLKS : slbit := '0';
45 signal CLKH : slbit := '0';
46
47 signal I_RXD : slbit := '1';
48 signal O_TXD : slbit := '1';
49 signal I_SWI : slv8 := (others=>'0');
50 signal I_BTN : slv4 := (others=>'0');
51
52 signal O_FUSP_RTS_N : slbit := '0';
53 signal I_FUSP_CTS_N : slbit := '0';
54 signal I_FUSP_RXD : slbit := '1';
55 signal O_FUSP_TXD : slbit := '1';
56
57 signal RXD : slbit := '1';
58 signal TXD : slbit := '1';
59 signal SWI : slv8 := (others=>'0');
60 signal BTN : slv4 := (others=>'0');
61
62 signal FUSP_RTS_N : slbit := '0';
63 signal FUSP_CTS_N : slbit := '0';
64 signal FUSP_RXD : slbit := '1';
65 signal FUSP_TXD : slbit := '1';
66
67 constant clock_period : Delay_length := 20 ns;
68 constant clock_offset : Delay_length := 200 ns;
69 constant delay_time : Delay_length := 2 ns;
70
71begin
72
73 SYSCLK : simclk
74 generic map (
77 port map (
78 CLK => CLK50
79 );
80
81 DCM_S : dcm_sfs
82 generic map (
83 CLKFX_DIVIDE => 5,
84 CLKFX_MULTIPLY => 6,
85 CLKIN_PERIOD => 20.0)
86 port map (
87 CLKIN => CLK50,
88 CLKFX => CLKS,
89 LOCKED => open
90 );
91
92 DCM_H : dcm_sfs
93 generic map (
94 CLKFX_DIVIDE => 2,
95 CLKFX_MULTIPLY => 4,
96 CLKIN_PERIOD => 20.0)
97 port map (
98 CLKIN => CLK50,
99 CLKFX => CLKH,
100 LOCKED => open
101 );
102
103 UUT : entity work.sys_tst_serloop2_n2
104 port map (
105 I_CLK50 => CLK50,
106 I_RXD => I_RXD,
107 O_TXD => O_TXD,
108 I_SWI => I_SWI,
109 I_BTN => I_BTN,
110 O_LED => open,
111 O_ANO_N => open,
112 O_SEG_N => open,
113 O_MEM_CE_N => open,
114 O_MEM_BE_N => open,
115 O_MEM_WE_N => open,
116 O_MEM_OE_N => open,
117 O_MEM_ADV_N => open,
118 O_MEM_CLK => open,
119 O_MEM_CRE => open,
120 I_MEM_WAIT => '0',
121 O_MEM_ADDR => open,
122 IO_MEM_DATA => open,
123 O_FLA_CE_N => open,
128 );
129
130 GENTB : entity work.tb_tst_serloop
131 port map (
132 CLKS => CLKS,
133 CLKH => CLKH,
134 P0_RXD => RXD,
135 P0_TXD => TXD,
136 P0_RTS_N => '0',
137 P0_CTS_N => open,
138 P1_RXD => FUSP_RXD,
139 P1_TXD => FUSP_TXD,
142 SWI => SWI,
143 BTN => BTN
144 );
145
146 I_RXD <= RXD after delay_time;
147 TXD <= O_TXD after delay_time;
152
153 I_SWI <= SWI after delay_time;
154 I_BTN <= BTN after delay_time;
155
156end sim;
CLKFX_DIVIDE positive := 1
in CLKIN slbit
CLKFX_MULTIPLY positive := 1
out LOCKED slbit
CLKIN_PERIOD real := 20.0
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( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40
Delay_length := 2 ns delay_time
slv8 :=( others => '0') SWI
slv4 :=( others => '0') I_BTN
Delay_length := 200 ns clock_offset
slv4 :=( others => '0') BTN
slv8 :=( others => '0') I_SWI
Delay_length := 20 ns clock_period
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