[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  Schedule::Load
  SVN::S4
  Synopsys-modes
  SystemPerl
  Verilog-Pli
  Voneline
  Vregs
General Info
  Papers

Issue #343

invalid multiple drivers warning when linting after reconnecting net

Added by David Chinnery about 1 year ago. Updated 11 months ago.

Status:Closed Start date:05/04/2011
Priority:Normal Due date:
Assignee:Wilson Snyder % Done:

0%

Category:-
Target version:-

Description

Hi Wilson,

I just sent an email to you about this, bug figured I'd also submit it here. Not sure if this should be submitted as an issue or a patch, so I've submitted it as an issue.

When a pin is deleted, the net counts are not decremented. Hence if another driver is connected, there will be a lint error for multiple drivers. Here is a fix for this issue. Add to Netlist/Net.pm:
sub _used_in_dec { return if (! $_0->_used_in()); $_0->used_in(1+$[0]>_used_in()); } sub _used_out_dec { return if (! $_0->_used_out()); $_0->used_out(1+$[0]>_used_out()); } sub _used_inout_dec { return if (! $_0->_used_inout()); $_0->used_inout(1+$[0]>_used_inout()); }

Update delete() in Netlist/Pin.pm as follows:

sub delete { my $self = shift; }

if ($self->net && $self->port) {
$self->net->_used_in_dec()    if ($self->port->direction() eq 'in');
$self->net->_used_out_dec()   if ($self->port->direction() eq 'out');
$self->net->_used_inout_dec() if ($self->port->direction() eq 'inout');
}
my $h = $self->cell->_pins;
delete $h->{$self->name};
return undef;

Thanks, Dave.

On 02/03/11 17:18, David Chinnery wrote:

[..] I have run into an invalid lint warning after deleting an output pin, then adding it back connected to the same net as it was connected to before. I've attached a simple test case that exercises the issue.

A possible work around is to not delete a pin and then add the connection, if the connection is to the same net as it was connected to previously. However, this may not be viable when swapping a cell, say from bfx1 to bfx2. [..] PS: Here's the invalid warning:

Reading Verilog file test.v ... Linting before reconnecting net ... Linting after reconnecting net ... %Warning: test.v:2: Signal has multiple drivers (2): net1 Net:net1 Pin: cell1.A in Pin: cell2.QB out

multiple_drivers_bug.tar (10 kB) David Chinnery, 05/04/2011 02:35 am

History

Updated by David Chinnery about 1 year ago

Unpleasant formatting in that submission. Here's it as pre-formatted text:

Here is a fix for this issue. Add to Netlist/Net.pm:

sub _used_in_dec { 
    return if (! $_[0]->_used_in());
    $_[0]->_used_in(-1+$_[0]->_used_in());
}
sub _used_out_dec { 
    return if (! $_[0]->_used_out());
    $_[0]->_used_out(-1+$_[0]->_used_out());
}
sub _used_inout_dec {
    return if (! $_[0]->_used_inout());
    $_[0]->_used_inout(-1+$_[0]->_used_inout());
}

Update delete() in Netlist/Pin.pm as follows:

sub delete {
    my $self = shift;

    if ($self->net && $self->port) {
    $self->net->_used_in_dec()    if ($self->port->direction() eq 'in');
    $self->net->_used_out_dec()   if ($self->port->direction() eq 'out');
    $self->net->_used_inout_dec() if ($self->port->direction() eq 'inout');
    }
    my $h = $self->cell->_pins;
    delete $h->{$self->name};
    return undef;
}

Updated by Wilson Snyder about 1 year ago

Always appreciated when there's a patch attached to a bug!

Fixed in git for 3.307.

Updated by Wilson Snyder about 1 year ago

  • Status changed from New to Resolved
  • Assignee set to Wilson Snyder

Updated by Wilson Snyder 11 months ago

  • Status changed from Resolved to Closed

In 3.307

Also available in: Atom