Skip to content

Commit 3f54bf1

Browse files
Merge pull request #3907 from YosysHQ/krys/docs
Manual rewrite and presentation merge
2 parents 3231c1c + 49f1bea commit 3f54bf1

File tree

261 files changed

+9076
-8988
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+9076
-8988
lines changed

.github/workflows/test-docs.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and test doc code samples
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Install Dependencies
13+
shell: bash
14+
run: |
15+
sudo apt-get update
16+
sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
17+
18+
- name: Setup GCC
19+
uses: Dup4/actions-setup-gcc@v1
20+
21+
- name: Runtime environment
22+
shell: bash
23+
env:
24+
WORKSPACE: ${{ github.workspace }}
25+
run: |
26+
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
27+
echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH
28+
echo "procs=$(nproc)" >> $GITHUB_ENV
29+
30+
- name: Checkout Yosys
31+
uses: actions/checkout@v3
32+
33+
- name: Build yosys
34+
shell: bash
35+
run: |
36+
make config-gcc
37+
make -j${{ env.procs }}
38+
39+
- name: Run tests
40+
shell: bash
41+
run: |
42+
make -C docs test -j${{ env.procs }}

.github/workflows/test-linux.yml

+7
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ jobs:
112112
make config-${CC%%-*}
113113
make -j${{ env.procs }} CXXSTD=${{ matrix.cpp_std }} CC=$CC CXX=$CC LD=$CC
114114
115+
- name: Store build artifact
116+
if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'gcc-11')
117+
uses: actions/upload-artifact@v4
118+
with:
119+
name: compiled-yosys
120+
path: yosys
121+
115122
- name: Run tests
116123
if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'gcc-11')
117124
shell: bash

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ passes/techmap/flowmap.cc @whitequark
1818
passes/opt/opt_lut.cc @whitequark
1919
passes/techmap/abc9*.cc @eddiehung @Ravenslofty
2020
backends/aiger/xaiger.cc @eddiehung
21+
docs/ @KrystalDelusion
2122

2223

2324
## External Contributors

Makefile

+13-5
Original file line numberDiff line numberDiff line change
@@ -971,17 +971,27 @@ docs/source/cmd/abc.rst: $(TARGETS) $(EXTRA_TARGETS)
971971
mkdir -p docs/source/cmd
972972
./$(PROGRAM_PREFIX)yosys -p 'help -write-rst-command-reference-manual'
973973

974-
PHONY: docs/gen_images docs/guidelines
974+
PHONY: docs/gen_examples docs/gen_images docs/guidelines docs/usage
975+
docs/gen_examples:
976+
$(Q) $(MAKE) -C docs examples
977+
975978
docs/gen_images:
976-
$(Q) $(MAKE) -C docs/images all
979+
$(Q) $(MAKE) -C docs images
977980

978981
DOCS_GUIDELINE_FILES := GettingStarted CodingStyle
979982
docs/guidelines:
980983
$(Q) mkdir -p docs/source/temp
981984
$(Q) cp -f $(addprefix guidelines/,$(DOCS_GUIDELINE_FILES)) docs/source/temp
982985

986+
# many of these will return an error which can be safely ignored, so we prefix
987+
# the command with a '-'
988+
DOCS_USAGE_PROGS := yosys yosys-config yosys-filterlib yosys-abc yosys-smtbmc yosys-witness
989+
docs/usage: $(addprefix docs/source/temp/,$(DOCS_USAGE_PROGS))
990+
docs/source/temp/%: docs/guidelines
991+
-$(Q) ./$(PROGRAM_PREFIX)$* --help > $@ 2>&1
992+
983993
DOC_TARGET ?= html
984-
docs: docs/source/cmd/abc.rst docs/gen_images docs/guidelines
994+
docs: docs/source/cmd/abc.rst docs/gen_examples docs/gen_images docs/guidelines docs/usage
985995
$(Q) $(MAKE) -C docs $(DOC_TARGET)
986996

