veripool / verilog-perl

Verilog parser, preprocessor, and related tools for the Verilog-Perl package
https://www.veripool.org/verilog-perl
Artistic License 2.0
121 stars 34 forks source link

Question: Using comments at end of line in AUTOINST #1312

Closed veripoolbot closed 6 years ago

veripoolbot commented 6 years ago

Author Name: arun kumar Original Redmine Message: 2581 from https://www.veripool.org


Hi

Is there a way to add comment in an autoinst.

[[https://www.veripool.org/boards/15/topics/2488?r=2490#message-2490]] was a good technique.

But how to add to end of the port line.

For example

a u_a (
     .unconnected_port ( ), // spyglass disable Warning_unconnected_port
);

Thanks

veripoolbot commented 6 years ago

Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2018-07-05T19:22:33Z


Sorry, I don't understand, what you showed should work fine.

a u_a ( .unconnected_port ( ), // spyglass disable Warning_unconnected_port /AUTOINST/ etc );

veripoolbot commented 6 years ago

Original Redmine Comment Author Name: arun kumar Original Date: 2018-07-06T06:11:06Z


a AUTO_TEMPLATE (
         .unconnected_port ( ), // spyglass disable Warning_unconnected_port
); 

the above code results in the following

a u_a (
     .unconnected_port ( ), // Templated
     /*AUTOINST*/
     etc
);

Instead is there a way to add comments specific to a port in AUTO_TEMPLATE

a AUTO_TEMPLATE (
         .unconnected_port ( ), // print comment as "spyglass disable Warning_unconnected_port"
); 

so that following is the result


a u_a (
     .unconnected_port ( ), // spyglass disable Warning_unconnected_port
     /*AUTOINST*/
     etc
);
veripoolbot commented 6 years ago

Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2018-07-06T14:16:44Z


There is not a way to do this, sorry. An alternative methodology I advocate is:

/AUTOWIRE/ ... a AUTO_TEMPLATE ( .unconnected_port (_unconnected_wire ), );

Then teach your linter (or wrapper script) to automatically suppress any unconnected warnings which have "_unconnected" in their name.

The advantage of this is it makes the intent clear, and also the code would work with any lint tool without updating meta comments.