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

Explicit hierarchical reference not resolving in Verilog::Net (CELL outside of module definition) #537

Closed
veripoolbot opened this issue Jul 26, 2012 · 4 comments

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Brian Mokrzycki
Original Redmine Issue: 537 from https://www.veripool.org
Original Date: 2012-07-26


This is a continuation of a previous issue described in the user forum, found at:

http://www.veripool.org/boards/18/topics/show/887-Verilog-Perl-bind-operator

After the resolution of the previous issue a new issue became apparent where the explicitly named path of the target module to be bound to is not resolving correctly, even though it's both valid systemverilog and a valid path to the target module. I've created a set of source files to highlight the issue.



After downloading the source

$> tar xvzf fcov-example.tar.gz
$> cd fcov-example
$> vhier example_top.v example_fcov.v

%Error: example_fcov.v:16: CELL outside of module definition


This bug was observed on Git hash 6f7ed3a
@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-07-26T22:41:09Z


Oh, no Verilog-Perl doesn't actually do anything with the bind. At the moment I unfortunately don't have the time to fix it, but if you'd like to it should be straight forward-ish and I'll take the patch:

Add a new bind callback routine in callbackgen. Then have File.pm get that callback and register it in the per-Module.pm structure. In the Module.pm link routine, iterate over the registered binds, find the appropriate scope, and add the appropriate Cell substructures.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Brian Mokrzycki
Original Date: 2012-07-28T20:59:48Z


What do you mean by 'register it in the per-Module.pm'? I've done the first few steps but have no figured out how to register the callback. I have noticed that there are callbacks in the Bison grammar file (VParseBison.y), is this what you meant?

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-07-28T23:22:41Z


Sorry was too brief.

After you add the new callback name to callbackgen, have VParseBison.y call it similar to the other callbacks but in the action of the rule where yBIND is. Add a "empty" callback to SigParser.pm, this is just a guide so people can see what the callbacks are. Compiling with "make" should work. "make test" should fail on test 35 at least, you can run just that test with "t/35_sigparser.t". That test should fail because it will miscompare with t/35_sigparser.out as you added the new callback, you'll see the test output listing the new callback with the appropriate parameters you passed. Make sure all the information you will need is listed.

Then in File.pm (which inherits SigParser) make a callback to receive the new bind callback. This call into a new Module.pm structure method that adds the bind. Now a module knows what's bound, and the last step as said before is to have link use that to link the module - see how Module's _link deals with cells now it should be similar for bound cells.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-05-30T00:37:32Z


Closing due to age - if you implemented something for this patches are always accepted.

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

No branches or pull requests

1 participant