SETDMAREG_Immediate
tenstorrent_tt_isa)Tenstorrent Wormhole B0 & Blackhole A0
main
userTensix, Scalar Unit, WormholeB0Summary
Write 16 bits to one half of a Tensix GPR, leaving the other half as-is. Note that all 32 bits of a GPR can be set by using two SETDMAREG instructions.
Syntax / Encoding
TT_SETDMAREG(0, /* u16 */ NewValue, 0, /* u7 */ ResultHalfReg)
Binary Encodings (1)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| 32 | Tensix-32b | 01000101xxxxxxxxxxxxxxxx0xxxxxxx | 0xff000080 / 0x45000000 |
Operands
| Name | Description |
|---|---|
NewValue | |
ResultHalfReg |
Reference Notes
# `SETDMAREG` (Set 16 bits of one GPR) **Summary:** Write 16 bits to one half of a Tensix GPR, leaving the other half as-is. Note that all 32 bits of a GPR can be set by using two `SETDMAREG` instructions. **Backend execution unit:** [Scalar Unit (ThCon)](ScalarUnit.md) ## Syntax ```c TT_SETDMAREG(0, /* u16 */ NewValue, 0, /* u7 */ ResultHalfReg) ``` ## Encoding  ## Functional model ```c uint16_t *HalfReg = (char*)&GPRs[CurrentThread][0] + ResultHalfReg * 2; *HalfReg = NewValue; ``` ## Performance This instruction executes in a single cycle, though if the Scalar Unit is busy with other instructions, it might have to wait at the Wait Gate until the Scalar Unit can accept it. ## Instruction scheduling On Blackhole, if an instruction executing at a unit other than the Scalar Unit (for example [`WRCFG`](WRCFG.md)) wants to consume the GPR written by `SETDMAREG`, then software must place a [`STALLWAIT`](STALLWAIT.md) with condition C0 between the two; see [Scalar Unit (ThCon)](ScalarUnit.md). This is not required on Wormhole.