Skip to content

Integrate yosys-slang #3076

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

Merged
merged 16 commits into from
May 5, 2025
Merged

Conversation

povik
Copy link
Contributor

@povik povik commented Apr 14, 2025

Add yosys-slang as a submodule and provide SYNTH_USE_SLANG option.

Changes from #2875 (now superseded):

  • new VERILOG_DEFINES variable piped into both yosys-slang and Yosys frontend
  • split RTLIL_FILE from VERILOG_FILES
  • updated yosys-slang with build system changes
  • convert all Ibex configs

I've tested with @jeffng-or's cva6 config from #2939

@povik povik added the do not merge This PR is not intended to be merged label Apr 14, 2025
@povik
Copy link
Contributor Author

povik commented Apr 14, 2025

Marking this as do not merge pending the resolution of povik/yosys-slang#120 which breaks build_openroad.sh --local

EDIT: resolved

@oharboe
Copy link
Collaborator

oharboe commented Apr 15, 2025

non-sequitor:

Longer term I'd like to see builds moved to bazel where there's no need to add submodules, just specify version and URLs + any patches of dependencies in MODULE.bazel.

@povik
Copy link
Contributor Author

povik commented Apr 15, 2025

Because we've reordered commands in the synthesis script, the change impacts non-slang designs too. mock-array fails with the following. Should I package a reproducer?

asap7 mock-array (base)
 Last log file 5_1_grt.log
 Found 2 errors in the logs.
     [ERROR DRT-0073] No access point for ces_1_0/io_ins_left[10].
     [ERROR DRT-0073] No access point for ces_0_0/io_ins_left[10].

@oharboe
Copy link
Collaborator

oharboe commented Apr 15, 2025

Because we've reordered commands in the synthesis script, the change impacts non-slang designs too. mock-array fails with the following. Should I package a reproducer?

asap7 mock-array (base)
 Last log file 5_1_grt.log
 Found 2 errors in the logs.
     [ERROR DRT-0073] No access point for ces_1_0/io_ins_left[10].
     [ERROR DRT-0073] No access point for ces_0_0/io_ins_left[10].

My thinking is that this is already reported The-OpenROAD-Project/OpenROAD#6991

@povik
Copy link
Contributor Author

povik commented Apr 15, 2025

Thanks, looks to be the same issue

@povik povik requested a review from oharboe April 15, 2025 09:08
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.

Not too many comments...

How about leaving src/ibex unmodified and adding a src/ibex_sv?

Those really are different test cases and it could be interesting to do an A/B comparison in the future.

@povik
Copy link
Contributor Author

povik commented Apr 15, 2025

What's there to test? I don't want to support sv2v processed sources when I'm already aware of the drawbacks of that method, and it's the motivation behind yosys-slang existence. I'll let @maliberty make the call.

@oharboe
Copy link
Collaborator

oharboe commented Apr 15, 2025

I see. I would consider using a new folder name as it is not a new version of the same, but something completely new.

@povik
Copy link
Contributor Author

povik commented Apr 15, 2025

To report here's how Ibex QoR is impacted by the switch (base: sv2v+read_verilog/test: yosys-slang)

asap7
Screenshot 2025-04-15 at 11 30 11

ihp-sg13g2
Screenshot 2025-04-15 at 11 31 31

nangate45
Screenshot 2025-04-15 at 11 32 02

gf180
Screenshot 2025-04-15 at 11 30 51

sky130hd
Screenshot 2025-04-15 at 11 32 30

sky130hs
Screenshot 2025-04-15 at 11 34 33

@povik
Copy link
Contributor Author

povik commented Apr 15, 2025

I would consider using a new folder name as it is not a new version of the same, but something completely new.

It should be the same design in the same version with a changed flow (instead of sv2v+read_verilog we do read_slang). In any case we can put the sources into a new folder.

@povik povik removed the do not merge This PR is not intended to be merged label Apr 16, 2025
@povik povik marked this pull request as ready for review April 16, 2025 12:07
povik added 11 commits May 2, 2025 16:17
Signed-off-by: Martin Povišer <povik@cutebit.org>
Add option to read the design via yosys-slang. Reorder read_liberty
ahead of design read-in so that Liberty cell definitions are
available when elaborating.

Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
@povik povik force-pushed the synth-yosys-slang branch from b0db29a to aeadf19 Compare May 2, 2025 14:28
@jeffng-or
Copy link
Contributor

@povik, we might have talked about this a while back, but I can't remember. But, can we change the flow variable SYNTH_USE_SLANG to something that could be used for both yosys-slang and Verific? In other words, something like SYNTH_SV_FRONTEND which could be yosys-slang or verific (can default to yosys-slang).

@povik
Copy link
Contributor Author

povik commented May 2, 2025

@jeffng-or Definitely. Let me make the change

povik added 2 commits May 2, 2025 21:08
Signed-off-by: Martin Povišer <povik@cutebit.org>
Signed-off-by: Martin Povišer <povik@cutebit.org>
@povik povik requested review from maliberty and jeffng-or May 2, 2025 20:50
@povik povik added the UpdateRules Starts GHA to update rules label May 2, 2025
@maliberty
Copy link
Member

