mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-25 11:26:22 +00:00
Migrate build system to CMake
See #5895 for details. This commit does not include CI or documentation changes.
This commit is contained in:
parent
9d0cdb8551
commit
9b087b4aa7
207 changed files with 5202 additions and 2294 deletions
9
misc/cmake/check_missing_depends.sh
Normal file
9
misc/cmake/check_missing_depends.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Builds each Yosys component individually to make sure there aren't any missing static dependencies.
|
||||
# Checking for dynamic dependencies would involve running the testsuite, which is much slower.
|
||||
|
||||
set -e
|
||||
cmake .. -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_LINKER_TYPE=LLD
|
||||
for comp in $(ninja --quiet print-yosys-components); do
|
||||
cmake . -DCOMPONENTS=$comp
|
||||
ninja --quiet yosys
|
||||
done
|
||||
29
misc/cmake/script_pass_depends.py
Normal file
29
misc/cmake/script_pass_depends.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
"""Extracts a list of requirements from a `ScriptPass` command.
|
||||
|
||||
Not entirely accurate, but very easy to implement. Should probably be replaced with an implementation
|
||||
in the kernel that performs the same extraction in a principled way.
|
||||
"""
|
||||
|
||||
import re
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
for name in sys.argv[1:]:
|
||||
output = subprocess.check_output(["./yosys", "-QT", "-p", f"help {name}"], encoding="ascii")
|
||||
header = False
|
||||
passes = []
|
||||
for line in output.splitlines():
|
||||
if line == "The following commands are executed by this synthesis command:":
|
||||
header = True
|
||||
continue
|
||||
if header:
|
||||
if m := re.match(r"^ \s*(\w+)", line):
|
||||
passes.append(m[1])
|
||||
if not header:
|
||||
print(output)
|
||||
sys.exit(1)
|
||||
print()
|
||||
print(f"===> {name}")
|
||||
for p in sorted(set(passes)):
|
||||
print(f"\t\t{p}")
|
||||
print()
|
||||
Loading…
Add table
Add a link
Reference in a new issue