Skip to content

Commit 2df3a55

Browse files
authored
Merge branch 'YosysHQ:main' into master
2 parents bf05ff7 + 4a27d93 commit 2df3a55

File tree

96 files changed

+1905
-1028
lines changed

Some content is hidden

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

96 files changed

+1905
-1028
lines changed

Diff for: .github/actions/setup-build-env/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ runs:
88
shell: bash
99
run: |
1010
sudo apt-get update
11-
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
11+
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 libbz2-dev
1212
1313
- name: Install macOS Dependencies
1414
if: runner.os == 'macOS'

Diff for: .github/workflows/test-compile.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,15 @@ jobs:
3030
- ubuntu-latest
3131
compiler:
3232
# oldest supported
33-
- 'clang-14'
33+
- 'clang-10'
3434
- 'gcc-10'
3535
# newest, make sure to update maximum standard step to match
36-
- 'clang-18'
36+
- 'clang-19'
3737
- 'gcc-13'
3838
include:
3939
# macOS
4040
- os: macos-13
4141
compiler: 'clang'
42-
# oldest clang not available on ubuntu-latest
43-
- os: ubuntu-20.04
44-
compiler: 'clang-10'
4542
fail-fast: false
4643
steps:
4744
- name: Checkout Yosys
@@ -72,7 +69,7 @@ jobs:
7269
7370
# maximum standard, only on newest compilers
7471
- name: Build C++20
75-
if: ${{ matrix.compiler == 'clang-18' || matrix.compiler == 'gcc-13' }}
72+
if: ${{ matrix.compiler == 'clang-19' || matrix.compiler == 'gcc-13' }}
7673
shell: bash
7774
run: |
7875
make config-$CC_SHORT

Diff for: CHANGELOG

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22
List of major changes and improvements between releases
33
=======================================================
44

5-
Yosys 0.48 .. Yosys 0.49-dev
5+
Yosys 0.49 .. Yosys 0.50-dev
66
--------------------------
77

8+
Yosys 0.48 .. Yosys 0.49
9+
--------------------------
10+
* Various
11+
- "$scopeinfo" cells are now part of JSON export by default.
12+
- Added option to specify hierarchical separator for "flatten".
13+
- Improved "wreduce" to handle more cases of operator size reduction.
14+
- Updated hashing interface, see docs/source/yosys_internals/hashing.rst
15+
for breaking API changes.
16+
17+
* New commands and options
18+
- Added "-noscopeinfo" option to "json" and "write_json" pass.
19+
820
Yosys 0.47 .. Yosys 0.48
921
--------------------------
1022
* Various

Diff for: COPYING

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ISC License
22

3-
Copyright (C) 2012 - 2020 Claire Xenia Wolf <[email protected]>
3+
Copyright (C) 2012 - 2025 Claire Xenia Wolf <[email protected]>
44

55
Permission to use, copy, modify, and/or distribute this software for any
66
purpose with or without fee is hereby granted, provided that the above

Diff for: Makefile

+96-121
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
CONFIG := none
33
# CONFIG := clang
44
# CONFIG := gcc
5-
# CONFIG := afl-gcc
65
# CONFIG := wasi
7-
# CONFIG := mxe
86
# CONFIG := msys2-32
97
# CONFIG := msys2-64
108

@@ -155,7 +153,7 @@ ifeq ($(OS), Haiku)
155153
CXXFLAGS += -D_DEFAULT_SOURCE
156154
endif
157155

158-
YOSYS_VER := 0.48+0
156+
YOSYS_VER := 0.49+1
159157

160158
# Note: We arrange for .gitcommit to contain the (short) commit hash in
161159
# tarballs generated with git-archive(1) using .gitattributes. The git repo
@@ -171,7 +169,7 @@ endif
171169
OBJS = kernel/version_$(GIT_REV).o
172170

173171
bumpversion:
174-
sed -i "/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline aaa5347.. | wc -l`/;" Makefile
172+
sed -i "/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline 427b5a2.. | wc -l`/;" Makefile
175173

176174
ABCMKARGS = CC="$(CXX)" CXX="$(CXX)" ABC_USE_LIBSTDCXX=1 ABC_USE_NAMESPACE=abc VERBOSE=$(Q)
177175

@@ -265,16 +263,6 @@ ifeq ($(DISABLE_ABC_THREADS),1)
265263
ABCMKARGS += "ABC_USE_NO_PTHREADS=1"
266264
endif
267265