I see. I would consider using a new folder name as it is not a new version of the same, but something completely new.

Is this truly something new or just the same thing in sv instead of v? I won't hold up this PR but I am unclear if this rename was needed.

@maliberty maliberty enabled auto-merge May 2, 2025 23:17
@openroad-ci openroad-ci removed the UpdateRules Starts GHA to update rules label May 3, 2025
@povik povik added the UpdateRules Starts GHA to update rules label May 3, 2025
@openroad-ci openroad-ci removed the UpdateRules Starts GHA to update rules label May 3, 2025
povik added 2 commits May 5, 2025 10:18
designs/gf180/ibex/rules-base.json updates:
| Metric                                        | Old      | New      | Type     |
| ------                                        | ---      | ---      | ----     |
| detailedroute__route__drc_errors              |        0 |        2 | Failing  |
| finish__timing__setup__ws                     |    -1.58 |    -1.31 | Tighten  |
| finish__timing__drv__setup_violation_count    |     1013 |      785 | Tighten  |
| finish__timing__wns_percent_delay             |    -21.3 |   -18.32 | Tighten  |

designs/ihp-sg13g2/ibex/rules-base.json updates:
| Metric                                        | Old      | New      | Type     |
| ------                                        | ---      | ---      | ----     |
| globalroute__antenna_diodes_count             |     1215 |      468 | Tighten  |
| detailedroute__route__wirelength              |  1304850 |  1195027 | Tighten  |
| detailedroute__antenna__violating__nets       |       48 |       42 | Tighten  |
| finish__timing__setup__ws                     |    -0.55 |     -1.1 | Failing  |
| finish__design__instance__area                |   646738 |   645780 | Tighten  |
| finish__timing__drv__setup_violation_count    |     1056 |      986 | Tighten  |

designs/sky130hd/microwatt/rules-base.json updates:
| Metric                                        | Old      | New      | Type     |
| ------                                        | ---      | ---      | ----     |
| detailedroute__route__wirelength              |  9717698 | 11718141 | Failing  |
| detailedroute__antenna__violating__nets       |        5 |        1 | Tighten  |
| finish__timing__setup__ws                     |    -3.56 |    -2.44 | Tighten  |
| finish__timing__wns_percent_delay             |   -21.23 |   -20.52 | Tighten  |

Signed-off-by: Martin Povišer <povik@cutebit.org>
auto-merge was automatically disabled May 5, 2025 08:22

Head branch was pushed to by a user without write access

Signed-off-by: Martin Povišer <povik@cutebit.org>
@maliberty maliberty enabled auto-merge May 5, 2025 13:43
@maliberty maliberty merged commit 4ec37c3 into The-OpenROAD-Project:master May 5, 2025
7 checks passed
@povik
Copy link
Contributor Author

povik commented May 5, 2025

Hooray! Now we can enable asap7/cva6 in the CI. I'm not sure about the steps required.

@maliberty
Copy link
Member

What is the runtime for asap7/cva6?

@povik
Copy link
Contributor Author

povik commented May 5, 2025

Jeff reported 50 minutes for the full flow

@povik povik deleted the synth-yosys-slang branch May 5, 2025 14:57
@jeffng-or
Copy link
Contributor

Nice! A few post-merge notes:

  1. I noticed that if you build_openroad.sh twice, the following slang files get re-compiled:
[ 94%] Building CXX object src/CMakeFiles/yosys-slang.dir/abort_helpers.cc.o
[ 94%] Building CXX object src/CMakeFiles/yosys-slang.dir/async_pattern.cc.o
[ 95%] Building CXX object src/CMakeFiles/yosys-slang.dir/blackboxes.cc.o
[ 96%] Building CXX object src/CMakeFiles/yosys-slang.dir/builder.cc.o
[ 97%] Building CXX object src/CMakeFiles/yosys-slang.dir/diag.cc.o
[ 98%] Building CXX object src/CMakeFiles/yosys-slang.dir/naming.cc.o
[ 99%] Building CXX object src/CMakeFiles/yosys-slang.dir/slang_frontend.cc.o
  1. nangate45/mempool_group run time is ~1h45m
  2. asap7/cva6 run time is ~54m
  3. I'll work with the DevOps team to get both enabled in CI

@povik
Copy link
Contributor Author

povik commented May 6, 2025

  1. I noticed that if you build_openroad.sh twice, the following slang files get re-compiled:

I confirm seeing the same on my end. I'll take a look.

@povik
Copy link
Contributor Author

povik commented May 6, 2025

The cause is Yosys headers getting updated so yosys-slang sees it needs to recompile all the .cc which depend on them. This should be fixable inside Yosys by adjusting the install script.

eder-matheus added a commit to eder-matheus/OpenROAD-flow-scripts that referenced this pull request May 6, 2025
…-yosys-slang"

This reverts commit 4ec37c3, reversing
changes made to ac59028.
eder-matheus added a commit to eder-matheus/OpenROAD-flow-scripts that referenced this pull request May 6, 2025
…-yosys-slang"

This reverts commit 4ec37c3, reversing
changes made to ac59028.

Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
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.

5 participants