@@ -37,8 +37,8 @@ entity neorv32_uart is
3737 clkgen_i : in std_ulogic_vector (7 downto 0 );
3838 uart_txd_o : out std_ulogic ; -- serial TX line
3939 uart_rxd_i : in std_ulogic ; -- serial RX line
40- uart_rts_o : out std_ulogic ; -- UART.RX ready to receive ("RTR"), low-active, optional
41- uart_cts_i : in std_ulogic ; -- UART.TX allowed to transmit, low-active, optional
40+ uart_rtsn_o : out std_ulogic ; -- ready to receive ("RTR"), low-active, optional
41+ uart_ctsn_i : in std_ulogic ; -- allowed to transmit, low-active, optional
4242 irq_rx_o : out std_ulogic ; -- RX interrupt
4343 irq_tx_o : out std_ulogic -- TX interrupt
4444 );
@@ -105,14 +105,14 @@ architecture neorv32_uart_rtl of neorv32_uart is
105105
106106 -- UART transmitter --
107107 type tx_engine_t is record
108- state : std_ulogic_vector (2 downto 0 );
109- sreg : std_ulogic_vector (8 downto 0 );
110- bitcnt : std_ulogic_vector (3 downto 0 );
111- baudcnt : std_ulogic_vector (9 downto 0 );
112- done : std_ulogic ;
113- busy : std_ulogic ;
114- cts_sync : std_ulogic_vector (1 downto 0 );
115- txd : std_ulogic ;
108+ state : std_ulogic_vector (2 downto 0 );
109+ sreg : std_ulogic_vector (8 downto 0 );
110+ bitcnt : std_ulogic_vector (3 downto 0 );
111+ baudcnt : std_ulogic_vector (9 downto 0 );
112+ done : std_ulogic ;
113+ busy : std_ulogic ;
114+ cts : std_ulogic_vector (1 downto 0 );
115+ txd : std_ulogic ;
116116 end record ;
117117 signal tx_engine : tx_engine_t;
118118
@@ -321,16 +321,16 @@ begin
321321 transmitter: process (rstn_i, clk_i)
322322 begin
323323 if (rstn_i = '0' ) then
324- tx_engine.cts_sync <= (others => '0' );
325- tx_engine.done <= '0' ;
326- tx_engine.state <= (others => '0' );
327- tx_engine.baudcnt <= (others => '0' );
328- tx_engine.bitcnt <= (others => '0' );
329- tx_engine.sreg <= (others => '0' );
330- tx_engine.txd <= '1' ;
324+ tx_engine.cts <= (others => '0' );
325+ tx_engine.done <= '0' ;
326+ tx_engine.state <= (others => '0' );
327+ tx_engine.baudcnt <= (others => '0' );
328+ tx_engine.bitcnt <= (others => '0' );
329+ tx_engine.sreg <= (others => '0' );
330+ tx_engine.txd <= '1' ;
331331 elsif rising_edge (clk_i) then
332332 -- synchronize clear-to-send --
333- tx_engine.cts_sync <= tx_engine.cts_sync (0 ) & uart_cts_i ;
333+ tx_engine.cts <= tx_engine.cts (0 ) & uart_ctsn_i ;
334334
335335 -- defaults --
336336 tx_engine.done <= '0' ;
@@ -352,7 +352,7 @@ begin
352352 when "101" => -- WAIT: check if we can start sending
353353 -- ------------------------------------------------------------
354354 if (uart_clk = '1' ) and -- start with next clock tick
355- ((tx_engine.cts_sync (1 ) = '0' ) or (ctrl.hwfc_en = '0' )) then -- allowed to send OR flow-control disabled
355+ ((tx_engine.cts (1 ) = '0' ) or (ctrl.hwfc_en = '0' )) then -- allowed to send OR flow-control disabled
356356 tx_engine.state(1 downto 0 ) <= "11" ;
357357 end if ;
358358
@@ -463,17 +463,17 @@ begin
463463 rtr_control: process (rstn_i, clk_i)
464464 begin
465465 if (rstn_i = '0' ) then
466- uart_rts_o <= '0' ;
466+ uart_rtsn_o <= '0' ;
467467 elsif rising_edge (clk_i) then
468468 if (ctrl.hwfc_en = '1' ) then
469469 if (ctrl.enable = '0' ) or -- UART disabled
470470 (rx_fifo.half = '1' ) then -- RX FIFO at least half-full: no "safe space" left in RX FIFO
471- uart_rts_o <= '1' ; -- NOT allowed to send
471+ uart_rtsn_o <= '1' ; -- NOT allowed to send
472472 else
473- uart_rts_o <= '0' ; -- ready to receive
473+ uart_rtsn_o <= '0' ; -- ready to receive
474474 end if ;
475475 else
476- uart_rts_o <= '0' ; -- always ready to receive when HW flow-control is disabled
476+ uart_rtsn_o <= '0' ; -- always ready to receive when HW flow-control is disabled
477477 end if ;
478478 end if ;
479479 end process rtr_control;
0 commit comments