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

Verilator won't inline modules that contain interfaces #1018

Closed
veripoolbot opened this issue Dec 23, 2015 · 5 comments
Closed

Verilator won't inline modules that contain interfaces #1018

veripoolbot opened this issue Dec 23, 2015 · 5 comments
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800

Comments

@veripoolbot
Copy link
Contributor


Author Name: Johan Bjork
Original Redmine Issue: 1018 from https://www.veripool.org
Original Date: 2015-12-22
Original Assignee: Johan Bjork


From V3Inline.cpp

     virtual void visit(AstVar* nodep, AstNUser*) {
	// Can't look at AstIfaceRefDType directly as it is no longer underneath the module
	if (nodep->isIfaceRef()) {
	    // Unsupported: Inlining of modules with ifaces (see AstIface comment above)
	    if (m_modp) cantInline("Interfaced",true);
	}
	nodep->iterateChildren(*this);
     }

Ideally verilator should support inlining modules that contain interfaces to improve both verilation/compilation time as well as runtime.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Johan Bjork
Original Date: 2015-12-25T05:28:31Z


I started working on this. Some tricky required to handle AstVarXRef's but nothing too terrible. patch draft here: https://github.com/phb/verilator-dev/tree/issue1018

Happy holidays everyone!

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-01-07T02:03:30Z


Surprisingly less code than I expected.

I think you need to m_renameInterfaces.clear() on each visit AstModule.

Also, for testing, for each of the exsting interface test .pl files please make a new _noinl.pl test file similar to e.g. t_inst_slice_noinl.pl. Otherwise we'll only be verifying the inliner version, and when the non-inline code drifts we'll soon get bug reports of large designs breaking because they didn't get inlined.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Johan Bjork
Original Date: 2016-01-21T04:19:48Z


Updated patch. From the first patch the main changes are

  1. Added noinl tests
  2. Ensure to clone the AstIfaceRefDType when needed, as it contains a link to the cell which now is cloned.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-01-22T00:14:09Z


Great, fixed in git towards 3.881.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-03-02T00:15:42Z


In 3.882.

@veripoolbot veripoolbot added resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800 labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800
Projects
None yet
Development

No branches or pull requests

1 participant