Part A · Lesson 4

Reading the workspace

The workspace puts one run of the simulator on one screen: a 3D stage of the machine, a time track, four program layers and an inspector, all following the same trace step. This lesson tells you which region answers which question, and how to move through a run quickly.

You have seen the workspace in lessons A1 to A3. Open it in its own tab at /riscq-studio and follow along. Its reference is docs/riscq-workspace.md.

1One screen, one step

Where on the screen is the answer to "what is happening now"?

A run is a list of frames. The workspace always shows one of them, the current step, and everything on screen is computed from the frames up to that step. Step 0 is the reset state before the first frame; the feed-forward run has 451 steps after it. Five regions show that step:

RegionWhereThe question it answers
Step cardTop left of the stageWhat is executing: step, batch, time, frame, hardware instruction, source line, firmware word
StageCentreWhich parts act, which they target, how the cause got there, which windows are open
Time trackUnder the stageWhere this step lies in the run, and which instructions overlap it
DockBottomThe exact fields: the frame, its causes, the machine state, the trace
Program layersRight columnWhich line of each program produced this step

The left rail lists the Parts of this run by kind, with counts. Hover a kind for what it is and which RISC-Q source it follows; click it to select its parts one after another. Under it, Highlights is the legend of the stage's colours and Selection holds the part you clicked, with buttons to jump to its previous or next frame. If you are lost, press Explain (key h) in the header and hover any region for a label.

Step 1 in the Whole machine view: the first frame, a read of the batch-time register by core q0.

2The four program layers

In this section: the right column, its colour highlights, and how it links back to the stage.

The program column stacks the layers of lesson A1 from top to bottom:

  1. Source. The program you wrote: OpenQASM, a ZAC program, a list of system calls, or C for the decoder.
  2. Intermediate. Only for trapped-ion runs: the TSIR program QCCD Studio compiled the OpenQASM to.
  3. Hardware instructions. The timed physical operations, with start and duration, grouped in segments. The header states the count and the batch length ("21 in 2 segments · one batch is 2 ns").
  4. Control firmware. The RV32I words of one core: address, machine word, disassembly and the instruction it was emitted for. The selector chooses the core; acting core follows the core of the current step.

Three highlights tie the layers together. Yellow marks the row of the current step in every layer. Blue marks hardware instructions whose pulse windows are open at the current batch, and their source lines. Hovering a row tints the related rows of the other layers violet and lights the channels and apparatus they act on. In the firmware listing a pale green band marks the words emitted for the current hardware instruction.

Clicking a source, intermediate or hardware row jumps to its first frame. Clicking a firmware word jumps to its next traced execution. With Follow ticked, every layer scrolls to keep its yellow row in view.

Not every instruction is a step. By default the trace records only the instructions that touch a control register (trace: "io"): loads and stores of the control block, the put window and the host window. Arithmetic and branches run but leave no frame, so many firmware words have no step of their own. The detailed debugger can record every instruction ("Trace every instruction").

Go to step 333 of the feed-forward run. The firmware layer highlights the store that fires the first x90 on qubit 0. What is its address? You may type it in hexadecimal, such as 0x8000….

The store sw x0, 0(x5) sits at 0x80000224 in core q0's RAM, which starts at 0x80000000. The step card shows the same address on its firmware line.

3The stage and its three views

The stage draws one 3D part for every core, posted link, inbox, channel, converter, the board hub, the host and the apparatus: qubits and resonators, trap sites and ions, or atoms and tweezers. Drag to orbit, scroll to zoom, Fit (key f) to frame it again. At each step:

The exact colours are in the Highlights legend of the rail. The three view buttons in the header only choose which parts are drawn; every part keeps running in every view, and its instructions stay in the program column.

ViewWhat it draws
ChipThe apparatus in the centre, converters on a ring around it, channels on an outer ring, coax from each converter to its parts
Control systemHost, hub, cores, links, inboxes, channels and converters at their schematic floorplan positions
Whole machineEvery part

When the acting part is not drawn in the current view, a badge Acting off view appears on the stage. Click it to switch to a view that shows the part. Positions outside the apparatus are schematic, and the rail's Display geometry note says so for each run.

