From 36a8982d79a6632ec37003f5ca601ee69ba765d9 Mon Sep 17 00:00:00 2001 From: Lukas Steiner Date: Tue, 7 Apr 2020 11:09:43 +0200 Subject: [PATCH] Removed unused member variables in congen address decoder. --- .../src/common/CongenAddressDecoder.cpp | 30 +++---------------- .../library/src/common/CongenAddressDecoder.h | 13 -------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/DRAMSys/library/src/common/CongenAddressDecoder.cpp b/DRAMSys/library/src/common/CongenAddressDecoder.cpp index b09ea149..b7051527 100644 --- a/DRAMSys/library/src/common/CongenAddressDecoder.cpp +++ b/DRAMSys/library/src/common/CongenAddressDecoder.cpp @@ -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) diff --git a/DRAMSys/library/src/common/CongenAddressDecoder.h b/DRAMSys/library/src/common/CongenAddressDecoder.h index a4a74cae..100ae350 100644 --- a/DRAMSys/library/src/common/CongenAddressDecoder.h +++ b/DRAMSys/library/src/common/CongenAddressDecoder.h @@ -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 vXor; std::vector> vChannelBits;