Skip to content

Commit 17a350a

Browse files
Merge pull request #181 from hdl/umarcor/readme
readme: split DEVELOPMENT.md; add Sphinx site
2 parents 64295d6 + 861e3b3 commit 17a350a

File tree

11 files changed

+393
-265
lines changed

11 files changed

+393
-265
lines changed

.btd.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
input: docs
2+
output: _build
3+
requirements: requirements.txt
4+
target: gh-pages
5+
formats: [ html ]
6+
theme: https://codeload.github.com/buildthedocs/sphinx.theme/tar.gz/v1

.github/workflows/docs.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Documentation
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: '0 0 * * 4'
8+
workflow_dispatch:
9+
10+
env:
11+
DOCKER_BUILDKIT: 1
12+
13+
jobs:
14+
15+
16+
docs:
17+
runs-on: ubuntu-latest
18+
name: '📓 Docs'
19+
steps:
20+
21+
- name: 🧰 Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: 📓 BuildTheDocs (BTD)
25+
uses: buildthedocs/btd@v0
26+
with:
27+
token: ${{ github.token }}
28+
skip-deploy: ${{ github.event_name == 'pull_request' }}
29+
30+
- name: '📤 Upload artifact: Sphinx HTML'
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: Documentation-HTML
34+
path: docs/_build/html

.github/workflows/tuttest.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
paths:
66
- 'syn/symbiflow-yosys/*'
77
- '.github/workflows/tuttest.yml'
8-
- 'README.md'
8+
- 'docs/DEVELOPMENT.md'
99
push:
1010
paths:
1111
- 'syn/symbiflow-yosys/*'
1212
- '.github/workflows/tuttest.yml'
13-
- 'README.md'
13+
- 'docs/DEVELOPMENT.md'
1414
workflow_dispatch:
1515

1616
env:
@@ -36,11 +36,11 @@ jobs:
3636

3737
- name: Grab install-prerequisites commands with tuttest
3838
run: |
39-
echo "# README.md/install-prerequisites" >$SCRIPT
39+
echo "# docs/DEVELOPMENT.md/install-prerequisites" >$SCRIPT
4040
echo >>$SCRIPT
4141
# SED changes URL in case the CI is running on a fork
4242
# and adds conda-eda as a directory name
43-
tuttest README.md install-prerequisites | sed -e "s#git clone .*\.git.*#git clone https://github.com/$GITHUB_REPOSITORY.git conda-eda#" >>$SCRIPT
43+
tuttest docs/DEVELOPMENT.md install-prerequisites | sed -e "s#git clone .*\.git.*#git clone https://github.com/$GITHUB_REPOSITORY.git conda-eda#" >>$SCRIPT
4444
echo >>$SCRIPT
4545
4646
- name: Add checkout commands
@@ -57,9 +57,9 @@ jobs:
5757
5858
- name: Grab prepare-and-build commands with tuttest
5959
run: |
60-
echo "# README.md/prepare-and-build" >>$SCRIPT
60+
echo "# docs/DEVELOPMENT.md/prepare-and-build" >>$SCRIPT
6161
echo >>$SCRIPT
62-
tuttest README.md prepare-and-build >>$SCRIPT
62+
tuttest docs/DEVELOPMENT.md prepare-and-build >>$SCRIPT
6363
6464
- name: Print ${{ env.SCRIPT }}
6565
run: cat $SCRIPT

README.md

+22-259
Original file line numberDiff line numberDiff line change
@@ -1,271 +1,34 @@
1-
# litex-conda-eda
1+
# Conda EDA
22

3-
Conda recipes for FPGA EDA tools (for synthesis, place and route and bitstream
4-
generation).
3+
<p align="center">
4+
<a href="https://hdl.github.io/conda-eda/"><img width=550px src="docs/_static/banner.png"/></a>
5+
</p>
56

6-
# Synthesis
7+
Conda recipes for FPGA EDA tools (for synthesis, place and route and bitstream generation).
78

