Skip to content

Commit 89208ac

Browse files
robtaylorclaude
andcommitted
Fix input.json format documentation to match implementation
Update simulation-guide.rst to show the correct input.json format with: - Root object with 'commands' array - Command objects with 'type', 'peripheral', 'event', 'payload' fields - 'action' type for queuing actions - 'wait' type for waiting on events Based on actual implementation in chipflow_lib/common/sim/models.cc:log_event 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b1bc816 commit 89208ac

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

docs/simulation-guide.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,18 @@ You can provide input commands via ``design/tests/input.json``:
349349

350350
.. code-block:: json
351351
352-
[
353-
{"timestamp": 1000, "type": "gpio_set", "pin": 0, "value": 1},
354-
{"timestamp": 2000, "type": "uart_tx", "data": "test"},
355-
{"timestamp": 3000, "type": "gpio_set", "pin": 0, "value": 0}
356-
]
352+
{
353+
"commands": [
354+
{"type": "action", "peripheral": "uart_0", "event": "tx", "payload": 72},
355+
{"type": "wait", "peripheral": "uart_0", "event": "tx", "payload": 62},
356+
{"type": "action", "peripheral": "uart_0", "event": "tx", "payload": 10}
357+
]
358+
}
359+
360+
Commands are processed sequentially:
361+
362+
- ``action`` commands queue an action (like transmitting data) for a peripheral
363+
- ``wait`` commands pause execution until the specified event occurs
357364

358365
Models process these commands at the specified timestamps.
359366

0 commit comments

Comments
 (0)