-
Notifications
You must be signed in to change notification settings - Fork 422
Switching from Synlig to Yosys-Slang #3181
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
Conversation
…stall with vtr when enabled with the cmake parameter -DSLANG_SYSTEMVERILOG=ON
…ultiple .sv files instead of single flattened .sv files (with the exception of the f4pga_pulse_width_led test since it uses .v files instead of .sv)
…oaded in when not enabled.
…log with yosys-slang
@petergrossmann21 - I ran tests with yosys-slang enabled on the benchmarks you listed in this PR #2885. Some of these benchmarks made it through the entire flow and passed while others failed at read_slang in Yosys or failed at the VPR stage. There are also many other benchmarks not in the list that also failed with yosys-slang. Whenever you're available Peter I'll need help with HDL file cleanup for this. Passing VPR Benchmarks:
Failing VPR Benchmarks:
I have not tried koios yet since the benchmarks take a long time to run, but I'm sure I will see similar results. |
…ng in synthesis.tcl to another .tcl (slang_filelist.tcl) to make synthesis.tcl more readable
…system. Updated golden results for SystemVerilog reg tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @loglav03 thank you so much for this PR! The CI test you added is exactly what I had in mind. Great job!
Some comments below.
libs/EXTERNAL/CMakeLists.txt
Outdated
|
||
# Ensure dependencies like Yosys are built first | ||
DEPENDS yosys # Ensure submodule sync runs before synlig build | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build ${SLANG_BUILD_DIR} -- -j${PROCESSOR_COUNT} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually uses -j1 if I remove the "-j${PROCESSOR_COUNT}". I get this when I remove it:
gmake[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
SOURCE_DIR ${SLANG_SRC_DIR} | ||
BINARY_DIR ${SLANG_BUILD_DIR} | ||
|
||
#Disabling UndrivenPass in slang_frontend.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some more comments here as to why we need to patch slang. Is this something that we can bring back to the slang master? Or is there something integral to VTR that causes problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I currently have it patching slang to disable the UndrivenPass because it was failing benchmarks due to unsupported synchronous rules in vtr_primitives.v and wouldn't let me run any benchmark with read_slang without disabling that pass.
I believe Peter is working on this in his work to clean up benchmarks to be compatible with read_slang. So if that ends up being fixed, I'll probably be able to remove the patch step for slang. I think we can leave this in for now just so the CI is able to pass the SystemVerilog reg test.
vtr_flow/tasks/regression_tests/vtr_reg_system_verilog/task_list.txt
Outdated
Show resolved
Hide resolved
…ated golden results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for resolving my prior comments! I appreciate it. This PR is looking very close to being able to be merged. I just have two final comments:
First, regarding the "-j" issue. When you remove it, it was asking you to prefix your call to the make subprocess with "+". So that would look like BUILD_COMMAND +${CMAKE_COMMAND} ...
. This should enable the job server of our CMake to communicate with the sub-cmake that you are calling. I wonder if this is the cause of the multiple builds we are seeing for the Yosys build? May be worth looking into. But for this PR, can you please remove the -j...
option and prepend the build command with +
. I want to avoid confusing warnings from showing up to users of VTR.
Second, thank you for adding back the koios SV regression test. It is actually very common to forget this. I actually made a CI test to check for this type of thing automatically. I only have it run on currently run test suites. Can you please add vtr_reg_system_verilog
to this config file:
{ | |
"name": "vtr_reg_valgrind_small", | |
"ignored_tasks": [] | |
}, |
I do not think you need to mark any tests as ignored, so you can just copy the entry for vtr_reg_valgrind_small
…stem_verilog to vtr test suite verifier
@AlexandreSinger All comments should be resolved now! Simply adding a + to the build_command for slang didn't work so I had to find a workaround for it. It should be inheriting threads properly now without emitting a warning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Replaced Synlig/Surelog with the Yosys-Slang plugin for Yosys for reading SystemVerilog.
Yosys-Slang is installed by default in the build system and depends on Yosys. To use Yosys-Slang as the parser instead of the default Yosys parser, add the '-parser slang' option at the end of your 'run_vtr_flow.py <circuit> <arch>' or add it to the script parameters in the config file for regression test suites.
Yosys-Slang can be used to parse both verilog and SystemVerilog but may require specific syntax when parsing with verilog.
If you disable the cmake param "-DWITH_PARMYS" you should also disable the "-DSLANG_SYSTEMVERILOG" param as well to avoid cmake errors.
Related Issue
Motivation and Context
Synlig has a lot of overhead when building with the vtr build system leading to issues when building in CI and sometimes locally. Synlig is also poorly maintained. Yosys-Slang has significantly less overhead, can easily be implemented as a plugin for yosys, and is regularly maintained.
How Has This Been Tested?
Has been tested with the vtr_reg_system_verilog tests [PASSED]
Types of changes
Checklist: