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

Netlist module converts "supply" statements to "wire" #127

Closed
veripoolbot opened this issue Jan 5, 2007 · 0 comments
Closed

Netlist module converts "supply" statements to "wire" #127

veripoolbot opened this issue Jan 5, 2007 · 0 comments
Assignees

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Jeff Trull (@jefftrull)
Original Redmine Issue: 127 from https://www.veripool.org
Original Date: 2007-01-05
Original Assignee: Wilson Snyder (@wsnyder)


This bug was cloned from Perl-RT, rt24248.

Email addresses have have been truncated.

Id: 	24248
Status: 	resolved
Left: 	0 min
Queue: 	Verilog-Perl
Owner: 	Nobody
Requestors: 	jetrull <jetrull@>

Severity: 	Important
Broken in: 	2.361
X Attachments
supply01.diff

     * Fri Jan 05 18:38:34 2007 (658b) by jetrull

Fri Jan 05 18:38:34 2007 jetrull - Ticket created

Subject: 	Netlist module converts "supply" statements to "wire"

"supply0" and "supply1" statements frequently appear in netlists to
indicate nets that are connected to power supplies. Presently an input
such as:

supply1 Vdd;

will be silently converted to:

wire Vdd;

on output, resulting in an undriven net.

A patch is attached.

Regards,
Jeff Trull

Subject: 	supply01.diff

[text/x-patch 658b]
--- Verilog-Perl-2.361/Netlist/File.pm 2006-10-02 06:22:49.000000000 -0700
+++ Verilog-Perl-2.361-mrhack/Netlist/File.pm 2007-01-05 15:06:07.737060000 -0800
@@ -161,10 +161,14 @@
|| $inout eq "supply0" || $inout eq "supply1"
) {
my $net = $modref->find_net ($netname);
+ my $nettype = "wire";
+ if ($inout =~ /^supply\d/) {
+ $nettype = $inout;
+ }
$net or $net = $modref->new_net
(name=>$netname,
filename=>$self->filename, lineno=>$self->lineno,
- simple_type=>1, type=>'wire', array=>$array,
+ simple_type=>1, type=>$nettype, array=>$array,
comment=>undef, msb=>$msb, lsb=>$lsb,
signed=>$signed,
);

Tue Jan 09 11:25:34 2007 WSNYDER - Correspondence added

I think the proper fix is not to special case supply0/supply1, but
to always pass the declaration type to the caller. Here's the patch
I'll put in the next version. (Some tests change too; not included here.)

===================================================================
--- Netlist/File.pm (revision 29737)
+++ Netlist/File.pm (working copy)
@@ -164,10 +164,11 @@
$net or $net = $modref->new_net
(name=>$netname,
filename=>$self->filename, lineno=>$self->lineno,
- simple_type=>1, type=>'wire', array=>$array,
+ simple_type=>1, type=>$inout, array=>$array,
comment=>undef, msb=>$msb, lsb=>$lsb,
signed=>$signed,
);
+ $net->type($inout); # If it's already declared as in/out etc, mark
the type
$self->{_cmtref} = $net;
}
elsif ($inout =~ /(inout|in|out)(put|)$/) {

Tue Jan 09 11:25:36 2007 RT_System - Status changed from 'new' to 'open'

Tue Jan 09 11:25:40 2007 WSNYDER - Status changed from 'open' to 'resolved'

Tue Jan 09 11:37:41 2007 WSNYDER - Status changed from 'resolved' to 'open'

Tue Jan 09 11:37:52 2007 WSNYDER - Status changed from 'open' to 'resolved'

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