You want to watch a posted write cross the link from core q0 to its channel. Which view draws the link?

  1. Chip only.
  2. Control system and Whole machine.
  3. None: links are not drawn.
  4. Chip and Control system.
In the Chip view the rail marks Posted link, Core inbox, RV32I control core, Board hub and Host processor as off. The Control system view draws them at their floorplan positions, and the Whole machine view draws everything.

4Moving through a run

In this section: the transport bar, the two kinds of playback, and the time track.

The transport bar under the time track steps one frame at a time with ‹ Step and Step › (arrow keys), and returns to reset with ⏮ (Home). Three buttons skip ahead to the next step of a kind, using predicates from stops in studio/riscq-model.js:

Play (space) has two modes, chosen in the menu beside the counter. Real-time playback, the default Whole run in 30 s, advances the batch time continuously and draws moving things between steps, so an ion is drawn partway along its segment. Step playback (5 steps/s up to 500 steps/s) jumps from frame to frame at a fixed rate. On the transmon ring the difference is small. On the ion machine a 64 µs shuttle covers few trace steps, so step playback shows the ion jumping between sites while real-time playback shows it gliding.

The time track draws each hardware instruction as a bar over its windows, one lane per kind of operation. A gold line marks the current batch, red lines mark faults. Hover it to list the instructions open at that time; click it to go to the last step at or before that time.

Press ⏮ to return to the reset state, then Next pulse once. Which step number does the counter show?

The first window of the run is the x90 on qubit 0, opening at batch 320. Steps before it are the cores programming their pulse tables and meeting at the first barrier.

5The dock: inspector, state, trace

The dock under the stage has four tabs.

Step 404: the readout result reaches q0's inbox. Look at the Step tab, then switch to Machine state and find core q0 still stalled on its result read.

In the Trace tab, find the first frame whose operation is result. What is its frame ID?

It is the readout result of qubit 0 settling in q0's inbox. Lesson B3 follows it from the demodulation window to the stalled load that receives it.

Go to step 355 and open the Machine state tab. How many windows are open at that batch?

Two: the x90 windows of h2 on q0.gate and h7 on q1.gate, both opening at batch 320. The Hardware instructions layer marks both rows in blue.

6Hover cards

Almost everything answers a hover. A part on the stage shows what it is, the RISC-Q source it follows, and live lines at this step: a core's status and last instruction, a channel's open window and start time, a converter's open windows, the hub's open barriers. A row in a program layer shows its links: a source line lists its hardware instructions; a hardware instruction shows its schedule, the batches its windows open and close, and how many frames carry it; a firmware word shows its address, machine word, region and how many times it executed. On the superconducting stage, the moving signal packets on the coax have cards too, with the window, the converter and the wire delay.

Hover hardware instruction h20, the conditioned x. Its card gives the batches its window opens and closes. At which batch does it close?

It opens at batch 1,239 and lasts 35 batches, the 70 ns x pulse, so it closes at 1,274. That is also the last batch of the run's work: segment 1 ends when this window closes.

7The detailed debugger and headless use

The header link Detailed debugger opens the same run at /riscq. It trades the program column for a long page: a controller schematic with a step inspector, a Channel timeline of every pulse window, carrier update and digital update (late, misaligned or overlapping windows in red), the list of faults, the apparatus parts and the effects that reached them, the program with a firmware table per core, and the execution trace. Use it when you need every field at once.

Neither page computes anything that a script cannot. Save a run with node riscq/cli.mjs --example superconducting-feedforward --outcome c=1 --out run.json and call the same functions the pages call: stateAt, causalChain, nextIndex and stops from studio/riscq-model.js, or focusAt and firmware from studio/riscq-layers.js. A person at the workspace and an agent reading run.json see the same step. The answer checks of this course do exactly that.

A reading habit. Start at the step card. If the part is off view, click its badge. Read the causes in the Step tab, then hover the yellow row in the hardware layer to see what else that instruction touches.

What to remember

  1. Every region shows the same step, rebuilt from the frames up to it.
  2. Yellow is the current step, blue the instructions with open windows, violet the rows linked to the one you hover.
  3. Views choose what is drawn, not what runs.
  4. Next instruction and Next pulse skip to the events you usually want; real-time playback shows motion between steps.
  5. The detailed debugger and studio/riscq-model.js read the same trace.