BRAM

BRAMs are on-chip scratchpads with fixed size. BRAMs can be specified as multi-dimensional, but the underlying addressing in hardware is always flat. The contents of BRAMs are currently persistent across loop iterations, even when they are declared in an inner scope. BRAMs can have an arbitrary number of readers but only one writer. This writer may be an element-based store or a load from an OffChipMem.

Static methods

def apply(name: String, dims: Index*)(implicit ev0: Num[T]): BRAM[T]

Creates a BRAM with given name and dimensions. Dimensions must be statically known signed integers (constants or parameters).


def apply(dims: Index*)(implicit ev0: Num[T]): BRAM[T]

Creates an unnamed BRAM with given dimensions. Dimensions must be statically known signed integers (constants or parameters).

Infix methods

def :=(tile: Tile[T]): Unit

Creates a tile store from a Tile of an OffChipMem to this BRAM.


def apply(ii: Index*): T

Creates a read from this BRAM at the given multi-dimensional address. Number of indices given can either be 1 or the same as the number of dimensions that the BRAM was declared with.

  • ii - multi-dimensional address

def update(i: Index, x: T): Unit

Creates a write to this BRAM at the given 1D address.

  • i - 1D address
  • x - element to be stored to BRAM

def update(i: Index, j: Index, x: T): Unit

Creates a write to this BRAM at the given 2D address. The BRAM must have initially been declared as 2D.

  • i - row index
  • j - column index
  • x - element to be stored to BRAM

def update(i: Index, j: Index, k: Index, x: T): Unit

Creates a write to this BRAM at the given 3D address. The BRAM must have initially been declared as 3D.

  • i - row index
  • j - column index
  • k - page index
  • x - element to be stored to BRAM

def update(y: Seq[Index], z: T): Unit