Line 1... |
Line 1... |
--! uart control unit
|
--! @file
|
|
--! @brief Uart control unit
|
library IEEE;
|
library IEEE;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_arith.all;
|
|
|
--! Use CPU Definitions package
|
--! Use CPU Definitions package
|
use work.pkgDefinitions.all;
|
use work.pkgDefinitions.all;
|
|
|
entity uart_control is
|
entity uart_control is
|
Port ( rst : in std_logic; -- Global reset
|
Port ( rst : in std_logic; --! Global reset
|
clk : in std_logic; -- Global clock
|
clk : in std_logic; --! Global clock
|
WE : in std_logic; -- Write enable
|
WE : in std_logic; --! Write enable
|
reg_addr : in std_logic_vector (1 downto 0); -- Register address
|
reg_addr : in std_logic_vector (1 downto 0); --! Register address
|
start : in std_logic; -- Start (Strobe)
|
start : in std_logic; --! Start (Strobe)
|
done : out std_logic; -- Done (ACK)
|
done : out std_logic; --! Done (ACK)
|
DAT_I : in std_logic_vector ((nBitsLarge-1) downto 0); -- Data Input (Wishbone)
|
DAT_I : in std_logic_vector ((nBitsLarge-1) downto 0); --! Data Input (Wishbone)
|
DAT_O : out std_logic_vector ((nBitsLarge-1) downto 0); -- Data output (Wishbone)
|
DAT_O : out std_logic_vector ((nBitsLarge-1) downto 0); --! Data output (Wishbone)
|
baud_wait : out std_logic_vector ((nBitsLarge-1) downto 0); -- Signal to control the baud rate frequency
|
baud_wait : out std_logic_vector ((nBitsLarge-1) downto 0); --! Signal to control the baud rate frequency
|
data_byte_tx : out std_logic_vector((nBits-1) downto 0); -- 1 Byte to be send to serial_transmitter
|
data_byte_tx : out std_logic_vector((nBits-1) downto 0); --! 1 Byte to be send to serial_transmitter
|
data_byte_rx : in std_logic_vector((nBits-1) downto 0); -- 1 Byte to be received by serial_receiver
|
data_byte_rx : in std_logic_vector((nBits-1) downto 0); --! 1 Byte to be received by serial_receiver
|
tx_data_sent : in std_logic; -- Signal comming from serial_transmitter
|
tx_data_sent : in std_logic; --! Signal comming from serial_transmitter
|
tx_start : out std_logic; -- Signal to start sending serial data...
|
tx_start : out std_logic; --! Signal to start sending serial data...
|
rst_comm_blocks : out std_logic; -- Reset Communication blocks
|
rst_comm_blocks : out std_logic; --! Reset Communication blocks
|
rx_data_ready : in std_logic); -- Signal comming from serial_receiver
|
rx_data_ready : in std_logic); --! Signal comming from serial_receiver
|
end uart_control;
|
end uart_control;
|
|
|
|
--! @brief Uart control unit
|
|
--! @details Configure, commands, the uart_communication_blocks
|
architecture Behavioral of uart_control is
|
architecture Behavioral of uart_control is
|
signal config_clk : std_logic_vector((nBitsLarge-1) downto 0);
|
signal config_clk : std_logic_vector((nBitsLarge-1) downto 0);
|
signal config_baud : std_logic_vector((nBitsLarge-1) downto 0);
|
signal config_baud : std_logic_vector((nBitsLarge-1) downto 0);
|
signal received_byte : std_logic_vector((nBits-1) downto 0);
|
signal received_byte : std_logic_vector((nBits-1) downto 0);
|
signal byte_to_transmit : std_logic_vector((nBits-1) downto 0);
|
signal byte_to_transmit : std_logic_vector((nBits-1) downto 0);
|
Line 56... |
Line 59... |
divident : in STD_LOGIC_VECTOR ((nBitsLarge-1) downto 0);
|
divident : in STD_LOGIC_VECTOR ((nBitsLarge-1) downto 0);
|
done : out STD_LOGIC);
|
done : out STD_LOGIC);
|
end component;
|
end component;
|
|
|
begin
|
begin
|
-- Instantiate block for calculate division
|
--! Instantiate block for calculate division
|
uDiv : divisor port map (
|
uDiv : divisor port map (
|
rst => sigDivRst,
|
rst => sigDivRst,
|
clk => clk,
|
clk => clk,
|
quotient => sigDivQuotient,
|
quotient => sigDivQuotient,
|
reminder => open, -- Indicates that this port will not be connected to anything
|
reminder => open, -- Indicates that this port will not be connected to anything
|