Reg¶
Reg defines a hardware register used to hold a scalar value. Regs have an optional name (primarily used for debugging) and reset value. The default reset value for a Reg is the numeric zero value for it’s specified type. Regs can have an arbitrary number of readers but can only have one writer. By default, Regs are reset based upon the controller that they are defined within. A Reg defined within a Pipe, for example, is reset at the beginning of each iteration of that Pipe.
Static methods¶
def apply(name: String)(implicit ev0: Num[T]): Reg[T]
Creates a register with type T and given name
def apply()(implicit ev0: Num[T]): Reg[T]
Creates an unnamed register with type T
def apply(name: String, reset: Int)(implicit ev0: Num[T]): Reg[T]
Creates a register of type T with given name and reset value
def apply(reset: Int)(implicit ev0: Num[T]): Reg[T]
Creates an unnamed register with type T and given reset value
def apply(name: String, reset: Long)(implicit ev0: Num[T]): Reg[T]
Creates a register of type T with given name and reset value
def apply(reset: Long)(implicit ev0: Num[T]): Reg[T]
Creates an unnamed register with type T and given reset value
def apply(name: String, reset: Float)(implicit ev0: Num[T]): Reg[T]
Creates a register of type T with given name and reset value
def apply(reset: Float)(implicit ev0: Num[T]): Reg[T]
Creates an unnamed register with type T and given reset value
def apply(name: String, reset: Double)(implicit ev0: Num[T]): Reg[T]
Creates a register of type T with given name and reset value
def apply(reset: Double)(implicit ev0: Num[T]): Reg[T]
Creates an unnamed register with type T and given reset value
Infix methods¶
def :=(x: T): Unit
Creates a writer to this Reg. Note that Regs and ArgOuts can only have one writer, while ArgIns cannot have any
def value(): T
Reads the current value of this register
Implicit methods¶
def regBitToBit(x: Reg[Bit]): Bit
Enables implicit reading from bit type Regs
def regFixToFix(x: Reg[FixPt[S,I,F]]): FixPt[S,I,F]
Enables implicit reading from fixed point type Regs
def regFltToFlt(x: Reg[FltPt[G,E]]): FltPt[G,E]
Enables implicit reading from floating point type Regs