2c2
< * Copyright (c) 2010-2015 ARM Limited
---
> * Copyright (c) 2010-2016 ARM Limited
901,903c901,902
< rank_ref.power.powerlib.doCommand(MemCommand::ACT, bank_ref.bank,
< divCeil(act_tick, tCK) -
< timeStampOffset);
---
> rank_ref.cmdList.push_back(Command(MemCommand::ACT, bank_ref.bank,
> act_tick));
1005,1007c1004,1005
< rank_ref.power.powerlib.doCommand(MemCommand::PRE, bank.bank,
< divCeil(pre_at, tCK) -
< timeStampOffset);
---
> rank_ref.cmdList.push_back(Command(MemCommand::PRE, bank.bank,
> pre_at));
1179,1188d1176
< // if this access should use auto-precharge, then we are
< // closing the row
< if (auto_precharge) {
< // if auto-precharge push a PRE command at the correct tick to the
< // list used by DRAMPower library to calculate power
< prechargeBank(rank, bank, std::max(curTick(), bank.preAllowedAt));
<
< DPRINTF(DRAM, "Auto-precharged bank: %d\n", dram_pkt->bankId);
< }
<
1195,1197c1183,1184
< dram_pkt->rankRef.power.powerlib.doCommand(command, dram_pkt->bank,
< divCeil(cmd_at, tCK) -
< timeStampOffset);
---
> dram_pkt->rankRef.cmdList.push_back(Command(command, dram_pkt->bank,
> cmd_at));
1201a1189,1198
> // if this access should use auto-precharge, then we are
> // closing the row after the read/write burst
> if (auto_precharge) {
> // if auto-precharge push a PRE command at the correct tick to the
> // list used by DRAMPower library to calculate power
> prechargeBank(rank, bank, std::max(curTick(), bank.preAllowedAt));
>
> DPRINTF(DRAM, "Auto-precharged bank: %d\n", dram_pkt->bankId);
> }
>
1561a1559,1586
> DRAMCtrl::Rank::flushCmdList()
> {
> // at the moment sort the list of commands and update the counters
> // for DRAMPower libray when doing a refresh
> sort(cmdList.begin(), cmdList.end(), DRAMCtrl::sortTime);
>
> auto next_iter = cmdList.begin();
> // push to commands to DRAMPower
> for ( ; next_iter != cmdList.end() ; ++next_iter) {
> Command cmd = *next_iter;
> if (cmd.timeStamp <= curTick()) {
> // Move all commands at or before curTick to DRAMPower
> power.powerlib.doCommand(cmd.type, cmd.bank,
> divCeil(cmd.timeStamp, memory.tCK) -
> memory.timeStampOffset);
> } else {
> // done - found all commands at or before curTick()
> // next_iter references the 1st command after curTick
> break;
> }
> }
> // reset cmdList to only contain commands after curTick
> // if there are no commands after curTick, updated cmdList will be empty
> // in this case, next_iter is cmdList.end()
> cmdList.assign(next_iter, cmdList.end());
> }
>
> void
1648,1650c1673
< power.powerlib.doCommand(MemCommand::PREA, 0,
< divCeil(pre_at, memory.tCK) -
< memory.timeStampOffset);
---
> cmdList.push_back(Command(MemCommand::PREA, 0, pre_at));
1686,1688c1709
< power.powerlib.doCommand(MemCommand::REF, 0,
< divCeil(curTick(), memory.tCK) -
< memory.timeStampOffset);
---
> cmdList.push_back(Command(MemCommand::REF, 0, curTick()));
1690,1693c1711,1713
< // at the moment sort the list of commands and update the counters
< // for DRAMPower libray when doing a refresh
< sort(power.powerlib.cmdList.begin(),
< power.powerlib.cmdList.end(), DRAMCtrl::sortTime);
---
> // All commands up to refresh have completed
> // flush cmdList to DRAMPower
> flushCmdList();