tukl-msd / DRAMSpec

A High-Level DRAM Timing, Power and Area Exploration Tool
Other
23 stars 12 forks source link

HMC output values #13

Open avacoder42 opened 4 years ago

avacoder42 commented 4 years ago

When I used the DRAMSpec output for HMC parameters (all combinations of technology and architectural I/P) in DRAMPower to calculate energy, I always got a negative value for act_energy. Here is the formula used in DRAMPower -

energy.act_energy += vdd2Domain.calcTivEnergy(sum(c.numberofactsBanks) * t.RAS , mps.idd0 - mps.idd3n1);

I mapped idd0 --> IDD0 ,idd3n1 --> IDD3N , what's the correct mapping to IDD1 and IDD5B to DRAMPower parameters? And can DRAMPower be used to calculate power and energy for HMC config?

myzinsky commented 4 years ago

Could be that there is something wrong with the Voltage Domains. Will come back to you soon.

AndreChinazzo commented 4 years ago

Hi @avacoder42 could you copy the output of DRAMSpec and what you use as input for DRAMPower?

avacoder42 commented 4 years ago

DRAMSpec : Arch I/P= techhmc_5x , Tech I/p= HMC_para512RB Output from DRAMSpec in xml file added as input to DRAMPower

<!DOCTYPE memspec SYSTEM "memspec.dtd">
<memspec>

  <parameter id="memoryId" type="string" value="techhmc_5x" />
  <parameter id="memoryType" type="string" value="WIDEIO_SDR" />
  <memarchitecturespec>
    <parameter id="width" type="uint" value="32" />
    <parameter id="nbrOfBanks" type="uint" value="256" />
    <parameter id="nbrOfRanks" type="uint" value="1" />
    <parameter id="dll" type="bool" value="1" />
    <parameter id="twoVoltageDomains" type="bool" value="1" />

    <parameter id="dataRate" type="uint" value="2.5" />
    <parameter id="burstLength" type="uint" value="4" />
  </memarchitecturespec>
  <memtimingspec>
      <parameter id="clkMhz" type="double" value="1250" />
      <parameter id="RC" type="uint" value="50" />
      <parameter id="RCD" type="uint" value="19" />
      <parameter id="RL" type="uint" value="15" />
      <parameter id="RP" type="uint" value="14" />
      <parameter id="RFC" type="uint" value="550" />
      <parameter id="RAS" type="uint" value="37" />
      <parameter id="WL" type="uint" value="0" />
      <parameter id="AL" type="uint" value="0" />
      <parameter id="DQSCK" type="uint" value="0" />      
      <parameter id="RTP" type="uint" value="12" />
      <parameter id="WR" type="uint" value="10" />
      <parameter id="XP" type="uint" value="0" />
      <parameter id="XPDLL" type="uint" value="0" />
      <parameter id="XS" type="uint" value="0" />
      <parameter id="XSDLL" type="uint" value="0" />
      <parameter id="REFI" type="uint" value="9750" />
      <parameter id="CL" type="uint" value="15" />

      <parameter id="CCD" type="uint" value="6" />

  </memtimingspec>
  <mempowerspec>
      <parameter id="idd0" type="double" value="41.2271" />
      <parameter id="idd02" type="double" value="0" />

      <parameter id="idd2n" type="double" value="33.5633" />
      <parameter id="idd2n2" type="double" value="0" />

      <parameter id="idd3n" type="double" value="46.7633" />
      <parameter id="idd3n2" type="double" value="0" />
      <parameter id="idd4r" type="double" value="1031" />

      <parameter id="idd4w" type="double" value="1031" />

      <parameter id="idd5" type="double" value="162.987" />

      <parameter id="vdd" type="double" value="2.8" />
      <parameter id="vdd2" type="double" value="1.1" />
  </mempowerspec>
</memspec>

DRAMPower results with sample trace file

* Trace Power and Energy Estimates:

ACT Cmd Energy: -1394874.38 pJ
PRE Cmd Energy: 678436.36 pJ
RD Cmd Energy: 13404516.46 pJ
WR Cmd Energy: 0.00 pJ
RD I/O Energy: 0.00 pJ
ACT Stdby Energy: 934652226.08 pJ
  Active Idle Energy: 636878.74 pJ
  Active Power-Up Energy: 0.00 pJ
    Active Stdby Energy during Auto-Refresh cycles in Self-Refresh Power-Up: 0.00 pJ
PRE Stdby Energy: 11378364477.61 pJ
  Precharge Idle Energy: 11357861575.93 pJ
  Precharged Power-Up Energy: 0.00 pJ
    Precharge Stdby Energy during Auto-Refresh cycles in Self-Refresh Power-Up: 0.00 pJ
  Self-Refresh Power-Up Energy: 0.00 pJ
Total Idle Energy (Active + Precharged): 11358498454.67 pJ
Total Power-Down Energy: 0.00 pJ
  Fast-Exit Active Power-Down Energy: 0.00 pJ
  Slow-Exit Active Power-Down Energy: 0.00 pJ
    Slow-Exit Active Power-Down Energy during Auto-Refresh cycles in Self-Refresh: 0.00 pJ
  Fast-Exit Precharged Power-Down Energy: 0.00 pJ
  Slow-Exit Precharged Power-Down Energy: 0.00 pJ
    Slow-Exit Precharged Power-Down Energy during Auto-Refresh cycles in Self-Refresh: 0.00 pJ
Auto-Refresh Energy: 2353574554.90 pJ
Bankwise-Refresh Energy: 0.00 pJ
Self-Refresh Energy: 0.00 pJ
----------------------------------------
Total Trace Energy: 14679279337.04 pJ
Average Power: 114.49 mW
----------------------------------------
AndreChinazzo commented 4 years ago

The negative value is then clear: since idd0 = 41 < idd3n = 46.76, the subtraction mps.idd0 - mps.idd3n1 < 0, thus the energy calculation outputs a negative number.

The problem seems to come from the definition of idd0 and idd3n. In DRAMPower, is seems to be assumed that idd0 (one bank act-pre current) minus idd3n (active standby current) should result in the fraction of the total idd0 that is spend by the operation itself, discounting the standby current.

The problem, however, is that DRAMSpec assumes idd3n as the worst case: when all banks are active. So idd3n is the total standby current, not the standby current of a single bank. To calculate idd0, DRAMSpec uses an internal variable that is the standby current of a single bank, but this variable is not outputted.

@myzinsky is the definition used in DRAMSpec incorrect?

avacoder42 commented 4 years ago

Hi, Thank you for the clarification. Maybe this holds for all configurations, not just HMC.

myzinsky commented 4 years ago

IDD3N is the worst case in DRAM Power as well. We introduced the rho parameter in order to configure this more precisely (see the two recent paper about DRAMPower). If the rho is set to 100% everything should be fine from DRAM power side and the worst case should be assumed.

I find it more suspicious that IDD3n generated from DRAMSpec is bigger than IDD0 since IDD0 actually included IDD3N/IDD2N. This should be double checked also with Christian.

AndreChinazzo commented 4 years ago

@avacoder42 I have fixed the calculation of IDD0. Now IDD0 = 56 mA > IDD3n = 50 mA when simulating:

./build/release/dramspec -t technology_input/techhmc_5x.json -p architecture_input/parhmc_512RB.json

Please let me know if that solves the problem.

avacoder42 commented 4 years ago

@AndreChinazzo , thank you for the update, now its all positive.

I had one query since DRAMPower does not have a memory type for HMC or HBM , are the values obtained with WIDEI/O as memory type and I/P parameters from HMC or HBM still correct?

config <parameter id="memoryType" type="string" value="WIDEIO_SDR" /