987997
clean:
@@ -1000,8 +1010,6 @@ clean:
10001010
rm -f tests/svinterfaces/*.log_stdout tests/svinterfaces/*.log_stderr tests/svinterfaces/dut_result.txt tests/svinterfaces/reference_result.txt tests/svinterfaces/a.out tests/svinterfaces/*_syn.v tests/svinterfaces/*.diff
10011011
rm -f tests/tools/cmp_tbdata
10021012
$(MAKE) -C docs clean
1003-
$(MAKE) -C docs/images clean
1004-
rm -rf docs/source/cmd docs/util/__pycache__
10051013

10061014
clean-abc:
10071015
$(MAKE) -C abc DEP= clean

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,12 @@ Simply visit https://yosys.readthedocs.io/en/latest/ instead.
610610
In addition to those packages listed above for building Yosys from source, the
611611
following are used for building the website:
612612

613-
$ sudo apt-get install pdf2svg faketime
613+
$ sudo apt install pdf2svg faketime
614614

615615
PDFLaTeX, included with most LaTeX distributions, is also needed during the
616-
build process for the website.
616+
build process for the website. Or, run the following:
617+
618+
$ sudo apt install texlive-latex-base texlive-latex-extra latexmk
617619

618620
The Python package, Sphinx, is needed along with those listed in
619621
`docs/source/requirements.txt`:

docs/.gitignore

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
/build/
22
/source/cmd
33
/source/temp
4-
/images/*.log
5-
/images/*.aux
6-
/images/*.pdf
7-
/images/*.svg
8-
/images/011/*.log
9-
/images/011/*.aux
10-
/images/011/*.pdf
11-
/images/011/*.svg
4+
/source/_images/**/*.log
5+
/source/_images/**/*.aux
6+
/source/_images/**/*.pdf
7+
/source/_images/**/*.svg
8+
/source/_images/**/*.dot
9+
/source/_images/code_examples

docs/Makefile

+27-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ help:
4545
@echo " dummy to check syntax errors of document sources"
4646

4747
.PHONY: clean
48-
clean:
48+
clean: clean-examples
4949
rm -rf $(BUILDDIR)/*
50+
rm -rf source/cmd util/__pycache__
51+
$(MAKE) -C source/_images clean
5052

5153
.PHONY: html
5254
html:
@@ -224,3 +226,27 @@ dummy:
224226
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
225227
@echo
226228
@echo "Build finished. Dummy builder generates no files."
229+
230+
PYTHON ?= python3
231+
232+
.PHONY: test test-examples test-macros examples
233+
test: test-examples test-macros
234+
235+
FORCE:
236+
Makefile-%: FORCE
237+
$(MAKE) -C $(@D) $(*F)
238+
239+
CODE_EXAMPLES := $(wildcard source/code_examples/*/Makefile)
240+
TEST_EXAMPLES := $(addsuffix -all,$(CODE_EXAMPLES))
241+
CLEAN_EXAMPLES := $(addsuffix -clean,$(CODE_EXAMPLES))
242+
test-examples: $(TEST_EXAMPLES)
243+
clean-examples: $(CLEAN_EXAMPLES)
244+
examples: $(TEST_EXAMPLES)
245+
246+
test-macros:
247+
$(PYTHON) tests/macro_commands.py
248+
249+
.PHONY: images
250+
images:
251+
$(MAKE) -C source/_images
252+

docs/images/011/example_out.tex

-18
This file was deleted.

docs/images/011/select_prod.tex

-19
This file was deleted.

docs/images/011/splitnets_libfile.tex

-15
This file was deleted.

docs/images/011/submod_dots.tex

-27
This file was deleted.

docs/images/Makefile

-44
This file was deleted.

docs/images/approach_flow.png

-9.48 KB
Binary file not shown.

docs/images/basics_abstractions.png

-28.5 KB
Binary file not shown.

docs/images/basics_ast.png

-9.26 KB
Binary file not shown.

docs/images/basics_flow.png

-12.2 KB
Binary file not shown.

docs/images/basics_parsetree.png

-22.7 KB
Binary file not shown.

docs/images/overview_flow.png

-17.3 KB
Binary file not shown.

docs/images/overview_rtlil.png

-15.7 KB
Binary file not shown.

docs/images/verilog_flow.png

-15.6 KB
Binary file not shown.

docs/source/APPNOTE_011_Design_Investigation/cmos_00.dot

-34
This file was deleted.

docs/source/APPNOTE_011_Design_Investigation/cmos_01.dot

-23
This file was deleted.

docs/source/APPNOTE_011_Design_Investigation/example.ys

-11
This file was deleted.

0 commit comments

Comments
 (0)