You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace incomplete code example with practical guidance:
- Point to existing model implementations in chipflow_lib/common/sim/
- Reference CXXRTL documentation and runtime source
- Show simplified model registration example
- Add note that comprehensive CXXRTL runtime docs are planned
This provides actionable guidance while acknowledging that detailed
CXXRTL runtime documentation should be separate work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/simulation-guide.rst
+34-42Lines changed: 34 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -370,64 +370,56 @@ Customizing Simulation
370
370
Adding Custom Models
371
371
~~~~~~~~~~~~~~~~~~~~
372
372
373
-
To add a custom peripheral model:
373
+
ChipFlow's built-in simulation models cover common peripherals (UART, SPI, I2C, GPIO, QSPI Flash). For custom peripherals, you'll need to write C++ models that interact with the CXXRTL-generated design.
374
374
375
-
1. **Write the C++ Model**
375
+
**Learning Resources:**
376
376
377
-
Create ``design/sim/my_model.h``:
377
+
1. **Study existing models**: The best way to learn is to examine ChipFlow's built-in implementations:
378
378
379
-
.. code-block:: cpp
379
+
- ``chipflow_lib/common/sim/models.h`` - Model interfaces and helper functions
Then reference your custom step in ``chipflow.toml``:
424
415
425
-
3. **Reference in chipflow.toml**
416
+
.. code-block:: toml
426
417
427
-
.. code-block:: toml
418
+
[chipflow.steps]
419
+
sim = "my_design.steps.sim:MySimStep"
428
420
429
-
[chipflow.steps]
430
-
sim = "my_design.steps.sim:MySimStep"
421
+
.. note::
422
+
Comprehensive CXXRTL runtime documentation is planned for a future release. For now, refer to existing model implementations and the Yosys CXXRTL source code.
0 commit comments