This memory interface provides the highest performance interface to external DRAM. Both the write-side and read-side data ports are exposed as 64-bit data words. Requests to write to and read from DRAM are satisfied by issuing a write or read command to the Random Access - 64 Bit memory interface.

The following table lists the I/O provided by the Random Access - 64 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 16 bits wide (2 bytes). Each unique address value represents 2 bytes of data. Therefore, the total number of unique addresses in external memory is equal to (Memory Size in bytes)/2.
Note The memory interface exposed to LabVIEW FPGA is 64 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 64-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 U32 From memory Displays the upper 32 bits of the 64-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 U32 From memory Displays the lower 32 bits of the 64-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 memoryTRUE = 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 U32 To memory Sets the upper 32 bits of the 64-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 U32 To memory Sets the lower 32 bits of the 64-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
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 - 64 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 - 64 Bit memory interface when the command FIFO is full.

The Random Access - 64 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 - 64 Bit memory interface before the initialization sequence is completed. The Initialization_Done signal returns to TRUE when the Random Access - 64 Bit memory interface initialization sequence is completed.

Each individual address value accesses 16 bits of data. Each write and read command writes and reads 64 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 16 bits of data, the maximum number of valid addresses is equal to (Memory Size in Bytes)/2.

The Random Access - 64 Bit memory interface requires that you define the clock domain of the single-cycle Timed Loop from which it is being accessed. You can configure the clock domain in the Clock Selections property page for the corresponding DRAM bank item in the LabVIEW project. Configure the User_Clk signal to be driven with the LabVIEW FPGA clock resource that you are using to clock the single-cycle Timed Loop that is accessing the Random Access - 64 Bit memory interface I/O. All DRAM interface I/O added to the LabVIEW FPGA project by the Random Access - 64 Bit memory interface are synchronous to this User_Clk.
Note All memory interface signals must be used in a single-cycle Timed Loop.
Note You must disable all synchronization registers for all DRAM FPGA I/O signals (by setting the value to 0). The DRAM interface signals are synchronous to the DRAM interface clock. Synchronization registers causes a delay in sending and receiving data/commands to/from the DRAM interface. This delay can prevent proper operation. Always disable synchronization registers for synchronous interfaces where proper operation depends on no latency. All NI PXI version 1.1 and later CLIP items and all NI PXI Express CLIP items automatically disable all synchronization registers. For more information about disabling synchronization registers, refer to the Advanced Code Generation FPGA I/O Properties Page.

Complete the following steps to write data into the DRAM:

  1. Ensure that the Command_FIFO_Full Boolean is FALSE.
  2. Drive the Address signal with the DRAM memory address that you want to write.
  3. Drive the Write_Data_Upper with the upper 32 bits of the 64-bit data word.
  4. Drive the Write_Data_Lower with the lower 32 bits of the 64-bit data word.
  5. Drive the Command signal with 0. This communicates to the Random Access - 64 Bit memory interface to perform a memory write command.
  6. 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 - 64 Bit memory interface.

Complete the following steps to read data from DRAM:

  1. Ensure that the Command_FIFO_Full Boolean is FALSE.
  2. Drive the Address signal with the DRAM memory address that you want to read from.
  3. Drive the Command signal with 1. This signal communicates to the Random Access - 64 Bit memory interface to perform a memory read command.
  4. 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 - 64 Bit memory interface.
  5. Continually monitor the state of the Read_Strobe signal. When this signal reads as TRUE, latch the 64-bit data value on the Read_Data_Upper and Read_Data_Lower signals. This contains the data most recently read from the Random Access - 64 Bit memory interface.
Note The Random Access - 64 Bit memory interface queues read requests internally. Therefore, you may issue multiple read requests for different addresses before you even receive the data back for your first read request. As a result, if you are queuing up multiple read requests, it is important that you properly track the order of the data that is returned when Read_Strobe asserts. All data returned from the Random Access - 64 Bit memory interface when Read_Strobe asserts is properly ordered with respect to the original read request command ordering.

LabVIEW contains example VIs that read and write to the Random Access - 64 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.