Reg¶
Reg defines a hardware register used to hold a scalar value. The default reset value for a Reg is the numeric zero value for it’s specified type.
ArgIn, ArgOut, and HostIO are specialized forms of Reg which are used to transfer scalar values to and from the accelerator. ArgIns and ArgOuts are used for setup values at the initialization of the FPGA. ArgIns may not be written to, while ArgOuts generally should not be read from. HostIOs are for values which may be continuously changed or read by the host during FPGA execution.
In Spatial, ArgIns, ArgOuts, and HostIO registers are specified outside the Accel block, in host code.
Static methods
object Reg | |
---|---|
object ArgIn | |
---|---|
object ArgOut | |
---|---|
object HostIO | |
---|---|
Infix methods
class Reg[T] | |
---|---|
def value: T
Returns the value currently held by this register.
|
|
def :=(data: T): Unit
Writes the given data to this register.
|
|
def reset: Unit
Resets the value of this register back to its reset value.
|
|
Implicit methods
def readReg[T](reg: Reg[T]): T
Implicitly reads the value of this register.
|