Use vluint32_t where possible, aid bug204

This commit is contained in:
Wilson Snyder
2010-01-15 20:27:01 -05:00
parent 919fdd70b8
commit f60f8396bb
4 changed files with 45 additions and 6 deletions
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
use IO::File;
my $root = "..";
my $Debug;
if (!-r "$root/.git") {
$Self->skip("Not in a git repository");
} else {
### Must trim output before and after our file list
#my $files = "*/*.c* */*.h test_regress/t/*.c* test_regress/t/*.h";
# src isn't clean, and probably doesn't need to be (yet?)
my $files = "include/*.c* include/*.h test_c/*.c* test_c/*.h test_regress/t/*.c* test_regress/t/*.h";
my $cmd = "cd $root && fgrep -n int $files | sort";
print "C $cmd\n";
my $grep = `$cmd`;
my %names;
foreach my $line (split /\n/, $grep) {
next if $line !~ /uint\d+_t/;
next if $line =~ /vl[su]int\d+_t/;
next if $line =~ /typedef/;
next if $line =~ m!include/svdpi.h!; # Not ours
$names{$1} = 1 if $line =~ /^([^:]+)/;
}
if (keys %names) {
$Self->error("Files with uint32*_t instead of vluint32s: ",join(' ',sort keys %names));
}
}
ok(1);
1;
+1 -1
View File
@@ -11,7 +11,7 @@ public:
~t_extend_class_c() {}
// METHODS
// This function will be called from a instance created in Verilog
inline uint32_t my_math(uint32_t in) {
inline vluint32_t my_math(vluint32_t in) {
return in+1;
}
};