Removed unused member variables in congen address decoder.

This commit is contained in:
Lukas Steiner
2020-04-07 11:09:43 +02:00
parent 22c79fa3df
commit 36a8982d79
2 changed files with 4 additions and 39 deletions

View File

@@ -91,41 +91,19 @@ void CongenAddressDecoder::setConfiguration(std::string url)
reportFatal("ConGenAddressDecorder",
"Root node name differs from \"CONGEN\". File format not supported.");
// Load basic configuration
tinyxml2::XMLElement *pNode = getXMLNode(pRoot, "NAME");
strName = pNode->GetText();
pNode = getXMLNode(pRoot, "COSTS");
nCost = getUnsignedTextFromXMLNode(pNode);
tinyxml2::XMLElement *pConfig = getXMLNode(pRoot, "CONFIG");
pNode = getXMLNode(pConfig, "NUM_CHANNEL_BITS");
nChannelBits = getUnsignedTextFromXMLNode(pNode);
pNode = getXMLNode(pConfig, "NUM_RANK_BITS");
nRankBits = getUnsignedTextFromXMLNode(pNode);
pNode = getXMLNode(pConfig, "NUM_BANKGROUP_BITS");
nBankGroupBits = getUnsignedTextFromXMLNode(pNode);
pNode = getXMLNode(pConfig, "NUM_BANK_BITS");
nBankBits = getUnsignedTextFromXMLNode(pNode);
pNode = getXMLNode(pConfig, "NUM_ROW_BITS");
nRowBits = getUnsignedTextFromXMLNode(pNode);
pNode = getXMLNode(pConfig, "NUM_COLUMN_BITS");
nColumnBits = getUnsignedTextFromXMLNode(pNode);
pNode = getXMLNode(pConfig, "NUM_BYTE_BITS");
nByteBits = getUnsignedTextFromXMLNode(pNode);
// Load address mapping
unsigned id = 0;
tinyxml2::XMLElement *pNode;
for (pNode = pRoot->FirstChildElement("SOLUTION"); pNode != nullptr;
pNode = pNode->NextSiblingElement("SOLUTION"))
{
if (getUnsignedAttrFromXMLNode(pNode, "ID") == id)
if (getUnsignedAttrFromXMLNode(pNode, "ID") == 0)
break; // Correct mapping was found.
}
// If no mapping was found report error
if (pNode == nullptr)
SC_REPORT_FATAL("ConGenAddressDecoder",
("No mapping with ID " + std::to_string(id) + " was found.").c_str());
SC_REPORT_FATAL("ConGenAddressDecoder", "No mapping with ID 0 was found.");
// get XOR connections
// An XOR connection needs two parameters: A bank bit and a Row bit.
@@ -219,7 +197,7 @@ void CongenAddressDecoder::setConfiguration(std::string url)
|| memSpec->numberOfBankGroups != amount.bankgroup || memSpec->numberOfBanks != amount.bank
|| memSpec->numberOfRows != amount.row || memSpec->numberOfColumns != amount.column
|| config.numberOfDevicesOnDIMM * memSpec->bitWidth != amount.bytes * 8)
SC_REPORT_FATAL("XmlAddressDecoder", "Memspec and addressmapping do not match");
SC_REPORT_FATAL("CongenAddressDecoder", "Memspec and addressmapping do not match");
}
DecodedAddress CongenAddressDecoder::decodeAddress(uint64_t encAddr)

View File

@@ -60,19 +60,6 @@ public:
// Member variables
private:
std::string strName; // The Name of this mapping
unsigned nCost; // Number of row misses produced by this mapping
unsigned nChannelBits;
unsigned nRankBits;
unsigned nBankGroupBits;
unsigned nBankBits; // Number of Bank bits used by this mapping
unsigned nRowBits; // Number of Row bits used by this mapping
unsigned nColumnBits; // Number of Column bits used by this mapping
unsigned nByteBits; // Number of Byte bits used by this mapping
// 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"
std::vector<XOR> vXor;
std::vector<std::pair<unsigned, unsigned>> vChannelBits;