Transfer Operations

These operations are used to transfer scalar values and arrays between the CPU host and the hardware accelerator. They must be specified explicitly in the host code (not in Accel scopes).

Methods

def setArg[T](reg: Reg[T], value: T): Unit
Transfer a scalar value from the host to the accelerator through the register reg.
reg should be allocated as the HostIO or ArgIn methods.
def getArg[T:Type:Bits](reg: Reg[T]): T
Transfer a scalar value from the accelerator to the host through the register reg.
reg should be allocated using the HostIO or ArgIn methods.
def setMem[T:Type:Bits](dram: DRAM[T], data: Array[T]): Unit
Transfers the given Array of data from the host’s memory to dram’s region of accelerator DRAM.
def getMem[T:Type:Bits](dram: DRAM[T]): Array[T]
Transfers dram’s region of accelerator DRAM to the host’s memory and returns the result as an Array.
def setMem[T:Type:Bits](dram: DRAM[T], data: Matrix[T]): Unit
Transfers the given Matrix of data from the host’s memory to dram’s region of accelerator DRAM.
def getMatrix[T:Type:Bits](dram: DRAM2[T])(implicit ctx: SrcCtx): Matrix[T]
Transfers dram’s region of accelerator DRAM to the host’s memory and returns the result as a Matrix.
def setMem[T:Type:Bits](dram: DRAM[T], tensor3: Tensor3[T]): Unit
Transfers the given Tensor3 of data from the host’s memory to dram’s region of accelerator DRAM.
def getTensor3[T:Type:Bits](dram: DRAM3[T])(implicit ctx: SrcCtx): Tensor3[T]
Transfers dram’s region of accelerator DRAM to the host’s memory and returns the result as a Tensor3.
def setMem[T:Type:Bits](dram: DRAM[T], tensor4: Tensor4[T]): Unit
Transfers the given Tensor4 of data from the host’s memory to dram’s region of accelerator DRAM.
def getTensor4[T:Type:Bits](dram: DRAM4[T])(implicit ctx: SrcCtx): Tensor4[T]
Transfers dram’s region of accelerator DRAM to the host’s memory and returns the result as a Tensor4.
def setMem[T:Type:Bits](dram: DRAM[T], tensor5: Tensor5[T]): Unit
Transfers the given Tensor5 of data from the host’s memory to dram’s region of accelerator DRAM.
def getTensor5[T:Type:Bits](dram: DRAM5[T])(implicit ctx: SrcCtx): Tensor5[T]
Transfers dram’s region of accelerator DRAM to the host’s memory and returns the result as a Tensor5.