URL
https://opencores.org/ocsvn/bluespec_md6/bluespec_md6/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 5 |
Rev 7 |
# I expect ARGV[0] to be the test dir
|
# I expect ARGV[0] to be the test dir
|
chomp(@ARGV[0]);
|
chomp(@ARGV[0]);
|
@md6files = `ls @ARGV[0]`;
|
@md6files = `ls @ARGV[0]`;
|
$pass = 1;
|
$pass = 1;
|
foreach(@md6files)
|
foreach(@md6files)
|
{
|
{
|
if($_=~m/CVS/) {
|
if($_=~m/CVS/) {
|
next;
|
next;
|
}
|
}
|
chomp($_);
|
chomp($_);
|
|
|
print $_;
|
print $_;
|
print "\n";
|
print "\n";
|
|
|
&buildBits("./md6_encode","@ARGV[0]/$_");
|
&buildBits("./md6_encode","@ARGV[0]/$_");
|
$pass = &runTest() && $pass;
|
$pass = &runTest() && $pass;
|
|
|
for($i=0; $i < 10; $i = $i +1) {
|
for($i=0; $i < 10; $i = $i +1) {
|
&buildBits("./md6_random","@ARGV[0]/$_");
|
&buildBits("./md6_random","@ARGV[0]/$_");
|
$pass = &runTest() && $pass;
|
$pass = &runTest() && $pass;
|
}
|
}
|
|
|
}
|
}
|
|
|
if($pass) {
|
if($pass) {
|
print "PASS\n";
|
print "PASS\n";
|
}
|
}
|
|
|
|
|
|
|
sub buildBits {
|
sub buildBits {
|
my ($exec,$file) = @_;
|
my ($exec,$file) = @_;
|
print "$exec $file md6Input.hex md6Result.hex inputSize.hex\n";
|
print "$exec $file md6Input.hex md6Result.hex inputSize.hex\n";
|
`$exec $file md6Input.hex md6Result.hex inputSize.hex`;
|
`$exec $file md6Input.hex md6Result.hex inputSize.hex`;
|
}
|
}
|
|
|
sub runTest {
|
sub runTest {
|
system("./MD6TestBench | grep \"PASS\" > out.hex");
|
system("./MD6TestBench | grep \"PASS\" > out.hex");
|
$out = `cat out.hex`;
|
$out = `cat out.hex`;
|
if($out =~ "PASS") {
|
if($out =~ "PASS") {
|
print "Test $_ passes.\n";
|
print "Test $_ passes.\n";
|
return 1;
|
return 1;
|
} else {
|
} else {
|
print "Test $_ fails.\n";
|
print "Test $_ fails.\n";
|
die "failed a test";
|
die "failed a test";
|
}
|
}
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.