mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Use vluint32_t where possible, aid bug204
This commit is contained in:
Executable
+39
@@ -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;
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user