ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 913 microarchs · 15,555 chips · 105 sources
Arch:
Tier:

PACR_SETREG

T1 tenstorrent system insn
PACR_SETREG (MMIO register write sequenced with PACR)
SourceTenstorrent Official Tensix ISA Documentation (Wormhole & Blackhole) (tenstorrent_tt_isa)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeBlackholeA0 / WormholeB0
Tenstorrent Wormhole B0 & Blackhole A0
License & VersionApache-2.0
main
Upstreamhttps://github.com/tenstorrent/tt-isa-documentation
Privilegeuser
ExtensionsTensix, Packers, BlackholeA0, WormholeB0

Summary

Once all previous PACR instructions have gotten past the packer's late format conversion stage, flush any data in the packer buffers just before L1 and simultaneously perform a 32-bit memory write within a small window of the MMIO address space.

Syntax / Encoding

TT_PACR_SETREG(1, /* u1 */ AddrSel, /* u10 */ Value10, 0xf, /* u6 */ AddrMid, 1, 0)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32Tensix-32b010010101xxxxxxxxxxx1111xxxxxx1x0xff800f02 / 0x4a800f02

Operands

NameDescription
AddrSel
Value10
AddrMid

Reference Notes

# `PACR_SETREG` (MMIO register write sequenced with PACR)

**Summary:** Once all previous `PACR` instructions have gotten past the packer's late format conversion stage, flush any data in the packer buffers just before L1 and simultaneously perform a 32-bit memory write within a small window of the MMIO address space.

This instruction is `UnsupportedFunctionality` and its use is strongly discouraged: it has no known usage.

**Backend execution unit:** [Packers](Packers/README.md)

## Syntax

```c
TT_PACR_SETREG(1, /* u1 */ AddrSel, /* u10 */ Value10, 0xf, /* u6 */ AddrMid, 1, 0)
```

## Encoding

![](../../../Diagrams/Out/Bits32_PACR_SETREG.svg)

## Functional model

Once all previous `PACR` instructions have gotten past the packer's late format conversion stage, the following happens:

```c
UnsupportedFunctionality(); // No known usage
uint1_t StateID = ThreadConfig[CurrentThread].CFG_STATE_ID_StateID;
auto& Packer0Config = Packers[0].Config[StateID];
uint32_t Addr = 0xFFB00000 + Packers.SetRegBase[AddrSel] + (AddrMid << 12);
uint32_t ValueHi = Value10 * Packers.SetRegHiScaler[Packer0Config.Out_data_format & 3];
uint32_t Value32 = Value10 + ((ValueHi & 0x1ffff) << 12);
if (Addr < 0xFFB11000) {
  UndefinedBehavior();
} else if (Addr < 0xFFB80000) {
  *Addr = Value32;
}
```

The `SetRegBase` and `SetRegHiScaler` fields are set via TDMA-RISC, rather than being traditional backend configuration. The value of `Packer0Config.Out_data_format` is sampled as the `PACR_SETREG` instruction starts, whereas the values of `SetRegBase` and `SetRegHiScaler` are sampled at some unspecified point in the evaluation of the instruction.

The bits of `Addr` will consist of 12 fixed bits (`0xFFB`), two bits from `SetRegBase`, six bits from `AddrMid`, ten more bits from `SetRegBase`, then two fixed bits (`0b00`). See the [memory map](../BabyRISCV/README.md#memory-map) for details of what exists within this range.