Merge branch 'master' of https://git.rhrk.uni-kl.de/schlemmi/dram
This commit is contained in:
7
dram/clean
Executable file
7
dram/clean
Executable 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
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
const sc_time getExecutionTime() const;
|
||||
|
||||
Bank getBank() const;
|
||||
BankGroup getBankGroup() const;
|
||||
Row getRow() const;
|
||||
|
||||
unsigned int getBurstLength() const;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user