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

Intenal Error of "Multiple root modules" happens if one of sub modules is not inlined when creating a protect lib. #1616

Closed
veripoolbot opened this issue Nov 29, 2019 · 6 comments
Assignees

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Nov 29, 2019


Author Name: Yutetsu TAKATSUKASA (@yTakatsukasa)
Original Redmine Issue: 1616 from https://www.veripool.org

Original Assignee: Todd Strader (@toddstrader)


First of all, thank you very much for maintaining and evolving the great software.

I am exploring --protect-lib to shorten the verilator runtime for a large design.
When I tried, I encountered Intenal Error of "Multiple root modules".
I can not share the actual design, so I made a tiny case to see the error.
The attached file is a small HDL to show the error.

I ran verilator as the following.

$ verilator --protect-lib tbp --top-module to_be_protected  --cc ./to_be_protected.sv

The error message is

%Error: Internal Error: to_be_protected.sv:10: ../V3ProtectLib.cpp:81: Multiple root modules
module to_be_protected  (input wire in, output wire out);
        ^~~~~~~~~~~~~~~
                         ... See the manual and https://verilator.org for more assistance.

As far as I tried, non-inlined module seems to cause the internal error because one of the following setting is necessary.

  • Adding /verilator no_inline_module/ comment
  • -O0 option

I tried the following versions and saw the error.
stable branch tag:verilator_4_022
master branch 3d6e8e9

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Nov 29, 2019


Original Redmine Comment
Author Name: Todd Strader (@toddstrader)
Original Date: 2019-11-29T23:21:09Z


Thanks for the example. I'll take a look.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Nov 30, 2019


Original Redmine Comment
Author Name: Todd Strader (@toddstrader)
Original Date: 2019-11-30T16:37:07Z


That check was overly aggressive when inlining. Here's my proposed solution:
https://github.com/toddstrader/verilator-dev/tree/protect-inline

Wilson: I'm guessing this sort of fix doesn't require a Changes entry. But please let me know if it does. Also, please let me know if this needs any changes before pushing.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 1, 2019


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-12-01T10:58:10Z


Todd, thanks for fixing. Feel free to push, you just need to init m_foundTop = false in the constructor.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 1, 2019


Original Redmine Comment
Author Name: Todd Strader (@toddstrader)
Original Date: 2019-12-01T13:02:22Z


m_foundTop is already in the constructor initializer list. Is it fine there or should I move it to the constructor's implementation?

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 1, 2019


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-12-01T16:01:44Z


Sorry, missed that, looks fine.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 2, 2019


Original Redmine Comment
Author Name: Todd Strader (@toddstrader)
Original Date: 2019-12-02T13:35:24Z


Fixed in git towards 4.024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.