summaryrefslogtreecommitdiff
path: root/src/gpuwattch/memoryctrl.cc
diff options
context:
space:
mode:
authorJingwen Leng (UT Austin) <[email protected]>2013-10-15 19:05:58 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:59 -0700
commitda74edd77d3effb3da82090c05ebd3a1f3965f1f (patch)
treedcd310e14a7a343f285a4408374d72a9c43db194 /src/gpuwattch/memoryctrl.cc
parent3c71147d4138fbed4334a70c80b70a54539cce35 (diff)
fix dram sampling interval scaling
fix dram clock energy scaling [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 17124]
Diffstat (limited to 'src/gpuwattch/memoryctrl.cc')
-rw-r--r--src/gpuwattch/memoryctrl.cc73
1 files changed, 19 insertions, 54 deletions
diff --git a/src/gpuwattch/memoryctrl.cc b/src/gpuwattch/memoryctrl.cc
index b8a8a6c..d145ce1 100644
--- a/src/gpuwattch/memoryctrl.cc
+++ b/src/gpuwattch/memoryctrl.cc
@@ -483,30 +483,18 @@ MCFrontEnd::MCFrontEnd(ParseXML *XML_interface,InputParameter* interface_ip_, co
void DRAM::computeEnergy(bool is_tdp)
{
if (is_tdp){
- power.reset();
-
- }
- else{
- rt_power.reset();
- dramp.executionTim = XML->sys.total_cycles/(XML->sys.target_core_clockrate*1e6);
+ power.reset();
+ return; /// not supporting TDP calculation for DRAM
}
+ rt_power.reset();
+ dramp.executionTime = XML->sys.total_cycles/(XML->sys.target_core_clockrate*1e6);
power_t.reset();
- power_t.readOp.dynamic+=XML->sys.mc.memory_reads*dramp.rd_coeff*dramp.executionTim;
- power_t.readOp.dynamic+=XML->sys.mc.memory_writes*dramp.wr_coeff*dramp.executionTim;
- power_t.readOp.dynamic+=XML->sys.mc.dram_pre*dramp.pre_coeff*dramp.executionTim;
- if (is_tdp){
- power.reset();
-
- }
- else{
- //rt_power.reset();
- rt_power = rt_power + power_t ;
- //printf("DRAM power: %f total_cycles: %f target_clock_rate: %f\n",rt_power.readOp.dynamic/dramp.executionTim,
- // XML->sys.total_cycles,(XML->sys.target_core_clockrate*1e6) );
- }
-
+ power_t.readOp.dynamic+=XML->sys.mc.memory_reads*dramp.rd_coeff;
+ power_t.readOp.dynamic+=XML->sys.mc.memory_writes*dramp.wr_coeff;
+ power_t.readOp.dynamic+=XML->sys.mc.dram_pre*dramp.pre_coeff;
+ rt_power = rt_power + power_t ;
}
@@ -914,43 +902,20 @@ void MemoryController::displayEnergy(uint32_t indent,int plevel,bool is_tdp)
}
}
+
void DRAM::set_dram_param()
{
- if (dram_type==GDDR5)
- {
- dramp.clockRate=XML->sys.mc.mc_clock*2*1e6;
- dramp.executionTim=XML->sys.total_cycles/(XML->sys.target_core_clockrate*1e6);
- dramp.cmd_coeff=0;
- dramp.act_coeff=0;
- dramp.nop_coeff=0;
- dramp.activity_coeff=0;
-
- dramp.pre_coeff=0.81*0.0665;// 0.0383;//0.0395;//0.0401637266720557;//0.0092780790143343;//0.005;//*dramp.executionTim;
- dramp.rd_coeff= 0.81*0.1339;// 0.0653;//0.064;//0.0624228500824509;//0.0565534489065191;//0.0446;//*dramp.executionTim;
- dramp.wr_coeff= 0.81*0.0613;//0.0067;//0.006;//0.0251181528358946;//0.015;//0.0079;//*dramp.executionTim;
- dramp.req_coeff=0;
- dramp.const_coeff=0;
-
- }else if (dram_type==GDDR3)
- {
- dramp.clockRate=XML->sys.mc.mc_clock*2*1e6;
- dramp.executionTim=XML->sys.total_cycles/(XML->sys.target_core_clockrate*1e6);
- dramp.cmd_coeff=0;
- dramp.act_coeff=0;
- dramp.nop_coeff=0;
- dramp.activity_coeff=0;
-
- dramp.pre_coeff=0.020;//0.0665;// 0.0383;//0.0395;//0.0401637266720557;//0.0092780790143343;//0.005;//*dramp.executionTim;
- dramp.rd_coeff= 0.040;//0.1339;// 0.0653;//0.064;//0.0624228500824509;//0.0565534489065191;//0.0446;//*dramp.executionTim;
- dramp.wr_coeff= 0.017;//0.0213;//0.0067;//0.006;//0.0251181528358946;//0.015;//0.0079;//*dramp.executionTim;
- dramp.req_coeff=0;
- dramp.const_coeff=0;
- }else
- {
- cout<<"Unknown DRAM type" <<endl;
- exit(0);
- }
+ dramp.cmd_coeff = XML->sys.mc.dram_rd_coeff;
+ dramp.act_coeff = XML->sys.mc.dram_act_coeff;
+ dramp.nop_coeff = XML->sys.mc.dram_nop_coeff;
+ dramp.activity_coeff = XML->sys.mc.dram_activity_coeff;
+ dramp.pre_coeff = XML->sys.mc.dram_pre_coeff;
+ dramp.rd_coeff = XML->sys.mc.dram_rd_coeff;
+ dramp.wr_coeff = XML->sys.mc.dram_wr_coeff;
+ dramp.req_coeff = XML->sys.mc.dram_req_coeff;
+ dramp.const_coeff = XML->sys.mc.dram_const_coeff;
}
+
void MemoryController::set_mc_param()
{