Operator Library: Memory
The FrameMemoryRandomRd (frame memory random read) operator buffers an image in memory with random read access. The frame data is transferred into the operator via link I. The random read of the data can be performed by transferring addresses to ports RColA (read column address) and RRowA (read row address). The operator will use the addresses to read the frame data by the given coordinates. The resulting output frame will have the image dimensions of the address inputs.
The required memory size is defined by the image dimension of the input frame (Max. Img Width and Max. Img Height).
For information on the latency of the operator, see Table 43, 'Individual Latencies of the Operators in Library Memory'.
The operator can be implemented in two variants. Namely, a single buffer implementation and a double buffer implementation. The first implementation saves RAM, but does not allow a timely overlap of writing and reading. Thus the address input links RColA and RRowA are stopped during the write state. The latter implementation doubles the RAM and allows to random read the last frame while accepting the next frame at the input link I.
The operator has two states:
-
Write State: The pixels of link I are stored linear in the buffer i.e. the coordinates of the pixels form the addresses in the buffer.
-
Read State: The memory is read-out using the addresses given at the inputs RColA and RRowA. The number of addresses and address link image dimensions define the image output width and height. For example, if a frame consisting of only one pixel is input at the address inputs, the output frame will only consist of one pixel. The other pixels of the input frame are discarded.
The image data input and the address inputs are not synchronous to each other. They may have different image dimensions. Both address inputs RColA and RRowA have to be O-synchronous.
Please not the timing of the input links. The address inputs must not be sourced by the same operator as the data link input I without buffering. This is because while writing the image data into the operator, no addresses to read the current frame can be accepted. Only if the frame is fully stored into the buffer, addresses can be accepted. In many cases, the operator CreateBlankImage is used to generate the images for the addresses.
The timing is visualized in the following figure.
The operator uses the FPGA's internal block RAM memory. Thus, no VisualApplets frame grabber resources of type RAM are used. The FPGA-internal block RAM is limited. Full resolution frames might not fit into the FPGA-internal block RAM. Consider using operator FrameBufferRandomRead instead.
Operator Restrictions
-
Empty frames are not supported.
Images with varying line lengths are not supported.
Property | Value |
---|---|
Operator Type | M |
Input Links | I, image data input RColA, read column address for the pixel at I RRowA, read row address for the pixel at I |
Output Link | O, data input |
Synchronous and Asynchronous Inputs
- Synchronous Group: RColA and RRowA
- Input I is asynchronous to the group.
Implementation | |
---|---|
Type | static parameter |
Default | SingleBuffer |
Range | {SingleBuffer, DoubleBuffer} |
This parameter selects the implementation of the FrameMemoryRandomRd (see above). |
The use of operator FrameMemoryRandomRd is shown in the following examples:
-
'Functional Example for Specific Operators of Library Memory and Library Signal'
Examples - Demonstration of how to use the operator