268-
else ifeq ($(CONFIG),afl-gcc)
269-
CXX = AFL_QUIET=1 AFL_HARDEN=1 afl-gcc
270-
CXXFLAGS += -std=$(CXXSTD) $(OPT_LEVEL)
271-
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H"
272-
273-
else ifeq ($(CONFIG),cygwin)
274-
CXX = g++
275-
CXXFLAGS += -std=gnu++11 $(OPT_LEVEL)
276-
ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H"
277-
278266
else ifeq ($(CONFIG),wasi)
279267
ifeq ($(WASI_SDK),)
280268
CXX = clang++
@@ -302,18 +290,6 @@ LINK_ABC := 1
302290
DISABLE_ABC_THREADS := 1
303291
endif
304292

305-
else ifeq ($(CONFIG),mxe)
306-
PKG_CONFIG = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-pkg-config
307-
CXX = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-g++
308-
CXXFLAGS += -std=$(CXXSTD) $(OPT_LEVEL) -D_POSIX_SOURCE -Wno-attributes
309-
CXXFLAGS := $(filter-out -fPIC,$(CXXFLAGS))
310-
LINKFLAGS := $(filter-out -rdynamic,$(LINKFLAGS)) -s
311-
LIBS := $(filter-out -lrt,$(LIBS))
312-
ABCMKARGS += ARCHFLAGS="-DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
313-
# TODO: Try to solve pthread linking issue in more appropriate way
314-
ABCMKARGS += LIBS="lib/x86/pthreadVC2.lib -s" LINKFLAGS="-Wl,--allow-multiple-definition" ABC_USE_NO_READLINE=1 CC="/usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc"
315-
EXE = .exe
316-
317293
else ifeq ($(CONFIG),msys2-32)
318294
CXX = i686-w64-mingw32-g++
319295
CXXFLAGS += -std=$(CXXSTD) $(OPT_LEVEL) -D_POSIX_SOURCE -DYOSYS_WIN32_UNIX_DIR
@@ -340,7 +316,7 @@ ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H $(ABC_ARCHFLAGS)"
340316
LTOFLAGS =
341317

342318
else
343-
$(error Invalid CONFIG setting '$(CONFIG)'. Valid values: clang, gcc, mxe, msys2-32, msys2-64, none)
319+
$(error Invalid CONFIG setting '$(CONFIG)'. Valid values: clang, gcc, msys2-32, msys2-64, none)
344320
endif
345321

346322

@@ -392,9 +368,6 @@ ifeq ($(LINK_TERMCAP),1)
392368
LIBS += -ltermcap
393369
ABCMKARGS += "ABC_READLINE_LIBRARIES=-lreadline -ltermcap"
394370
endif
395-
ifeq ($(CONFIG),mxe)
396-
LIBS += -ltermcap
397-
endif
398371
else
399372
ifeq ($(ENABLE_EDITLINE),1)
400373
CXXFLAGS += -DYOSYS_ENABLE_EDITLINE
@@ -443,17 +416,12 @@ TCL_INCLUDE ?= /usr/include/$(TCL_VERSION)
443416
TCL_LIBS ?= -l$(TCL_VERSION)
444417
endif
445418

446-
ifeq ($(CONFIG),mxe)
447-
CXXFLAGS += -DYOSYS_ENABLE_TCL
448-
LIBS += -ltcl86 -lwsock32 -lws2_32 -lnetapi32 -lz -luserenv
449-
else
450419
CXXFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --cflags tcl || echo -I$(TCL_INCLUDE)) -DYOSYS_ENABLE_TCL
451420
LIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs tcl || echo $(TCL_LIBS))
452421
ifneq (,$(findstring TCL_WITH_EXTERNAL_TOMMATH,$(CXXFLAGS)))
453422
LIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --silence-errors --libs libtommath || echo)
454423
endif
455424
endif
456-
endif
457425

458426
ifeq ($(ENABLE_GCOV),1)
459427
CXXFLAGS += --coverage
@@ -842,71 +810,101 @@ else
842810
ABCOPT=""
843811
endif
844812

