Skip to content

Commit 276ff7b

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 23e15b1 commit 276ff7b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/simulation-guide.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,18 @@ You can provide input commands via ``design/tests/input.json``. To reduce test c
349349

350350
.. code-block:: json
351351
352-
[
353-
{"wait_for": {"type": "uart_rx", "data": ">"}, "action": {"type": "uart_tx", "data": "help\n"}},
354-
{"wait_for": {"type": "uart_rx", "data": "Ready"}, "action": {"type": "gpio_set", "pin": 0, "value": 1}}
355-
]
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
356364

357365
See the `mcu_soc example <https://github.com/ChipFlow/chipflow-examples/blob/main/mcu_soc/design/tests/input.json>`_ for a working input.json file.
358366

0 commit comments

Comments
 (0)