Operator Library: Memory
The FrameMemory operator is a memory block which stores input images using random write access. The write addresses are specified with input links row address RowA and column address ColA. Thus, for each input pixel value, a row and column address has to be specified.
After a frame has been written to the memory, it is read and output using link O. The output image dimension is defined with parameters and is independent of the input image dimension. The memory is pre-initialized with values zero.
For information on the latency of the operator, see Table 43, 'Individual Latencies of the Operators in Library Memory'.
The memory size is defined by parameters FrameWidth and FrameHeight.
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 input link I is stopped during the read state. The latter implementation doubles the RAM and allows to output a frame while accepting the next frame at the input link I.
The operator has two states:
-
Write State: The value of Link I is stored at the address specified with ColA and RowA. This is done only if link WriteI is one. If link WriteI is zero, the current pixel is skipped. Writing to any address of the valid address range is possible. It is not necessary to write to each memory cell.
-
Read State: The memory is read out sequentially and produces a line of the parameterized width. By use of parameters XOffset, XLength, YOffset and YLength it is possible to define the read address range i.e. a ROI. Reading the memory resets the content of the read addresses to zero. Thus if a memory cell is read which has not been written before, a zero will be output.
The toggling between these two states is triggered by an end-of-frame at the input link I. Please note, that the frame width and height at the output link is fixed to the size defined by parameters XOffset, XLength, YOffset and YLength and is independent from the line width and frame height of the input link.
The operator can be useful for mirroring or sensor correction.
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 WriteI, write enable input ColA, write column address for the pixel at I RowA, write row address for the pixel at I |
Output Link | O, data input |
Synchronous and Asynchronous Inputs
- All inputs are synchronous to each other i.e. they have to be sourced by the same M-type operator through an arbitrary network of O-type operators.
Implementation | |
---|---|
Type | static parameter |
Default | SingleBuffer |
Range | {SingleBuffer, DoubleBuffer} |
This parameter selects the implementation of the FrameMemory (see above). |
FrameWidth | |
---|---|
Type | static parameter |
Default | 1024 |
Range | [0, 65534] |
This parameter selects the image width of the output link in pixels. |
FrameHeight | |
---|---|
Type | static parameter |
Default | 1024 |
Range | [0, 65534] |
This parameter selects the image height of the output link in lines. |
XOffset | |
---|---|
Type | dynamic/static read/write parameter |
Default | 0 |
Range | [0, Max.Img Height - YLength] |
This parameter defines the y-coordinate of the upper left corner of the ROI. |
XLength | |
---|---|
Type | dynamic/static read/write parameter |
Default | 1024 |
Range | [1, Max.Img Width - XOffset] |
This parameter defines the width of the ROI. |
YOffset | |
---|---|
Type | dynamic/static read/write parameter |
Default | 0 |
Range | [0, Max.Img Height - YLength] |
This parameter defines the y-coordinate of the upper left corner of the ROI. |
YLength | |
---|---|
Type | dynamic/static read/write parameter |
Default | 1024 |
Range | [1, Max.Img Height - YOffset] |
This parameter defines the height of the ROI. |
The use of operator FrameMemory 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