LineBufferΒΆ

LineBuffers are two dimensional, on-chip scratchpads with a fixed size. LineBuffers act as a FIFO on input, supporting only queued writes, but support addressed reading like SRAMs. For writes, the current row buffer and column is maintained using an internal counter. This counter resets every time the controller containing the enqueue completes execution.

The contents of LineBuffers are persistent across loop iterations, even when they are declared in an inner scope. Up to 5-dimensional LineBuffers are currently supported.


Static methods

object LineBuffer
def apply[T:Type:Bits](rows: Index, cols: Index): LineBuffer[T]
Allocates a LineBuffer with given rows and cols.
The contents of this LineBuffer are initially undefined.
rows and cols must be statically determinable integers.
def strided[T:Type:Bits](rows: Index, cols: Index, stride: Index): LineBuffer[T]
Allocates a LineBuffer with given number of rows and cols, and with given stride.
The contents of this LineBuffer are initially undefined.
rows, cols, and stride must be statically determinable integers.

Infix methods

class LineBuffer[T]
def apply(row: Index, col: Index): T
Creates a load port to this LineBuffer at the given row and col.
def apply(row: Index, cols: Range)(implicit ctx: SrcCtx): Vector[T]
Creates a vectorized load port to this LineBuffer at the given row and cols.
def apply(rows: Range, col: Index)(implicit ctx: SrcCtx): Vector[T]
Creates a vectorized load port to this LineBuffer at the given rows and col.
def enq(data: T): Unit
Creates an enqueue (write) port of data to this LineBuffer.
def enq(data: T, en: Bit): Unit
Creates an enqueue (write) port of data to this LineBuffer, enabled by en.
def load(dram: DRAMDenseTile1[T])(implicit ctx: SrcCtx): Unit
Creates a dense transfer from the given region of DRAM to this on-chip memory.