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
File.pm and Preproc.pm - Enhancement Request #813
Comments
Original Redmine Comment Looking at the current sources, there is a "parser" option passed to the read method of Netlist::File which was added since the version you based your patch upon. Can you see if this also solves your issue? |
Original Redmine Comment I don't see a "parser" option in 3.404, but I do make use of the "preproc" one. "preproc" passes the class name for the new object to be created (my derived class). The Preproc obj still needs a ref back to File obj. At one point I also thought it would be good to have a ref to the Preproc obj from File obj, but it turns out I don't need this. |
Original Redmine Comment Please make sure your $VERSION in that file is 3.404 or 3.405, the File.pm you sent is much older VERSION. Here's the change, which was first in 3.404. 585bc4d (Wilson Snyder 2014-05-02 12:37:46 -0400 441) my $parser_class = ($params{parser} || $netlist->{parser}); |
Original Redmine Comment Okay, now I see what you are talking about. This would let me pass in my own derived File::Parser class which could change the constructor to do what I need. I prefer not to do this, though. I don't like having to maintain my own copied versions of things, in this case the constructor. And because $preproc is a local var, I can't just call super new and then call $preproc->fileref(..) I guess one solution would be to make $preproc be a member of the File::Parser class instead of a private var. So I still think what I first described would be a nice thing to put in the base File::Parser class. |
Original Redmine Comment I added Verilog::Preproc->parent() and Verilog::Netlist::File->preproc() Fixed in git towards 3.405. Please test the git version, thanks. |
Original Redmine Comment In 3.406. |
Author Name: Ed Carstens
Original Redmine Issue: 813 from https://www.veripool.org
Original Date: 2014-08-28
Original Assignee: Wilson Snyder (@wsnyder)
I would like the following simple enhancement made to File.pm:
Add a method called 'set_fileref(fileref)' to Preproc.pm which sets {fileref} to a File object reference
In the constructor for File.pm add a call to this set_fileref method with $params{fileref} argument.
This allows me to make a derived Preproc class that has a ref to the File obj, which in turn has a ref
to Netlist obj, which I supplied with {parent} to point back to my Connect obj. Otherwise, one has to use
an ugly full Module reference to get data back to the Connect obj.
I do have my own modified version of File.pm I am using. Instead of modifying Preproc.pm, I have a derived
Preproc class. I uploaded File.pm.
The text was updated successfully, but these errors were encountered: