From da74edd77d3effb3da82090c05ebd3a1f3965f1f Mon Sep 17 00:00:00 2001 From: "Jingwen Leng (UT Austin)" Date: Tue, 15 Oct 2013 19:05:58 -0800 Subject: fix dram sampling interval scaling fix dram clock energy scaling [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 17124] --- CHANGES | 5 ++ configs/GTX480/gpuwattch_gtx480.xml | 10 ++++ configs/QuadroFX5600/gpuwattch_quadrofx5600.xml | 10 ++++ src/gpuwattch/XML_Parse.cc | 11 ++++ src/gpuwattch/XML_Parse.h | 12 ++++ src/gpuwattch/basic_components.h | 45 ++++++++++++++- src/gpuwattch/memoryctrl.cc | 73 +++++++------------------ src/gpuwattch/processor.h | 6 +- 8 files changed, 114 insertions(+), 58 deletions(-) diff --git a/CHANGES b/CHANGES index d22401b..fe73cbc 100644 --- a/CHANGES +++ b/CHANGES @@ -87,6 +87,11 @@ Version 3.2.1+edits (development branch) versus 3.2.1 write-allocation requests from L1 cache are not consumed by the L2 cache. - Fixed a bug that caused allocated local and stack memory to be not correctly aligned. + - Fix for Bug 67 - updated the DRAM operaion coeff so that it adapts to different + calculation interval. Moved the DRAM related coeffs in XML configuration. Both + gpuwattch_gtx480.xml and gpuwattch_quadrofx5600.xml are added with GDDR5/GDDR3 + coeffs. + Version 3.2.1 versus 3.2.0 - Added kernel name and launch uids to performance statistics log. diff --git a/configs/GTX480/gpuwattch_gtx480.xml b/configs/GTX480/gpuwattch_gtx480.xml index 8154c39..304e0fd 100755 --- a/configs/GTX480/gpuwattch_gtx480.xml +++ b/configs/GTX480/gpuwattch_gtx480.xml @@ -474,6 +474,16 @@ + + + + + + + + + + diff --git a/configs/QuadroFX5600/gpuwattch_quadrofx5600.xml b/configs/QuadroFX5600/gpuwattch_quadrofx5600.xml index 63a5551..2c5a6fc 100644 --- a/configs/QuadroFX5600/gpuwattch_quadrofx5600.xml +++ b/configs/QuadroFX5600/gpuwattch_quadrofx5600.xml @@ -474,6 +474,16 @@ + + + + + + + + + + diff --git a/src/gpuwattch/XML_Parse.cc b/src/gpuwattch/XML_Parse.cc index 8e33f3f..39bf2a1 100644 --- a/src/gpuwattch/XML_Parse.cc +++ b/src/gpuwattch/XML_Parse.cc @@ -1586,6 +1586,15 @@ void ParseXML::parse(char* filepath) if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"type")==0) {sys.mc.type=atoi(xNode3.getChildNode("param",k).getAttribute("value"));continue;} if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"withPHY")==0) {sys.mc.withPHY=(bool)atoi(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_cmd_coeff")==0) {sys.mc.dram_cmd_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_act_coeff")==0) {sys.mc.dram_act_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_nop_coeff")==0) {sys.mc.dram_nop_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_activity_coeff")==0) {sys.mc.dram_activity_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_pre_coeff")==0) {sys.mc.dram_pre_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_rd_coeff")==0) {sys.mc.dram_rd_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_wr_coeff")==0) {sys.mc.dram_wr_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_req_coeff")==0) {sys.mc.dram_req_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} + if (strcmp(xNode3.getChildNode("param",k).getAttribute("name"),"dram_const_coeff")==0) {sys.mc.dram_const_coeff=atof(xNode3.getChildNode("param",k).getAttribute("value"));continue;} } itmp=xNode3.nChildNode("stat"); for(k=0; ksys.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" <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() { diff --git a/src/gpuwattch/processor.h b/src/gpuwattch/processor.h index 46d954e..7202460 100644 --- a/src/gpuwattch/processor.h +++ b/src/gpuwattch/processor.h @@ -195,7 +195,7 @@ class Processor : public Component value+=(mc->frontend->mcp.llcBlockSize*8.0/mc->mcp.dataBusWidth)* (mc->frontend->readBuffer->local_result.power.writeOp.dynamic); - value+=mc->dram->dramp.rd_coeff*cores[0]->executionTime; + value+=mc->dram->dramp.rd_coeff; /* value+=mc->frontend->PRT->local_result.power.readOp.dynamic; value+=mc->frontend->threadMasks->local_result.power.readOp.dynamic; @@ -239,7 +239,7 @@ class Processor : public Component value+=(mc->frontend->mcp.llcBlockSize*8.0/mc->frontend->mcp.dataBusWidth)* (mc->frontend->writeBuffer->local_result.power.writeOp.dynamic); - value+=mc->dram->dramp.wr_coeff*cores[0]->executionTime; + value+=mc->dram->dramp.wr_coeff; /* value+=(mc->frontend->PRT->local_result.power.writeOp.dynamic); @@ -273,7 +273,7 @@ class Processor : public Component double get_coefficient_mem_pre() { double value=0; - value+=mc->dram->dramp.pre_coeff*cores[0]->executionTime; + value+=mc->dram->dramp.pre_coeff; //return 0.4*value; return value; -- cgit v1.3