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

Tensix: UNPACR (Increment context counter)

T1 tenstorrent guide guide
Tenstorrent WormholeB0 Tensix — UNPACR (Increment context counter)
SourceTenstorrent Official Tensix ISA Documentation (Wormhole & Blackhole) (tenstorrent_tt_isa)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeTenstorrent WormholeB0
Tenstorrent Wormhole B0 & Blackhole A0
License & VersionApache-2.0
main
Upstreamhttps://github.com/tenstorrent/tt-isa-documentation
ExtensionsTensix, WormholeB0

Summary

When in MultiContextMode, UNPACR (Move datums from L1 to SrcA or SrcB or Dst) can use a counter to quickly switch between multiple distinct sets of configuration. This instruction increments said counter.

Reference Notes

# `UNPACR` (Increment context counter)

**Summary:** When in `MultiContextMode`, [`UNPACR` (Move datums from L1 to `SrcA` or `SrcB` or `Dst`)](UNPACR_Regular.md) can use a counter to quickly switch between multiple distinct sets of configuration. This instruction increments said counter.

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

## Syntax

```c
TT_OP_UNPACR(/* u1 */ WhichUnpacker,
             0,
             true,
             0,
             0,
             false,
             false,
             false,
             false,
             false,
             false,
             false)
```

## Encoding

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

## Functional model

```c
uint1_t StateID = ThreadConfig[CurrentThread].CFG_STATE_ID_StateID;
auto& ConfigState = Config[StateID];
auto& CurrentUnpacker = Unpackers[WhichUnpacker];

uint3_t WhichContext = CurrentUnpacker.ContextCounter[CurrentThread];
uint3_t IncrementedCounter = WhichContext + 1;
if (IncrementedCounter >= (1 << ConfigState.THCON_SEC[WhichUnpacker].Context_count)) {
  IncrementedCounter = 0;
}
CurrentUnpacker.ContextCounter[CurrentThread] = IncrementedCounter;
```