Operator FrameMemoryRandomRd

Operator Library: Memory

FrameMemoryRandomRd(帧内存随机读取)operator 在 Memory 中缓冲图像,并提供随机读取访问。帧数据通过 link I 传入 operator。通过将地址传输到端口 RColA(读取列地址)和 RRowA(读取行地址),可以对数据进行随机读取。operator 将根据给定的坐标使用这些地址来读取帧数据。生成的输出帧将具有地址输入的图像尺寸。

所需的 memory 大小由输入帧的图像尺寸(Max. Img Width 和 Max. Img Height)决定。

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

该 operator 可以通过两种变体实现:即单缓冲实现和双缓冲实现。第一种实现方式可节省 RAM,但不允许写入和读取在时间上重叠。因此,地址输入 links RColA 和 RRowA 在写入状态下会停止。后一种实现方式使 RAM 加倍,允许在接收输入 link I 上的下一帧的同时,对上一帧进行随机读取。

该算子有两种状态:

  1. 写入状态:link I 的像素以线性方式存储在缓冲区中,即像素的坐标构成缓冲区中的地址。

  2. 读取状态:使用在输入 RColA 和 RRowA 处给定的地址对 memory 进行读取。地址的数量和地址 link 图像尺寸决定了图像输出的宽度和高度。例如,如果在地址输入端输入仅由一个像素组成的帧,则输出帧将仅由一个像素组成。输入帧的其他像素将被丢弃。

图像数据输入和地址输入彼此异步。它们可能具有不同的图像尺寸。两个地址输入 RColA 和 RRowA 必须是 O-synchronous 的。

请注意输入 links 的时序。如果没有进行缓冲,地址输入不得由与数据 link 输入 I 相同的 operator 提供来源。这是因为在将图像数据写入 operator 的同时,无法接受用于读取当前帧的地址。只有当帧完全存储在缓冲区中后,才能接受地址。在许多情况下,operator CreateBlankImage 用于为地址生成图像。

时序如下图所示。

该 operator 使用 FPGA 的内部块 RAM memory。因此,不占用任何 RAM 类型的 VisualApplets frame grabber 资源。FPGA 内部块 RAM 是有限的。完整分辨率的帧可能无法放入 FPGA 内部块 RAM 中。请考虑改用 operator FrameBufferRandomRead。

算子限制

  • 不支持空帧。

  • 不支持具有不同行长的图像。

I/O Property

Property 值
Operator Type M
输入链路 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,数据输入

同步和异步输入

  • Synchronous Group: RColA and RRowA
  • Input I is asynchronous to the group.

支持的 Link Format

Link Parameter Input Link I 输入链接 RColA Input Link RRowA Output Link O
Bit Width [1, 64]1 auto2 auto3 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 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 any 作为 RColA 作为 RColA
Max. Img Height any any 作为 RColA 作为 RColA

1

对于无符号输入,输入 Bit Width 的范围是 [1, 64]。 对于有符号输入,范围是 [2, 64]。 对于无符号彩色输入,范围是 [3, 63],对于有符号彩色输入,范围是 [6, 63]。

2

列地址的 Bit Width 为:

3

行地址的 Bit Width 为:

参数

实现方式
键入 静态参数
默认 SingleBuffer
范围 {SingleBuffer, DoubleBuffer}

此参数用于选择 FrameMemoryRandomRd 的实现方式(参见上文)。

使用示例

以下示例展示了 operator FrameMemoryRandomRd 的用法: