3
#########################################################################
5
# Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. #
6
# All rights reserved. Email: russ@q12.org Web: www.q12.org #
8
# This library is free software; you can redistribute it and/or #
9
# modify it under the terms of EITHER: #
10
# (1) The GNU Lesser General Public License as published by the Free #
11
# Software Foundation; either version 2.1 of the License, or (at #
12
# your option) any later version. The text of the GNU Lesser #
13
# General Public License is included with this library in the #
15
# (2) The BSD-style license that is included with this library in #
16
# the file LICENSE-BSD.TXT. #
18
# This library is distributed in the hope that it will be useful, #
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files #
21
# LICENSE.TXT and LICENSE-BSD.TXT for more details. #
23
#########################################################################
32
system ($cmd)==0 or die "FAILED";
36
sub main::createParametersFile # (filename)
38
open (PARAM,">$_[0]");
39
print PARAM "# perl script to set parameters required by the code generator\n";
40
print PARAM "\$FNAME=\"$main::FNAME\";\n" if defined($main::FNAME);
41
print PARAM "\$TYPE=\"$main::TYPE\";\n" if defined($main::TYPE);
42
print PARAM "\$N1=$main::N1;\n" if defined($main::N1);
43
print PARAM "\$UNROLL1=$main::UNROLL1;\n" if defined($main::UNROLL1);
44
print PARAM "\$UNROLL2=$main::UNROLL2;\n" if defined($main::UNROLL2);
45
print PARAM "\$MADD=$main::MADD;\n" if defined($main::MADD);
46
print PARAM "\$FETCH=$main::FETCH;\n" if defined($main::FETCH);
47
print PARAM "\$LAT1=$main::LAT1;\n" if defined($main::LAT1);
48
print PARAM "\$LAT2=$main::LAT2;\n" if defined($main::LAT2);
53
# read back a data file and find best parameters
55
sub main::readBackDataFile # (filename)
59
open (FILE,$filename);
63
if ($line =~ /error/) {
64
print "ERRORS FOUND IN $filename\n";
69
my @nums = split (/\s+/,$line);
71
if ($time < $maxtime) {
73
$main::UNROLL1 = $nums[2];
74
$main::UNROLL2 = $nums[3];
75
$main::MADD = $nums[4];
76
$main::FETCH = $nums[5];
77
$main::LAT1 = $nums[6];
78
$main::LAT2 = $nums[7];