OpenCores
URL https://opencores.org/ocsvn/miniuart2/miniuart2/trunk

Subversion Repositories miniuart2

[/] [miniuart2/] [trunk/] [sim/] [ModelSim/] [test_bench3/] [test.bak] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 philippe
--------------------------------------------------------
2
-- Title   : UART Testbench
3
-- Project : UART
4
-------------------------------------------------------
5
-------------------------------------------------------
6
-- VHDL description (RTL level)
7
--
8
-------------------------------------------------------
9
-- Designed by : ISIS_MPP
10
-- file        : Interface.vhd
11
-------------------------------------------------------
12
-- Version  : A
13
-- Author   : P.CARTON
14
-- date     : 24 Octobre 2002
15
-- Description :
16
-------------------------------------------------------
17
-- Evolutions :
18
-- date      Author      Version        Description
19
--
20
-------------------------------------------------------
21
--=====================================================
22
--=====================================================
23
--------------------------------------------------------
24
-- Auteur : N.PERRENOT
25
-- 30/09/02
26
-- Version A
27
--------------------------------------------------------
28
-- fichier 'test.vhd'
29
--------------------------------------------------------
30
-- Fonction :
31
-- test entity UART
32
--------------------------------------------------------
33
--------------------------------------------------------
34
library IEEE;
35
use IEEE.std_logic_1164.all;
36
 
37
library simu_lib;
38
use simu_lib.HORLOGE;
39
use simu_lib.GEN_WAVE_BUS;
40
 
41
library work;
42
use work.all;
43
 
44
--------------------------------------------------------
45
entity TEST_MINIUART is
46
 generic( CHEMIN : string := "test_bench3/");
47
end TEST_MINIUART;
48
----------------------------------------------------------------------
49
-- architecture de type comportementale
50
----------------------------------------------------------------------
51
architecture ARCH_TEST_BENCH OF TEST_MINIUART is
52
 
53
------------------------------------------
54
-- declaration des signaux internes de connection
55
------------------------------------------
56
signal ZERO  : std_logic;
57
signal UN    : std_logic;
58
 
59
signal PATT  : std_logic_vector(13 downto 0);
60
signal VISU  : std_logic_vector(11 downto 0);
61
 
62
signal CLK  : std_logic; -- Horloge systeme
63
signal BRCLK : std_logic; -- Horloge Baudrate
64
 
65
------------------------------------------
66
component HORLOGE
67
 generic ( NOM_FICHIER_HORLOGE : string := "HORLOGE.IN" );
68
 port    ( CLOCK : out std_logic );
69
end component;
70
 
71
------------------------------------------
72
component GEN_WAVE_BUS
73
 generic ( nb_bits                  : integer := 4;   -- largeur bus
74
           NOM_FICHIER_WAVE : string := "GEN_WAVE.IN" );
75
 port ( SIGNAL_OUT : out std_logic_vector((nb_bits-1) downto 0) );
76
end component;
77
 
78
------------------------------------------
79
component UART
80
 generic(BRDIVISOR: INTEGER range 0 to 65535 := 130); -- Baud rate divisor
81
 port(
82
-- Wishbone signals
83
     WB_CLK_I : in  std_logic;  -- clock
84
     WB_RST_I : in  std_logic;  -- Reset input
85
     WB_ADR_I : in  std_logic_vector(1 downto 0); -- Adress bus
86
     WB_DAT_I : in  std_logic_vector(7 downto 0); -- DataIn Bus
87
     WB_DAT_O : out std_logic_vector(7 downto 0); -- DataOut Bus
88
     WB_WE_I  : in  std_logic;  -- Write Enable
89
     WB_STB_I : in  std_logic;  -- Strobe
90
     WB_ACK_O : out std_logic;   -- Acknowledge
91
-- process signals
92
     IntTx_O  : out std_logic;  -- Transmit interrupt: indicate waiting for Byte
93
     IntRx_O  : out std_logic;  -- Receive interrupt: indicate Byte received
94
     BR_Clk_I : in  std_logic;  -- Clock used for Transmit/Receive
95
     TxD_PAD_O: out std_logic;  -- Tx RS232 Line
96
     RxD_PAD_I: in  std_logic   -- Rx RS232 Line
97
     );
98
end component;
99
 
100
-----------------------------------------
101
-- debut du corps de l'entite
102
------------------------------------------
103
begin
104
 UN <= '1';
105
 ZERO <= '0';
106
 
107
--------------------------------------
108
GERE_BUS : GEN_WAVE_BUS
109
 generic map ( nb_bits  => PATT'length,
110
                NOM_FICHIER_WAVE => CHEMIN & "patt.in")
111
 port map    ( SIGNAL_OUT => PATT );
112
------------------------------------------
113
HORLOGE_CLK : HORLOGE
114
 generic map ( NOM_FICHIER_HORLOGE => CHEMIN & "clk.in")
115
 port map    ( CLOCK => CLK );
116
------------------------------------------
117
HORLOGE_BRCLK : HORLOGE
118
 generic map ( NOM_FICHIER_HORLOGE => CHEMIN & "brclk.in")
119
 port map    ( CLOCK => BRCLK );
120
------------------------------------------
121
DUT : UART
122
 generic map (BRDIVISOR => 1)
123
 port map(
124
     WB_CLK_I => CLK,
125
     WB_RST_I => PATT(0),
126
     WB_ADR_I => PATT(2 downto 1),
127
     WB_DAT_I => PATT(10 downto 3),
128
     WB_DAT_O => VISU(7 downto 0),
129
     WB_WE_I  => PATT(11),
130
     WB_STB_I => PATT(12),
131
     WB_ACK_O => VISU(8),
132
 
133
     IntTx_O  => VISU(9),
134
     IntRx_O  => VISU(10),
135
     BR_Clk_I => BRCLK,
136
     TxD_PAD_O => VISU(11),
137
     RxD_PAD_I => PATT(13)
138
     );
139
 
140
--------------------------------------------
141
 
142
end ARCH_TEST_BENCH;
143
 

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.