Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add yosys-slang #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions default/rules/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'imctk',
'ghdl',
'ghdl-yosys-plugin',
'yosys-slang-plugin',
'nextpnr-generic',
'nextpnr-ice40',
'nextpnr-ecp5',
Expand Down
31 changes: 31 additions & 0 deletions default/rules/yosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
Empty file added default/scripts/slang.sh
Empty file.
8 changes: 8 additions & 0 deletions default/scripts/yosys-slang-plugin.sh
Original file line number Diff line number Diff line change
@@ -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/.