@@ -22,9 +22,9 @@ entity UART_RX is
22
22
UART_CLK_EN : in std_logic ; -- oversampling (16x) UART clock enable
23
23
UART_RXD : in std_logic ; -- serial receive data
24
24
-- USER DATA OUTPUT INTERFACE
25
- DATA_OUT : out std_logic_vector (7 downto 0 ); -- output data
26
- DATA_VLD : out std_logic ; -- when DATA_VLD = 1, output data are valid
27
- FRAME_ERROR : out std_logic -- when FRAME_ERROR = 1, stop bit was invalid
25
+ DOUT : out std_logic_vector (7 downto 0 ); -- data received via UART
26
+ DOUT_VLD : out std_logic ; -- when DOUT_VLD = 1, DOUT is valid (is assert only for one clock cycle)
27
+ FRAME_ERROR : out std_logic -- when FRAME_ERROR = 1, stop bit was invalid (is assert only for one clock cycle)
28
28
);
29
29
end UART_RX;
30
30
@@ -117,7 +117,7 @@ begin
117
117
end if ;
118
118
end process ;
119
119
120
- DATA_OUT <= rx_data;
120
+ DOUT <= rx_data;
121
121
122
122
-- -------------------------------------------------------------------------
123
123
-- UART RECEIVER PARITY GENERATOR AND CHECK
@@ -158,14 +158,14 @@ begin
158
158
begin
159
159
if (rising_edge (CLK)) then
160
160
if (RST = '1' ) then
161
- DATA_VLD <= '0' ;
161
+ DOUT_VLD <= '0' ;
162
162
FRAME_ERROR <= '0' ;
163
163
else
164
164
if (rx_clk_en = '1' AND rx_output_reg_en = '1' ) then
165
- DATA_VLD <= NOT rx_parity_error AND UART_RXD;
165
+ DOUT_VLD <= NOT rx_parity_error AND UART_RXD;
166
166
FRAME_ERROR <= NOT UART_RXD;
167
167
else
168
- DATA_VLD <= '0' ;
168
+ DOUT_VLD <= '0' ;
169
169
FRAME_ERROR <= '0' ;
170
170
end if ;
171
171
end if ;
@@ -194,9 +194,9 @@ begin
194
194
case rx_pstate is
195
195
196
196
when idle =>
197
- rx_output_reg_en <= '0' ;
198
- rx_receiving_data <= '0' ;
199
- rx_clk_divider_en <= '0' ;
197
+ rx_output_reg_en <= '0' ;
198
+ rx_receiving_data <= '0' ;
199
+ rx_clk_divider_en <= '0' ;
200
200
rx_parity_check_en <= '0' ;
201
201
202
202
if (UART_RXD = '0' ) then
@@ -206,9 +206,9 @@ begin
206
206
end if ;
207
207
208
208
when startbit =>
209
- rx_output_reg_en <= '0' ;
210
- rx_receiving_data <= '0' ;
211
- rx_clk_divider_en <= '1' ;
209
+ rx_output_reg_en <= '0' ;
210
+ rx_receiving_data <= '0' ;
211
+ rx_clk_divider_en <= '1' ;
212
212
rx_parity_check_en <= '0' ;
213
213
214
214
if (rx_clk_en = '1' ) then
@@ -218,9 +218,9 @@ begin
218
218
end if ;
219
219
220
220
when databits =>
221
- rx_output_reg_en <= '0' ;
222
- rx_receiving_data <= '1' ;
223
- rx_clk_divider_en <= '1' ;
221
+ rx_output_reg_en <= '0' ;
222
+ rx_receiving_data <= '1' ;
223
+ rx_clk_divider_en <= '1' ;
224
224
rx_parity_check_en <= '0' ;
225
225
226
226
if ((rx_clk_en = '1' ) AND (rx_bit_count = "111" )) then
@@ -234,9 +234,9 @@ begin
234
234
end if ;
235
235
236
236
when paritybit =>
237
- rx_output_reg_en <= '0' ;
238
- rx_receiving_data <= '0' ;
239
- rx_clk_divider_en <= '1' ;
237
+ rx_output_reg_en <= '0' ;
238
+ rx_receiving_data <= '0' ;
239
+ rx_clk_divider_en <= '1' ;
240
240
rx_parity_check_en <= '1' ;
241
241
242
242
if (rx_clk_en = '1' ) then
@@ -246,10 +246,10 @@ begin
246
246
end if ;
247
247
248
248
when stopbit =>
249
- rx_receiving_data <= '0' ;
250
- rx_clk_divider_en <= '1' ;
249
+ rx_receiving_data <= '0' ;
250
+ rx_clk_divider_en <= '1' ;
251
251
rx_parity_check_en <= '0' ;
252
- rx_output_reg_en <= '1' ;
252
+ rx_output_reg_en <= '1' ;
253
253
254
254
if (rx_clk_en = '1' ) then
255
255
rx_nstate <= idle;
@@ -258,9 +258,9 @@ begin
258
258
end if ;
259
259
260
260
when others =>
261
- rx_output_reg_en <= '0' ;
262
- rx_receiving_data <= '0' ;
263
- rx_clk_divider_en <= '0' ;
261
+ rx_output_reg_en <= '0' ;
262
+ rx_receiving_data <= '0' ;
263
+ rx_clk_divider_en <= '0' ;
264
264
rx_parity_check_en <= '0' ;
265
265
rx_nstate <= idle;
266
266
0 commit comments