Line 15... |
Line 15... |
|
|
----------------------------------------------
|
----------------------------------------------
|
-- Constants
|
-- Constants
|
----------------------------------------------
|
----------------------------------------------
|
constant MAIN_CLK_PER : time := 20 ns; -- 50 MHz
|
constant MAIN_CLK_PER : time := 20 ns; -- 50 MHz
|
|
constant MAIN_CLK : integer := 50;
|
constant BAUD_RATE : integer := 9600; -- Bits per Second
|
constant BAUD_RATE : integer := 9600; -- Bits per Second
|
constant RST_LVL : std_logic := '1'; -- Active Level of Reset
|
constant RST_LVL : std_logic := '1'; -- Active Level of Reset
|
|
|
----------------------------------------------
|
----------------------------------------------
|
-- Signal Declaration
|
-- Signal Declaration
|
Line 32... |
Line 33... |
-- Configuration signals
|
-- Configuration signals
|
signal par_en : std_logic;
|
signal par_en : std_logic;
|
-- uPC Interface
|
-- uPC Interface
|
signal tx_req : std_logic;
|
signal tx_req : std_logic;
|
signal tx_end : std_logic;
|
signal tx_end : std_logic;
|
signal tx_data : std_logic_vector(7 downto 0);
|
signal tx_data : std_logic_vector(7 downto 0) := x"5A";
|
signal rx_ready : std_logic;
|
signal rx_ready : std_logic;
|
signal rx_data : std_logic_vector(7 downto 0);
|
signal rx_data : std_logic_vector(7 downto 0);
|
|
|
-- Testbench Signals
|
-- Testbench Signals
|
signal uart_clk : std_logic := '0';
|
signal uart_clk : std_logic := '0';
|
Line 58... |
Line 59... |
rx => data_from_transceiver, -- RS232 received serial data
|
rx => data_from_transceiver, -- RS232 received serial data
|
tx => data_to_transceiver, -- RS232 transmitted serial data
|
tx => data_to_transceiver, -- RS232 transmitted serial data
|
-- RS232/UART Configuration
|
-- RS232/UART Configuration
|
par_en => par_en, -- Parity bit enable
|
par_en => par_en, -- Parity bit enable
|
-- uPC Interface
|
-- uPC Interface
|
tx_req => tx_req, -- Request SEND of data
|
tx_req => '1', -- Request SEND of data
|
tx_end => tx_end, -- Data SENDED
|
tx_end => tx_end, -- Data SENDED
|
tx_data => tx_data, -- Data to transmit
|
tx_data => tx_data, -- Data to transmit
|
rx_ready => rx_ready, -- Received data ready to uPC read
|
rx_ready => rx_ready, -- Received data ready to uPC read
|
rx_data => rx_data -- Received data
|
rx_data => rx_data -- Received data
|
);
|
);
|
Line 84... |
Line 85... |
uart_clk <= not uart_clk;
|
uart_clk <= not uart_clk;
|
end process;
|
end process;
|
|
|
-- Reset generation
|
-- Reset generation
|
rst <= RST_LVL, not RST_LVL after MAIN_CLK_PER*5;
|
rst <= RST_LVL, not RST_LVL after MAIN_CLK_PER*5;
|
|
data_from_transceiver <= data_to_transceiver;
|
end Behavioral;
|
end Behavioral;
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|