Skip to content
STIMSMITH

JSON program representation

Concept

A JSON-based intermediate format used by OTBN's random instruction generator. `otbn-rig gen` emits random programs in this format, and `otbn-rig asm` deterministically translates it to assembly (and optionally a linker script). The representation models a generated program as a tree of snippets and may change over time.

First seen 6/1/2026
Last seen 6/1/2026
Evidence 1 chunks
Wiki v1

WIKI

Overview

The JSON program representation is the format written by otbn-rig gen when it generates a random OTBN program. The same representation is consumed by otbn-rig asm, which translates it into an assembly listing and, when requested, a linker script. The documentation explicitly notes that this JSON format may change over time, but it is understood by the asm command.

Structure

READ FULL ARTICLE →

NEIGHBORHOOD

No graph connections found for this entity yet. It may appear in future ingestion runs.

explore full graph →

RELATIONSHIPS

2 connections
otbn-rig ← uses 100% 1e
otbn-rig's gen command writes the generated program to stdout in a JSON format
snippet part of → 90% 1e
The JSON output format represents the tree of snippets that form a generated program

CITATIONS

5 sources
5 citations — click to expand
[1] `otbn-rig gen` writes a random program to stdout in JSON format, and this format is understood by `otbn-rig asm`, though it may change over time. OTBN Random Instruction Generator - OpenTitan
[2] The JSON output format represents the generated program as a tree of snippets. OTBN Random Instruction Generator - OpenTitan
[3] Snippet size is used to control program growth: single-instruction snippets have size 1, straight-line snippets of `N` instructions have size `N`, and an if/else-style snippet has size `a + max(b, c)`; size is intended as an upper bound on executed instructions, though not always a strict one. OTBN Random Instruction Generator - OpenTitan
[4] Programs represented in this JSON format are designed not to trigger architecturally unspecified behavior, though they may still trigger errors; generated programs also include a few words of randomly initialized data scattered around DMEM. OTBN Random Instruction Generator - OpenTitan
[5] `otbn-rig asm` performs a deterministic translation from JSON input to assembly and linker-script output; with `--output` it writes `.s` and `.ld` files, and without `--output` it prints the assembly listing to stdout. OTBN Random Instruction Generator - OpenTitan