Skip to content

Commit

Permalink
[WIP] docs: update
Browse files Browse the repository at this point in the history
Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
  • Loading branch information
umarcor committed Aug 7, 2022
1 parent a1892cb commit c204923
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 63 deletions.
59 changes: 12 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,23 @@
# FOSS Flows For FPGA (F4PGA) project

<p align="center">
<a title="Website" href="https://f4pga.org"><img src="https://img.shields.io/website?longCache=true&style=flat-square&label=f4pga.org&up_color=10cfc9&url=https%3A%2F%2Ff4pga.org%2Findex.html&labelColor=fff"></a><!--
-->
<a title="Community" href="https://f4pga.readthedocs.io/en/latest/community.html#communication"><img src="https://img.shields.io/badge/Chat-IRC%20%7C%20Slack-white?longCache=true&style=flat-square&logo=Slack&logoColor=fff"></a><!--
<a title="Documentation" href="https://f4pga.readthedocs.io"><img src="https://img.shields.io/website?longCache=true&style=flat-square&label=Documentation&up_color=1226aa&up_message=%E2%9E%9A&url=https%3A%2F%2Ff4pga.readthedocs.io%2Fen%2Flatest%2Findex.html&labelColor=fff"></a><!--
-->
<a title="'Automerge' workflow status" href="https://github.com/chipsalliance/f4pga/actions/workflows/Doc.yml"><img alt="'Automerge' workflow status" src="https://img.shields.io/github/workflow/status/chipsalliance/f4pga/Automerge/main?longCache=true&style=flat-square&label=Tests&logo=Github%20Actions&logoColor=fff"></a><!--
<a title="Community" href="https://f4pga.readthedocs.io/en/latest/community.html#communication"><img src="https://img.shields.io/badge/Chat-IRC%20%7C%20Slack-white?longCache=true&style=flat-square&logo=Slack&logoColor=fff"></a><!--
-->
</p>

