OpenCores
URL https://opencores.org/ocsvn/theia_gpu/theia_gpu/trunk

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [icarus_version/] [scripts/] [run_regressions.pl] - Diff between revs 194 and 195

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 194 Rev 195
Line 80... Line 80...
        copy("$TestPath/Reference.ppm","$TestDir/") or die "-E- $TestPath/Reference.ppm $!\n";
        copy("$TestPath/Reference.ppm","$TestDir/") or die "-E- $TestPath/Reference.ppm $!\n";
                copy("$TestPath/Textures.mem","$TestDir/") or die "-E- $TestPath/Textures.ppm $!\n";
                copy("$TestPath/Textures.mem","$TestDir/") or die "-E- $TestPath/Textures.ppm $!\n";
                copy("$TestPath/Instructions.mem","$TestDir/") or die "-E- $TestPath/Instructions.ppm $!\n";
                copy("$TestPath/Instructions.mem","$TestDir/") or die "-E- $TestPath/Instructions.ppm $!\n";
                copy("$TestPath/Instructions.mem","$TestDir/") or die "-E- $TestPath/Instructions.ppm $!\n";
                copy("$TestPath/Instructions.mem","$TestDir/") or die "-E- $TestPath/Instructions.ppm $!\n";
                #Print some information about the scene
                #Print some information about the scene
                my $Line = `grep -i  width $TestDir/Params.mem`;
 
                my ($Width,$Height) = split(" ", $Line);
 
                $Width = (hex $Width)/$Scale;
                my $Width = $TestList{$TestName}->{'width'};
                $Height = (hex $Height)/$Scale;
                my $Height = $TestList{$TestName}->{'height'};
 
 
                print  LOG "Scene Resolution: $Width x $Height\n";
                print  LOG "Scene Resolution: $Width x $Height\n";
                $Line = `grep -i  texture $TestDir/Params.mem`;
                my $Line = `grep -i  texture $TestDir/Params.mem`;
                my ($Width,$Height) = split(" ", $Line);
                my ($tWidth,$tHeight) = split(" ", $Line);
                $Width = (hex $Width)/$Scale;
                $tWidth = (hex $tWidth)/$Scale;
                $Height = (hex $Height)/$Scale;
                $tHeight = (hex $tHeight)/$Scale;
                print  LOG "Texture: $Width x $Height\n";
                print  LOG "Texture: $tWidth x $tHeight\n";
                my $TringleCount = `grep -A 1 -i child $TestDir/Vertex.mem | grep -v -i child`;
                my $TringleCount = `grep -A 1 -i child $TestDir/Vertex.mem | grep -v -i child`;
                print LOG "Triangle count: $TringleCount\n";
                print LOG "Triangle count: $TringleCount\n";
 
 
        #Copy the Source files just in case..
        #Copy the Source files just in case..
        mkdir "$RegDir/rtl";
        mkdir "$RegDir/rtl";
Line 112... Line 112...
        Number of execution cores: $CoreCount
        Number of execution cores: $CoreCount
        Number of texture memory banks: $MemBankCount
        Number of texture memory banks: $MemBankCount
  ";
  ";
 
 
  chdir "../simulation";
  chdir "../simulation";
  if ( system("make compile GPUCORES=$CoreCount GPUMEMBANKS=$MemBankCount") != 0)
  if ( system("make compile GPUCORES=$CoreCount GPUMEMBANKS=$MemBankCount WIDTH=$Width HEIGHT=$Height") != 0)
  {
  {
        die "-E- Error compiling test code! ($!)\n";
        die "-E- Error compiling test code! ($!)\n";
  }
  }
 #Now copy the binary over to our simulation directory
 #Now copy the binary over to our simulation directory
 
 
Line 180... Line 180...
    local $/ = undef;
    local $/ = undef;
    my $string = <F>;
    my $string = <F>;
    close F;
    close F;
    return $string;
    return $string;
}
}
 
#-------------------------------------------------------------------------------
 
sub Round
 
{
 
  my $number = shift;
 
  my $rounded = sprintf("%.3f", $number);
 
  return $rounded;
 
}
#----------------------------------------------------------------
#----------------------------------------------------------------
sub ParseOutputPPM()
sub ParseOutputPPM()
{
{
  my $TestDir = shift;
  my $TestDir = shift;
  open FILE, "$TestDir/Output.ppm" or die "Can't open  $TestDir/Output.ppm !$\n";
  open FILE, "$TestDir/Output.ppm" or die "Can't open  $TestDir/Output.ppm !$\n";
Line 207... Line 214...
      return;
      return;
    }
    }
     $i++;
     $i++;
  }
  }
  close FILE;
  close FILE;
 
 
 
 my $TotalTime = 0;
 
open F, "$TestDir/Simulation.log" or die "$TestDir/Simulation.log' : $!\n";
 
 
 
 
 
local $/=undef;
 
my $Temp = <F>;
 
close F;
 
my($junk,$StartSimTime) = split /Simulation start time \:\s+/,$Temp;
 
my($junk,$EndSimTime) = split /Simulation end time \:\s+/,$Temp;
 
$StartSimTime =~ s/ns//;
 
$EndSimTime =~ s/ns//;
 
$TotalTime = ($EndSimTime-$StartSimTime)/1000000000;
 
print LOG "Simulated start time: $StartSimTime\n";
 
print LOG "Simulated end time: $EndSimTime\n";
 
print LOG "Total Time: $TotalTime seconds\n";
 
print LOG "Theorical FPS: ". Round( (1 /$TotalTime) )."\n";
}
}
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.