Skip to content
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

invalid multiple drivers warning when linting after reconnecting net #343

Closed
veripoolbot opened this issue May 4, 2011 · 3 comments
Closed
Assignees

Comments

@veripoolbot
Copy link
Collaborator


Author Name: David Chinnery
Original Redmine Issue: 343 from https://www.veripool.org
Original Date: 2011-05-04
Original Assignee: Wilson Snyder (@wsnyder)


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

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: David Chinnery
Original Date: 2011-05-04T02:36:20Z


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;
}

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-05-10T03:18:16Z


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

Fixed in git for 3.307.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-06-22T20:44:13Z


In 3.307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants