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

synth: Add yosys-slang option; demonstrate on Ibex #2875

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

povik
Copy link
Contributor

@povik povik commented Feb 25, 2025

Demonstrate integrating yosys-slang for direct read-in of SV sources

Cc @jeffng-or

Signed-off-by: Martin Povišer <povik@cutebit.org>
export VERILOG_INCLUDE_DIRS = \
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/vendor/lowrisc_ip/prim/rtl/

export USE_YOSYS_SLANG = 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've converted nangate45/ibex to use this option. I've kept Ibex at the same version (from Nov 2020) but replaced the pre-processed Verilog sources with the SystemVerilog originals

@povik
Copy link
Contributor Author

povik commented Feb 25, 2025

Leaving a note to update the bazel file for Ibex, I'm guessing it will now be

filegroup(
    name = "verilog",
    srcs = glob(include = ["*.v", "*.sv"]),
    visibility = ["//visibility:public"],
)

which will pick up both .v and .sv files, inclusive of subdirectories (until now it only had to pick up .v)

@maliberty
Copy link
Member

@oharboe see note about bazel

Copy link
Collaborator

@oharboe oharboe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Requests for change:

  1. rename variable to use SYNTH_ prefix, e.g. SYNTH_SLANG, for consistency
  2. add SYNTH_SLANG to flow/scripts/variables.yaml

Once this is in master, I'll do a round to clean up the bazel BUILD scripts.

For now, I maintain the ORFS bazel scripts outside of CI, we'll see what happens down the road.

@oharboe
Copy link
Collaborator

oharboe commented Feb 26, 2025

@maliberty @povik Has it been decided to ship the slang binary in the ORFS docker image?

If ORFS is to contain a test-case for slang and to offer a way to test slang, then I'm thinking that ./build_openroad.sh would need to support building slang for docker and local.

@povik
Copy link
Contributor Author

povik commented Feb 26, 2025

If ORFS is to contain a test-case for slang and to offer a way to test slang, then I'm thinking that ./build_openroad.sh would need to support building slang for docker and local.

Yes, if we go ahead with this we need to add yosys-slang to build_openroad.sh, the documentation, and other places.

@maliberty
Copy link
Member

I was thinking it would be a dependency installer addition. Do you think we need to put it in the ORFS build?

@oharboe
Copy link
Collaborator

oharboe commented Feb 26, 2025

I was thinking it would be a dependency installer addition. Do you think we need to put it in the ORFS build?

Will it get into the official ORFS docker image?

@povik
Copy link
Contributor Author

povik commented Feb 26, 2025

I was thinking it would be a dependency installer addition. Do you think we need to put it in the ORFS build?

I haven't realized it until now but we need to because it depends on Yosys, and Yosys is built as part of ORFS

@maliberty
Copy link
Member

Is slang separate from yosys-slang? Wondering if slang would be a dependency.

@povik
Copy link
Contributor Author

povik commented Feb 26, 2025

Yosys-slang compiles against a specific slang vesion and sometimes I have to do patches. It's a pinned submodule somewhat like openroad and opensta

@povik
Copy link
Contributor Author

povik commented Feb 26, 2025

To get a sense of the compilation runtime I compared it against Yosys just now:

Yosys

real	3m13.631s
user	21m27.703s
sys	0m45.744s

yosys-slang (inclusive of slang)

real	1m22.555s
user	6m57.400s
sys	0m20.017s

@jeffng-or
Copy link
Contributor

@povik , how do I pass additional options to yosys-slang? When I ran it standalone, I included -Wno-index-oob --ignore-assertions to get mempool_group to go through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants