Revert "ngspice version detection implemented"

does not work when "configured" in a separate working directory.

apart from that, repeatedly executing a ngspice solely to check the version
  is slow, and actually useless because the test harness is part of the Makefile
  and thus the version is known to be exactly that of the currently
  checked out commit.
This commit is contained in:
rlar 2017-07-27 20:24:36 +02:00
parent d3b5d5c275
commit fb24e80363
2 changed files with 13 additions and 52 deletions

View File

@ -6,49 +6,15 @@
#
# Rel Date Who Comments
# ==== ========== ============= ========
# 1.1 07/05/17 Dietmar Warning Version detection included
# 1.0 05/13/11 Dietmar Warning Initial version
#
package simulate;
if (defined($main::simulatorCommand)) {
$simulatorCommand=$main::simulatorCommand;
} else {
$simulatorCommand="ngspice";
}
$netlistFile="ngspiceCkt";
use strict;
sub version {
my($version,$vaVersion);
$version="unknown";
$vaVersion="unknown";
if (!open(OF,">$simulate::netlistFile")) {
die("ERROR: cannot open file $simulate::netlistFile, stopped");
}
print OF "version test";
print OF "r1 1 0 1";
print OF "v1 1 0 1";
print OF ".control";
print OF "version";
print OF ".endc";
print OF ".end";
close(OF);
if (!open(SIMULATE,"$simulate::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) {
die("ERROR: cannot run $simulate::simulatorCommand, stopped");
}
while (<SIMULATE>) {
chomp;
# Check whether this line is the one we are looking for.
# Also the term in parenthesis "()" stores the number to $1 which we can reuse later.
if (s/.+ngspice-([0-9]+)//) {
# Simple read the stored group from the matching in the if clause
$version=$1;
last;
}
}
close(SIMULATE);
return($version,$vaVersion);
return("26"); # the version only seems to be printed in interactive mode
}
sub runNoiseTest {
@ -111,8 +77,8 @@ sub runNoiseTest {
# Run simulations and get the results
#
if (!open(SIMULATE,"$simulate::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) {
die("ERROR: cannot run $simulate::simulatorCommand, stopped");
if (!open(SIMULATE,"$main::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) {
die("ERROR: cannot run $main::simulatorCommand, stopped");
}
$inData=0;
while (<SIMULATE>) {
@ -237,8 +203,8 @@ sub runAcTest {
# Run simulations and get the results
#
if (!open(SIMULATE,"$simulate::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) {
die("ERROR: cannot run $simulate::simulatorCommand, stopped");
if (!open(SIMULATE,"$main::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) {
die("ERROR: cannot run $main::simulatorCommand, stopped");
}
$inData=0;
while (<SIMULATE>) {
@ -374,8 +340,8 @@ sub runDcTest {
# Run simulations and get the results
#
if (!open(SIMULATE,"$simulate::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) {
die("ERROR: cannot run $simulate::simulatorCommand, stopped");
if (!open(SIMULATE,"$main::simulatorCommand < $simulate::netlistFile 2>/dev/null|")) {
die("ERROR: cannot run $main::simulatorCommand, stopped");
}
$inResults=0;
while (<SIMULATE>) {

View File

@ -32,6 +32,7 @@ Options:
-nw do not print warning messages
-platform prints the hardware platform and operating system version
-p plot results (limited, only standard test variant)
-P plot results (complete, for all test variants)
-r re-use previously simulated results if they exist
(default is to resimulate, even if results exist)
-sv prints the simulator version being run
@ -69,7 +70,6 @@ undef($qaSpecFile);
undef(@Setup);
undef(@Test);
undef(@Variants);
undef(@TestVariants);
$debug=0;
$verbose=0;
$reallyVerbose=0;
@ -98,7 +98,6 @@ undef($acClip);undef($acNdigit);undef($acRelTol);
undef($noiseClip);undef($noiseNdigit);undef($noiseRelTol);
undef($mFactor);undef($shrinkPercent);undef($scaleFactor);undef(%TestSpec);
undef($refrnceDirectory);
undef($simulatorCommand);
#
# These are the tolerances used to compare results
@ -231,13 +230,9 @@ if (!$onlyDoComparison) {
#
if (!$onlyDoComparison) {
($version,$vaVersion)=&simulate::version();
$version=&simulate::version();
if ($onlyDoSimulatorVersion) {
if ($vaVersion eq "unknown") {
print $version;exit(0);
} else {
print $version,$vaVersion;exit(0);
}
print $version;exit(0);
}
}
$qaSpecFile=$ARGV[0];
@ -302,7 +297,7 @@ if ($reallyVerbose) {
$flag="";
}
foreach $test (@Test) {
next if (%doTest && !$doTest{$test});
next if (!$doTest{$test});
if ($verbose) {print "\n****** Running test ($simulatorName): $test"}
@ -310,13 +305,13 @@ foreach $test (@Test) {
undef($outputAc);
undef($outputNoise);
&modelQa::processTestSpec(@{$TestSpec{$test}});
foreach $variant (@TestVariants) {
foreach $variant (@Variants) {
if ($variant eq "standard") {
$refFile="$refrnceDirectory/$test.standard";
} else {
$refFile="$resultsDirectory/$test.standard";
}
next if (%doVariant && !$doVariant{$variant});
next if (!$doVariant{$variant});
$simFile="$resultsDirectory/$test.$variant";
if ($outputDc) {
if (($forceSimulation || ! -r $simFile) && !$onlyDoComparison) {