Instant callback returns the last lineno for multiple line instantiation
Added by Jeffrey Lin 7 months ago
This maybe a intended feature, but when I have a module instantiation like the following:
LINE1: module_name #( LINE2: .PARAM1 (), LINE3: .PARAM2 (), LINE4: ... LINE5: ) cell_name ( LINE6: );
the instant() callback returns ->lineno() = 5. It would be nice to have it return 1, at the line the instantiation begins.
Thanks, Jeffrey Lin
Replies (6)
RE: Instant callback returns the last lineno for multiple line instantiation - Added by Wilson Snyder 7 months ago
That's intentional because if you have multiple cells it might otherwise be confusing.
module_name cell_1 (...many lines...), cell_2 (...many lines...);
RE: Instant callback returns the last lineno for multiple line instantiation - Added by Jeffrey Lin 7 months ago
Thanks.
If it's not too much to ask, is there anyway that I can identify LINE1 in my example?
regards, Jeffrey Lin
RE: Instant callback returns the last lineno for multiple line instantiation - Added by Wilson Snyder 7 months ago
You could add a symbolCb that remembers the filelines in a hash for each last symbol, then look it up using the instance name when you get the instanceCb.
Or, change the source.
You should probably be warned that there are many other places where the fileline might not match the 'beginning' of a statement, but maybe you only care about cells.
If you are willing to explain more what you're after perhaps there's another way too.
RE: Instant callback returns the last lineno for multiple line instantiation - Added by Jeffrey Lin 7 months ago
Hi,
I'm writing a perl script to add a prefix to the name of all modules and all `define macros in a design hierarchy. It need to locate the module declarations, the module instantiations, and all macros. I'm only interested at the module name, hence the original question. I found that the SigParser.pm is the best fit for this task. If you think there is other tools that will do a better job for what I need, It would be very appreciated if you can suggest it to me.
Thank you very much for the help.
RE: Instant callback returns the last lineno for multiple line instantiation - Added by Wilson Snyder 7 months ago
Makes sense. I wouldn't think you would need the line number of the cell then; once you have all of the module names, can't you just globally replace each module name with the new module name in every file? (Or use vrename to do it for you.)
RE: Instant callback returns the last lineno for multiple line instantiation - Added by Jeffrey Lin 7 months ago
I think I'm going with your previous reply's suggest. I'll add a symbolCb to remember lineno of all the symbols in a hash. And I'll use moduleCb and InstantCb to identify all the module names in a file. Then I'll get all the lineno for each module name from the symbol lineno hash. This way, I'll have all the module names and the correct lineno for them.
Thank you very much for taking your precious time to answer my questions.
regards, Jeffrey Lin
(1-6/6)
![[logo]](/img/veripool_small.png)