1 |
139 |
arniml |
-------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- Testbench for the T421 system toplevel.
|
4 |
|
|
--
|
5 |
179 |
arniml |
-- $Id: tb_t421.vhd 179 2009-04-01 19:48:38Z arniml $
|
6 |
139 |
arniml |
--
|
7 |
|
|
-- Copyright (c) 2006 Arnim Laeuger (arniml@opencores.org)
|
8 |
|
|
--
|
9 |
|
|
-- All rights reserved
|
10 |
|
|
--
|
11 |
|
|
-- Redistribution and use in source and synthezised forms, with or without
|
12 |
|
|
-- modification, are permitted provided that the following conditions are met:
|
13 |
|
|
--
|
14 |
|
|
-- Redistributions of source code must retain the above copyright notice,
|
15 |
|
|
-- this list of conditions and the following disclaimer.
|
16 |
|
|
--
|
17 |
|
|
-- Redistributions in synthesized form must reproduce the above copyright
|
18 |
|
|
-- notice, this list of conditions and the following disclaimer in the
|
19 |
|
|
-- documentation and/or other materials provided with the distribution.
|
20 |
|
|
--
|
21 |
|
|
-- Neither the name of the author nor the names of other contributors may
|
22 |
|
|
-- be used to endorse or promote products derived from this software without
|
23 |
|
|
-- specific prior written permission.
|
24 |
|
|
--
|
25 |
|
|
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
26 |
|
|
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
27 |
|
|
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
28 |
|
|
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
|
29 |
|
|
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
30 |
|
|
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
31 |
|
|
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
32 |
|
|
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
33 |
|
|
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
34 |
|
|
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
35 |
|
|
-- POSSIBILITY OF SUCH DAMAGE.
|
36 |
|
|
--
|
37 |
|
|
-- Please report bugs to the author, but before you do so, please
|
38 |
|
|
-- make sure that this is not a derivative work and that
|
39 |
|
|
-- you have the latest version of this file.
|
40 |
|
|
--
|
41 |
|
|
-- The latest version of this file can be found at:
|
42 |
|
|
-- http://www.opencores.org/cvsweb.shtml/t400/
|
43 |
|
|
--
|
44 |
|
|
-------------------------------------------------------------------------------
|
45 |
|
|
|
46 |
|
|
entity tb_t421 is
|
47 |
|
|
|
48 |
|
|
end tb_t421;
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
library ieee;
|
52 |
|
|
use ieee.std_logic_1164.all;
|
53 |
|
|
|
54 |
|
|
use work.t400_system_comp_pack.t421;
|
55 |
|
|
use work.tb_pack.tb_elems;
|
56 |
|
|
use work.t400_opt_pack.all;
|
57 |
|
|
|
58 |
|
|
architecture behav of tb_t421 is
|
59 |
|
|
|
60 |
|
|
-- 210.4 kHz clock
|
61 |
|
|
constant period_c : time := 4.75 us;
|
62 |
|
|
signal ck_s : std_logic;
|
63 |
|
|
|
64 |
|
|
signal reset_n_s : std_logic;
|
65 |
|
|
|
66 |
|
|
signal io_l_s : std_logic_vector(7 downto 0);
|
67 |
|
|
signal io_d_s : std_logic_vector(3 downto 0);
|
68 |
|
|
signal io_g_s : std_logic_vector(3 downto 0);
|
69 |
|
|
signal io_in_s : std_logic_vector(3 downto 0);
|
70 |
|
|
|
71 |
|
|
signal si_s,
|
72 |
|
|
so_s,
|
73 |
|
|
sk_s : std_logic;
|
74 |
|
|
|
75 |
|
|
signal vdd_s : std_logic;
|
76 |
|
|
|
77 |
|
|
begin
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
vdd_s <= '1';
|
81 |
|
|
reset_n_s <= '1';
|
82 |
|
|
|
83 |
|
|
-----------------------------------------------------------------------------
|
84 |
|
|
-- DUT
|
85 |
|
|
-----------------------------------------------------------------------------
|
86 |
|
|
t421_b : t421
|
87 |
|
|
generic map (
|
88 |
|
|
opt_ck_div_g => t400_opt_ck_div_4_c,
|
89 |
|
|
opt_cko_g => t400_opt_cko_gpi_c
|
90 |
|
|
)
|
91 |
|
|
port map (
|
92 |
|
|
ck_i => ck_s,
|
93 |
|
|
ck_en_i => vdd_s,
|
94 |
|
|
reset_n_i => reset_n_s,
|
95 |
|
|
cko_i => io_in_s(2),
|
96 |
|
|
si_i => si_s,
|
97 |
|
|
so_o => so_s,
|
98 |
|
|
sk_o => sk_s,
|
99 |
|
|
io_l_b => io_l_s,
|
100 |
|
|
io_d_o => io_d_s,
|
101 |
|
|
io_g_b => io_g_s
|
102 |
|
|
);
|
103 |
|
|
|
104 |
|
|
io_l_s <= (others => 'H');
|
105 |
|
|
io_d_s <= (others => 'H');
|
106 |
|
|
io_g_s <= (others => 'H');
|
107 |
|
|
io_in_s <= (others => 'H');
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
-----------------------------------------------------------------------------
|
111 |
|
|
-- Testbench elements
|
112 |
|
|
-----------------------------------------------------------------------------
|
113 |
|
|
tb_elems_b : tb_elems
|
114 |
|
|
generic map (
|
115 |
|
|
period_g => period_c,
|
116 |
|
|
d_width_g => 4,
|
117 |
|
|
g_width_g => 4
|
118 |
|
|
)
|
119 |
|
|
port map (
|
120 |
|
|
io_l_i => io_l_s,
|
121 |
|
|
io_d_i => io_d_s,
|
122 |
|
|
io_g_i => io_g_s,
|
123 |
|
|
io_in_o => io_in_s,
|
124 |
|
|
so_i => so_s,
|
125 |
|
|
si_o => si_s,
|
126 |
|
|
sk_i => sk_s,
|
127 |
|
|
ck_o => ck_s
|
128 |
|
|
);
|
129 |
|
|
|
130 |
|
|
end behav;
|