URL
https://opencores.org/ocsvn/uart2bus/uart2bus/trunk
[/] [uart2bus/] [trunk/] [vhdl/] [rtl/] [uartTop.vhd] - Blame information for rev 6
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
6 |
smuller |
-----------------------------------------------------------------------------------------
|
2 |
|
|
-- uart top level module
|
3 |
|
|
--
|
4 |
|
|
-----------------------------------------------------------------------------------------
|
5 |
|
|
library IEEE;
|
6 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
7 |
|
|
|
8 |
|
|
entity uartTop is
|
9 |
|
|
port ( -- global signals
|
10 |
|
|
clr : in std_logic; -- global reset input
|
11 |
|
|
clk : in std_logic; -- global clock input
|
12 |
|
|
-- uart serial signals
|
13 |
|
|
serIn : in std_logic; -- serial data input
|
14 |
|
|
serOut : out std_logic; -- serial data output
|
15 |
|
|
-- transmit and receive internal interface signals
|
16 |
|
|
txData : in std_logic_vector(7 downto 0); -- data byte to transmit
|
17 |
|
|
newTxData : in std_logic; -- asserted to indicate that there is a new data byte for transmission
|
18 |
|
|
txBusy : out std_logic; -- signs that transmitter is busy
|
19 |
|
|
rxData : out std_logic_vector(7 downto 0); -- data byte received
|
20 |
|
|
newRxData : out std_logic; -- signs that a new byte was received
|
21 |
|
|
-- baud rate configuration register - see baudGen.vhd for details
|
22 |
|
|
baudFreq : in std_logic_vector(11 downto 0); -- baud rate setting registers - see header description
|
23 |
|
|
baudLimit : in std_logic_vector(15 downto 0); -- baud rate setting registers - see header description
|
24 |
|
|
baudClk : out std_logic); --
|
25 |
|
|
end uartTop;
|
26 |
|
|
|
27 |
|
|
architecture Behavioral of uartTop is
|
28 |
|
|
|
29 |
|
|
component baudGen
|
30 |
|
|
port (
|
31 |
|
|
clr : in std_logic;
|
32 |
|
|
clk : in std_logic;
|
33 |
|
|
baudFreq : in std_logic_vector(11 downto 0);
|
34 |
|
|
baudLimit : in std_logic_vector(15 downto 0);
|
35 |
|
|
ce16 : out std_logic);
|
36 |
|
|
end component;
|
37 |
|
|
|
38 |
|
|
component uartTx
|
39 |
|
|
port (
|
40 |
|
|
clr : in std_logic;
|
41 |
|
|
clk : in std_logic;
|
42 |
|
|
ce16 : in std_logic;
|
43 |
|
|
txData : in std_logic_vector(7 downto 0);
|
44 |
|
|
newTxData : in std_logic;
|
45 |
|
|
serOut : out std_logic;
|
46 |
|
|
txBusy : out std_logic);
|
47 |
|
|
end component;
|
48 |
|
|
|
49 |
|
|
component uartRx
|
50 |
|
|
port (
|
51 |
|
|
clr : in std_logic;
|
52 |
|
|
clk : in std_logic;
|
53 |
|
|
ce16 : in std_logic;
|
54 |
|
|
serIn : in std_logic;
|
55 |
|
|
rxData : out std_logic_vector(7 downto 0);
|
56 |
|
|
newRxData : out std_logic);
|
57 |
|
|
end component;
|
58 |
|
|
|
59 |
|
|
signal ce16 : std_logic; -- clock enable at bit rate
|
60 |
|
|
|
61 |
|
|
begin
|
62 |
|
|
-- baud rate generator module
|
63 |
|
|
bg : baudGen
|
64 |
|
|
port map (
|
65 |
|
|
clr => clr,
|
66 |
|
|
clk => clk,
|
67 |
|
|
baudFreq => baudFreq,
|
68 |
|
|
baudLimit => baudLimit,
|
69 |
|
|
ce16 => ce16);
|
70 |
|
|
-- uart receiver
|
71 |
|
|
ut : uartTx
|
72 |
|
|
port map (
|
73 |
|
|
clr => clr,
|
74 |
|
|
clk => clk,
|
75 |
|
|
ce16 => ce16,
|
76 |
|
|
txData => txData,
|
77 |
|
|
newTxData => newTxData,
|
78 |
|
|
serOut => serOut,
|
79 |
|
|
txBusy => txBusy);
|
80 |
|
|
-- uart transmitter
|
81 |
|
|
ur : uartRx
|
82 |
|
|
port map (
|
83 |
|
|
clr => clr,
|
84 |
|
|
clk => clk,
|
85 |
|
|
ce16 => ce16,
|
86 |
|
|
serIn => serIn,
|
87 |
|
|
rxData => rxData,
|
88 |
|
|
newRxData => newRxData);
|
89 |
|
|
baudClk <= ce16;
|
90 |
|
|
end Behavioral;
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.