8-
* [Yosys](https://github.com/YosysHQ/yosys)
9-
* TODO: [GHDL Synthesis](https://github.com/tgingold/ghdlsynth-beta)
9+
## Synthesis
1010

11-
# Place and Route
11+
* [Yosys](https://github.com/YosysHQ/yosys)
12+
* TODO: [GHDL Synthesis](https://github.com/tgingold/ghdlsynth-beta)
1213

13-
* [arachne](https://github.com/cseed/arachne-pnr)
14-
* [nextpnr (iCE40, ECP5, generic)](https://github.com/YosysHQ/nextpnr)
15-
* [Versatile Place and Route (vpr)](https://github.com/verilog-to-routing/vtr-verilog-to-routing)
14+
## Place and Route
1615

17-
# Bitstream
16+
* [arachne](https://github.com/cseed/arachne-pnr)
17+
* [nextpnr (iCE40, ECP5, generic)](https://github.com/YosysHQ/nextpnr)
18+
* [Versatile Place and Route (vpr)](https://github.com/verilog-to-routing/vtr-verilog-to-routing)
1819

19-
* [Project Icestorm](https://github.com/cliffordwolf/icestorm)
20-
* [Project Trellis](https://github.com/SymbiFlow/prjtrellis)
21-
* TODO: [Project X-Ray](https://github.com/SymbiFlow/prjxray)
20+
## Bitstream
2221

23-
# Simulation
22+
* [Project Icestorm](https://github.com/cliffordwolf/icestorm)
23+
* [Project Trellis](https://github.com/SymbiFlow/prjtrellis)
24+
* TODO: [Project X-Ray](https://github.com/SymbiFlow/prjxray)
2425

25-
* TODO: [GHDL](http://ghdl.free.fr/)
26-
* [Icarus Verilog](http://iverilog.icarus.com/)
27-
* [Verilator](https://www.veripool.org/wiki/verilator)
26+
## Simulation
2827

29-
# Formal
28+
* TODO: [GHDL](http://ghdl.free.fr/)
29+
* [Icarus Verilog](http://iverilog.icarus.com/)
30+
* [Verilator](https://www.veripool.org/wiki/verilator)
3031

31-
* [Symbiyosys](https://github.com/YosysHQ/SymbiYosys)
32+
## Formal
3233

33-
# Building
34-
35-
This repository is set up to be built by Travis CI, using the GitHub
36-
integration to Travis CI.
37-
38-
See [`.travis.yml`](.travis.yml) for the build configuration given to
39-
Travis CI, and the [`.travis`](.travis) directory for scripts referenced.
40-
41-
The Travis CI output can be found on the https://travis-ci.com/ for the
42-
GitHub account and GitHub repository. For instance, for the main:
43-
44-
https://github.com/litex-hub/litex-conda-eda
45-
46-
GitHub repository, the Travis CI results can be seen at:
47-
48-
https://travis-ci.com/litex-hub/litex-conda-eda
49-
50-
On a successful build in the `litex-hub` Travis CI, the resulting packages
51-
are uploaded to:
52-
53-
https://anaconda.org/litex-hub/repo
54-
55-
and can be installed with:
56-
57-
```
58-
conda install --channel "LiteX-Hub" package
59-
```
60-
61-
These packages are mostly used by
62-
[`litex-buildenv`](https://github.com/litex-hub/litex-buildenv).
63-
64-
## Building via Travis CI in your own repository
65-
66-
If you [enable Travis CI on your GitHub
67-
fork](https://travis-ci.com/getting_started) of `litex-conda-eda`
68-
then your Travis CI results will be at:
69-
70-
```
71-
https://travis-ci.org/${GITHUB_USER}/litex-conda-eda
72-
```
73-
74-
Since the repository includes `.travis.yml` and all the other Travis CI
75-
setup, you should just need to turn on the Travis CI integration at GitHub,
76-
and push changes to your GitHub repo, to trigger a Travis CI build, then
77-
watch the https://travis-ci.org/ site for the build progress.
78-
79-
A full build of everything will take the Travis CI infrastructure a few
80-
hours if it all builds successfully.
81-
82-
## Common Travis CI build failures
83-
84-
If the build fails, see the [common Travis CI build
85-
problems](https://docs.travis-ci.com/user/common-build-problems/)
86-
for assistance investigating the issues. Common issues with this
87-
repository include package dependencies (eg, where Conda has changed),
88-
output log file size (Travis CI has a 4MB maximum, and some package
89-
builds like `gcc` generate a *lot* of output), and builds timing out
90-
(either for maximum time allocation, or for ["no output" for more than
91-
10 minutes](https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received)).
92-
93-
## Testing conda builds locally
94-
95-
It is recommend to build these packages in a fresh disposable environment
96-
such as a clean container (Docker, Podman etc.).
97-
While the goal is for the conda environment to be totally self contained,
98-
there is a constant battle to make sure this happens.
99-
100-
The commands from the following subsections were tested to be enough to build
101-
a package in a clean container based on `ubuntu` (`16.04`-`20.04`) or `debian`
102-
(`8`-`10`) Docker image.
103-
104-
### Prerequisites
105-
106-
Apart from cloning this repository to a local directory, the following
107-
prerequisites are required:
108-
* [Git](https://git-scm.com/),
109-
* Conda installed and initialized, e.g., using
110-
[Miniconda](https://docs.conda.io/en/latest/miniconda.html)
111-
(which includes self contained versions of the required *python3* with
112-
*pip* and *setuptools* tooling),
113-
* [conda-build-prepare](https://github.com/litex-hub/conda-build-prepare).
114-
115-
On Debian and Ubuntu, these requirements can be satisfied using the following
116-
commands:
117-
118-
<!-- name="install-prerequisites" -->
119-
```bash
120-
# Install git and wget (might require using `sudo`)
121-
apt-get update
122-
apt-get install -y git wget
123-
124-
# Download Miniconda and install in CONDA_PATH
125-
CONDA_PATH=~/conda
126-
wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
127-
chmod a+x Miniconda3-latest-Linux-x86_64.sh
128-
./Miniconda3-latest-Linux-x86_64.sh -p $CONDA_PATH -b -f
129-
130-
# Initialize Conda in the shell
131-
eval "$("$CONDA_PATH/bin/conda" "shell.bash" 'hook' 2> /dev/null)"
132-
133-
# Install `conda-build-prepare`
134-
python3 -m pip install git+https://github.com/litex-hub/[email protected]#egg=conda-build-prepare
135-
136-
# Clone the `conda-eda` repository
137-
git clone https://github.com/hdl/conda-eda.git
138-
cd conda-eda
139-
```
140-
141-
### Required environment variables
142-
143-
Some recipes require exporting additional environment variables.
144-
Such variables must be set before preparing the recipe, which is done
145-
with one of the commands from the next subsection.
146-
147-
Currently there are no such variables and recipes in this repository,
148-
although there are a few such cases in other `hdl/conda-*` repositories.
149-
150-
The `DATE_NUM` and `DATE_STR` environment variables are required by the most of
151-
this repository's recipes.
152-
Values of these variables are commonly used as `build/number` and
153-
`build/string` keys in the recipes.
154-
155-
If the `DATE_STR` hasn't been set in the environment then it is set during the
156-
preparation based:
157-
* on the latest commit's committer date if the recipe belongs to a git
158-
repository,
159-
* on the latest file modification date after checking all recipe files
160-
otherwise,
161-
using UTC timezone and `%Y%m%d_%H%M%S` time format, e.g., `20210216_155420`.
162-
163-
The `DATE_NUM` is always automatically set with all `DATE_STR` digits.
164-
In case of the aforementioned `DATE_STR` example, `20210216155420` would be
165-
used as the `DATE_NUM` value.
166-
167-
### Preparing and building the package
168-
169-
After getting all prerequisites and setting the required variables, it is
170-
recommended to prepare the recipe with *conda-build-prepare* before building,
171-
as it gives you the advantages described [on the tool's GitHub
172-
page](https://github.com/litex-hub/conda-build-prepare).
173-
Since it's also used within the CI, the locally built packages will be much
174-
more similar to the ones built by the CI workflow.
175-
176-
#### Preparing the recipe with *conda-build-prepare*
177-
178-
The *conda-build-prepare* is a Python module with a CLI.
179-
Its calling signature is:
180-
```
181-
python3 -m conda_build_prepare
182-
[-h]
183-
[--channels CHANNEL [CHANNEL ...]]
184-
[--packages PACKAGE [PACKAGE ...]]
185-
--dir DIRECTORY
186-
RECIPE
187-
```
188-
189-
The required arguments are:
190-
* `--dir DIRECTORY` – the path for a new directory that will be created with
191-
output files,
192-
* `RECIPE` – the path to the recipe corresponding to the package chosen to be
193-
built.
194-
195-
To build a package similarly to how the packages are built in the CI it is
196-
recommended to pass the following optional arguments:
197-
* `--channels litex-hub` – to search for build dependencies in the LiteX-Hub
198-
channel in addition to the recipe-specific channels (from its `condarc` file),
199-
* `--packages python=3.7` – to use the same versions of
200-
packages that influence building as in the CI.
201-
202-
After preparing, the output `DIRECTORY` will contain subdirectories:
203-
* `conda-env` with a clean Conda environment to host the build process,
204-
* `git-repos` with source git repositories cloned and slightly adjusted,
205-
* `recipe` with an adjusted recipe (locked requirements, version set etc.).
206-
207-
More details can be found on [the *conda-build-prepare*
208-
GitHub page](https://github.com/litex-hub/conda-build-prepare).
209-
210-
#### Building the package
211-
212-
To build the package using the prepared subdirectories:
213-
* activate the Conda environment from `DIRECTORY/conda-env`,
214-
* run `conda-build` tool with `DIRECTORY/recipe`.
215-
216-
#### Script to prepare the recipe and build the package
217-
218-
All of the following commands are meant to be run from the repository root.
219-
220-
If the provided commands are to be used unmodified, it is important to first
221-
set the `RECIPE_PATH` variable with the proper recipe's path to build the
222-
chosen package and the variables mentioned in the previous subsection, if the
223-
recipe requires such.
224-
By default, the `yosys` package will be built.
225-
226-
The `PREPARED_RECIPE_OUTPUTDIR` variable sets the directory that will be
227-
created with the already described `conda-build-prepare`'s output
228-
subdirectories.
229-
By default, the `cbp-outdir` will be created in the repository root.
230-
231-
<!-- name="prepare-and-build" -->
232-
```bash
233-
# Some defaults for the variables used in subsequent commands
234-
PREPARED_RECIPE_OUTPUTDIR=${PREPARED_RECIPE_OUTPUTDIR:-cbp-outdir}
235-
RECIPE_PATH=${RECIPE_PATH:-syn/yosys}
236-
237-
# Prepare the RECIPE with `conda-build-prepare`
238-
ADDITIONAL_PACKAGES="python=3.7"
239-
python3 -m conda_build_prepare \
240-
--channels litex-hub \
241-
--packages $ADDITIONAL_PACKAGES \
242-
--dir $PREPARED_RECIPE_OUTPUTDIR \
243-
$RECIPE_PATH
244-
245-
# Activate prepared environment where `conda build` will be run
246-
conda activate $PREPARED_RECIPE_OUTPUTDIR/conda-env
247-
248-
# Build the package
249-
conda build $PREPARED_RECIPE_OUTPUTDIR/recipe
250-
```
251-
252-
### Additional information
253-
254-
Expect packages like `binutils` to take 3-5 minutes to build, packages
255-
like `gcc/nostdc` to take 10-15 minutes to build, and packages like
256-
`gcc/newlib` to take 25-40 minutes to build, on a relatively fast
257-
build system (eg, SSD, i7, reasonable amount of RAM). Beware that
258-
`gcc/newlib` wants to see `gcc/nostdc` *of the same version* already
259-
installed before it will build; this means that `gcc/newlib` is
260-
non-trivial to build individually.
261-
262-
To build one architecture of tools, without any cleanup will need a
263-
VM with maybe 12-15GiB of space available (a 10GiB disk image is not
264-
quite big enough). Building more architectures at once will need more
265-
disk space.
266-
267-
**NOTE**: By preference only packages built by Travis CI should be
268-
uploaded to the Anaconda repository, so that the externally visible
269-
packages have consistent package versions (and do not conflict). But
270-
it can be useful to build locally to debug `conda-build` config issues
271-
without waiting for a full Travis CI cycle.
34+
* [Symbiyosys](https://github.com/YosysHQ/SymbiYosys)

0 commit comments

Comments
 (0)