diff options
author | Matthias Jung <jungma@eit.uni-kl.de> | 2016-07-01 10:31:36 -0500 |
---|---|---|
committer | Matthias Jung <jungma@eit.uni-kl.de> | 2016-07-01 10:31:36 -0500 |
commit | 86e9a6ffecbeb1ba743c71786e934cf290bab7ff (patch) | |
tree | 8b114edcc523409f6b2cb33b9ae910cea2ca4e5a /ext/drampower/src/TraceParser.cc | |
parent | 137e244bda708e27882aa8b2f13d47cfd17e9d97 (diff) | |
download | gem5-86e9a6ffecbeb1ba743c71786e934cf290bab7ff.tar.xz |
ext: Update DRAMPower
Sync DRAMPower to external tool
This patch syncs the DRAMPower library of gem5 to the external
one on github (https://github.com/ravenrd/DRAMPower) of which
I am a maintainer.
The version used is the commit:
902a00a1797c48a9df97ec88868f20e847680ae6
from 07. May. 2016.
Committed by Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'ext/drampower/src/TraceParser.cc')
-rw-r--r-- | ext/drampower/src/TraceParser.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/ext/drampower/src/TraceParser.cc b/ext/drampower/src/TraceParser.cc index ec87f06da..2cf9a8572 100644 --- a/ext/drampower/src/TraceParser.cc +++ b/ext/drampower/src/TraceParser.cc @@ -42,14 +42,19 @@ using namespace Data; using namespace std; +TraceParser::TraceParser(int64_t nbrOfBanks) : + counters(nbrOfBanks) +{ +} + + Data::MemCommand TraceParser::parseLine(std::string line) { - MemCommand memcmd; + MemCommand memcmd(MemCommand::UNINITIALIZED, 0, 0); istringstream linestream(line); string item; - double item_val; + int64_t item_val; unsigned itemnum = 0; - MemCommand::cmds type = MemCommand::NOP; // Initialized to prevent warning while (getline(linestream, item, ',')) { if (itemnum == 0) { @@ -62,10 +67,8 @@ Data::MemCommand TraceParser::parseLine(std::string line) } else if (itemnum == 2) { stringstream bank(item); bank >> item_val; - memcmd.setType(type); memcmd.setBank(static_cast<unsigned>(item_val)); } - type = memcmd.getType(); itemnum++; } return memcmd; @@ -90,13 +93,13 @@ void TraceParser::parseFile(MemorySpecification memSpec, std::ifstream& trace, cmd_list.push_back(cmdline); nCommands++; if (nCommands == window) { - counters.getCommands(memSpec, memSpec.memArchSpec.nbrOfBanks, cmd_list, lastupdate); + counters.getCommands(memSpec, cmd_list, lastupdate); nCommands = 0; cmd_list.clear(); } } lastupdate = true; - counters.getCommands(memSpec, memSpec.memArchSpec.nbrOfBanks, cmd_list, lastupdate); + counters.getCommands(memSpec, cmd_list, lastupdate); cmd_list.clear(); pwr_trace.close(); } else { @@ -106,13 +109,13 @@ void TraceParser::parseFile(MemorySpecification memSpec, std::ifstream& trace, cmd_list.push_back(cmdline); nCommands++; if (nCommands == window) { - counters.getCommands(memSpec, memSpec.memArchSpec.nbrOfBanks, cmd_list, lastupdate); + counters.getCommands(memSpec, cmd_list, lastupdate); nCommands = 0; cmd_list.clear(); } } lastupdate = true; - counters.getCommands(memSpec, memSpec.memArchSpec.nbrOfBanks, cmd_list, lastupdate); + counters.getCommands(memSpec, cmd_list, lastupdate); cmd_list.clear(); } counters.clear(); |