SRAMΒΆ

SRAMs are on-chip scratchpads with fixed size. SRAMs can be specified as multi-dimensional, but the underlying addressing in hardware is always flat. The contents of SRAMs are persistent across loop iterations, even when they are declared in an inner scope. Up to 5-dimensional SRAMs are currently supported.


Static methods

object SRAM
def apply[T:Type:Bits](length: Index): SRAM1[T]
Allocates a 1-dimensional SRAM with the specified length.
def apply[T:Type:Bits](rows: Index, cols: Index): SRAM2[T]
Allocates a 2-dimensional SRAM with the specified number of rows and cols.
def apply[T:Type:Bits](p: Index, r: Index, c: Index): SRAM3[T]
Allocates a 3-dimensional SRAM with the specified dimensions.
def apply[T:Type:Bits](q: Index, p: Index, r: Index, c: Index): SRAM4[T]
Allocates a 4-dimensional SRAM with the specified dimensions.
def apply[T:Type:Bits](m: Index, q: Index, p: Index, r: Index, c: Index): SRAM5[T]
Allocates a 5-dimensional SRAM with the specified dimensions.

Infix methods

abstract class SRAM[T]
def dims: List[Index]
Returns a Scala List of the dimensions of this DRAM
class SRAM1[T] extends SRAM[T]
def length: Index
Returns the total size of this SRAM1.
def size: Index
Returns the total size of this SRAM1.
def par(p: Index): SRAM1[T] = { val x = SRAM1(s); x.p
Annotates that addresses in this SRAM1 can be read in parallel by factor p.

Used when creating references to sparse regions of DRAM.
def apply(a: Index): T
Returns the value in this SRAM1 at the given address a.
def update(a: Index, data: T): Unit
Updates the value in this SRAM1 at the given address a to data.
def gather(dram: DRAMSparseTile[T]): Unit
Create a sparse load from the given sparse region of DRAM to this on-chip memory.

Elements will be gathered and stored contiguously in this memory.
def load(dram: DRAM1[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
def load(dram: DRAMDenseTile1[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
class SRAM2[T] extends SRAM[T]
def rows: Index
Returns the number of rows in this SRAM2.
def cols: Index
Returns the number of columns in this SRAM2.
def size: Index
Returns the total size of this SRAM2.
def apply(row: Index, col: Index): T
Returns the value in this SRAM2 at the given row and col.
def update(row: Index, col: Index, data: T): Unit
Updates the value in this SRAM2 at the given row and col to data.
def par(p: Index): SRAM2[T] = { val x = SRAM2(s); x.p
Annotates that addresses in this SRAM2 can be read in parallel by factor p.

Used when creating references to sparse regions of DRAM.
def load(dram: DRAM2[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
def load(dram: DRAMDenseTile2[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
class SRAM3[T] extends SRAM[T]
def dim0: Index
Returns the first dimension of this SRAM3.
def dim1: Index
Returns the second dimension of this SRAM3.
def dim2: Index
Returns the third dimension of this SRAM3.
def size: Index
Returns the total size of this SRAM3.
def apply(a: Index, b: Index, c: Index): T
Returns the value in this SRAM3 at the given 3-dimensional address a, b, c.
def update(a: Index, b: Index, c: Index, data: T): Unit
Updates the value in this SRAM3 at the given 3-dimensional address to data.
def par(p: Index): SRAM3[T] = { val x = SRAM3(s); x.p
Annotates that addresses in this SRAM2 can be read in parallel by factor p.

Used when creating references to sparse regions of DRAM.
def load(dram: DRAM3[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
def load(dram: DRAMDenseTile3[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
class SRAM4[T] extends SRAM[T]
def dim0: Index
Returns the first dimension of this SRAM4.
def dim1: Index
Returns the second dimension of this SRAM4.
def dim2: Index
Returns the third dimension of this SRAM4.
def dim3: Index
Returns the fourth dimension of this SRAM4.
def size: Index
Returns the total size of this SRAM4.
def apply(a: Index, b: Index, c: Index, d: Index): T
Returns the value in this SRAM4 at the 4-dimensional address a, b, c, d.
def update(a: Index, b: Index, c: Index, d: Index, data: T): Unit
Updates the value in this SRAM4 at the 4-dimensional address to data.
def load(dram: DRAM4[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
def load(dram: DRAMDenseTile4[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
class SRAM5[T] extends SRAM[T]
def dim0: Index
Returns the first dimension of this SRAM5.
def dim1: Index
Returns the second dimension of this SRAM5.
def dim2: Index
Returns the third dimension of this SRAM5.
def dim3: Index
Returns the fourth dimension of this SRAM5.
def dim4: Index
Returns the fifth dimension of this SRAM5.
def size: Index
Returns the total size of this SRAM5.
def apply(a: Index, b: Index, c: Index, d: Index, e: Index): T
Returns the value in this SRAM5 at the 5-dimensional address a, b, c, d, e.
def update(a: Index, b: Index, c: Index, d: Index, e: Index, data: T): Unit
Updates the value in this SRAM5 at the 5-dimensional address to data.
def load(dram: DRAM5[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.
def load(dram: DRAMDenseTile5[T]): Unit
Create a dense, burst load from the given region of DRAM to this on-chip memory.