Operator LineMemory

Operator Library: Memory

The LineMemory operator is a memory block which stores incoming images lines using random write access. The write addresses are specified with input link column address ColA. Thus for each input pixel value, a column address has to be specified.

After a line has been fully written to the memory, it is read and output using link O. The output image width is defined with parameters and is independent of the input image width. The memory is pre-initialized with values zero.

For information on the latency of the operator, see Table 42, 'Individual Latencies of the Operators in Library Memory'.

The memory size is defined by parameter FrameWidth.

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 an image line while accepting the next line at the input link I.

The operator has two states:

  1. Write State: The value of Link I is stored at the address specified with ColA. 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. The is no necessity to write to each memory cell.

  2. Read State: The memory is read out sequentially and produces a line of the parameterized width. By use of parameters XOffset and XLength 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-line at the input link I. Please note, that the line width at the output link is fixed to the size defined by parameters XOffset and XLength and is independent from the line width of the input link.

The operator can be useful for mirroring or sensor correction.

The operator uses the FPGA-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.

I/O Properties

Property Value
Operator Type M
Input Links I, image data input
WriteI, write enable input
ColA, write column 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.

Supported Link Format

Link Parameter Input Link I Input Link WriteI Input Link ColA Output Link O
Bit Width [1, 64]1 1 auto2 as I
Arithmetic {unsigned, signed} unsigned unsigned as I
Parallelism 1 as I as I as I
Kernel Columns any 1 1 as I
Kernel Rows any 1 1 as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D} as I as I as I
Color Format any VAF_GRAY VAF_GRAY as I
Color Flavor any FL_NONE FL_NONE as I
Max. Img Width any as I as I parameter FrameWidth
Max. Img Height any as I as I as I

1

The range of the input bit width is [1, 64] for unsigned inputs. For signed inputs, the range is [2, 64]. For unsigned color inputs, the range is [3, 63] and for signed color, the range is [6, 63].

2

The bit width of the column address is:

Parameters

Implementation
Type static parameter
Default SingleBuffer
Range {SingleBuffer, DoubleBuffer}

This parameter selects the implementation of the LineMemory (see above).

FrameWidth
Type static parameter
Default 1024
Range [0, 65534]

This parameter selects the image width of the output link in pixels.

XOffset
Type dynamic/static read/write parameter
Default 0
Range [0, Max.Img Height - XLength]

This parameter defines the x-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.

Examples of Use

The use of operator LineMemory is shown in the following examples: