Transferring Data Using a Memory Item
- Updated2023-02-17
- 3 minute(s) read
Transferring Data Using a Memory Item
What to Use
- While Loops
- Create Memory
- Write Memory
- Read Memory
What to Do
Create the following diagram to transfer data between loops on an FPGA.
Customize the gray sections for your unique programming goals.

|
|
Define the data type, size, and latency of your locally scoped memory item using the Create Memory node. In this example, the Create Memory node defines the memory item properties to the following values:
|
|
|
Specify the address within the memory item where you write data from this clock domain. The code in this diagram generates one address per loop iteration in the series {0,1,2} so that the Write Memory node can write a value for each of the three cases in the Case Structure in this While Loop. |
|
|
Capture or generate the data you write to memory during each loop iteration. In this diagram, the Case Structure performs Square, Negate, and Increment operations on the value received from input value. |
|
|
Use the memory reference from the Create Memory node to specify the memory item that the Write Memory node writes data samples to. For example, in this diagram, the Write Memory node writes the result of the square operation to address 0, writes the result of the negate operation to address 1, and writes the result of the increment operation to address 2. |
|
|
Specify the address you read from this loop. The Case Selector, labeled operation, selects address 0 for Square, address 1 for Negate, and address 2 for Increment. |
|
|
The Read Memory node waits until data from the specified address is read from the memory. |
|
|
The Read Memory node returns an error if the specified address is greater than the size of the memory. Use the error out output to check if the output data is valid. Use the output data to perform subsequent operations. |
Troubleshooting
If the memory item returns unexpected data, verify that the input addresses for the Read Memory and Write Memory nodes are correct.
Examples
Search within the programming environment to access the following installed example: Memory.
Related Information
- Data Transfer Using Memory Items
A memory item is a data storage container of a specified size, used to store and reference data samples on an FPGA.
- Storing and Transferring Data
Store and transfer data on an FPGA using resource items like FIFOs, memory items, FPGA registers, or handshake items. You can also transfer data on an FPGA using panel controls or indicators.