845-
# When YOSYS_NOVERIFIC is set as a make variable, also export it to the
846-
# enviornment, so that `YOSYS_NOVERIFIC=1 make test` _and_
847-
# `make test YOSYS_NOVERIFIC=1` will run with verific disabled.
848-
ifeq ($(YOSYS_NOVERIFIC),1)
849-
export YOSYS_NOVERIFIC
850-
endif
851-
852-
test: $(TARGETS) $(EXTRA_TARGETS)
813+
# Tests that generate .mk with tests/gen-tests-makefile.sh
814+
MK_TEST_DIRS =
815+
MK_TEST_DIRS += tests/arch/anlogic
816+
MK_TEST_DIRS += tests/arch/ecp5
817+
MK_TEST_DIRS += tests/arch/efinix
818+
MK_TEST_DIRS += tests/arch/gatemate
819+
MK_TEST_DIRS += tests/arch/gowin
820+
MK_TEST_DIRS += tests/arch/ice40
821+
MK_TEST_DIRS += tests/arch/intel_alm
822+
MK_TEST_DIRS += tests/arch/machxo2
823+
MK_TEST_DIRS += tests/arch/microchip
824+
MK_TEST_DIRS += tests/arch/nanoxplore
825+
MK_TEST_DIRS += tests/arch/nexus
826+
MK_TEST_DIRS += tests/arch/quicklogic/pp3
827+
MK_TEST_DIRS += tests/arch/quicklogic/qlf_k6n10f
828+
MK_TEST_DIRS += tests/arch/xilinx
829+
MK_TEST_DIRS += tests/opt
830+
MK_TEST_DIRS += tests/sat
831+
MK_TEST_DIRS += tests/sim
832+
MK_TEST_DIRS += tests/svtypes
833+
MK_TEST_DIRS += tests/techmap
834+
MK_TEST_DIRS += tests/various
853835
ifeq ($(ENABLE_VERIFIC),1)
854-
ifeq ($(YOSYS_NOVERIFIC),1)
855-
@echo
856-
@echo "Running tests without verific support due to YOSYS_NOVERIFIC=1"
857-
@echo
858-
else
859-
+cd tests/verific && bash run-test.sh $(SEEDOPT)
860-
endif
861-
endif
862-
+cd tests/simple && bash run-test.sh $(SEEDOPT)
863-
+cd tests/simple_abc9 && bash run-test.sh $(SEEDOPT)
864-
+cd tests/hana && bash run-test.sh $(SEEDOPT)
865-
+cd tests/asicworld && bash run-test.sh $(SEEDOPT)
866-
# +cd tests/realmath && bash run-test.sh $(SEEDOPT)
867-
+cd tests/share && bash run-test.sh $(SEEDOPT)
868-
+cd tests/opt_share && bash run-test.sh $(SEEDOPT)
869-
+cd tests/fsm && bash run-test.sh $(SEEDOPT)
870-
+cd tests/techmap && bash run-test.sh
871-
+cd tests/memories && bash run-test.sh $(ABCOPT) $(SEEDOPT)
872-
+cd tests/memlib && bash run-test.sh $(SEEDOPT)
873-
+cd tests/bram && bash run-test.sh $(SEEDOPT)
874-
+cd tests/various && bash run-test.sh
875-
+cd tests/select && bash run-test.sh
876-
+cd tests/sat && bash run-test.sh
877-
+cd tests/sim && bash run-test.sh
878-
+cd tests/svinterfaces && bash run-test.sh $(SEEDOPT)
879-
+cd tests/svtypes && bash run-test.sh $(SEEDOPT)
880-
+cd tests/proc && bash run-test.sh
881-
+cd tests/blif && bash run-test.sh
882-
+cd tests/opt && bash run-test.sh
883-
+cd tests/aiger && bash run-test.sh $(ABCOPT)
884-
+cd tests/arch && bash run-test.sh
885-
+cd tests/arch/ice40 && bash run-test.sh $(SEEDOPT)
886-
+cd tests/arch/xilinx && bash run-test.sh $(SEEDOPT)
887-
+cd tests/arch/ecp5 && bash run-test.sh $(SEEDOPT)
888-
+cd tests/arch/machxo2 && bash run-test.sh $(SEEDOPT)
889-
+cd tests/arch/efinix && bash run-test.sh $(SEEDOPT)
890-
+cd tests/arch/anlogic && bash run-test.sh $(SEEDOPT)
891-
+cd tests/arch/gowin && bash run-test.sh $(SEEDOPT)
892-
+cd tests/arch/intel_alm && bash run-test.sh $(SEEDOPT)
893-
+cd tests/arch/nanoxplore && bash run-test.sh $(SEEDOPT)
894-
+cd tests/arch/nexus && bash run-test.sh $(SEEDOPT)
895-
+cd tests/arch/quicklogic/pp3 && bash run-test.sh $(SEEDOPT)
896-
+cd tests/arch/quicklogic/qlf_k6n10f && bash run-test.sh $(SEEDOPT)
897-
+cd tests/arch/gatemate && bash run-test.sh $(SEEDOPT)
898-
+cd tests/arch/microchip && bash run-test.sh $(SEEDOPT)
899-
+cd tests/rpc && bash run-test.sh
900-
+cd tests/memfile && bash run-test.sh
901-
+cd tests/verilog && bash run-test.sh
902-
+cd tests/xprop && bash run-test.sh $(SEEDOPT)
903-
+cd tests/fmt && bash run-test.sh
904-
+cd tests/cxxrtl && bash run-test.sh
836+
ifneq ($(YOSYS_NOVERIFIC),1)
837+
MK_TEST_DIRS += tests/verific
838+
endif
839+
endif
840+
MK_TEST_DIRS += tests/verilog
841+
842+
# Tests that don't generate .mk
843+
SH_TEST_DIRS =
844+
SH_TEST_DIRS += tests/simple
845+
SH_TEST_DIRS += tests/simple_abc9
846+
SH_TEST_DIRS += tests/hana
847+
SH_TEST_DIRS += tests/asicworld
848+
# SH_TEST_DIRS += tests/realmath
849+
SH_TEST_DIRS += tests/share
850+
SH_TEST_DIRS += tests/opt_share
851+
SH_TEST_DIRS += tests/fsm
852+
SH_TEST_DIRS += tests/memlib
853+
SH_TEST_DIRS += tests/bram
854+
SH_TEST_DIRS += tests/svinterfaces
855+
SH_TEST_DIRS += tests/xprop
856+
SH_TEST_DIRS += tests/select
857+
SH_TEST_DIRS += tests/proc
858+
SH_TEST_DIRS += tests/blif
859+
SH_TEST_DIRS += tests/arch
860+
SH_TEST_DIRS += tests/rpc
861+
SH_TEST_DIRS += tests/memfile
862+
SH_TEST_DIRS += tests/fmt
863+
SH_TEST_DIRS += tests/cxxrtl
905864
ifeq ($(ENABLE_FUNCTIONAL_TESTS),1)
906-
+cd tests/functional && bash run-test.sh
907-
endif
865+
SH_TEST_DIRS += tests/functional
866+
endif
867+
868+
# Tests that don't generate .mk and need special args
869+
SH_ABC_TEST_DIRS =
870+
SH_ABC_TEST_DIRS += tests/memories
871+
SH_ABC_TEST_DIRS += tests/aiger
872+
SH_ABC_TEST_DIRS += tests/alumacc
873+
874+
# seed-tests/ is a dummy string, not a directory
875+
.PHONY: seed-tests
876+
seed-tests: $(SH_TEST_DIRS:%=seed-tests/%)
877+
.PHONY: seed-tests/%
878+
seed-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
879+
+cd $* && bash run-test.sh $(SEEDOPT)
880+
+@echo "...passed tests in $*"
881+
882+
# abcopt-tests/ is a dummy string, not a directory
883+
.PHONY: abcopt-tests
884+
abcopt-tests: $(SH_ABC_TEST_DIRS:%=abcopt-tests/%)
885+
abcopt-tests/%: %/run-test.sh $(TARGETS) $(EXTRA_TARGETS)
886+
+cd $* && bash run-test.sh $(ABCOPT) $(SEEDOPT)
887+
+@echo "...passed tests in $*"
888+
889+
# makefile-tests/ is a dummy string, not a directory
890+
.PHONY: makefile-tests
891+
makefile-tests: $(MK_TEST_DIRS:%=makefile-tests/%)
892+
# this target actually emits .mk files
893+
%.mk:
894+
+cd $(dir $*) && bash run-test.sh
895+
# this one spawns submake on each
896+
makefile-tests/%: %/run-test.mk $(TARGETS) $(EXTRA_TARGETS)
897+
$(MAKE) -C $* -f run-test.mk
898+
+@echo "...passed tests in $*"
899+
900+
test: makefile-tests abcopt-tests seed-tests
908901
@echo ""
909902
@echo " Passed \"make test\"."
903+
ifeq ($(ENABLE_VERIFIC),1)
904+
ifeq ($(YOSYS_NOVERIFIC),1)
905+
@echo " Ran tests without verific support due to YOSYS_NOVERIFIC=1."
906+
endif
907+
endif
910908
@echo ""
911909

