Random Access - 128 Bit Memory Interface
- Updated2025-10-10
- 6 minute(s) read
This memory interface provides the highest performance interface to external DRAM. Both the write-side and read-side data ports are exposed as 128-bit data words. Requests to write to and read from DRAM are satisfied by issuing a write or read command to the Random Access - 128 Bit memory interface.
The following table lists the I/O provided by the Random Access - 128 Bit memory interface.
| Memory Interface I/O | Data Type | To Memory/From Memory | Description |
|---|---|---|---|
| Address | U32 | To Memory | Sets the address in external memory for reading or writing. The physical data bus for
external memory is 32 bits wide (4 bytes). Each unique address value
represents 4 bytes of data. Therefore, the total number of unique
addresses in external memory is equal to (Memory Size in bytes)/4. Note The
memory interface exposed to LabVIEW FPGA is 128 bits wide. As a
result, each memory write or read operation accesses four different
address locations in memory. The memory controller latches this
signal value only when you issue a new memory write command by
asserting the Command_Write_Enable signal.
|
| Command | U8 | To Memory | 0 = Performs a memory write. 1 = Perform a memory read. The memory controller latches this signal value only when you issue a new memory write command by asserting the Command_Write_Enable signal. |
| Command_Write_Enable | Bool | To Memory | TRUE = Performs either a memory write or read command, as dictated by the Command signal setting. FALSE = Does not perform any new memory write or read commands. To write or read a single 128-bit data value, assert this signal for only one clock cycle. Each new command is latched in a single clock cycle. |
| Command_FIFO_Full | Bool | From memory | TRUE = The memory controller internal command FIFO is full. FALSE = Space is available in the
command FIFO, and the memory controller can accept new commands. Note Never
assert the Command_Write_Enable signal when the
Command_FIFO_Full signal is TRUE.
|
| Read_Data_Upper | U64 | From memory | Displays the upper 64 bits of the 128-bit data value that was read from external memory. When you issue a memory read command, this signal contains the data retrieved from external memory. The signal state is valid only on the clock cycles in which Read_Strobe is TRUE. |
| Read_Data_Lower | U64 | From memory | Displays the lower 64 bits of the 128-bit data value that was read from external memory. When you issue a memory read command, this signal contains the data retrieved from external memory. The signal state is valid only on the clock cycles in which Read_Strobe is TRUE. |
| Read_Strobe | Bool | From memory | TRUE = Indicates that you can latch data onto the Read_Data_Upper and
Read_Data_Lower signals. FALSE = Indicates that you
cannot latch data onto the Read_Data_Upper and
Read_Data_Lower signals yet. When you issue a
memory read command, the memory read operation takes more than one clock
cycle to complete. When the memory read completes, the
Read_Strobe signal asserts TRUE for one clock
cycle. Note You must latch the Read_Data_Upper and
Read_Data_Lower signals on the same clock cycle
that Read_Strobe asserts. The memory
controller permits you to queue multiple read commands without waiting
for the first read command to complete. All read data returns from the
memory controller in the order that the read commands were issued. In
this situation, the Read_Strobe signal asserts once for
each of the completed queued read commands. |
| Write_Data_Upper | U64 | To memory | Sets the upper 64 bits of the 128-bit data value to be written to external memory. The memory controller latches this signal value only when you issue a new memory write command by asserting the Command_Write_Enable signal. |
| Write_Data_Lower | U64 | To memory | Sets the lower 64 bits of the 128-bit data value to be written to external memory. The memory controller latches this signal value only when you issue a new memory write command by asserting the Command_Write_Enable signal. |
| Data Mask Lower | |||
| Data Mask Upper | |||
| Initialization_Done | Bool | From memory | TRUE = Indicates that the memory interface initialization sequence is completed. FALSE =
Indicates that the memory interface initialization sequence is not
completed. The memory controller performs its initialization sequence
each time the FPGA is reprogrammed, and when the Reset Invoke Method
function
is called in the host VI. Note Never assert
Command_Write_Enable when the
Initialization_Done signal is FALSE.
|
Each command that is written to the Random Access - 128 Bit memory interface is added to an internal command FIFO. This command FIFO can fill up, which drives the Command_FIFO_Full signal to TRUE. Do not issue any new commands to the Random Access - 128 Bit memory interface when the command FIFO is full.
The Random Access - 128 Bit memory interface automatically performs an initialization sequence after the FPGA is first programmed, and when the Reset Invoke Method function is called in the host VI. Do not issue new commands to the Random Access - 128 Bit memory interface before the initialization sequence is completed. The Initialization_Done signal returns to TRUE when the Random Access - 128 Bit memory interface initialization sequence is completed.
Each individual address value accesses 32 bits of data. Each write and read command writes and reads 128 bits of data, respectively. Because of this scheme, writing and reading data at consecutive addresses requires that you increment the address by 4 for each write and read command. Also, because each address value accesses 32 bits of data, the maximum number of valid addresses is equal to (Memory Size in Bytes)/4.
Complete the following steps to write data into the DRAM:
- Ensure that the Command_FIFO_Full Boolean is FALSE.
- Drive the Address signal with the DRAM memory address that you want to write.
- Drive the Write_Data_Upper with the upper 64 bits of the 128-bit data word.
- Drive the Write_Data_Lower with the lower 64 bits of the 128-bit data word.
- Drive the Command signal with 0. This communicates to the Random Access - 128 Bit memory interface to perform a memory write command.
- Drive the Command_Write_Enable signal to TRUE for one clock cycle. You must only drive this signal for a single clock cycle if you want to only issue a single memory write command. Each clock cycle that this signal asserts causes a new write command to be issued to the Random Access - 128 Bit memory interface.
Complete the following steps to read data from DRAM:
- Ensure that the Command_FIFO_Full Boolean is FALSE.
- Drive the Address signal with the DRAM memory address that you want to read from.
- Drive the Command signal with 1. This signal communicates to the Random Access - 128 Bit memory interface to perform a memory read command.
- Drive the Command_Write_Enable signal to TRUE for one clock cycle. You must only drive this signal for a single clock cycle if you want to only issue a single memory read command. Each clock cycle in which this signal is asserted causes a new read command to be issued to the Random Access - 128 Bit memory interface.
- Continually monitor the state of the Read_Strobe signal. When this signal reads as TRUE, latch the 128-bit data value on the Read_Data_Upper and Read_Data_Lower signals. This contains the data most recently read from the Random Access - 128 Bit memory interface.
LabVIEW contains example VIs that read and write to the Random Access - 128 Bit memory interface. To access the NI Example Finder, open LabVIEW and select Help»Find Examples, then select Hardware Input and Output»FlexRIO. You can also access device-specific examples by selecting Add device from the Hardware pull-down menu in the NI Example Finder.