Skip to content

Commit

Permalink
Changes for version 0.17.35 part 2
Browse files Browse the repository at this point in the history
CVC: Changed "<step> Usage:" to "Usage <step>:"
CVC: Deleted or moved DEBUG statements to debug file
CVC: Added backupResults parameter. Made no backup the default
CVC: Moved large circuit display to debug file
  • Loading branch information
d-m-bailey committed Oct 30, 2020
1 parent 4a6048b commit cca51d3
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 90 deletions.
20 changes: 10 additions & 10 deletions src/CCvcDb_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
}
cvcParameters.SaveDatabaseParameters();
reportFile << "Cdl fixed data size " << cvcCircuitList.cdlText.Size() << endl;
reportFile << PrintProgress(&lastSnapshot, "CDL ") << endl;
reportFile << PrintProgress(&lastSnapshot, "CDL") << endl;
LoadCellChecksums();
CountObjectsAndLinkSubcircuits();
AssignGlobalIDs();
LoadNetChecks();
PrintLargeCircuits();
reportFile << PrintProgress(&lastSnapshot, "DB ") << endl;
reportFile << PrintProgress(&lastSnapshot, "DB") << endl;
}
returnCode_t myCellErrorLimitStatus = LoadCellErrorLimits();
if ( myCellErrorLimitStatus != OK ) {
Expand Down Expand Up @@ -161,7 +161,7 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
if ( gSetup_cvc ) {
PrintNetSuggestions();
}
reportFile << PrintProgress(&lastSnapshot, "EQUIV ") << endl;
reportFile << PrintProgress(&lastSnapshot, "EQUIV") << endl;
reportFile << "Power nets " << CPower::powerCount << endl;
// DumpStatistics(parameterModelPtrMap, "parameter->model map", logFile);
DumpStatistics(parameterResistanceMap, "parameter->resistance map", logFile);
Expand All @@ -176,7 +176,7 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
ShortNonConductingResistors();
// SetResistorVoltagesForMosSwitches();
SetResistorVoltagesByPower();
reportFile << PrintProgress(&lastSnapshot, "RES ") << endl;
reportFile << PrintProgress(&lastSnapshot, "RES") << endl;
reportFile << "Power nets " << CPower::powerCount << endl;
if ( gInteractive_cvc && --gContinueCount < 1
&& InteractiveCvc(STAGE_RESISTANCE) == SKIP ) continue;
Expand All @@ -190,7 +190,7 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
/// - PMOS gate-source errors\n
ResetMinMaxPower();
SetAnalogNets();
reportFile << PrintProgress(&lastSnapshot, "MIN/MAX1 ") << endl;
reportFile << PrintProgress(&lastSnapshot, "MIN/MAX1") << endl;
reportFile << "Power nets " << CPower::powerCount << endl;
if ( detectErrorFlag ) {
if ( ! cvcParameters.cvcLogicDiodes ) {
Expand All @@ -208,7 +208,7 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
if ( ! gSetup_cvc ) {
FindPmosGateVsSourceErrors();
}
reportFile << PrintProgress(&lastSnapshot, "ERROR ") << endl;
reportFile << PrintProgress(&lastSnapshot, "ERROR") << endl;
}
if ( gInteractive_cvc && --gContinueCount < 1
&& InteractiveCvc(STAGE_FIRST_MINMAX) == SKIP ) continue;
Expand All @@ -219,7 +219,7 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
SaveMinMaxLeakVoltages();
SetSimPower(POWER_NETS_ONLY);
cvcCircuitList.PrintAndResetCircuitErrors(this, cvcParameters.cvcCircuitErrorLimit, logFile, errorFile, "! Logic shorts 1");
reportFile << PrintProgress(&lastSnapshot, "SIM1 ") << endl;
reportFile << PrintProgress(&lastSnapshot, "SIM1") << endl;
reportFile << "Power nets " << CPower::powerCount << endl;
if ( ! cvcParameters.cvcSOI ) {
CheckConnections();
Expand All @@ -238,7 +238,7 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
SetSCRCPower();
}
SetSimPower(ALL_NETS_AND_FUSE);
reportFile << PrintProgress(&lastSnapshot, "SIM2 ") << endl;
reportFile << PrintProgress(&lastSnapshot, "SIM2") << endl;
reportFile << "Power nets " << CPower::powerCount << endl;
CNetIdSet myNewNetSet;
vector<bool> myIgnoreNet_v(simNet_v.size(), false);
Expand All @@ -263,7 +263,7 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
/// - expected value errors
ResetMinMaxPower();
SetInverters();
reportFile << PrintProgress(&lastSnapshot, "MIN/MAX2 ") << endl;
reportFile << PrintProgress(&lastSnapshot, "MIN/MAX2") << endl;
reportFile << "Power nets " << CPower::powerCount << endl;
if ( detectErrorFlag ) {
if ( cvcParameters.cvcLogicDiodes ) {
Expand All @@ -277,7 +277,7 @@ void CCvcDb::VerifyCircuitForAllModes(int argc, const char * argv[]) {
}
PrintErrorTotals();
// PrintShortedNets(cvcParameters.cvcReportBaseFilename + ".shorts.gz");
reportFile << PrintProgress(&lastSnapshot, "Total ") << endl;
reportFile << PrintProgress(&lastSnapshot, "Total") << endl;
if ( gDebug_cvc ) {
PrintAllVirtualNets<CVirtualNetVector>(minNet_v, simNet_v, maxNet_v, "(3)");
cvcCircuitList.Print("", "CVC Full Circuit List");
Expand Down
151 changes: 76 additions & 75 deletions src/CCvcDb_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,88 +38,89 @@ void CCvcDb::SetOutputFiles(string theReportFilename) {
string mySystemCommand;
myBaseFilename = theReportFilename.substr(0, theReportFilename.find(".log"));
cvcParameters.cvcReportBaseFilename = myBaseFilename;
int myFileSuffix = 0;
myBackupFilename = theReportFilename;
myCompressedFilename = myBackupFilename + ".gz";
while ( ( myTestFile.open(myBackupFilename), myTestFile.good() ) || ( myTestFile.open(myCompressedFilename), myTestFile.good() ) ) {
myTestFile.close();
myBackupFilename = theReportFilename + "." + to_string<int>(++myFileSuffix);
if ( cvcParameters.cvcBackupResults ) {
int myFileSuffix = 0;
myBackupFilename = theReportFilename;
myCompressedFilename = myBackupFilename + ".gz";
}
if ( myFileSuffix > 0 ) {
cout << "INFO: Moving " << theReportFilename << " to " << myCompressedFilename << endl;
assert(rename(theReportFilename.c_str(), myBackupFilename.c_str()) == 0);
mySystemCommand = "gzip -f " + myBackupFilename;
assert(system(mySystemCommand.c_str()) == 0);

myBaseFilename = cvcParameters.cvcReportBaseFilename + ".error";
myBaseCompressedFilename = myBaseFilename + ".gz";
myBackupFilename = myBaseFilename + "." + to_string<int>(myFileSuffix);
myCompressedFilename = myBackupFilename + ".gz";
if ( ( myTestFile.open(myBackupFilename), myTestFile.good() ) || ( myTestFile.open(myCompressedFilename), myTestFile.good() ) ) {
while ( ( myTestFile.open(myBackupFilename), myTestFile.good() ) || ( myTestFile.open(myCompressedFilename), myTestFile.good() ) ) {
myTestFile.close();
cout << "INFO: Removing " << myBackupFilename << endl;
assert((remove(myBackupFilename.c_str()) == 0) || (remove(myCompressedFilename.c_str()) == 0));
myBackupFilename = theReportFilename + "." + to_string<int>(++myFileSuffix);
myCompressedFilename = myBackupFilename + ".gz";
}
if ( myTestFile.open(myBaseFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Moving " << myBaseFilename << " to " << myCompressedFilename << endl;
assert(rename(myBaseFilename.c_str(), myBackupFilename.c_str()) == 0);
if ( myFileSuffix > 0 ) {
cout << "INFO: Moving " << theReportFilename << " to " << myCompressedFilename << endl;
assert(rename(theReportFilename.c_str(), myBackupFilename.c_str()) == 0);
mySystemCommand = "gzip -f " + myBackupFilename;
assert(system(mySystemCommand.c_str()) == 0);
} else if ( myTestFile.open(myBaseCompressedFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Moving " << myBaseCompressedFilename << " to " << myCompressedFilename << endl;
assert(rename(myBaseCompressedFilename.c_str(), myCompressedFilename.c_str()) == 0);
}

myBaseFilename = cvcParameters.cvcReportBaseFilename + ".shorts";
myBaseCompressedFilename = myBaseFilename + ".gz";
myBackupFilename = myBaseFilename + "." + to_string<int>(myFileSuffix);
myCompressedFilename = myBackupFilename + ".gz";
if ( ( myTestFile.open(myBackupFilename), myTestFile.good() ) || ( myTestFile.open(myCompressedFilename), myTestFile.good() ) ) {
myTestFile.close();
cout << "INFO: Removing " << myBackupFilename << endl;
assert((remove(myBackupFilename.c_str()) == 0) || (remove(myCompressedFilename.c_str()) == 0));
}
if ( myTestFile.open(myBaseFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Moving " << myBaseFilename << " to " << myCompressedFilename << endl;
assert(rename(myBaseFilename.c_str(), myBackupFilename.c_str()) == 0);
mySystemCommand = "gzip -f " + myBackupFilename;
assert(system(mySystemCommand.c_str()) == 0);
} else if ( myTestFile.open(myBaseCompressedFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Moving " << myBaseCompressedFilename << " to " << myCompressedFilename << endl;
assert(rename(myBaseCompressedFilename.c_str(), myCompressedFilename.c_str()) == 0);
}
} else {
myBaseFilename = cvcParameters.cvcReportBaseFilename + ".error";
myBaseCompressedFilename = myBaseFilename + ".gz";
if ( myTestFile.open(myBaseFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Removing " << myBaseFilename << endl;
remove(myBaseFilename.c_str());
}
if ( myTestFile.open(myBaseCompressedFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Removing " << myBaseCompressedFilename << endl;
remove(myBaseCompressedFilename.c_str());
}
myBaseFilename = cvcParameters.cvcReportBaseFilename + ".shorts";
myBaseCompressedFilename = myBaseFilename + ".gz";
if ( myTestFile.open(myBaseFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Removing " << myBaseFilename << endl;
remove(myBaseFilename.c_str());
}
if ( myTestFile.open(myBaseCompressedFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Removing " << myBaseCompressedFilename << endl;
remove(myBaseCompressedFilename.c_str());
myBaseFilename = cvcParameters.cvcReportBaseFilename + ".error";
myBaseCompressedFilename = myBaseFilename + ".gz";
myBackupFilename = myBaseFilename + "." + to_string<int>(myFileSuffix);
myCompressedFilename = myBackupFilename + ".gz";
if ( ( myTestFile.open(myBackupFilename), myTestFile.good() ) || ( myTestFile.open(myCompressedFilename), myTestFile.good() ) ) {
myTestFile.close();
cout << "INFO: Removing " << myBackupFilename << endl;
assert((remove(myBackupFilename.c_str()) == 0) || (remove(myCompressedFilename.c_str()) == 0));
}
if ( myTestFile.open(myBaseFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Moving " << myBaseFilename << " to " << myCompressedFilename << endl;
assert(rename(myBaseFilename.c_str(), myBackupFilename.c_str()) == 0);
mySystemCommand = "gzip -f " + myBackupFilename;
assert(system(mySystemCommand.c_str()) == 0);
} else if ( myTestFile.open(myBaseCompressedFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Moving " << myBaseCompressedFilename << " to " << myCompressedFilename << endl;
assert(rename(myBaseCompressedFilename.c_str(), myCompressedFilename.c_str()) == 0);
}

myBaseFilename = cvcParameters.cvcReportBaseFilename + ".shorts";
myBaseCompressedFilename = myBaseFilename + ".gz";
myBackupFilename = myBaseFilename + "." + to_string<int>(myFileSuffix);
myCompressedFilename = myBackupFilename + ".gz";
if ( ( myTestFile.open(myBackupFilename), myTestFile.good() ) || ( myTestFile.open(myCompressedFilename), myTestFile.good() ) ) {
myTestFile.close();
cout << "INFO: Removing " << myBackupFilename << endl;
assert((remove(myBackupFilename.c_str()) == 0) || (remove(myCompressedFilename.c_str()) == 0));
}
if ( myTestFile.open(myBaseFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Moving " << myBaseFilename << " to " << myCompressedFilename << endl;
assert(rename(myBaseFilename.c_str(), myBackupFilename.c_str()) == 0);
mySystemCommand = "gzip -f " + myBackupFilename;
assert(system(mySystemCommand.c_str()) == 0);
} else if ( myTestFile.open(myBaseCompressedFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Moving " << myBaseCompressedFilename << " to " << myCompressedFilename << endl;
assert(rename(myBaseCompressedFilename.c_str(), myCompressedFilename.c_str()) == 0);
}
} else {
myBaseFilename = cvcParameters.cvcReportBaseFilename + ".error";
myBaseCompressedFilename = myBaseFilename + ".gz";
if ( myTestFile.open(myBaseFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Removing " << myBaseFilename << endl;
remove(myBaseFilename.c_str());
}
if ( myTestFile.open(myBaseCompressedFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Removing " << myBaseCompressedFilename << endl;
remove(myBaseCompressedFilename.c_str());
}
myBaseFilename = cvcParameters.cvcReportBaseFilename + ".shorts";
myBaseCompressedFilename = myBaseFilename + ".gz";
if ( myTestFile.open(myBaseFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Removing " << myBaseFilename << endl;
remove(myBaseFilename.c_str());
}
if ( myTestFile.open(myBaseCompressedFilename), myTestFile.good() ) {
myTestFile.close();
cout << "INFO: Removing " << myBaseCompressedFilename << endl;
remove(myBaseCompressedFilename.c_str());
}
}
}
cout << "DEBUG: report file '" << theReportFilename << "'" << endl;
logFile.open(theReportFilename);
if ( ! logFile.good() ) {
throw EFatalError("Could not open " + theReportFilename);
Expand Down Expand Up @@ -978,7 +979,7 @@ void CCvcDb::PrintLargeCircuits() {
for ( auto circuit_ppit = cvcCircuitList.begin(); circuit_ppit != cvcCircuitList.end(); circuit_ppit++ ) {
if ( (*circuit_ppit)->deviceCount > cvcParameters.cvcLargeCircuitSize ) {
for ( auto instance_pit = (*circuit_ppit)->instanceId_v.begin(); instance_pit != (*circuit_ppit)->instanceId_v.end(); instance_pit++ ) {
reportFile << "INFO: Large circuit " << HierarchyName(*instance_pit, true, true) << " device count " << (*circuit_ppit)->deviceCount << endl;
debugFile << "INFO: Large circuit " << HierarchyName(*instance_pit, true, true) << " device count " << (*circuit_ppit)->deviceCount << endl;
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion src/CCvcParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ void CCvcParameters::ResetEnvironment() {
//! When true, uses logic values, if known, for diode checks. Default is to ignore logic values.
cvcAnalogGates = defaultAnalogGates;
//! When false, ignore errors from analog gates. Default is to use analog values.
cvcBackupResults = defaultBackupResults;
//! When true, backup log and error file. Default is to not create backups.
cvcMosDiodeErrorThreshold = defaultErrorThreshold;
cvcShortErrorThreshold = defaultErrorThreshold;
cvcBiasErrorThreshold = defaultErrorThreshold;
Expand Down Expand Up @@ -128,7 +130,8 @@ void CCvcParameters::PrintEnvironment(ostream & theOutputFile) {
theOutputFile << "CVC_IGNORE_NO_LEAK_FLOATING = '" << (( cvcIgnoreNoLeakFloating ) ? "true" : "false") << "'" << endl;
theOutputFile << "CVC_LEAK_OVERVOLTAGE = '" << (( cvcLeakOvervoltage ) ? "true" : "false") << "'" << endl;
theOutputFile << "CVC_LOGIC_DIODES = '" << (( cvcLogicDiodes ) ? "true" : "false") << "'" << endl;
theOutputFile << "CVC_ANALOG_GATES = '" << (( cvcLogicDiodes ) ? "true" : "false") << "'" << endl;
theOutputFile << "CVC_ANALOG_GATES = '" << (( cvcAnalogGates ) ? "true" : "false") << "'" << endl;
theOutputFile << "CVC_BACKUP_RESULTS = '" << (( cvcBackupResults ) ? "true" : "false") << "'" << endl;
theOutputFile << "CVC_MOS_DIODE_ERROR_THRESHOLD = '" << Voltage_to_float(cvcMosDiodeErrorThreshold) << "'" << endl;
theOutputFile << "CVC_SHORT_ERROR_THRESHOLD = '" << Voltage_to_float(cvcShortErrorThreshold) << "'" << endl;
theOutputFile << "CVC_BIAS_ERROR_THRESHOLD = '" << Voltage_to_float(cvcBiasErrorThreshold) << "'" << endl;
Expand Down Expand Up @@ -174,6 +177,7 @@ void CCvcParameters::PrintDefaultEnvironment() {
myDefaultCvcrc << "CVC_LEAK_OVERVOLTAGE = '" << (( cvcLeakOvervoltage ) ? "true" : "false") << "'" << endl;
myDefaultCvcrc << "CVC_LOGIC_DIODES = '" << (( cvcLogicDiodes ) ? "true" : "false") << "'" << endl;
myDefaultCvcrc << "CVC_ANALOG_GATES = '" << (( cvcAnalogGates ) ? "true" : "false") << "'" << endl;
myDefaultCvcrc << "CVC_BACKUP_RESULTS = '" << (( cvcBackupResults ) ? "true" : "false") << "'" << endl;
myDefaultCvcrc << "CVC_MOS_DIODE_ERROR_THRESHOLD = '" << Voltage_to_float(cvcMosDiodeErrorThreshold) << "'" << endl;
myDefaultCvcrc << "CVC_SHORT_ERROR_THRESHOLD = '" << Voltage_to_float(cvcShortErrorThreshold) << "'" << endl;
myDefaultCvcrc << "CVC_BIAS_ERROR_THRESHOLD = '" << Voltage_to_float(cvcBiasErrorThreshold) << "'" << endl;
Expand Down Expand Up @@ -266,6 +270,8 @@ void CCvcParameters::LoadEnvironment(const string theEnvironmentFilename, const
cvcLogicDiodes = strcasecmp(myBuffer, "true") == 0;
} else if ( myVariable == "CVC_ANALOG_GATES" ) {
cvcAnalogGates = strcasecmp(myBuffer, "true") == 0;
} else if ( myVariable == "CVC_BACKUP_RESULTS" ) {
cvcBackupResults = strcasecmp(myBuffer, "true") == 0;
} else if ( myVariable == "CVC_MOS_DIODE_ERROR_THRESHOLD" ) {
cvcMosDiodeErrorThreshold = String_to_Voltage(string(myBuffer));
} else if ( myVariable == "CVC_SHORT_ERROR_THRESHOLD" ) {
Expand Down
4 changes: 3 additions & 1 deletion src/CCvcParameters.hh
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ public:
const bool defaultLeakOvervoltage = true;
const bool defaultLogicDiodes = false;
const bool defaultAnalogGates = true;
const bool defaultBackupResults = false;
const voltage_t defaultErrorThreshold = 0;
const size_t defaultParallelCircuitPortLimit = 0;
const string defaultCellErrorLimitFile = "";
const string defaultCellChecksumFile = "";
const size_t defaultLargeCircuitSize = 10e6;
const string defaultNetCheckFile = "";
const string defaultNetCheckFile = "";

string cvcReportTitle;

Expand Down Expand Up @@ -91,6 +92,7 @@ public:
bool cvcLeakOvervoltage = defaultLeakOvervoltage;
bool cvcLogicDiodes = defaultLogicDiodes;
bool cvcAnalogGates = defaultAnalogGates;
bool cvcBackupResults = defaultBackupResults;
voltage_t cvcMosDiodeErrorThreshold = defaultErrorThreshold;
voltage_t cvcShortErrorThreshold = defaultErrorThreshold;
voltage_t cvcBiasErrorThreshold = defaultErrorThreshold;
Expand Down
4 changes: 2 additions & 2 deletions src/CInstance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void CInstance::AssignTopGlobalIDs(CCvcDb * theCvcDb_p, CCircuit * theMaster_p)
}
theCvcDb_p->netParent_v.shrink_to_fit();
theCvcDb_p->deviceParent_v.shrink_to_fit();
cout << "DEBUG: netParent size " << theCvcDb_p->netParent_v.size() << "; deviceParent size " << theCvcDb_p->deviceParent_v.size() << endl;
cout << "DEBUG: parallel collisions " << gHashCollisionCount << " max length " << gMaxHashLength << endl;
theCvcDb_p->debugFile << "DEBUG: netParent size " << theCvcDb_p->netParent_v.size() << "; deviceParent size " << theCvcDb_p->deviceParent_v.size() << endl;
theCvcDb_p->debugFile << "DEBUG: parallel collisions " << gHashCollisionCount << " max length " << gMaxHashLength << endl;
}

void CInstance::AssignGlobalIDs(CCvcDb * theCvcDb_p, const instanceId_t theInstanceId, CDevice * theSubcircuit_p, const instanceId_t theParentId,
Expand Down
2 changes: 1 addition & 1 deletion src/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ char * PrintProgress(rusage * theLastSnapshot_p, string theHeading) {

TakeSnapshot(&currentSnapshot);

sprintf(myString, "%sUsage: Time: %ld Memory: %ld I/O: %ld Swap: %ld", theHeading.c_str(), currentSnapshot.ru_utime.tv_sec,
sprintf(myString, "Usage %s: Time: %ld Memory: %ld I/O: %ld Swap: %ld", theHeading.c_str(), currentSnapshot.ru_utime.tv_sec,
currentSnapshot.ru_maxrss, currentSnapshot.ru_inblock + currentSnapshot.ru_oublock,
currentSnapshot.ru_nswap);

Expand Down

0 comments on commit cca51d3

Please sign in to comment.