r57297 - in /trunk/libverilog-perl: ./ Netlist/ Parser/ Preproc/ debian/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sun May 2 02:55:53 UTC 2010


Author: jawnsy-guest
Date: Sun May  2 02:55:46 2010
New Revision: 57297

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57297
Log:
New upstream release

Added:
    trunk/libverilog-perl/t/60_vpassert.out
      - copied unchanged from r57291, branches/upstream/libverilog-perl/current/t/60_vpassert.out
Modified:
    trunk/libverilog-perl/Changes
    trunk/libverilog-perl/EditFiles.pm
    trunk/libverilog-perl/Getopt.pm
    trunk/libverilog-perl/Language.pm
    trunk/libverilog-perl/MANIFEST
    trunk/libverilog-perl/META.yml
    trunk/libverilog-perl/Netlist.pm
    trunk/libverilog-perl/Netlist/Cell.pm
    trunk/libverilog-perl/Netlist/ContAssign.pm
    trunk/libverilog-perl/Netlist/File.pm
    trunk/libverilog-perl/Netlist/Interface.pm
    trunk/libverilog-perl/Netlist/ModPort.pm
    trunk/libverilog-perl/Netlist/Module.pm
    trunk/libverilog-perl/Netlist/Net.pm
    trunk/libverilog-perl/Netlist/Pin.pm
    trunk/libverilog-perl/Netlist/Port.pm
    trunk/libverilog-perl/Netlist/Subclass.pm
    trunk/libverilog-perl/Parser/Parser.pm
    trunk/libverilog-perl/Parser/SigParser.pm
    trunk/libverilog-perl/Parser/VParse.h
    trunk/libverilog-perl/Parser/bisonpre
    trunk/libverilog-perl/Parser/callbackgen
    trunk/libverilog-perl/Preproc/Preproc.pm
    trunk/libverilog-perl/Preproc/VPreproc.cpp
    trunk/libverilog-perl/Preproc/VPreprocLex.h
    trunk/libverilog-perl/Preproc/VPreprocLex.l
    trunk/libverilog-perl/Std.pm
    trunk/libverilog-perl/debian/changelog
    trunk/libverilog-perl/t/60_vpassert.t
    trunk/libverilog-perl/vhier
    trunk/libverilog-perl/vpassert
    trunk/libverilog-perl/vppreproc
    trunk/libverilog-perl/vrename

Modified: trunk/libverilog-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Changes?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Changes (original)
+++ trunk/libverilog-perl/Changes Sun May  2 02:55:46 2010
@@ -2,6 +2,14 @@
 
 The contributors that suggested a given feature are shown in [].  [by ...]
 indicates the contributor was also the author of the fix; Thanks!
+
+* Verilog::Language 3.241 2010/05/01
+
+***	Add vpassert --call-* switches to use user's PLI display functions.
+
+****	Disable Parser unreadback() data during std:: parsing. [Mark Nodine]
+
+****	Fix preprocessing some DOS carriage returns, broke in 3.240.
 
 * Verilog::Language 3.240 2010/03/29
 

Modified: trunk/libverilog-perl/EditFiles.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/EditFiles.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/EditFiles.pm (original)
+++ trunk/libverilog-perl/EditFiles.pm Sun May  2 02:55:46 2010
@@ -13,7 +13,7 @@
 ######################################################################
 #### Configuration Section
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 #######################################################################
 # CONSTRUCTORS

Modified: trunk/libverilog-perl/Getopt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Getopt.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Getopt.pm (original)
+++ trunk/libverilog-perl/Getopt.pm Sun May  2 02:55:46 2010
@@ -16,7 +16,7 @@
 ######################################################################
 #### Configuration Section
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 # Basenames we should ignore when recursing directories,
 # Because they contain large files of no relevance

Modified: trunk/libverilog-perl/Language.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Language.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Language.pm (original)
+++ trunk/libverilog-perl/Language.pm Sun May  2 02:55:46 2010
@@ -140,7 +140,7 @@
 ######################################################################
 #### Configuration Section
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 ######################################################################
 #### Internal Variables

Modified: trunk/libverilog-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/MANIFEST?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/MANIFEST (original)
+++ trunk/libverilog-perl/MANIFEST Sun May  2 02:55:46 2010
@@ -98,6 +98,7 @@
 t/56_editfiles_b.out
 t/56_editfiles_edit.out
 t/58_vsplitmodule.t
+t/60_vpassert.out
 t/60_vpassert.t
 t/80_vppreproc.t
 t/80_vppreproc_cmped.out

