File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 2525
2626library IEEE;
2727use IEEE.STD_LOGIC_1164.ALL ;
28- use IEEE.STD_LOGIC_UNSIGNED .ALL ;
28+ use IEEE.NUMERIC_STD .ALL ;
2929
3030entity UART_TESTBENCH is
3131end UART_TESTBENCH;
@@ -45,6 +45,7 @@ architecture FULL of UART_TESTBENCH is
4545 constant clk_period : time := 20 ns ;
4646 constant uart_period : time := 8696 ns ;
4747 constant data_value : std_logic_vector (7 downto 0 ) := "10100111" ;
48+ constant data_value2 : std_logic_vector (7 downto 0 ) := "00110110" ;
4849
4950begin
5051
9798 rx_uart <= '1' ; -- stop bit
9899 wait for uart_period;
99100
101+ rx_uart <= '0' ; -- start bit
102+ wait for uart_period;
103+
104+ for i in 0 to 7 loop
105+ rx_uart <= data_value2(i); -- data bits
106+ wait for uart_period;
107+ end loop ;
108+
109+ rx_uart <= '1' ; -- stop bit
110+ wait for uart_period;
111+
100112 wait ;
101113
102114 end process ;
@@ -119,6 +131,18 @@ begin
119131
120132 wait until rising_edge (CLK);
121133
134+ wait for 100 us ;
135+ wait until rising_edge (CLK);
136+
137+ data_send <= '1' ;
138+ data_in <= data_value2;
139+
140+ wait until rising_edge (CLK);
141+
142+ data_send <= '0' ;
143+
144+ wait until rising_edge (CLK);
145+
122146 wait ;
123147
124148 end process ;
You can’t perform that action at this time.
0 commit comments