@@ -1606,6 +1606,8 @@ sub expand_all_macros {
16061606 $self -> expand_macro(' FORINST' , \&expand_forinst);
16071607 $self -> expand_macro(' AUTOTOSTRING' , \&expand_autotostring);
16081608 $self -> expand_macro(' AUTOINC' , \&expand_includes);
1609+ # note: AUTONC should expand before AUTOINTERFACE, as it will change
1610+ # what ports are declared in AUTOINTERFACE.
16091611 $self -> expand_macro(' AUTONC' , \&expand_autonc);
16101612 # note: AUTOINTERFACE must expand before AUTONET, as it will change
16111613 # AUTONET's behavior.
@@ -2410,6 +2412,10 @@ sub expand_autonc($$) {
24102412 my @names = ();
24112413 my @tieoffs = ();
24122414 my @unused = ();
2415+ my $lint_unused_signals = " lint_unused_signals" ;
2416+ if ($macro =~ s / ^(.*)--signal=(\S +)/ $1 / ){
2417+ $lint_unused_signals = $2 ;
2418+ }
24132419 foreach my $line (split (/ \s *\n\s */ , $macro )) {
24142420 chomp ($line );
24152421 if ($line =~ m / ^\s *$ / ) {next ;}
@@ -2474,8 +2480,8 @@ sub expand_autonc($$) {
24742480 if (@unused ) {
24752481 @unused = sort @unused ;
24762482 if (@tieoffs ) { print " \n " ; }
2477- print " logic lint_unused_signals;\n " ;
2478- print " assign lint_unused_signals =\n " ;
2483+ print " logic ${ lint_unused_signals} ;\n " ;
2484+ print " assign ${ lint_unused_signals} =\n " ;
24792485 print " " ,join ((" ||\n " , map { " ($_ == '0)" } @unused ))," ;\n " ;
24802486 }
24812487}
0 commit comments