in reply to Verilog-Perl get verilog comment

I got it to work (on version 3.306, which is older than yours). First, you need to use "keep_comments=>1" in the constructor, as the Verilog::Netlist::Port POD states. Then, it seems like you also need to use the "net" method in conjunction with "comment", although I didn't find this documented. I used the "grep" CPAN feature to hunt that down:
my $nl = new Verilog::Netlist(keep_comments=>1); ... $pt->net->comment();
Data::Dumper is also handy to see if your comment was correctly parsed.

Update: 3 nov 2011: Related (same?) issue: http://www.veripool.org/issues/409-Verilog-Perl-Print-verilog-comment

Replies are listed 'Best First'.
Re^2: Verilog-Perl get verilog comment
by samb31 (Initiate) on Oct 29, 2011 at 19:53 UTC
    It works with net!
    In the doc of Verilog::Netlist::Port there is a description
    of the accessor "comment":
    $self->comment
    Returns any comments following the definition.
    keep_comments=>1 must be passed to Verilog::Netlist::new for comments to be retained
    Thanks again toolic!