Skip to content

Commit 74bcbe4

Browse files
authored
Merge branch 'YosysHQ:main' into master
2 parents 216a82a + cb07710 commit 74bcbe4

File tree

282 files changed

+9919
-9183
lines changed

Some content is hidden

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

282 files changed

+9919
-9183
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ body:
3434
- macOS
3535
- Windows
3636
- BSD
37+
- WebAssembly
3738
multiple: true
3839
validations:
3940
required: true
@@ -42,7 +43,7 @@ body:
4243
attributes:
4344
value: >
4445
When providing steps to reproduce the issue, please ensure that the issue
45-
is reproducible in the current git master of Yosys. Also ensure to
46+
is reproducible in the current git main of Yosys. Also ensure to
4647
provide all necessary source files needed.
4748
4849

.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+
- main
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

+31-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

2-
CONFIG := clang
2+
CONFIG := none
3+
# CONFIG := clang
34
# CONFIG := gcc
45
# CONFIG := afl-gcc
56
# CONFIG := emcc
@@ -141,7 +142,7 @@ LIBS += -lrt
141142
endif
142143
endif
143144

144-
YOSYS_VER := 0.39+0
145+
YOSYS_VER := 0.39+149
145146

146147
# Note: We arrange for .gitcommit to contain the (short) commit hash in
147148
# tarballs generated with git-archive(1) using .gitattributes. The git repo
@@ -217,7 +218,7 @@ endif
217218
ifeq ($(CONFIG),clang)
218219
CXX = clang++
219220
CXXFLAGS += -std=$(CXXSTD) -Os
220-
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H -Wno-c++11-narrowing $(ABC_ARCHFLAGS)"
221+
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H $(ABC_ARCHFLAGS)"
221222

