Error model changed to avoid premature end of simulation.

Check if the provided temperature and retention time are in a valid range that
is covered by the input data stored in the errorMap. In case values are out of
range the maximum values provided are used and debug messages are generated to
alert the user.
This commit is contained in:
Éder F. Zulian
2015-10-15 12:10:01 +02:00
parent 82c165fb53
commit 07fb5287b8

View File

@@ -711,55 +711,55 @@ void errorModel::prepareWeakCells()
// Retrieve number of flipping bits which fits best to temperature input and time since last refresh
unsigned int errorModel::getNumberOfFlips(double temp, sc_time time)
{
// Check if the provided temperature and time are in a valid range that
// is covered by the input data stored in the errorMap:
if(temp > maxTemperature)
{
SC_REPORT_FATAL("errormodel","temperature out of range");
// Check if the provided temperature and retention time are in a valid
// range that is covered by the input data stored in the errorMap.
// In case values are out of range the maximum values provided are used
// (saturation) and debug messages are generated to alert the user.
if (temp > maxTemperature) {
temp = maxTemperature;
DebugManager::getInstance().printDebugMessage(name, "errormodel, temperature out of range.");
}
else if(time > maxTime)
{
SC_REPORT_FATAL("errormodel","time out of range");
if (time > maxTime) {
time = maxTime;
DebugManager::getInstance().printDebugMessage(name, "errormodel, time out of range.");
}
else
// Find nearest temperature:
double nearestTemperature = 0;
for( const auto &i : errorMap )
{
// Find nearest temperature:
double nearestTemperature = 0;
for( const auto &i : errorMap )
if(i.first >= temp) // for worst case reasons we go to the next bin
{
if(i.first >= temp) // for worst case reasons we go to the next bin
{
nearestTemperature = i.first;
break;
}
nearestTemperature = i.first;
break;
}
// Find nearest time:
sc_time nearestTime;
for( const auto &i : errorMap[nearestTemperature])
{
if(i.first >= time) // for worst case reasons we go to the next bin
{
nearestTime = i.first;
break;
}
}
errors e = errorMap[nearestTemperature][nearestTime];
//std::stringstream msg;
//msg << "ACT/REF temp:" << temp
// << " time:" << time
// << " nearestTemp:" << nearestTemperature
// << " nearestTime:" << nearestTime
// << " ind:" << e.independent
// << " dep:" << e.dependent;
//DebugManager::getInstance().printDebugMessage(name, msg.str());
return e.independent + e.dependent;
}
return 0;
// Find nearest time:
sc_time nearestTime;
for( const auto &i : errorMap[nearestTemperature])
{
if(i.first >= time) // for worst case reasons we go to the next bin
{
nearestTime = i.first;
break;
}
}
errors e = errorMap[nearestTemperature][nearestTime];
//std::stringstream msg;
//msg << "ACT/REF temp:" << temp
// << " time:" << time
// << " nearestTemp:" << nearestTemperature
// << " nearestTime:" << nearestTime
// << " ind:" << e.independent
// << " dep:" << e.dependent;
//DebugManager::getInstance().printDebugMessage(name, msg.str());
return e.independent + e.dependent;
}
void errorModel::setContext(DecodedAddress addr)