diff --git a/default/rules/default.py b/default/rules/default.py index a1c2040..b937bf1 100644 --- a/default/rules/default.py +++ b/default/rules/default.py @@ -10,6 +10,7 @@ 'imctk', 'ghdl', 'ghdl-yosys-plugin', + 'yosys-slang-plugin', 'nextpnr-generic', 'nextpnr-ice40', 'nextpnr-ecp5', diff --git a/default/rules/yosys.py b/default/rules/yosys.py index 66aed4d..f86915f 100644 --- a/default/rules/yosys.py +++ b/default/rules/yosys.py @@ -16,6 +16,23 @@ license_file = 'LICENSE', ) +SourceLocation( + name = 'slang', + vcs = 'git', + location = 'https://github.com/MikePopoloski/slang', + revision = 'origin/master', + license_file = 'LICENSE', + license_build_only = True, +) + +SourceLocation( + name = 'yosys-slang-plugin', + vcs = 'git', + location = 'https://github.com/povik/yosys-slang', + revision = 'origin/master', + license_file = 'LICENSE', +) + SourceLocation( name = 'graphviz', vcs = 'git', @@ -54,6 +71,20 @@ arch = [ 'linux-x64', 'darwin-x64', 'darwin-arm64' ], ) +Target( + name = 'slang', + sources = [ 'slang'], + build_native = True, # using this for license only + license_build_only = True, +) + +Target( + name = 'yosys-slang-plugin', + sources = [ 'yosys-slang-plugin' ], + dependencies = [ 'yosys' ], + arch = [ 'linux-x64', 'linux-arm64', 'windows-x64' ], +) + SourceLocation( name = 'xdot', vcs = 'git', diff --git a/default/scripts/slang.sh b/default/scripts/slang.sh new file mode 100644 index 0000000..e69de29 diff --git a/default/scripts/yosys-slang-plugin.sh b/default/scripts/yosys-slang-plugin.sh new file mode 100644 index 0000000..046795e --- /dev/null +++ b/default/scripts/yosys-slang-plugin.sh @@ -0,0 +1,8 @@ +cd yosys-slang-plugin +sed -i 's/Windows.h/windows.h/g' third_party/slang/source/util/OS.cpp +sed -i 's,/yosyshq/share,../yosys/yosyshq/share,g' ../yosys/yosyshq/bin/yosys-config +sed -i 's,/yosyshq/include,../yosys/yosyshq/share/yosys/include,g' ../yosys/yosyshq/bin/yosys-config +sed -i 's,/yosyshq/lib,../yosys/yosyshq/lib,g' ../yosys/yosyshq/bin/yosys-config +make YOSYS_CONFIG=../yosys/yosyshq/bin/yosys-config +mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/share/yosys/plugins +cp -rf build/slang.so ${OUTPUT_DIR}${INSTALL_PREFIX}/share/yosys/plugins/.