This commit is contained in:
robert
2014-04-10 01:06:07 +02:00
8 changed files with 55 additions and 17 deletions

7
dram/clean Executable file
View File

@@ -0,0 +1,7 @@
echo "Cleaning Up:"
echo " -->remove *.txt"
rm *.txt
echo " -->remove *.tdb-journal"
rm *.tdb
echo " -->remove *.tdb-journal"
rm *.tdb-journal

View File

@@ -15,15 +15,15 @@ DebugManager& DebugManager::getInstance()
return manager;
}
void DebugManager::printDebugMessage(string sender,string message)
void DebugManager::printDebugMessage(string sender, string message)
{
if (whiteList.count(sender))
{
if (printTime)
std::cout << " at " << sc_time_stamp();
if (printLocation)
std::cout << " in " << sender;
cout << "\t: " << message << endl;
if (writeToConsole)
cout << " at " << sc_time_stamp() << "\t in " << sender << "\t: " << message << endl;
if (writeToFile)
debugFile << " at " << sc_time_stamp().to_default_time_units() << " in " << sender << "\t: " << message << "\n";
}
}
@@ -34,8 +34,24 @@ void DebugManager::addToWhiteList(string sender)
void DebugManager::addToWhiteList(vector<string> senders)
{
for(string sender: senders)
for (string sender : senders)
addToWhiteList(sender);
}
DebugManager::DebugManager() :
writeToConsole(true), writeToFile(true)
{
debugFile.open("debug.txt");
}
void DebugManager::setDebugFile(std::string filename)
{
if(debugFile)
debugFile.close();
debugFile.open(filename);
}
DebugManager::~DebugManager()
{
debugFile.close();
}

View File

@@ -15,19 +15,25 @@
class DebugManager
{
public:
~DebugManager();
static DebugManager& getInstance();
bool printTime;
bool printLocation;
bool writeToConsole;
bool writeToFile;
void printDebugMessage(std::string message, std::string sender);
void addToWhiteList(std::string sender);
void addToWhiteList(std::vector<std::string> senders);
void setDebugFile(std::string filename);
private:
DebugManager() : printTime(true), printLocation(true) {};
DebugManager(const DebugManager&);
ofstream debugFile;
DebugManager();
DebugManager(const DebugManager&){};
std::set<std::string> whiteList;

View File

@@ -63,6 +63,11 @@ Bank ScheduledCommand::getBank() const
return extension.getBank();
}
BankGroup ScheduledCommand::getBankGroup() const
{
return extension.getBankGroup();
}
Row ScheduledCommand::getRow() const
{
return extension.getRow();
@@ -112,4 +117,3 @@ bool ScheduledCommand::collidesOnDataStrobe(const ScheduledCommand& cmd) const
}
}

View File

@@ -46,6 +46,7 @@ public:
const sc_time getExecutionTime() const;
Bank getBank() const;
BankGroup getBankGroup() const;
Row getRow() const;
unsigned int getBurstLength() const;

View File

@@ -76,7 +76,7 @@ bool ActivateChecker::satsfies_activateToActivate_differentBank(ScheduledCommand
{
sc_time time = act.first;
sc_time tRRD =
(getBankGroup(command.getBank()) == getBankGroup(act.second)) ?
(command.getBankGroup() == getBankGroup(act.second)) ?
config.Timings.tRRD_L : config.Timings.tRRD_S;
if ((time < command.getStart() && command.getStart() - time < tRRD)

View File

@@ -62,7 +62,8 @@ sc_time ReadChecker::getExecutionTime(const tlm::tlm_generic_payload& payload,
}
else
{
return getBurstLengthOnDataStrobe(payload.get_streaming_width()) + max(config.Timings.tRP, config.Timings.tRL);
return getBurstLengthOnDataStrobe(payload.get_streaming_width())
+ max(config.Timings.tRP, config.Timings.tRL);
}
}
@@ -75,7 +76,7 @@ bool ReadChecker::collidesWithStrobeCommand(ScheduledCommand& read,
bool collision = read.collidesOnDataStrobe(strobeCommand);
sc_time tCCD =
(getBankGroup(read.getBank()) == getBankGroup(strobeCommand.getBank())) ?
(read.getBankGroup() == strobeCommand.getBankGroup()) ?
config.Timings.tCCD_L : config.Timings.tCCD_S;
bool casToCas =
(getDistance(read.getStart(), strobeCommand.getStart()) < tCCD) ? true : false;
@@ -94,7 +95,7 @@ bool ReadChecker::collidesWithStrobeCommand(ScheduledCommand& read,
else
{
sc_time tWTR =
(getBankGroup(read.getBank()) == getBankGroup(strobeCommand.getBank())) ?
(read.getBankGroup() == strobeCommand.getBankGroup()) ?
config.Timings.tWTR_L : config.Timings.tWTR_S;
return read.getStart()

View File

@@ -61,7 +61,10 @@ Simulation::Simulation(sc_module_name name, string pathToResources, string trace
whiteList.push_back(ControllerCore::senderName);
whiteList.push_back(PowerDownManager::senderName);
}
DebugManager::getInstance().addToWhiteList(whiteList);
auto& dbg = DebugManager::getInstance();
dbg.addToWhiteList(whiteList);
dbg.setDebugFile(traceName + ".txt");
}
Simulation::~Simulation()