912910
VALGRIND ?= valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes --errors-for-leak-kinds=all
@@ -1101,19 +1099,6 @@ vcxsrc: $(GENFILES) $(EXTRA_TARGETS)
11011099
zip -r yosys-win32-vcxsrc-$(YOSYS_VER).zip yosys-win32-vcxsrc-$(YOSYS_VER)/
11021100
rm -f srcfiles.txt kernel/version.cc
11031101

1104-
ifeq ($(CONFIG),mxe)
1105-
mxebin: $(TARGETS) $(EXTRA_TARGETS)
1106-
rm -rf yosys-win32-mxebin-$(YOSYS_VER){,.zip}
1107-
mkdir -p yosys-win32-mxebin-$(YOSYS_VER)
1108-
cp -r $(PROGRAM_PREFIX)yosys.exe share/ yosys-win32-mxebin-$(YOSYS_VER)/
1109-
ifeq ($(ENABLE_ABC),1)
1110-
cp -r $(PROGRAM_PREFIX)yosys-abc.exe abc/lib/x86/pthreadVC2.dll yosys-win32-mxebin-$(YOSYS_VER)/
1111-
endif
1112-
echo -en 'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-$(YOSYS_VER)/readme.txt
1113-
echo -en 'Documentation at https://yosyshq.net/yosys/.\r\n' >> yosys-win32-mxebin-$(YOSYS_VER)/readme.txt
1114-
zip -r yosys-win32-mxebin-$(YOSYS_VER).zip yosys-win32-mxebin-$(YOSYS_VER)/
1115-
endif
1116-
11171102
config-clean: clean
11181103
rm -f Makefile.conf
11191104

