Skip to main content

Register Map Elements

Register maps contain a list of register map elements, which can be registers, arrays of registers or memory interfaces.

Access Modes

Access modes define how register map elements interface with the bus and the user logic. In airhdl, there are four different access modes:

  • Write-only elements are written from the bus, and read from the user logic. Write-only elements can be used for control registers that you don't need to read back from the bus. For large register banks, replacing some of the read-write registers with write-only registers can be useful to relax the timing on the read data path.
  • Read-write elements can be both written and read from the bus. The register value is driven to the user logic.
  • Read-only elements can only be read from the bus. The register value is driven from the user logic.
  • Interrupt elements are set from the user logic. Their value can be read from the bus. Interrupt element bits are cleared from the bus by writing '1' to the corresponding bits, a process also known as "write-one-to-clear".

Register map element access modes

info

Trying to read from a write-only register, or write to a read-only register will result in an AXI4 SLVERR error response.

Registers

Registers are the simplest type of register map element. They translate into flip-flops in the generated register bank, and each register occupies 4 bytes in the address space.

Depending on the register's access mode, airhdl generates different ports in the RTL component.

For write-only and read-write registers, airhdl generates the following ports:

NameDirectionDescription
<register name>_strobeoutputa strobe signal that is pulsed every time the register is written from the bus
<register name>_<field_name>outputthe current value of the corresponding register field (one port per field)

For read-write registers with volatile fields, an additional input port is generated:

NameDirectionDescription
<register name>_<field_name>_rdinputthe read value of a volatile field (one port per field)

For read-only registers, airhdl generates the following ports:

NameDirectionDescription
<register name>_strobeoutputa strobe signal that is pulsed every time the register is read from the bus
<register name>_<field_name>outputthe current value of the corresponding register field (one port per field)

For interrupt registers, airhdl generates the following ports:

NameDirectionDescription
<register name>_<field_name>_setinputthe set signal, which allows the user logic to set the corresponding register field (one port per field)

Register Arrays

Registers arrays are two-dimensional registers of configurable length. They can be used to store data such as filter coefficients that require parallel access to all elements.

Depending on the register's access mode, airhdl generates different ports in the RTL component.

For write-only and read-write registers:

NameDirectionDescription
<register name>_strobe [0:N-1]outputa strobe signal that is pulsed every time the register is written from the bus
<register_name>_<field_name> [0:N-1]outputthe current value of the corresponding register field (one port per field)

For read-only registers:

NameDirectionDescription
<register name>_strobe [0:N-1]outputa strobe signal that is pulsed every time the register is written from the bus
<register_name>_<field_name> [0:N-1]inputthe current value of the corresponding regsiter field (one port per field)

For interrupt registers:

NameDirectionDescription
<register name>_<field_name>_set [0:N-1]inputthe set signal, which allows the user logic to set the corresponding register field (one port per field).

Memories

Memories are actually memory interfaces, which can be used to connect synchronous RAMs like the Block RAMs found in Xilinx™ FPGAs to the generated register bank.

Depending on the access mode, the memory can then be written and/or read from the bus. Memories can be useful for implementing objects like look-up tables, which don't need parallel access to all elements at once in the user logic.

note

Memories have a configurable read latency of 1 to 5 clock cycles.

note

Unlike other register map elements, memories do not support the interrupt access mode.

Memory Ports

Depending on the memory's access mode, airhdl generates different ports in the RTL component.

For write-only memories:

NameDirectionDescription
<memory name>_addroutputthe memory address word
<memory name>_wenoutputthe memory write-enable signal
<memory name>_wdataoutputthe memory write data word

For read-write memories:

NameDirectionDescription
<memory name>_addroutputthe memory address word
<memory name>_wenoutputthe memory write-enable signal
<memory name>_wdataoutputthe memory write data word
<memory name>_renoutputthe memory read-enable signal
<memory name>_rdatainputthe memory read data word

For read-only memories:

NameDirectionDescription
<memory name>_addroutputthe memory address word
<memory name>_renoutputthe memory read-enable signal
<memory name>_rdatainputthe memory read data word

Memory Access Timings

Memory Write Timing

Memory writes are performed by asserting the *_wen signals while outputting the write address on the *_addr port and the write data on the *_wdata port.

Memory write access

Memory Read Timing

Memory reads assume a synchronous RAM with a read latency between 1 and 5 clock cycles. The following diagram illustrates a read access to a memory with read latency of one clock cycle. The *_ren signal can be used as an enable signal for the RAM cell.

Memory read access

Connecting an External Memory to a Register Bank

The following schematic shows how to connect a Xilinx™ Block Memory IP (blk_mem_gen_0) to the memory interface of an airhdl generated register bank (mymap_regs_0) in the Xilinx™ Vivado™ block diagram editor.

Connecting a memory to a register bank