Radical Computer Technologies
Interfaces / entity

radif_uart_to_reg

Documentation version: 0.2.0 / Subpackage: radif_uart / Source package: radif

UART bridge to the RADIF register interface for low-cost board bring-up. Protocol bytes are binary and intentionally small: Write request: 0x57 addr_hi addr_lo data[31:24] data[23:16] data[15:8] data[7:0] Write response: 0x77 status Read request: 0x52 addr_hi addr_lo Read response: 0x72 status data[31:24] data[23:16] data[15:8] data[7:0] Status is 0 for OK and 1 for register target error.

Use Cases

Block Diagram

radif_uart_to_reg radhdl entity clk rstn uart_rx_i reg_data_out reg_wr_rdy reg_rd_rdy reg_wr_valid reg_rd_valid reg_error uart_tx_o reg_wr_addr reg_rd_addr reg_wr_en reg_rd_en reg_data_in
VHDL Include And Instantiation Template

File Header

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

library radhdl;
-- Direct entity instantiation below does not require importing the entity name.
use radhdl.interfaces.all;
-- Narrower alternative: use radhdl.interfaces_uart.all;

Component Declaration

component radif_uart_to_reg is
  generic (
    DATA_WIDTH : integer := 32;
    ADDR_WIDTH : integer := 16;
    BAUD_DIVISOR : positive := 868;
    VENDOR_TAG : string := "GENERIC";
    PRODUCT_SERIES_TAG : string := "GENERIC"
  );
  port (
    clk : in std_logic;
    rstn : in std_logic;
    uart_rx_i : in std_logic;
    uart_tx_o : out std_logic;
    reg_wr_addr : out std_logic_vector(ADDR_WIDTH - 1 downto 0);
    reg_rd_addr : out std_logic_vector(ADDR_WIDTH - 1 downto 0);
    reg_wr_en : out std_logic;
    reg_rd_en : out std_logic;
    reg_data_in : out std_logic_vector(DATA_WIDTH - 1 downto 0);
    reg_data_out : in std_logic_vector(DATA_WIDTH - 1 downto 0);
    reg_wr_rdy : in std_logic;
    reg_rd_rdy : in std_logic;
    reg_wr_valid : in std_logic;
    reg_rd_valid : in std_logic;
    reg_error : in std_logic
  );
end component;

Direct Entity Instantiation

u_radif_uart_to_reg : entity radhdl.radif_uart_to_reg
  generic map (
    DATA_WIDTH         => 32,
    ADDR_WIDTH         => 16,
    BAUD_DIVISOR       => 868,
    VENDOR_TAG         => "GENERIC",
    PRODUCT_SERIES_TAG => "GENERIC"
  )
  port map (
    clk          => <clk_signal>,
    rstn         => <rstn_signal>,
    uart_rx_i    => <uart_rx_i_signal>,
    uart_tx_o    => <uart_tx_o_signal>,
    reg_wr_addr  => <reg_wr_addr_signal>,
    reg_rd_addr  => <reg_rd_addr_signal>,
    reg_wr_en    => <reg_wr_en_signal>,
    reg_rd_en    => <reg_rd_en_signal>,
    reg_data_in  => <reg_data_in_signal>,
    reg_data_out => <reg_data_out_signal>,
    reg_wr_rdy   => <reg_wr_rdy_signal>,
    reg_rd_rdy   => <reg_rd_rdy_signal>,
    reg_wr_valid => <reg_wr_valid_signal>,
    reg_rd_valid => <reg_rd_valid_signal>,
    reg_error    => <reg_error_signal>
  );

Generics

NameTypeDefaultDescription
DATA_WIDTHinteger32Width of the RADIF register data path. This bridge currently transports 32-bit words.
ADDR_WIDTHinteger16Width of the RADIF byte address path.
BAUD_DIVISORpositive868Number of clk cycles per UART bit.
VENDOR_TAGstring"GENERIC"Vendor selector retained for generated package consistency.
PRODUCT_SERIES_TAGstring"GENERIC"Device-family selector retained for generated package consistency.

Ports

NameDirectionTypeDescription
clkinstd_logicRegister/UART clock.
rstninstd_logicActive-low reset.
uart_rx_iinstd_logicUART receive pin.
uart_tx_ooutstd_logicUART transmit pin.
reg_wr_addroutstd_logic_vector(ADDR_WIDTH - 1 downto 0)Register write address.
reg_rd_addroutstd_logic_vector(ADDR_WIDTH - 1 downto 0)Register read address.
reg_wr_enoutstd_logicOne-cycle register write request.
reg_rd_enoutstd_logicOne-cycle register read request.
reg_data_inoutstd_logic_vector(DATA_WIDTH - 1 downto 0)Register write data.
reg_data_outinstd_logic_vector(DATA_WIDTH - 1 downto 0)Register read data.
reg_wr_rdyinstd_logicRegister target write ready.
reg_rd_rdyinstd_logicRegister target read ready.
reg_wr_validinstd_logicRegister target write response valid.
reg_rd_validinstd_logicRegister target read response valid.
reg_errorinstd_logicRegister target error for current response.

Register Interfaces

Static register maps are rendered below for this module.

InterfaceDirectionsSignalsRepresentative ports
Register control/statusin, out11reg_wr_addr, reg_rd_addr, reg_wr_en, reg_rd_en, reg_data_in, reg_data_out, reg_wr_rdy, reg_rd_rdy, +3 more

Register Maps

radif_uart_to_reg

Source: interfaces/hdl/radif/register_maps/radif_uart_to_reg.map.json

The UART bridge has no local configuration registers; it forwards binary UART commands to downstream RADIF register targets.

RegisterOffsetAccessResetDescription
write_frame0x00protocolnoneUART write command frame.
read_frame0x04protocolnoneUART read command frame.

write_frame

Offset 0x00 / Access protocol / Reset none

UART write command frame.

WriteFrame[15:0]
1514131211109876543210
ADDR [15:8]
CMD [7:0]
WriteFrame[31:16]
31302928272625242322212019181716
DATA [31:24]
ADDR [23:16]
NameRegister bit(s)Description
DATAWriteFrame[31:24]Four-byte big-endian 32-bit write data.
ADDRWriteFrame[23:8]Two-byte big-endian byte address.
CMDWriteFrame[7:0]First byte is 0x57 for write.

read_frame

Offset 0x04 / Access protocol / Reset none

UART read command frame.

ReadFrame[15:0]
1514131211109876543210
ADDR [15:8]
CMD [7:0]
ReadFrame[31:16]
31302928272625242322212019181716
RSVD [31:24]
ADDR [23:16]
NameRegister bit(s)Description
ADDRReadFrame[23:8]Two-byte big-endian byte address.
CMDReadFrame[7:0]First byte is 0x52 for read.

Testbenches

No directly associated testbench was found.

Sources