Included cmake debug flag into debug manager.

This commit is contained in:
Lukas Steiner
2020-04-06 11:44:33 +02:00
parent 2e255217e2
commit 658e3fb1ca
10 changed files with 31 additions and 38 deletions

View File

@@ -37,14 +37,15 @@
#include "utils.h"
#include <fstream>
#include <set>
using std::ifstream;
using std::cout;
using std::endl;
#include <set>
using std::set;
using std::pair;
using std::map;
using std::deque;
tinyxml2::XMLElement *CongenAddressDecoder::GetXMLNode(tinyxml2::XMLElement
*pRoot, std::string strName)

View File

@@ -43,10 +43,6 @@
#include <vector>
#include <map>
using std::vector;
using std::pair;
using std::map;
class CongenAddressDecoder : private AddressDecoder
{
// Friendship needed so that the AddressDecoder can access the
@@ -80,13 +76,13 @@ private:
m_nByteBits; // Number of Byte bits used by this mapping
vector<XOR>
std::vector<XOR>
m_vXor; // This container stores for each used xor gate a pair which consists of "First/Number of an address bit which corresponds to a bank" and "Second/Number of an address bit which corresponds to a row"
vector<pair<unsigned, unsigned>>
std::vector<std::pair<unsigned, unsigned>>
m_vBankBits; // This container stores for each bank bit a pair which consists of "First/Number of the bank bit" and "Second/Number of the address bit"
vector<pair<unsigned, unsigned>>
std::vector<std::pair<unsigned, unsigned>>
m_vRowBits; // This container stores for each row bit a pair which consists of "First/Number of the row bit" and "Second/Number of the address bit"
vector<pair<unsigned, unsigned>>
std::vector<std::pair<unsigned, unsigned>>
m_vColumnBits; // This container stores for each column bit a pair which consists of "First/Number of the column bit" and "Second/Number of the address bit"
//Methods

View File

@@ -36,13 +36,13 @@
#include "DebugManager.h"
#ifdef DEBUGGING
#ifndef NDEBUG
#include "../configuration/Configuration.h"
void DebugManager::printDebugMessage(std::string sender, std::string message)
{
if (Configuration::getInstance().Debug) {
if (Configuration::getInstance().debug) {
if (writeToConsole)
std::cout << " at " << sc_time_stamp() << "\t in " << sender << "\t: " << message <<
std::endl;

View File

@@ -37,9 +37,7 @@
#ifndef DEBUGMANAGER_H
#define DEBUGMANAGER_H
//#define DEBUGGING
#ifndef DEBUGGING
#ifdef NDEBUG
#define PRINTDEBUGMESSAGE(sender, message) {}
#else
#define PRINTDEBUGMESSAGE(sender, message) DebugManager::getInstance().printDebugMessage(sender, message)

View File

@@ -153,12 +153,12 @@ void TlmRecorder::introduceTransactionSystem(tlm_generic_payload &trans)
currentTransactionsInSystem[&trans].timeOfGeneration =
GenerationExtension::getExtension(&trans).TimeOfGeneration();
PRINTDEBUGMESSAGE(name, "New transaction #" + to_string(id) + " generation time " +
PRINTDEBUGMESSAGE(name, "New transaction #" + std::to_string(id) + " generation time " +
currentTransactionsInSystem[&trans].timeOfGeneration.to_string());
if (id % transactionCommitRate == 0) {
PRINTDEBUGMESSAGE(name, "Committing transactions " +
to_string(id - transactionCommitRate + 1) + " - " + to_string(id));
std::to_string(id - transactionCommitRate + 1) + " - " + std::to_string(id));
commitRecordedDataToDB();
}
}
@@ -168,7 +168,7 @@ void TlmRecorder::removeTransactionFromSystem(tlm_generic_payload &trans)
assert(currentTransactionsInSystem.count(&trans) != 0);
PRINTDEBUGMESSAGE(name, "Removing transaction #" +
to_string(currentTransactionsInSystem[&trans].id));
std::to_string(currentTransactionsInSystem[&trans].id));
Transaction &recordingData = currentTransactionsInSystem[&trans];
recordedData.push_back(recordingData);

View File

@@ -81,9 +81,9 @@ void ControllerRecordable::recordPhase(tlm_generic_payload &trans, tlm_phase pha
uint64_t id __attribute__((unused)) = DramExtension::getExtension(trans).getPayloadID();
PRINTDEBUGMESSAGE(name(), "Recording " + phaseNameToString(phase) + " thread " +
to_string(thr) + " channel " + to_string(ch) + " bank group " + to_string(
bg) + " bank " + to_string(bank) + " row " + to_string(row) + " column " +
to_string(col) + " id " + to_string(id) + " at " + recTime.to_string());
std::to_string(thr) + " channel " + std::to_string(ch) + " bank group " + std::to_string(
bg) + " bank " + std::to_string(bank) + " row " + std::to_string(row) + " column " +
std::to_string(col) + " id " + std::to_string(id) + " at " + recTime.to_string());
tlmRecorder->recordPhase(trans, phase, recTime);
}

View File

@@ -5,6 +5,7 @@
#include <string.h>
using std::cout;
using std::deque;
CWord::CWord(unsigned nBitLength)
: m_nBitLength(nBitLength)

View File

@@ -3,15 +3,12 @@
#include <deque>
#include "Bit.h"
using std::deque;
class CWord
{
protected:
unsigned m_nBitLength;
deque<CBit> m_word;
std::deque<CBit> m_word;
public:

View File

@@ -58,7 +58,7 @@ public:
private:
tlm_utils::peq_with_cb_and_phase<ReorderBuffer> payloadEventQueue;
deque<tlm::tlm_generic_payload *> pendingRequestsInOrder;
std::deque<tlm::tlm_generic_payload *> pendingRequestsInOrder;
std::set<tlm::tlm_generic_payload *> receivedResponses;
bool responseIsPendingInInitator;
@@ -130,8 +130,8 @@ private:
{
sc_assert(phase == END_REQ ||
(phase == BEGIN_RESP && pendingRequestsInOrder.front() == &payload
sc_assert(phase == tlm::END_REQ ||
(phase == tlm::BEGIN_RESP && pendingRequestsInOrder.front() == &payload
&& receivedResponses.count(&payload)));
tlm::tlm_phase TPhase = phase;

View File

@@ -100,9 +100,9 @@ void DramRecordable<BaseDram>::recordPhase(tlm_generic_payload &trans, tlm_phase
unsigned int col __attribute__((unused)) = DramExtension::getExtension(trans).getColumn().ID();
PRINTDEBUGMESSAGE(this->name(), "Recording " + phaseNameToString(phase) + " thread " +
to_string(thr) + " channel " + to_string(ch) + " bank group " + to_string(
bg) + " bank " + to_string(bank) + " row " + to_string(row) + " column " +
to_string(col) + " at " + recTime.to_string());
std::to_string(thr) + " channel " + std::to_string(ch) + " bank group " + std::to_string(
bg) + " bank " + std::to_string(bank) + " row " + std::to_string(row) + " column " +
std::to_string(col) + " at " + recTime.to_string());
tlmRecorder->recordPhase(trans, phase, recTime);
@@ -139,12 +139,12 @@ void DramRecordable<BaseDram>::powerWindow()
* Configuration::getInstance().numberOfDevicesOnDIMM);
// Here considering that DRAMPower provides the energy in pJ and the power in mW
PRINTDEBUGMESSAGE(this->name(), string("\tWindow Energy: \t") + to_string(
DRAMPower->getEnergy().window_energy *
Configuration::getInstance().numberOfDevicesOnDIMM) + string("\t[pJ]"));
PRINTDEBUGMESSAGE(this->name(), string("\tWindow Average Power: \t") + to_string(
DRAMPower->getPower().window_average_power *
Configuration::getInstance().numberOfDevicesOnDIMM) + string("\t[mW]"));
PRINTDEBUGMESSAGE(this->name(), std::string("\tWindow Energy: \t") + std::to_string(
this->DRAMPower->getEnergy().window_energy *
Configuration::getInstance().numberOfDevicesOnDIMM) + std::string("\t[pJ]"));
PRINTDEBUGMESSAGE(this->name(), std::string("\tWindow Average Power: \t") + std::to_string(
this->DRAMPower->getPower().window_average_power *
Configuration::getInstance().numberOfDevicesOnDIMM) + std::string("\t[mW]"));
} while (true);
}