Modified: trunk/libverilog-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/META.yml?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/META.yml (original)
+++ trunk/libverilog-perl/META.yml Sun May  2 02:55:46 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:         Verilog-Perl
-version:      3.240
+version:      3.241
 version_from: Language.pm
 abstract:     Verilog language utilities and parsing
 license:      perl

Modified: trunk/libverilog-perl/Netlist.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist.pm (original)
+++ trunk/libverilog-perl/Netlist.pm Sun May  2 02:55:46 2010
@@ -14,7 +14,7 @@
 use strict;
 use vars qw($Debug $Verbose $VERSION);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 ######################################################################
 #### Error Handling

Modified: trunk/libverilog-perl/Netlist/Cell.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/Cell.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/Cell.pm (original)
+++ trunk/libverilog-perl/Netlist/Cell.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::Cell;
-use Class::Struct;
 
 use Verilog::Netlist;
 use Verilog::Netlist::Subclass;
@@ -12,7 +11,7 @@
 @ISA = qw(Verilog::Netlist::Cell::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 structs('new',
 	'Verilog::Netlist::Cell::Struct'

Modified: trunk/libverilog-perl/Netlist/ContAssign.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/ContAssign.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/ContAssign.pm (original)
+++ trunk/libverilog-perl/Netlist/ContAssign.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::ContAssign;
-use Class::Struct;
 
 use Verilog::Netlist;
 use Verilog::Netlist::Subclass;
@@ -12,7 +11,7 @@
 @ISA = qw(Verilog::Netlist::ContAssign::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 structs('new',
 	'Verilog::Netlist::ContAssign::Struct'

Modified: trunk/libverilog-perl/Netlist/File.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/File.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/File.pm (original)
+++ trunk/libverilog-perl/Netlist/File.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::File;
-use Class::Struct;
 use Carp;
 
 use Verilog::Netlist;
@@ -13,7 +12,7 @@
 @ISA = qw(Verilog::Netlist::File::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 structs('new',
 	'Verilog::Netlist::File::Struct'

Modified: trunk/libverilog-perl/Netlist/Interface.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/Interface.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/Interface.pm (original)
+++ trunk/libverilog-perl/Netlist/Interface.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::Interface;
-use Class::Struct;
 
 use Verilog::Netlist;
 use Verilog::Netlist::ModPort;
@@ -15,7 +14,7 @@
 @ISA = qw(Verilog::Netlist::Interface::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 structs('new',
 	'Verilog::Netlist::Interface::Struct'
@@ -357,10 +356,6 @@
 
 =over 4
 
-=item $self->autos
-
-Updates the AUTOs for the interface.
-
 =item $self->find_net(I<name>)
 
 Returns Verilog::Netlist::Net matching given name.

Modified: trunk/libverilog-perl/Netlist/ModPort.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/ModPort.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/ModPort.pm (original)
+++ trunk/libverilog-perl/Netlist/ModPort.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::ModPort;
-use Class::Struct;
 
 use Verilog::Netlist;
 use Verilog::Netlist::Net;
@@ -13,7 +12,7 @@
 @ISA = qw(Verilog::Netlist::ModPort::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 structs('new',
 	'Verilog::Netlist::ModPort::Struct'

Modified: trunk/libverilog-perl/Netlist/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/Module.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/Module.pm (original)
+++ trunk/libverilog-perl/Netlist/Module.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::Module;
-use Class::Struct;
 
 use Verilog::Netlist;
 use Verilog::Netlist::ContAssign;
@@ -17,7 +16,7 @@
 @ISA = qw(Verilog::Netlist::Module::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 structs('new',
 	'Verilog::Netlist::Module::Struct'
@@ -429,10 +428,6 @@
 
 =over 4
 
-=item $self->autos
-
-Updates the AUTOs for the module.
-
 =item $self->find_cell(I<name>)
 
 Returns Verilog::Netlist::Cell matching given name.

Modified: trunk/libverilog-perl/Netlist/Net.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/Net.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/Net.pm (original)
+++ trunk/libverilog-perl/Netlist/Net.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::Net;
-use Class::Struct;
 
 use Verilog::Netlist;
 use Verilog::Netlist::Subclass;
@@ -12,7 +11,7 @@
 @ISA = qw(Verilog::Netlist::Net::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 my %_Type_Widths = (
     'bit'	=> 1,

Modified: trunk/libverilog-perl/Netlist/Pin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/Pin.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/Pin.pm (original)
+++ trunk/libverilog-perl/Netlist/Pin.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::Pin;
-use Class::Struct;
 
 use Verilog::Netlist;
 use Verilog::Netlist::Port;
@@ -17,7 +16,7 @@
 @ISA = qw(Verilog::Netlist::Pin::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 structs('new',
 	'Verilog::Netlist::Pin::Struct'

Modified: trunk/libverilog-perl/Netlist/Port.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/Port.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/Port.pm (original)
+++ trunk/libverilog-perl/Netlist/Port.pm Sun May  2 02:55:46 2010
@@ -3,7 +3,6 @@
 ######################################################################
 
 package Verilog::Netlist::Port;
-use Class::Struct;
 
 use Verilog::Netlist;
 use Verilog::Netlist::Subclass;
@@ -12,7 +11,7 @@
 @ISA = qw(Verilog::Netlist::Port::Struct
 	Verilog::Netlist::Subclass);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 structs('_new_base',
 	'Verilog::Netlist::Port::Struct'

Modified: trunk/libverilog-perl/Netlist/Subclass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Netlist/Subclass.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Netlist/Subclass.pm (original)
+++ trunk/libverilog-perl/Netlist/Subclass.pm Sun May  2 02:55:46 2010
@@ -3,14 +3,16 @@
 ######################################################################
 
 package Verilog::Netlist::Subclass;
+use Scalar::Util qw(weaken);
+use Carp;
+
 use Verilog::Netlist::Logger;
-use Class::Struct;
 require Exporter;
 use base qw(Exporter);
 use vars qw($VERSION @EXPORT);
 use strict;
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 @EXPORT = qw(structs);
 
 # Maybe in the future.  For now all users of this must do it themselves
@@ -90,34 +92,142 @@
 ######################################################################
 ######################################################################
 ######################################################################
-# DANGER WILL ROBINSON!
+#
 # Prior to perl 5.6, Class::Struct's new didn't bless the arguments,
-# or allow parameter initialization!  We'll override it!
+# or allow parameter initialization!  Later versions didn't support weak
+# references.
+# This code is thus from Class::Struct, copyright under the Artistic license
 
 sub structs {
     my $func = shift;
-    Class::Struct::struct (@_);
     my $baseclass = $_[0];
+
+    # Determine parameter list structure, one of:
+    #	struct (class => [ element-list ])
+
+    my ($class, @decls);
+    my $base_type = ref $_[1];
+    if	($base_type eq 'ARRAY')	 {
+	$class = shift;
+	@decls = @{shift()};
+	confess "structs usage error" if @_;
+    }
+    else {
+	confess "structs usage error";
+    }
+    confess "structs usage error" if @decls % 2 == 1;
+
+    # Create constructor.
+    croak "function 'new' already defined in package $class"
+	if do { no strict 'refs'; defined &{$class . "::new"} };
+
+    my @methods = ();
+    my %refs = ();
+    my %arrays = ();
+    my %hashes = ();
+    my %types;
+    my $got_class = 0;
+    my $out = '';
+
+    $out .= "{\n  package $class;\n  use Carp;\n";
+    $out .= "  use Scalar::Util qw(weaken);\n\n";
+    $out .= "  sub new {\n";
+    $out .= "    my (\$class, \%init) = \@_;\n";
+    $out .= "    \$class = __PACKAGE__ unless \@_;\n";
+
+    my $cnt = 0;
+    my ($cmt, $elem);
+
+    if ($base_type eq 'ARRAY') {
+	$out .= "    my(\$r) = [];\n";
+    }
+    for (my $idx=0; $idx < @decls; $idx+=2) {
+	my $name = $decls[$idx];
+	my $type = $decls[$idx+1];
+	$types{$name} = $type;
+	push (@methods, $name);
+	if ($base_type eq 'ARRAY') {
+	    $elem = "[$cnt]";
+	    ++$cnt;
+	    $cmt = " # $name";
+	}
+	if ($type =~ /^\*(.)/) {
+	    $refs{$name}++;
+	    $type = $1;
+	}
+	my $init = "defined(\$init{'$name'}) ? \$init{'$name'} :";
+	if ($type eq '@') {
+	    $out .= "    croak 'Initializer for $name must be array reference'\n";
+	    $out .= "      if defined(\$init{'$name'}) && ref(\$init{'$name'}) ne 'ARRAY';\n";
+	    $out .= "    \$r->$elem = $init [];$cmt\n";
+	    $arrays{$name}++;
+	}
+	elsif ($type eq '%') {
+	    $out .= "    croak 'Initializer for $name must be hash reference'\n";
+	    $out .= "      if defined(\$init{'$name'}) && ref(\$init{'$name'}) ne 'HASH';\n";
+	    $out .= "    \$r->$elem = $init {};$cmt\n";
+	    $hashes{$name}++;
+	}
+	elsif ($type eq '$') {
+	    $out .= "    \$r->$elem = $init undef;$cmt\n";
+	}
+	else{
+	    croak "'$type' is not a valid struct element type";
+	}
+    }
+    $out .= "     bless \$r, \$class;\n	}\n";
+
+    # Create accessor methods.
+
+    my ($pre, $pst, $sel);
+    $cnt = 0;
+    foreach my $name (@methods) {
+	my $type = $types{$name};
+	if  (do { no strict 'refs'; defined &{$class . "::$name"} }) {
+	    warnings::warnif("function '$name' already defined, overrides struct accessor method");
+	}
+	else {
+	    $pre = $pst = $cmt = $sel = '';
+	    if (defined $refs{$name}) {
+		$pre = "\\(";
+		$pst = ")";
+		$cmt = " # returns ref";
+	    }
+	    $out .= "  sub $name {$cmt\n    my \$r = shift;\n";
+	    if ($base_type eq 'ARRAY') {
+		$elem = "[$cnt]";
+		++$cnt;
+	    }
+	    if (defined $arrays{$name}) {
+		$out .= "    my \$i;\n";
+		$out .= "    \@_ ? (\$i = shift) : return \$r->$elem;\n";
+		$out .= "    if (ref(\$i) eq 'ARRAY' && !\@_) { \$r->$elem = \$i; return \$r }\n";
+		$sel = "->[\$i]";
+	    }
+	    elsif (defined $hashes{$name}) {
+		$out .= "    my \$i;\n";
+		$out .= "    \@_ ? (\$i = shift) : return \$r->$elem;\n";
+		$out .= "    if (ref(\$i) eq 'HASH' && !\@_) { \$r->$elem = \$i; return \$r }\n";
+		$sel = "->{\$i}";
+	    }
+	    $out .= "    croak 'Too many args to $name' if \@_ > 1;\n";
+	    $out .= "    \@_ ? ($pre\$r->$elem$sel = shift$pst) : $pre\$r->$elem$sel$pst;\n";
+	    $out .= "  }\n";
+	}
+    }
+
+    #print $out;
+    $out .= "}\n1;\n";
+    my $result = eval $out;
+    carp $@ if $@;
+
+    # Create top class
     (my $overclass = $baseclass) =~ s/::Struct$//;
-    if ($] < 5.006) {
-	# Now override what class::struct created
-	eval "
-            package $overclass;
-            sub ${func} {
-		my \$class = shift;
-		my \$self = new $baseclass;
-		bless \$self, \$class;
-		while (\@_) {
-		    my \$param = shift; my \$value = shift;
-		    eval (\"\\\$self->\$param(\\\$value);\");  # Slow, sorry.
-		}
-		return \$self;
-	    }";
-    } else {
+    {
 	#print \"NEW \",join(' ',\@_),\"\\n\";
 	eval "
-            package $overclass;
-            sub ${func} {
+	    package $overclass;
+	    sub ${func} {
 		my \$class = shift;
 		my \$self = new $baseclass (\@_);
 		bless \$self, \$class;

Modified: trunk/libverilog-perl/Parser/Parser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Parser/Parser.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Parser/Parser.pm (original)
+++ trunk/libverilog-perl/Parser/Parser.pm Sun May  2 02:55:46 2010
@@ -14,7 +14,7 @@
 use strict;
 use vars qw($VERSION $Debug);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 #$Debug sets the default value for debug.  You're better off with the object method though.
 

Modified: trunk/libverilog-perl/Parser/SigParser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Parser/SigParser.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Parser/SigParser.pm (original)
+++ trunk/libverilog-perl/Parser/SigParser.pm Sun May  2 02:55:46 2010
@@ -14,7 +14,7 @@
 ######################################################################
 #### Configuration Section
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 our @_Callback_Names = qw(
   attribute

Modified: trunk/libverilog-perl/Parser/VParse.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Parser/VParse.h?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Parser/VParse.h (original)
+++ trunk/libverilog-perl/Parser/VParse.h Sun May  2 02:55:46 2010
@@ -133,8 +133,8 @@
     void inLineDirective(const char* text) { m_inFilelinep = inFilelinep()->lineDirective(text); }
 
     string unreadback() const { return (m_useUnreadback ? m_unreadback : "new(...,use_unreadback=>0) was used"); }
-    void unreadback(const string& text) { if (m_useUnreadback) m_unreadback = text; }
-    void unreadbackCat(const string& text) { if (m_useUnreadback) m_unreadback += text; }
+    void unreadback(const string& text) { if (m_useUnreadback && callbackMasterEna()) m_unreadback = text; }
+    void unreadbackCat(const string& text) { if (m_useUnreadback && callbackMasterEna()) m_unreadback += text; }
     void unreadbackCat(const char* textp, size_t len) { unreadbackCat(string(textp,len)); }
 
     // The default behavior is to pass all unknown `defines right through.

Modified: trunk/libverilog-perl/Parser/bisonpre
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Parser/bisonpre?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Parser/bisonpre (original)
+++ trunk/libverilog-perl/Parser/bisonpre Sun May  2 02:55:46 2010
@@ -9,7 +9,7 @@
 use strict;
 use vars qw ($Debug $VERSION);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 our $Self;
 

Modified: trunk/libverilog-perl/Parser/callbackgen
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Parser/callbackgen?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Parser/callbackgen (original)
+++ trunk/libverilog-perl/Parser/callbackgen Sun May  2 02:55:46 2010
@@ -9,7 +9,7 @@
 use strict;
 use vars qw ($Debug $VERSION);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 # xs_manual=>1,   -> The .xs file makes the handler itself
 

Modified: trunk/libverilog-perl/Preproc/Preproc.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Preproc/Preproc.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Preproc/Preproc.pm (original)
+++ trunk/libverilog-perl/Preproc/Preproc.pm Sun May  2 02:55:46 2010
@@ -11,7 +11,7 @@
 use strict;
 use vars qw($VERSION);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 ######################################################################
 #### Configuration Section

Modified: trunk/libverilog-perl/Preproc/VPreproc.cpp
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Preproc/VPreproc.cpp?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Preproc/VPreproc.cpp (original)
+++ trunk/libverilog-perl/Preproc/VPreproc.cpp Sun May  2 02:55:46 2010
@@ -518,20 +518,25 @@
     // Filter all DOS CR's en-mass.  This avoids bugs with lexing CRs in the wrong places.
     // This will also strip them from strings, but strings aren't supposed to be multi-line without a "\"
     for (StrList::iterator it=wholefile.begin(); it!=wholefile.end(); ++it) {
-	// We don't test for \0 as we allow and strip mid-string '\0's (for now).
-	// We also edit in place.  This is nasty to other users of the string, but
-	// there aren't any, and it avoids needing 2x the memory on very large files.
+	// We don't end-loop at \0 as we allow and strip mid-string '\0's (for now).
+	bool strip = false;
 	const char* sp = it->data();
 	const char* ep = sp + it->length();
-	char* cp = (char*) sp;
-	for (; sp<ep; sp++) {
-	    if (*sp != '\r' && *sp != '\0') {
-		*cp++ = *sp;
-	    }
-	}
-	size_t len = cp - it->data();
-	// Truncate old string
-	it->erase(len);
+	// Only process if needed, as saves extra string allocations
+	for (const char* cp=sp; cp<ep; cp++) {
+	    if (*cp == '\r' || *cp == '\0') {
+		strip = true; break;
+	    }
+	}
+	if (strip) {
+	    string out;  out.reserve(it->length());
+	    for (const char* cp=sp; cp<ep; cp++) {
+		if (!(*cp == '\r' || *cp == '\0')) {
+		    out += *cp;
+		}
+	    }
+	    *it = out;
+	}
 
 	// Push the data to an internal buffer.
 	m_lexp->scanBytesBack(*it);

Modified: trunk/libverilog-perl/Preproc/VPreprocLex.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Preproc/VPreprocLex.h?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Preproc/VPreprocLex.h (original)
+++ trunk/libverilog-perl/Preproc/VPreprocLex.h Sun May  2 02:55:46 2010
@@ -110,7 +110,7 @@
 #define KEEPCMT_EXP 3
 
 //======================================================================
-// Class entry for each per-lexter state
+// Class entry for each per-lexer state
 
 class VPreprocLex {
   public:	// Used only by VPreprocLex.cpp and VPreproc.cpp

Modified: trunk/libverilog-perl/Preproc/VPreprocLex.l
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Preproc/VPreprocLex.l?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Preproc/VPreprocLex.l (original)
+++ trunk/libverilog-perl/Preproc/VPreprocLex.l Sun May  2 02:55:46 2010
@@ -177,7 +177,6 @@
 <DEFVAL>[\\]{crnl}	{ linenoInc(); appendDefValue((char*)"\n",1); } /* Return, but not \ is part of define value */
 <DEFVAL>[^\/\*\n\r\\]+	|
 <DEFVAL>[\\][^\n\r]	|
-<DEFVAL>{word}		{ appendDefValue(yytext,yyleng); }
 <DEFVAL>.		{ appendDefValue(yytext,yyleng); }
 
 	/* Comments inside define values - if embedded get added to define value per spec */

Modified: trunk/libverilog-perl/Std.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/Std.pm?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/Std.pm (original)
+++ trunk/libverilog-perl/Std.pm Sun May  2 02:55:46 2010
@@ -14,7 +14,7 @@
 ######################################################################
 #### Configuration Section
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 #######################################################################
 # ACCESSORS

Modified: trunk/libverilog-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/debian/changelog?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/debian/changelog (original)
+++ trunk/libverilog-perl/debian/changelog Sun May  2 02:55:46 2010
@@ -1,3 +1,9 @@
+libverilog-perl (3.241-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Sat, 01 May 2010 23:15:09 -0400
+
 libverilog-perl (3.240-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libverilog-perl/t/60_vpassert.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/t/60_vpassert.t?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/t/60_vpassert.t (original)
+++ trunk/libverilog-perl/t/60_vpassert.t Sun May  2 02:55:46 2010
@@ -9,13 +9,14 @@
 use strict;
 use Test;
 
-BEGIN { plan tests => 5 }
+BEGIN { plan tests => 6 }
 BEGIN { require "t/test_utils.pl"; }
 
 print "Checking vpassert...\n";
 
 # Preprocess the files
 mkdir "test_dir/.vpassert", 0777;
+mkdir "test_dir/.vpassertcall", 0777;
 system ("/bin/rm -rf test_dir/verilog");
 symlink ("../verilog", "test_dir/verilog");  # So `line files are found; ok if fails
 run_system ("${PERL} ./vpassert --minimum --nostop --date --axiom --verilator --vcs --synthcov"
@@ -25,6 +26,14 @@
 
 ok(compare('lines', [glob("test_dir/.vpassert/*.v")]));
 ok(compare('diff',  [glob("test_dir/.vpassert/*.v")]));
+
+# Preprocess with custom outputters
+run_system ("${PERL} ./vpassert --date --verilator --vcs"
+	    .q{ --call-error '$callError'}
+	    .q{ --call-info '$callInfo'}
+	    .q{ --call-warn '$callWarn'}
+	    ." -o test_dir/.vpassertcall -y verilog/");
+ok(files_identical("test_dir/.vpassertcall/example.v", "t/60_vpassert.out"));
 
 # Build the model
 unlink "simv";
@@ -85,7 +94,7 @@
     my $filename = shift;
     my $fh = IO::File->new($filename) or die "%Error: $! $filename";
     my @lines = $fh->getlines();
-    @lines = grep (!/`line/, @lines);
+    @lines = grep (!/\`line/, @lines);
     return $#lines;
 }
 

Modified: trunk/libverilog-perl/vhier
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/vhier?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/vhier (original)
+++ trunk/libverilog-perl/vhier Sun May  2 02:55:46 2010
@@ -16,7 +16,7 @@
 use strict;
 use vars qw ($Debug $VERSION);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 ######################################################################
 # main

Modified: trunk/libverilog-perl/vpassert
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/vpassert?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/vpassert (original)
+++ trunk/libverilog-perl/vpassert Sun May  2 02:55:46 2010
@@ -10,6 +10,7 @@
 use FindBin qw($RealBin);
 use File::Copy;
 use strict "vars";
+use POSIX qw();
 
 use lib 'blib/arch';
 use lib 'blib/lib';
@@ -33,7 +34,7 @@
 	     %Files %Files_Read
 	     %File_Dest
 	     );
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 ######################################################################
 # configuration
@@ -53,9 +54,9 @@
        #'$ui' =>		# Used inside ucover_foreach_clk
        '$uinfo' =>		\&ins_uinfo,
        '$uwarn' =>		\&ins_uwarn,
-       #'$uassert_clk' =>	sub {shift; my $clk=shift; my $cond=shift; umessage_clk("%%E", $cond,$clk, at _); }, # May be confusing, try without
-       '$uerror_clk' =>		sub {shift; umessage_clk("%%E", 0, @_); },
-       '$uwarn_clk' =>		sub {shift; umessage_clk("%%W", 0, @_); },
+       #'$uassert_clk' =>	sub {shift; my $clk=shift; my $cond=shift; umessage_clk('%%E', $cond,$clk, at _); }, # May be confusing, try without
+       '$uerror_clk' =>		sub {shift; umessage_clk('%%E', 0, @_); },
+       '$uwarn_clk' =>		sub {shift; umessage_clk('%%W', 0, @_); },
        '$ucover_clk' =>		sub {shift; ucover_clk(@_); },
        '$ucover_foreach_clk' =>	sub {shift; ucover_foreach_clk(@_); },
        );
@@ -68,6 +69,9 @@
 my $Opt_Quiet = 0;	# Don't blab about what files are being worked on
 my $Opt_Axiom;		# Athdl
 my $Opt_AllFiles = 0;	# Preprocess all files
+my $Opt_Call_Error;
+my $Opt_Call_Info;
+my $Opt_Call_Warn;
 my $Opt_Date = 0;	# Check dates
 my $Opt_NoPli = 0;	# Delete all pli calls
 $Opt_Vericov = 0;	# Add vericov on/off comments (messes up line # counts)
@@ -96,9 +100,13 @@
 @ARGV = $Opt->parameter(@ARGV);	# Strip -y, +incdir+, etc
 
 if (! GetOptions (
+		  # When add flags, update _switch_line also as appropriate
 		  "-o=s"	=> \$output_dirname,
 		  "allfiles!"	=> \$Opt_AllFiles,
 		  "axiom!"	=> \$Opt_Axiom,
+		  "call-error=s" => \$Opt_Call_Error,
+		  "call-info=s" => \$Opt_Call_Info,
+		  "call-warn=s" => \$Opt_Call_Warn,
 		  "date!"	=> \$Opt_Date,
 		  "debug"	=> \&debug,
 		  "exclude=s"	=> sub {shift; push @Opt_Exclude, shift;},
@@ -125,11 +133,17 @@
     # If any of these flags change, we must regenerate output
     my $sw = "";
     $sw .= " --axiom" if $Opt_Axiom;
+    $sw .= " --call-error=$Opt_Call_Error" if $Opt_Call_Error;
+    $sw .= " --call-info=$Opt_Call_Info" if $Opt_Call_Info;
+    $sw .= " --call-warn=$Opt_Call_Warn" if $Opt_Call_Warn;
     $sw .= " --line" if $Opt_Line;
     $sw .= " --minimum=$Opt_Minimum" if defined $Opt_Minimum;
     $sw .= " --nopli" if $Opt_NoPli;
     $sw .= " --realintent" if $Opt_RealIntent;
     $sw .= " --stop" if $Opt_Stop;
+    $sw .= " --synthcov" if $Opt_Synthcov;
+    $sw .= " --timeformat-precision=$Opt_Timeformat_Precision" if $Opt_Timeformat_Precision;
+    $sw .= " --timeformat-units=$Opt_Timeformat_Units" if $Opt_Timeformat_Units;
     $sw .= " --vericov" if $Opt_Vericov;
     $sw .= " --verilator" if $Opt_Verilator;
     $sw .= " --vcs" if $Opt_Vcs;
@@ -196,15 +210,15 @@
 # Functions that transform the tokens
 
 # Note -I is specially detected below
-sub ins_uinfo   { shift; sendout( message (get_lineinfo(), 1, "-I",  1, "", @_)); }
-sub ins_uwarn   { shift; sendout( message (get_lineinfo(), 1, "%%W", 1, "", @_)); }
-sub ins_uerror  { shift; sendout( message (get_lineinfo(), 1, "%%E", 1, "", @_)); }
+sub ins_uinfo   { shift; sendout( message (get_lineinfo(), 1, '-I',  1, "", @_)); }
+sub ins_uwarn   { shift; sendout( message (get_lineinfo(), 1, '%%W', 1, "", @_)); }
+sub ins_uerror  { shift; sendout( message (get_lineinfo(), 1, '%%E', 1, "", @_)); }
 
 sub ins_uassert {
     shift;
     my $cond = shift;
     my @params = @_;
-    sendout( message (get_lineinfo(), 1, "%%E", $cond, "", 0, @params));
+    sendout( message (get_lineinfo(), 1, '%%E', $cond, "", 0, @params));
 }
 
 sub ins_uassert_info {
@@ -532,7 +546,7 @@
     my $out = message_header();
 
     # These long lines without breaks are intentional; I want to preserve line numbers
-    my $is_warn = (($char eq "%%E") || ($char eq "%%W") || ($char eq "-i"));
+    my $is_warn = (($char eq '%%E') || ($char eq '%%W') || ($char eq "-i"));
 
     if ($cond ne "1") {
 	# Conditional code, for $uassert
@@ -554,23 +568,42 @@
     }
 
     my $task;
-    if (($char eq "-I") || ($char eq "-i")) {}
-    elsif ($char eq "%%E") {
-	$task = ($Opt_Stop ? '$stop;' : "`pli.errors = `pli.errors+1;");
-    } elsif ($char eq "%%W") {
-	$task = ($Opt_Stop ? '$stop;' : "`pli.warnings = `pli.warnings+1;");
-    } else { die "%Error: Unknown message character class '$char'\n"; }
+    my $call;
+    if (($char eq '-I') || ($char eq '-i')) {
+	if ($Opt_Call_Info) {
+	    $call = $Opt_Call_Info;
+	}
+    }
+    elsif ($char eq '%%E') {
+	if ($Opt_Call_Error) {
+	    $call = $Opt_Call_Error;
+	} else {
+	    $task = ($Opt_Stop ? '$stop;' : "`pli.errors = `pli.errors+1;");
+	}
+    }
+    elsif ($char eq '%%W') {
+	if ($Opt_Call_Error) {
+	    $call = $Opt_Call_Warn;
+	} else {
+	    $task = ($Opt_Stop ? '$stop;' : "`pli.warnings = `pli.warnings+1;");
+	}
+    }
+    else { die "%Error: Unknown message character class '$char'\n"; }
 
     {	# if's body
 	$out .= "begin";
 	$out .= " \$timeformat($Opt_Timeformat_Units, $Opt_Timeformat_Precision,\"\",20);"
 	    if defined $Opt_Timeformat_Units;
-	$out .= " \$write (\"[%0t] ${char}:${lineinfo} ";
+	$out .= " \$write (\"[%0t] ${char}:${lineinfo} "
+	    if !$call;
+	$out .= " ${call} (\"" if $call;
 
 	my $par = $params[1];
 	$par =~ s/^\s*\"//;
 
-	$out .= "$par,\$time$otherargs";
+	$out .= "$par";
+	$out .= ",\$time" if !$call;
+	$out .= $otherargs;
 	for my $parn (2 .. $#params) {
 	    my $p = $params[$parn];
 	    $out .= ", $p";
@@ -977,7 +1010,7 @@
 	    # Didn't need to do processing
 	    $no_output = 1;
 	    print "nooutput: vpassert_process ($srcfile, $destfile,0 )\n" if ($Debug);
-	    copy($srcfile,$destfile);
+	    nochange_copy($srcfile,$destfile);
 	} else {
 	    # Make sure didn't clobber another directory's file
 	    print "madenew:  vpassert_process ($srcfile, $destfile,0 )\n" if ($Debug);
@@ -995,6 +1028,25 @@
 	}
     }
     $file_directory{$destfile} = $srcfile;
+}
+
+sub nochange_copy {
+    my $srcfile = shift;
+    my $dstfile = shift;
+    my $fhw = IO::File->new(">$dstfile");
+    my $fhr = IO::File->new("<$srcfile");
+    if (!$fhr) { warn "%Warning: $! $srcfile\n"; return; }
+    $fhw->print("`line 1 \"$srcfile\" 0\n") if $Opt_Line;
+    # Unfortunately File::Copy::copy overwrites our line statement.
+    my $eof;
+    while (!$eof) {
+	my $data = '';
+	$!=undef;
+	my $rv = $fhr->sysread($data, POSIX::BUFSIZ, 0);
+	#print "RRV=$rv b=$!\n" if $Debug;
+	$eof = 1 if !$rv || (!$fhr || ($! && $! != POSIX::EWOULDBLOCK));
+	$fhw->print($data);
+    }
 }
 
 ######################################################################
@@ -1408,6 +1460,21 @@
 
 Special Axiom ATHDL enables/disables added around unreachable code.
 
+=item --call-error <function>
+
+When $uerror (or $uassert etc.) wants to display a message, call the
+specified function instead of $display and $stop.
+
+=item --call-info <function>
+
+When $uinfo wants to display a message, call the specified function instead
+of $display.
+
+=item --call-warn <function>
+
+When $uwarn (or $uwarn_clk etc.) wants to display a message, call the
+specified function instead of $display and $stop.
+
 =item --date
 
 Check file dates and sizes versus the last run of vpassert and don't

Modified: trunk/libverilog-perl/vppreproc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/vppreproc?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/vppreproc (original)
+++ trunk/libverilog-perl/vppreproc Sun May  2 02:55:46 2010
@@ -16,7 +16,7 @@
 use strict;
 use vars qw ($Debug $VERSION);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 ######################################################################
 # main

Modified: trunk/libverilog-perl/vrename
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libverilog-perl/vrename?rev=57297&op=diff
==============================================================================
--- trunk/libverilog-perl/vrename (original)
+++ trunk/libverilog-perl/vrename Sun May  2 02:55:46 2010
@@ -23,7 +23,7 @@
 	     $Debug $Opt_Xref $Opt_Crypt $Opt_Crypt_All $Opt_Write $Opt_Keywords
 	     @Files);
 
-$VERSION = '3.240';
+$VERSION = '3.241';
 
 ######################################################################
 




More information about the Pkg-perl-cvs-commits mailing list