Line 1... |
Line 1... |
-----------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------
|
-- uart to internal bus top module
|
-- uart to internal bus top module
|
--
|
--
|
-----------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------
|
library IEEE;
|
library ieee;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use ieee.std_logic_1164.all;
|
|
|
|
library work;
|
|
use work.uart2BusTop_pkg.all;
|
|
|
entity uart2BusTop is
|
entity uart2BusTop is
|
generic ( AW : integer := 8);
|
generic ( AW : integer := 8);
|
port ( -- global signals
|
port ( -- global signals
|
clr : in STD_LOGIC; -- global reset input
|
clr : in STD_LOGIC; -- global reset input
|
clk : in STD_LOGIC; -- global clock input
|
clk : in STD_LOGIC; -- global clock input
|
-- uart serial signals
|
-- uart serial signals
|
serIn : in STD_LOGIC; -- serial data input
|
serIn : in STD_LOGIC; -- serial data input
|
serOut : out STD_LOGIC; -- serial data output
|
serOut : out STD_LOGIC; -- serial data output
|
-- internal bus to register file
|
-- internal bus to register file
|
|
intAccessReq : out std_logic; --
|
|
intAccessGnt : in std_logic; --
|
intRdData : in STD_LOGIC_VECTOR (7 downto 0); -- data read from register file
|
intRdData : in STD_LOGIC_VECTOR (7 downto 0); -- data read from register file
|
intAddress : out STD_LOGIC_VECTOR (AW - 1 downto 0); -- address bus to register file
|
intAddress : out STD_LOGIC_VECTOR (AW - 1 downto 0); -- address bus to register file
|
intWrData : out STD_LOGIC_VECTOR (7 downto 0); -- write data to register file
|
intWrData : out STD_LOGIC_VECTOR (7 downto 0); -- write data to register file
|
intWrite : out STD_LOGIC; -- write control to register file
|
intWrite : out STD_LOGIC; -- write control to register file
|
intRead : out STD_LOGIC); -- read control to register file
|
intRead : out STD_LOGIC); -- read control to register file
|
end uart2BusTop;
|
end uart2BusTop;
|
|
|
architecture Behavioral of uart2BusTop is
|
architecture Behavioral of uart2BusTop is
|
|
|
component uartTop
|
|
port ( clr : in std_logic;
|
|
clk : in std_logic;
|
|
serIn : in std_logic;
|
|
txData : in std_logic_vector(7 downto 0);
|
|
newTxData : in std_logic;
|
|
baudFreq : in std_logic_vector(11 downto 0);
|
|
baudLimit : in std_logic_vector(15 downto 0);
|
|
serOut : out std_logic;
|
|
txBusy : out std_logic;
|
|
rxData : out std_logic_vector(7 downto 0);
|
|
newRxData : out std_logic;
|
|
baudClk : out std_logic);
|
|
end component;
|
|
|
|
component uartParser
|
|
generic ( AW : integer := 8);
|
|
port ( clr : in std_logic;
|
|
clk : in std_logic;
|
|
txBusy : in std_logic;
|
|
rxData : in std_logic_vector(7 downto 0);
|
|
newRxData : in std_logic;
|
|
intRdData : in std_logic_vector(7 downto 0);
|
|
txData : out std_logic_vector(7 downto 0);
|
|
newTxData : out std_logic;
|
|
intAddress : out std_logic_vector(AW - 1 downto 0);
|
|
intWrData : out std_logic_vector(7 downto 0);
|
|
intWrite : out std_logic;
|
|
intRead : out std_logic);
|
|
end component;
|
|
|
|
-- baud rate configuration, see baudGen.vhd for more details.
|
-- baud rate configuration, see baudGen.vhd for more details.
|
-- baud rate generator parameters for 115200 baud on 25MHz clock
|
-- baud rate generator parameters for 115200 baud on 25MHz clock
|
constant baudFreq : std_logic_vector(11 downto 0) := x"480";
|
constant baudFreq : std_logic_vector(11 downto 0) := x"480";
|
constant baudLimit : std_logic_vector(15 downto 0) := x"3889";
|
constant baudLimit : std_logic_vector(15 downto 0) := x"3889";
|
signal txData : std_logic_vector(7 downto 0); -- data byte to transmit
|
signal txData : std_logic_vector(7 downto 0); -- data byte to transmit
|
Line 91... |
Line 65... |
rxData => rxData,
|
rxData => rxData,
|
newRxData => newRxData,
|
newRxData => newRxData,
|
intRdData => intRdData,
|
intRdData => intRdData,
|
txData => txData,
|
txData => txData,
|
newTxData => newTxData,
|
newTxData => newTxData,
|
|
intReq => intAccessReq,
|
|
intGnt => intAccessGnt,
|
intAddress => intAddress,
|
intAddress => intAddress,
|
intWrData => intWrData,
|
intWrData => intWrData,
|
intWrite => intWrite,
|
intWrite => intWrite,
|
intRead => intRead);
|
intRead => intRead);
|
|
|
end Behavioral;
|
end Behavioral;
|
|
|
No newline at end of file
|
No newline at end of file
|