Operator FrameMemoryRandomRd

Operator Library: Memory

FrameMemoryRandomRd (frame memory random read) operator 會將圖像緩衝在 Memory 中,並支援隨機讀取存取。 幀資料會透過 link I 傳輸到 operator 中。 可以透過將位址傳輸到 port RColA (read column address) 與 RRowA (read row address) 來執行資料的隨機讀取。 operator 將使用這些位址,根據給定的座標來讀取幀資料。 產生的輸出幀將具有位址輸入的圖像尺寸。

所需的 memory 大小由輸入幀的圖像尺寸(Max. Img Width 與 Max. Img Height)決定。

有關 operator 延遲的資訊,請參閱 表 46「Library Memory 中各 operator 的個別延遲」。

此 operator 可以實作為兩種變體。 也就是單緩衝區實作與雙緩衝區實作。 第一種實作可節省 RAM,但不允許寫入與讀取的時間重疊。 因此,位址輸入 link RColA 與 RRowA 會在寫入狀態期間停止。 後者實作則將 RAM 加倍,並允許在接收輸入 link I 上的下一幀的同時,對上一幀進行隨機讀取。

此運算子有兩種狀態:

  1. 寫入狀態: link I 的像素會以線性方式儲存在緩衝區中,亦即像素的座標會在緩衝區中形成位址。

  2. 讀取狀態:使用輸入 RColA 與 RRowA 提供的位址來讀出 memory。 位址數量與位址 link 圖像尺寸決定了圖像輸出的寬度與高度。 例如,如果在位址輸入端輸入僅包含一個像素的幀, 則輸出幀將僅包含一個像素。輸入幀的其他像素將被捨棄。

圖像資料輸入與位址輸入彼此非同步。 它們可能具有不同的圖像尺寸。 位址輸入 RColA 與 RRowA 兩者都必須是 O-synchronous。

請注意輸入 link 的時序。 位址輸入不得由與資料 link 輸入 I 相同的 operator 提供來源,且未經緩衝處理。 這是因為在將圖像資料寫入 operator 期間,無法接受讀取目前幀的位址。 只有在幀完全儲存到緩衝區中後,才能接受位址。 在許多情況下,會使用 operator CreateBlankImage 來為位址產生圖像。

時序顯示於下圖中。

operator 使用 FPGA 的內部 block RAM memory。 因此,不會使用類型為 RAM 的 VisualApplets frame grabber 資源。 FPGA-internal block RAM 是有限的。全解析度幀可能無法放入 FPGA 內部 block RAM 中。 請考慮改用 operator FrameBufferRandomRead。

算子限制

  • 不支援空白畫面。

  • 不支援具有不同行長度的影像。

I/O Properties

Property Value
Operator Type M
輸入連結 I,影像資料輸入
RColA,I 處像素的讀取欄位位址
RRowA,I 處像素的讀取列位址
Output Link O,資料輸入

同步與非同步輸入

  • 同步群組:RColA 與 RRowA
  • 輸入 I 對該群組而言是非同步的。

支援的 Link 格式

Link Parameter Input Link I 輸入連結 RColA 輸入連結 RRowA Output Link O
Bit Width [1, 64]1 自動2 自動3 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 為:

參數

實作
Type static parameter
Default SingleBuffer
Range {SingleBuffer, DoubleBuffer}

此參數會選擇 FrameMemoryRandomRd 的實作(見上方)。

使用範例

operator FrameMemoryRandomRd 的使用方式顯示於以下範例中: