Skip to content

Commit

Permalink
Add yosys-slang
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Nov 15, 2024
1 parent fec25bc commit 085dd31
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
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/.

0 comments on commit 085dd31

Please sign in to comment.