This is the top-level repository for the [F4PGA](https://f4pga.org/) project, which is a Workgroup under the [CHIPS Alliance](https://chipsalliance.org).
The elements of the project include (but are not limited to):

* The F4PGA open source FPGA toolchains for programming FPGAs (formerly known as [SymbiFlow](https://github.com/SymbiFlow)).
This includes:

* [![Documentation](https://img.shields.io/website?longCache=true&style=flat-square&label=Documentation&up_color=1226aa&up_message=%E2%9E%9A&url=https%3A%2F%2Ff4pga.readthedocs.io%2Fen%2Flatest%2Findex.html&labelColor=fff)](https://f4pga.readthedocs.io)
* F4PGA Architecture Definitions [![Arch-Defs (for Developers)](https://img.shields.io/website?longCache=true&style=flat-square&label=For%20Developers&up_color=231f20&up_message=%E2%9E%9A&url=https%3A%2F%2Ff4pga.readthedocs.io%2Fprojects%2Farch-defs%2Fen%2Flatest%2Findex.html&labelColor=fff)](https://f4pga.readthedocs.io/projects/arch-defs)
* F4PGA Examples [![Examples (for Users)](https://img.shields.io/website?longCache=true&style=flat-square&label=For%20Users&up_color=231f20&up_message=%E2%9E%9A&url=https%3A%2F%2Ff4pga-examples.readthedocs.io%2Fen%2Flatest%2Findex.html&labelColor=fff)](https://f4pga-examples.readthedocs.io)
* [F4PGA Yosys plugins](https://github.com/chipsalliance/yosys-f4pga-plugins)

* The FPGA interchange format (an interchange format defined by CHIPS Alliance to enable interoperability between
different FPGA tools) adopted by the F4PGA toolchain:

* [FPGA Interchange schema](https://github.com/chipsalliance/fpga-interchange-schema)
* [FPGA Interchange Python utilities](https://github.com/chipsalliance/python-fpga-interchange)
* [FPGA Interchange Test suite](https://github.com/SymbiFlow/fpga-interchange-tests)

* The [FPGA tool performance framework](https://github.com/chipsalliance/fpga-tool-perf) framework for benchmarking
designs against various FPGA tools, and vice versa, over time.

* FPGA Database visualisation tools for visual exploration of FPGA bitstream and databases:

* [F4PGA bitstream viewer](https://github.com/SymbiFlow/f4pga-bitstream-viewer)
* [F4PGA database visualizer](https://github.com/chipsalliance/f4pga-database-visualizer)

* Other utilities (FPGA assembly format, documentation and other):

* [F4PGA Assembly (FASM)](https://github.com/chipsalliance/fasm)
* [Xilinx bitstream generation library](https://github.com/SymbiFlow/f4pga-xc-fasm)
* [Verilog-to-routing XML utilities](https://github.com/SymbiFlow/vtr-xml-utils)
* [SDF format utilities](https://github.com/chipsalliance/python-sdf-timing)
* [F4PGA tools data manager](https://github.com/SymbiFlow/symbiflow-tools-data-manager)
* [F4PGA Sphinx Theme](https://github.com/SymbiFlow/sphinx_symbiflow_theme)
* [F4PGA Sphinx HDL diagrams](https://github.com/SymbiFlow/sphinxcontrib-hdl-diagrams)
* [F4PGA Sphinx Verilog domain](https://github.com/SymbiFlow/sphinx-verilog-domain)
# FOSS Flows For FPGA (F4PGA) project

## F4PGA Workgroup
<p align="center">
<a title="'Automerge' workflow status" href="https://github.com/chipsalliance/f4pga/actions/workflows/Doc.yml"><img alt="'Automerge' workflow status" src="https://img.shields.io/github/workflow/status/chipsalliance/f4pga/Automerge/main?longCache=true&style=flat-square&label=Tests&logo=Github%20Actions&logoColor=fff"></a><!--
-->
</p>

The F4PGA Workgroup consists of members from different backgrounds, including FPGA vendors
([Xilinx](https://www.xilinx.com/) and [QuickLogic](https://www.quicklogic.com/)),
industrial users
([Google](https://www.google.com/), [Antmicro](https://antmicro.com/))
and academia
([University of Toronto](https://www.utoronto.ca/)),
This is the top-level repository for the [F4PGA](https://f4pga.org/) project, which is a Workgroup under the [CHIPS Alliance](https://chipsalliance.org); consisting of members from different backgrounds, including FPGA vendors, industrial users and academia (see [Documentation > Community](https://f4pga.readthedocs.io/en/latest/community.html));
who collaborate to build a more open source and software-driven FPGA ecosystem (IP, tools and workflows) to drive the
adoption of FPGAs in existing and new use cases, and eliminate barriers of entry.

* [Documentation > Getting started](https://f4pga.readthedocs.io) (for everyone)
* [F4PGA Examples](https://f4pga-examples.readthedocs.io) (for users)
* [F4PGA Architecture Definitions](https://f4pga.readthedocs.io/projects/arch-defs) (for developers)
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
REQUIREMENTS_FILE := requirements.txt
ENVIRONMENT_FILE := environment.yml

include ../third_party/make-env/conda.mk
#include ../third_party/make-env/conda.mk

# NOTE: make env to create a conda environment with the needed packages

Expand Down
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"examples": ("https://f4pga-examples.readthedocs.io/en/latest/", None),
"arch-defs": ("https://f4pga.readthedocs.io/projects/arch-defs/en/latest/", None),
"constraints": ("https://hdl.github.io/constraints/", None),
"containers": ("https://hdl.github.io/containers/", None),
"fasm": ("https://fasm.readthedocs.io/en/latest/", None),
"interchange": ("https://fpga-interchange-schema.readthedocs.io/", None),
"openfpgaloader": ("https://trabucayre.github.io/openFPGALoader/", None),
Expand All @@ -189,5 +191,5 @@
'ghsharp': ('https://github.com/chipsalliance/f4pga/issues/%s', '#'),
'ghissue': ('https://github.com/chipsalliance/f4pga/issues/%s', 'issue #'),
'ghpull': ('https://github.com/chipsalliance/f4pga/pull/%s', 'pull request #'),
'ghsrc': ('https://github.com/chipsalliance/f4pga/blob/master/%s', '')
'ghsrc': ('https://github.com/chipsalliance/f4pga/blob/main/%s', '')
}
93 changes: 93 additions & 0 deletions docs/f4pga/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# f4pga python package

This is the current in-development FPGA-oriented build system that's provided with f4pga.

This package aims to provide a unified front-end for executing _verilog-to-bitstream_ and
other flows for various FPGA platforms. It's meant as a future replacement of
`symbiflow_*` shell scripts.

It contains _EDA_ tool wrappers that provide meta-data about the tools, utilities
related to tracking files and inspection of data used within the flows, scripts used by
tools within flows, a dependency resolution algorithm and flow templates for various devices.

The basic usage requires creation of a `flow.json` file describing the FPGA-oriented project.
You can take
[one from the f4pga-examples repository](https://github.com/chipsalliance/f4pga-examples/blob/main/xc7/counter_test/flow.json)
as a reference. Alternatively there's a way to configure a flow with command-line parameters only.

Once you have your flow created, run

```
f4pga build -f flow.json
```

to build a default target.

To learn more about the package and its usage, visit
[related section in the docs](https://f4pga.readthedocs.io/en/latest/f4pga/index.html).

--------------------------------------------------

## Package capability status:

* Architecture support:
* Xilinx XC7 (**available** in main branch)
* Synthesis tool: yosys
* PnR tool: VPR
* bitstream generation: yes (xcfasm)
* used in f4pga-examples:
[yes](https://github.com/chipsalliance/f4pga-examples/blob/main/xc7/counter_test/flow.json)
* Quicklogic EOS-S3 (yosys+VPR flow) (**WIP**, see
[#577](https://github.com/chipsalliance/f4pga/pull/577))
* Synthesis tool: yosys
* PnR tool: VPR
* bitstream generation: yes (qlfasm)
* analysis: ?
* used in f4pga-examples: no
* Lattice ICE40 (yosys+nextpnr flow) (**WIP**, see
[#585](https://github.com/chipsalliance/f4pga/pull/585))
* Synthesis tool: yosys
* PnR tool: nextpnr
* bitstream generation: yes (icepack)
* used in f4pga-examples: no
* Quicklogic k4n8 (Unverified, not officially supported. Might work after some tinkering.)
* Synthesis tool: yosys
* PnR tool: VPR
* bitstream generation: yes (qlf_fasm)
* used in f4pga-examples: no
* Incremental builds support
* Support for multiple configurations for a single project
* Can be used as a python interface to _F4PGA_, however there's no official _API_ at the moment.

## Contributing

We welcome contributions from all people as long as they don't include any discriminatory, hateful
language, don't force users to use proprietary technologies and are related to the F4PGA project.

We will prioritize contributions which serve to improve support for platforms that are
officially supported by _f4pga_. UX-related contributions are welcome as well.

## Reporting bugs

If you find a bug and want other to take a look, please open an issue, attach a log and a minimal
example for reproducing the bug. Use `-vv` (maximum verbosity level) option when running `f4pga`
if possible.

Please, remember to specify the version of architecture definitions you are using (this applies only to VPR-based flows).
If you used a pre-built packages, please provide a hash that identifies the package and name
of the platform in question (_XC7_/_EOS-S3_).
The hash is the last alphanumeric component before the `.tar.gz` suffix of the archive with
prebuilt packages. Use your local installation to look-up the hash. Links to packages in
[the documention](https://f4pga-examples.readthedocs.io/en/latest/getting.html) get automatically
updated to point to the latest packages.

If you built the architecture definitions yourself, please specify the hash of the commit you've
used.

If you don't specify the version of architecture definitions, we might be unable to reproduce the
bug.

## Licensing

f4pga is a Free Open-Source Software licensed under Apache 2.0 license.

4 changes: 4 additions & 0 deletions docs/f4pga/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ The scope of Python F4PGA is threefold:
Therefore, it's still a *pre-alpha* and the codebase, commands and flows are subject to change.
It is strongly suggested not to rely on Python F4PGA until this note is updated/removed.

.. toctree::

README

References
==========

Expand Down
124 changes: 114 additions & 10 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,127 @@
Getting started
###############

To begin using F4PGA, you might want to take a look at the tutorials below, which make for a good starting point.
They will guide you through the process of using the toolchain, explaining how to generate and load a bitstream into
your FPGA.
To begin using F4PGA, you might want to take a look at the :ref:`GettingStarted:Guidelines` below, which make for a good
starting point.
They will guide you through the process of installing and using the flows, explaining how to generate and load a
bitstream into your FPGA.

* `Examples ➚ <https://f4pga-examples.readthedocs.io>`__ (for users)
F4PGA flows are composed of multiple tools, scripts and CLI utilities.
Fortunately, various alternatives exist for setting up the whole ecosystem without going through the daunting task of
installing pieces one-by-one.
See :ref:`GettingStarted:ToolchainInstallation` below.

* `Architecture Definitions ➚ <https://f4pga.readthedocs.io/projects/arch-defs/en/latest/getting-started.html>`__ (for developers)
.. _GettingStarted:Guidelines:

* `F4PGA Architectures Visualizer ➚ <https://chipsalliance.github.io/f4pga-database-visualizer/>`__
Guidelines
==========

* `Project X-Ray ➚ <https://f4pga.readthedocs.io/projects/prjxray/en/latest/>`__
This is the main documentation, which gathers info about the :ref:`Python CLI tools and APIs <pyF4PGA>` and the
:ref:`Desing Flows <Flows>` supported by F4PGA, along with a :ref:`Glossary`, references to specifications, plugins and
:ref:`publications <References>`.

* `X-Ray Quickstart ➚ <https://f4pga.readthedocs.io/projects/prjxray/en/latest/db_dev_process/readme.html#quickstart-guide>`__
Since F4PGA is meant for users with varying backgrounds and expertise, three paths are provided to walk into the ecosystem.

* `Project Trellis ➚ <https://prjtrellis.readthedocs.io/en/latest/>`__
**Newcomers** are invited to go through `Examples ➚ <https://f4pga-examples.readthedocs.io>`__, which provides
step-by-step guidelines to install the tools through `Conda ➚ <https://conda.io>`__, generate a bitstream from one of the
provided designs and load the bitstream into a development board.
See :ref:`examples:CustomizingMakefiles` for adapting the build plumbing to your own desings.

* :gh:`Project Icestorm ➚ <f4pga/icestorm>`
For **Intermediate** users and contributors, who are already familiar with installing the tools and building bitstreams,
it is recommended to read the shell scripts in subdir :ghsrc:`scripts`, as well as the Continuous Integration
:ghsrc:`Pipeline <.github/workflows/Pipeline.yml>`.
Moreover, workflow `containers-conda-f4pga.yml <https://github.com/hdl/packages/blob/main/.github/workflows/containers-conda-f4pga.yml>`__
in :gh:`hdl/packages` shows how to use the ``*/conda/f4pga/*`` containers from :gh:`hdl/containers`
(see `workflow runs <https://github.com/hdl/packages/actions/workflows/containers-conda-f4pga.yml>`__ and :ref:`containers:tools-and-images:f4pga`).

**Advanced** users and developers willing to support new devices and/or enhance the features of the supported families
(see `F4PGA Architectures Visualizer ➚ <https://chipsalliance.github.io/f4pga-database-visualizer/>`__)
should head to `Architecture Definitions ➚ <https://f4pga.readthedocs.io/projects/arch-defs>`__.
The effort to document the details of each device/family are distributed on multiple projects:

* `Project X-Ray ➚ <https://f4pga.readthedocs.io/projects/prjxray/en/latest/>`__

* `X-Ray Quickstart ➚ <https://f4pga.readthedocs.io/projects/prjxray/en/latest/db_dev_process/readme.html#quickstart-guide>`__

* `Project Trellis ➚ <https://prjtrellis.readthedocs.io/en/latest/>`__

* :gh:`Project Icestorm ➚ <f4pga/icestorm>`


.. _GettingStarted:ToolchainInstallation:

Toolchain installation
======================

F4PGA flows require multiple radpidly moving tools, assets and scripts, which makes it difficult for system packagers to
catch up.
Although some of the tools used in F4PGA (such as yosys, nextpnr or vpr) are available already through ``apt``, ``dnf``,
``pacman``, etc. they typically use pinned versions which are not the latest.
Therefore, the recommended installation procedure to follow the guidelines in F4PGA is repositories is using `Conda ➚ <https://conda.io>`__,
or some other pre-packaged solution combining latest releases.


Conda (Recommended)
-------------------

.. IMPORTANT::
Dure to size constraints, Architecture Definition packages cannot be distributed through Conda.
Hence, installing a functional F4PGA system is a two step process: bootstraping the conda environment and getting the
tarballs (or vice versa).
In the future, getting and managing the tarballs might be handled by F4PGA.

In coherence with the :ref:`GettingStarted:Guidelines` above, multiple Conda environments are provided:

* **Newcomers** will find environment and requirements files in :gh:`chipsalliance/f4pga-examples`, which are to be used
as explained in :ref:`examples:Getting`.

* **Intermediate** users and contributors can use the minimal environment and requirements files included in the
Architecture Definition packages, as is done in the CI of this repository.

* **Advanced** users and developers will get all the dependencies by bootstraping the environment in :gh:`SymbiFlow/f4pga-arch-defs`.

Summarizing, the installation procedure implies:

* Setting environment variables ``F4PGA_INSTALL_DIR`` and ``F4PGA_FAM`` (and optionally ``F4PGA_SHARE_DIR``), so that
CLI utilities can find tools and assets.
* Downloading and extracting the Architecture Definition tarballs.
* Getting the environment and requirements files, by cloning f4pga-examples or f4pga-arch-defs, or by using the ones
included in the tarballs.
* Bootstraping the Conda environment and optionally installing additional tools.

.. NOTE::
Architecture Definition packages are built and released in :gh:`SymbiFlow/f4pga-arch-defs`.
In this repository and in :gh:`chipsalliance/f4pga-examples`, pinned versions of the packages are used.
However, tracking the *latest* release is also supported.

TODO: add a section in the docs of arch-defs explaining that 'latest' txt files are pushed to GCP and as assets of release
`latest`. Explain how to use those instead of pinned versions (ref to the `latest.patch` in f4pga-examples and the HDLC
recipe in hdl/containers).
https://f4pga.readthedocs.io/projects/arch-defs/en/latest/README.html#pre-built-architecture-files


Other
-----

* :gh:`hdl/packages`
* Manual

* https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=symbiflow-install-notes.txt;hb=HEAD
* https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=symbiflow-install;hb=HEAD
* https://libre-soc.org/HDL_workflow/symbiflow/

Containers
~~~~~~~~~~

* :gh:`hdl/containers`

Ready-to-use docker/podman containers are available.
Those include Conda, the arch-defs and the f4pga Python package.

.. HINT::
:ghsharp:`574` is work in progress to provide an F4PGA Action
(see `Understanding GitHub Actions <https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions>`__)
based on ``*/conda/f4pga/*`` containers.


.. _GettingStarted:LoadingBitstreams:
Expand Down
2 changes: 2 additions & 0 deletions docs/glossary.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _Glossary:

Glossary
########

Expand Down
Loading

0 comments on commit c204923

Please sign in to comment.