222223
ifneq ($(SANITIZER),)
223224
$(info [Clang Sanitizer] $(SANITIZER))
@@ -265,7 +266,7 @@ ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H"
265266
else ifeq ($(CONFIG),emcc)
266267
CXX = emcc
267268
CXXFLAGS := -std=$(CXXSTD) $(filter-out -fPIC -ggdb,$(CXXFLAGS))
268-
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H -DABC_MEMALIGN=8 -Wno-c++11-narrowing"
269+
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H -DABC_MEMALIGN=8"
269270
EMCC_CXXFLAGS := -Os -Wno-warn-absolute-paths
270271
EMCC_LINKFLAGS := --embed-file share
271272
EMCC_LINKFLAGS += -s NO_EXIT_RUNTIME=1
@@ -317,7 +318,7 @@ CXXFLAGS := $(WASIFLAGS) -std=$(CXXSTD) -Os -D_WASI_EMULATED_PROCESS_CLOCKS $(fi
317318
LINKFLAGS := $(WASIFLAGS) -Wl,-z,stack-size=1048576 $(filter-out -rdynamic,$(LINKFLAGS))
318319
LIBS := -lwasi-emulated-process-clocks $(filter-out -lrt,$(LIBS))
319320
ABCMKARGS += AR="$(AR)" RANLIB="$(RANLIB)"
320-
ABCMKARGS += ARCHFLAGS="$(WASIFLAGS) -D_WASI_EMULATED_PROCESS_CLOCKS -DABC_USE_STDINT_H -DABC_NO_DYNAMIC_LINKING -DABC_NO_RLIMIT -Wno-c++11-narrowing"
321+
ABCMKARGS += ARCHFLAGS="$(WASIFLAGS) -D_WASI_EMULATED_PROCESS_CLOCKS -DABC_USE_STDINT_H -DABC_NO_DYNAMIC_LINKING -DABC_NO_RLIMIT"
321322
ABCMKARGS += OPTFLAGS="-Os"
322323
EXE = .wasm
323324

@@ -360,8 +361,12 @@ ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC
360361
ABCMKARGS += LIBS="-lpthread -lshlwapi -s" ABC_USE_NO_READLINE=0 CC="x86_64-w64-mingw32-gcc" CXX="$(CXX)"
361362
EXE = .exe
362363

363-
else ifneq ($(CONFIG),none)
364-
$(error Invalid CONFIG setting '$(CONFIG)'. Valid values: clang, gcc, emcc, mxe, msys2-32, msys2-64)
364+
else ifeq ($(CONFIG),none)
365+
CXXFLAGS += -std=$(CXXSTD) -Os
366+
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H $(ABC_ARCHFLAGS)"
367+
368+
else
369+
$(error Invalid CONFIG setting '$(CONFIG)'. Valid values: clang, gcc, emcc, mxe, msys2-32, msys2-64, none)
365370
endif
366371

367372
ifeq ($(ENABLE_LIBYOSYS),1)
@@ -971,17 +976,30 @@ docs/source/cmd/abc.rst: $(TARGETS) $(EXTRA_TARGETS)
971976
mkdir -p docs/source/cmd
972977
./$(PROGRAM_PREFIX)yosys -p 'help -write-rst-command-reference-manual'
973978

974-
PHONY: docs/gen_images docs/guidelines
979+
PHONY: docs/gen_examples docs/gen_images docs/guidelines docs/usage docs/reqs
980+
docs/gen_examples:
981+
$(Q) $(MAKE) -C docs examples
982+
975983
docs/gen_images:
976-
$(Q) $(MAKE) -C docs/images all
984+
$(Q) $(MAKE) -C docs images
977985

978986
DOCS_GUIDELINE_FILES := GettingStarted CodingStyle
979987
docs/guidelines:
980988
$(Q) mkdir -p docs/source/temp
981989
$(Q) cp -f $(addprefix guidelines/,$(DOCS_GUIDELINE_FILES)) docs/source/temp
982990

991+
# many of these will return an error which can be safely ignored, so we prefix
992+
# the command with a '-'
993+
DOCS_USAGE_PROGS := yosys yosys-config yosys-filterlib yosys-abc yosys-smtbmc yosys-witness
994+
docs/usage: $(addprefix docs/source/temp/,$(DOCS_USAGE_PROGS))
995+
docs/source/temp/%: docs/guidelines
996+
-$(Q) ./$(PROGRAM_PREFIX)$* --help > $@ 2>&1
997+
998+
docs/reqs:
999+
$(Q) $(MAKE) -C docs reqs
1000+
9831001
DOC_TARGET ?= html
984-
docs: docs/source/cmd/abc.rst docs/gen_images docs/guidelines
1002+
docs: docs/source/cmd/abc.rst docs/gen_examples docs/gen_images docs/guidelines docs/usage docs/reqs
9851003
$(Q) $(MAKE) -C docs $(DOC_TARGET)
9861004

9871005
clean:
@@ -1000,8 +1018,6 @@ clean:
10001018
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
10011019
rm -f tests/tools/cmp_tbdata
10021020
$(MAKE) -C docs clean
1003-
$(MAKE) -C docs/images clean
1004-
rm -rf docs/source/cmd docs/util/__pycache__
10051021

10061022
clean-abc:
10071023
$(MAKE) -C abc DEP= clean
@@ -1116,6 +1132,9 @@ echo-git-rev:
11161132
echo-abc-rev:
11171133
@echo "$(ABCREV)"
11181134

1135+
echo-cxx:
1136+
@echo "$(CXX)"
1137+
11191138
-include libs/*/*.d
11201139
-include frontends/*/*.d
11211140
-include passes/*/*.d

README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,17 @@ For Cygwin use the following command to install all prerequisites, or select the
105105

106106
setup-x86_64.exe -q --packages=bison,flex,gcc-core,gcc-g++,git,libffi-devel,libreadline-devel,make,pkg-config,python3,tcl-devel,boost-build,zlib-devel
107107

108-
To configure the build system to use a specific compiler, use one of
108+
The environment variable `CXX` can be used to control the C++ compiler used, or
109+
run one of the following:
109110

110111
$ make config-clang
111112
$ make config-gcc
112113

114+
Note that these will result in `make` ignoring the `CXX` environment variable,
115+
unless `CXX` is assigned in the call to make, e.g.
116+
117+
$ make CXX=$CXX
118+
113119
For other compilers and build configurations it might be
114120
necessary to make some changes to the config section of the
115121
Makefile.
@@ -610,10 +616,12 @@ Simply visit https://yosys.readthedocs.io/en/latest/ instead.
610616
In addition to those packages listed above for building Yosys from source, the
611617
following are used for building the website:
612618

613-
$ sudo apt-get install pdf2svg faketime
619+
$ sudo apt install pdf2svg faketime
614620

615621
PDFLaTeX, included with most LaTeX distributions, is also needed during the
616-
build process for the website.
622+
build process for the website. Or, run the following:
623+
624+
$ sudo apt install texlive-latex-base texlive-latex-extra latexmk
617625

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

0 commit comments

Comments
 (0)