-
Notifications
You must be signed in to change notification settings - Fork 26
/
checkresults.pl
42 lines (35 loc) · 1.04 KB
/
checkresults.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$test_case = $ARGV[0];
$expected_result_area = $ARGV[1];
$expected_results_ram = $ARGV[2];
if (open (FILE, "log_".$test_case.".txt")){
# Read out whatever results you are interested in:
while (<FILE>) {
chomp;
my($line) = $_;
#print($_."\n");
if ($line =~ / RAM (\S+)/){
$ram_area = $1;
}
if ($line =~ / Tile Area (\S+)/){
$tile_area = $1;
}
}
}else{
die "Error opening log file - $!\n";
return 0;
}
# Speculation of the expected results:
# Check tile area with 20% tolerance:
if ($tile_area> 1.2 * $expected_result_area || $tile_area < 0.8 * $expected_result_area)
{
die "Error: Tile area outside of expected range \n";
}else{
print("results for ".$test_case." logic area are in the expected range. \n");
}
# Check BRAM area with 20% tolerance:
if ($ram_area> 1.2 * $expected_results_ram || $ram_area < 0.8 * $expected_results_ram)
{
die "Error: BRAM area outside of expected range \n";
}else{
print("results for ".$test_case." BRAM area are in the expected range. \n");
}