Skip to content

Commit ae40303

Browse files
committed
UART_TESTBENCH: Add second data packet
1 parent d68c36a commit ae40303

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

source/uart_testbench.vhd

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
library IEEE;
2727
use IEEE.STD_LOGIC_1164.ALL;
28-
use IEEE.STD_LOGIC_UNSIGNED.ALL;
28+
use IEEE.NUMERIC_STD.ALL;
2929

3030
entity UART_TESTBENCH is
3131
end 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

4950
begin
5051

@@ -97,6 +98,17 @@ begin
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;

0 commit comments

Comments
 (0)