URL
https://opencores.org/ocsvn/uart_block/uart_block/trunk
[/] [uart_block/] [trunk/] [hdl/] [iseProject/] [testUart_communication_block.vhd] - Diff between revs 11 and 12
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 11 |
Rev 12 |
Line 1... |
Line 1... |
--! Test baud_generator module
|
--! Test baud_generator module
|
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_arith.all;
|
|
|
--! Use Global Definitions package
|
--! Use Global Definitions package
|
use work.pkgDefinitions.all;
|
use work.pkgDefinitions.all;
|
|
|
ENTITY testUart_communication_block IS
|
ENTITY testUart_communication_block IS
|
Line 72... |
Line 74... |
-- Stimulus process
|
-- Stimulus process
|
stim_proc: process
|
stim_proc: process
|
begin
|
begin
|
-- Setup communication blocks
|
-- Setup communication blocks
|
rst <= '1';
|
rst <= '1';
|
|
serial_in <= '1'; -- Idle..
|
cycle_wait_baud <= conv_std_logic_vector(16, (nBitsLarge));
|
cycle_wait_baud <= conv_std_logic_vector(16, (nBitsLarge));
|
|
start_tx <= '0';
|
wait for 2 ns;
|
wait for 2 ns;
|
rst <= '0';
|
rst <= '0';
|
|
|
wait for clk_period*10;
|
-- Send data..
|
|
start_tx <= '1';
|
|
byte_tx <= "01010101";
|
|
wait until data_sent_tx = '1';
|
|
|
|
wait for clk_period*3;
|
|
start_tx <= '0';
|
|
wait for clk_period*3;
|
|
|
|
start_tx <= '1';
|
|
byte_tx <= "11000100";
|
|
wait until data_sent_tx = '1';
|
|
|
|
wait for clk_period*3;
|
|
start_tx <= '0';
|
|
wait for clk_period*3;
|
|
|
|
-- Receive data...
|
|
-- Receive 0x55 value (01010101)
|
|
serial_in <= '0'; -- Start bit
|
|
wait for 8.68 us;
|
|
|
|
serial_in <= '1';
|
|
wait for 8.68 us;
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
serial_in <= '1';
|
|
wait for 8.68 us;
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
serial_in <= '1';
|
|
wait for 8.68 us;
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
serial_in <= '1';
|
|
wait for 8.68 us;
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
|
|
-- Stop bit here
|
|
serial_in <= '1';
|
|
wait for clk_period*20;
|
|
|
|
-- Receive 0xC4 value (11000100)
|
|
serial_in <= '0'; -- Start bit
|
|
wait for 8.68 us;
|
|
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
serial_in <= '1';
|
|
wait for 8.68 us;
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
serial_in <= '0';
|
|
wait for 8.68 us;
|
|
serial_in <= '1';
|
|
wait for 8.68 us;
|
|
serial_in <= '1';
|
|
wait for 8.68 us;
|
|
|
|
-- Stop bit here
|
|
serial_in <= '1';
|
|
wait for clk_period*20;
|
|
|
-- insert stimulus here
|
|
|
|
wait;
|
|
|
-- Stop Simulation
|
|
assert false report "NONE. End of simulation." severity failure;
|
|
|
end process;
|
end process;
|
|
|
END;
|
END;
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.