@@ -1129,9 +1114,6 @@ config-gcc-static: clean
11291114
echo 'ENABLE_READLINE := 0' >> Makefile.conf
11301115
echo 'ENABLE_TCL := 0' >> Makefile.conf
11311116

1132-
config-afl-gcc: clean
1133-
echo 'CONFIG := afl-gcc' > Makefile.conf
1134-
11351117
config-wasi: clean
11361118
echo 'CONFIG := wasi' > Makefile.conf
11371119
echo 'ENABLE_TCL := 0' >> Makefile.conf
@@ -1140,10 +1122,6 @@ config-wasi: clean
11401122
echo 'ENABLE_READLINE := 0' >> Makefile.conf
11411123
echo 'ENABLE_ZLIB := 0' >> Makefile.conf
11421124

1143-
config-mxe: clean
1144-
echo 'CONFIG := mxe' > Makefile.conf
1145-
echo 'ENABLE_PLUGINS := 0' >> Makefile.conf
1146-
11471125
config-msys2-32: clean
11481126
echo 'CONFIG := msys2-32' > Makefile.conf
11491127
echo "PREFIX := $(MINGW_PREFIX)" >> Makefile.conf
@@ -1152,9 +1130,6 @@ config-msys2-64: clean
11521130
echo 'CONFIG := msys2-64' > Makefile.conf
11531131
echo "PREFIX := $(MINGW_PREFIX)" >> Makefile.conf
11541132

1155-
config-cygwin: clean
1156-
echo 'CONFIG := cygwin' > Makefile.conf
1157-
11581133
config-gcov: clean
11591134
echo 'CONFIG := gcc' > Makefile.conf
11601135
echo 'ENABLE_GCOV := 1' >> Makefile.conf
@@ -1183,5 +1158,5 @@ echo-cxx:
11831158
-include kernel/*.d
11841159
-include techlibs/*/*.d
11851160

1186-
.PHONY: all top-all abc test install install-abc docs clean mrproper qtcreator coverage vcxsrc mxebin
1187-
.PHONY: config-clean config-clang config-gcc config-gcc-static config-afl-gcc config-gprof config-sudo
1161+
.PHONY: all top-all abc test install install-abc docs clean mrproper qtcreator coverage vcxsrc
1162+
.PHONY: config-clean config-clang config-gcc config-gcc-static config-gprof config-sudo

0 commit comments

Comments
 (0)