Zawrs Extension

Versions

1.0.1
State

ratified

Ratification date

2022-11

Synopsis

The Zawrs extension defines a pair of instructions to be used in polling loops that allows a core to enter a low-power state and wait on a store to a memory location. Waiting for a memory location to be updated is a common pattern in many use cases such as:

  • Contenders for a lock waiting for the lock variable to be updated.

  • Consumers waiting on the tail of an empty queue for the producer to queue work/data. The producer may be code executing on a RISC-V hart, an accelerator device, an external I/O agent.

  • Code waiting on a flag to be set in memory indicative of an event occurring. For example, software on a RISC-V hart may wait on a "done" flag to be set in memory by an accelerator device indicating completion of a job previously submitted to the device.

Instructions

The following instructions are affected by this extension:

wrs.nto

Wait-on-Reservation-Set-with-No-Timeout

wrs.sto

Wait-on-Reservation-Set-with-Short-Timeout