Skip to content

Commit 59d25cc

Browse files
gatecatrobtaylor
authored andcommitted
Add docs for chipflow commants
Signed-off-by: gatecat <[email protected]>
1 parent fc09b33 commit 59d25cc

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

docs/chipflow-commands.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
The ``chipflow`` command
2+
==========================
3+
4+
The ``chipflow`` tool enables you to simulate your design or submit it to the ChipFlow cloud build service.
5+
It implements several subcommands, which can be customised or added to in the ``steps`` section of :ref:`chipflow.toml<chipflow-toml-steps>`.
6+
7+
.. _chipflow_toml: chipflow-toml-guide.rst
8+
9+
``chipflow pin lock``
10+
---------------------
11+
12+
The ``chipflow pin lock`` command performs pin locking for the current design.
13+
For every new top level interface with containing external pins with a ``PinSignature`` that is discovered, the necessary number of package pins is allocated and the mapping saved in the ``pins.lock`` file.
14+
This means that, unless the ``pins.lock`` file is deleted or manually modified, the pin assignments of all existing pins will always remain the same.
15+
16+
``chipflow silicon``
17+
--------------------
18+
19+
The ``chipflow silicon`` subcommand is used to send the design to the cloud builder for build and tapeout. In general, it would be run inside GitHub Actions as part of a CI job.
20+
21+
- ``chipflow silicon prepare`` links the design, including all Amaranth modules and any external Verilog components, into a single RTLIL file that is ready to be sent to the cloud builder.
22+
- ``chipflow silicon submit`` sends the linked design along with the ``pins.lock`` file containing pinout information to the ChipFlow cloud service for the build. With the ``--dry-run`` argument, it can be used for a local test that the design is ready to be submitted.
23+
24+
Submitting the design to the cloud requires the ``CHIPFLOW_API_KEY`` environment variable to be set with a valid API key obtained from the cloud interface.
25+
26+
``chipflow sim``
27+
----------------
28+
29+
The ``chipflow sim build`` command is used to build a CXXRTL simulation of the design; converting the design to a fast compiled C++ format along with C++ models of any peripherals.
30+
31+
Extra C++ model files for the simulation, and any custom build steps required, can be added to the ``sim/doit_build.py`` `doit <https://pydoit.org/>`_ build script inside the user project.
32+
33+
A default simulation driver (the C++ code that runs the simulation) is included as `main.cc <https://github.com/ChipFlow/chipflow-examples/blob/main/minimal/design/sim/main.cc>`_ in the example projects. This code:
34+
35+
- Instantiates the user design; and the simulation models for the peripherals (SPI flash, UART and GPIO)
36+
- Initialises the CXXRTL debug agent, which is required to perform debugging with the `RTL Debugger <https://github.com/amaranth-lang/rtl-debugger>`_ VS Code extension
37+
- Configures input and output JSON files for stimuli and results respectively (for automated integration testing)
38+
- Runs the design for 3,000,000 clock cycles
39+
40+
``chipflow software``
41+
---------------------
42+
43+
If the design contains a CPU, the ``chipflow software build`` command is used to build test firmware for the target CPU. Which C source files to include, and any build options (like the target architecture or enabled RISC-V extensions) can be customised in the ``software/doit_build.py`` doit build script inside the user project.
44+

docs/chipflow-toml-guide.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ The instance name is the name the python object will be given in your design, an
4848
The module class path offers a way to locate Python objects as entry points.
4949
It consists of a module's :term:`qualified name` followed by a colon (:) and then the :term:`qualified name` of the class within that module.
5050

51+
.. _chipflow-toml-steps:
52+
5153
``[chipflow.steps]``
5254
--------------------
5355

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ ChipFlow Library Documentation
1515
:caption: Contents:
1616

1717
chipflow-toml-guide
18+
chipflow-commands
1819
autoapi/index

0 commit comments

Comments
 (0)