Skip to content

Commit 7620052

Browse files
robtaylorclaude
andcommitted
Address PR review comments on documentation clarity
- Enhance pin signature explanation to emphasize simulation model selection - Clarify that signatures are generic and implementation-independent - Improve terminology precision: "external interfaces of the IC" vs "IP blocks" - Add clarification that SimInterface annotations describe interface types - Remove unverified Custom Simulation Driver section from simulation-guide Addresses review comments on PR #144 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 62a6946 commit 7620052

File tree

4 files changed

+11
-39
lines changed

4 files changed

+11
-39
lines changed

docs/architecture.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ You write your design in Python using Amaranth HDL and ChipFlow signatures:
8181

8282
ChipFlow signatures are decorated with ``@amaranth_annotate`` which adds JSON schema metadata:
8383

84-
- **IOModel**: Direction, width, drive modes, trip points
85-
- **SimInterface**: UID for simulation models, parameters
86-
- **DriverModel**: C/H files, register structures
87-
- **Data**: Software binaries to load
84+
- **IOModel**: I/O configuration for external interfaces of the IC (direction, width, drive modes, trip points)
85+
- **SimInterface**: Interface type identification for matching simulation models (UID, parameters)
86+
- **DriverModel**: Software drivers for the IP block (C/H files, register structures)
87+
- **Data**: Software binaries to load into memory (flash images, bootloaders)
8888

8989
This metadata is preserved through the entire flow.
9090

docs/contributor-pin-signature-internals.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,12 @@ Core Module: ``chipflow_lib/platform/io/signatures.py``
198198

199199
Concrete pin signatures (UART, GPIO, SPI, etc.) combine I/O signatures with simulation metadata.
200200

201+
These signatures are annotations of the **type** of the external interface (UART, GPIO, SPI), allowing ChipFlow to select and typecheck suitable simulation models that match that interface type. The annotations are independent of any particular IP implementation - they describe the interface protocol, not the internal logic of peripherals.
202+
201203
simulatable_interface() Decorator
202204
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203205

204-
This decorator adds simulation model metadata:
206+
This decorator adds simulation model metadata for interface type identification:
205207

206208
.. code-block:: python
207209

docs/simulation-guide.rst

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -422,39 +422,6 @@ To add a custom peripheral model:
422422
[chipflow.steps]
423423
sim = "my_design.steps.sim:MySimStep"
424424
425-
Custom Simulation Driver
426-
~~~~~~~~~~~~~~~~~~~~~~~~~
427-
428-
For full control, create a custom ``main.cc``:
429-
430-
.. code-block:: cpp
431-
432-
#include "sim_soc.h"
433-
#include <iostream>
434-
435-
int main() {
436-
p_sim__top top;
437-
438-
// Custom initialization
439-
top.p_clk.set(false);
440-
top.p_rst.set(true);
441-
442-
// Custom stimulus
443-
for (int i = 0; i < 100; i++) {
444-
top.p_clk.set(!top.p_clk.curr);
445-
if (i == 10)
446-
top.p_rst.set(false);
447-
448-
// Read outputs
449-
if (top.p_uart__0____tx____o.curr)
450-
std::cout << "UART TX high at cycle " << i << std::endl;
451-
}
452-
453-
return 0;
454-
}
455-
456-
Place this in ``design/sim/main.cc`` and modify your SimStep to use it instead of the generated version.
457-
458425
Performance Tips
459426
----------------
460427

docs/using-pin-signatures.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ Pin signatures are used when defining your top-level component's interface:
5050
These signatures tell ChipFlow:
5151

5252
- How to connect your design to the physical pins of your chip
53-
- How to select appropriate simulation models and test benches for each interface
53+
- How to select appropriate simulation models for each external interface type
54+
- How to simulate signals and test the interface in a virtual environment
5455
- Requirements for pad and package pin allocation (power domains, drive strength, etc.)
5556

57+
Pin signatures are generic and independent of any particular IP implementation, allowing ChipFlow to match the interface type (UART, GPIO, SPI) to appropriate simulation models and test infrastructure.
58+
5659
IO Model Options
5760
~~~~~~~~~~~~~~~~
5861

0 commit comments

Comments
 (0)