FIFO

FIFOs (first-in, first-out) are on-chip scratchpads with additional control logic for address-less enqueue/dequeue operations. FIFOs preserve the ordering between elements as they are enqueued. A FIFO’s deq operation always returns the oldest enqueued element which has not yet been dequeued.


Static methods

object FIFO
def apply[T:Type:Bits](depth: Int): FIFO[T]
Creates a FIFO with given depth.

Depth must be a statically determinable signed integer.

Infix methods

class FIFO[T]
def par(p: Index): FIFO[T] = { val x = FIFO(s); x.p
Annotates that addresses in this FIFO can be read in parallel by factor p.

Used when creating references to sparse regions of DRAM.
def empty(): Bit
Returns true when this FIFO contains no elements, false otherwise.
def full(): Bit
Returns true when this FIFO cannot fit any more elements, false otherwise.
def almostEmpty(): Bit
Returns true when this FIFO contains exactly one element, false otherwise.
def almostFull(): Bit
Returns true when this FIFO can fit exactly one more element, false otherwise.
def numel(): Index
Returns the number of elements currently in this FIFO.
def enq(data: T): Unit
Creates an enqueue (write) port of data to this FIFO.
def enq(data: T, en: Bit): Unit
Creates an enqueue (write) port of data to this FIFO, enabled by en.
def deq(): T
Creates a dequeue (destructive read) port from this FIFO.
def deq(en: Bit): T
Creates a dequeue (destructive read) port from this FIFO, enabled by en.
def peek(): T
Creates a non-destructive read port from this FIFO.
def load(dram: DRAMDenseTile1[T]): Unit
Creates a dense, burst load from the specified region of DRAM to this on-chip memory.
def gather(dram: DRAMSparseTile[T]): Unit
Creates a sparse load from the specified sparse region of DRAM to this on-chip memory.