diff options
| author | Ahmed El-Shafiey <[email protected]> | 2012-12-26 09:00:14 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:49:24 -0700 |
| commit | 16843c3d564ceb47e58c8f1ed7df98fc0638adec (patch) | |
| tree | d5284605199453620ee1263cc9dabbd19d9d0661 | |
| parent | f2d7b79e26f8766a220ab07f8de3df603de9263c (diff) | |
-modifying the coefficients parsing code to be more readable, also modifies how it is set in the XML configuration file
This code modification avoids use of the string::assign function that seems to causing memory problems
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14886]
| -rwxr-xr-x | configs/GTX480/gpuwattch_gtx480.xml | 32 | ||||
| -rw-r--r-- | src/gpuwattch/XML_Parse.cc | 36 | ||||
| -rw-r--r-- | src/gpuwattch/XML_Parse.h | 36 | ||||
| -rw-r--r-- | src/gpuwattch/gpgpu_sim_wrapper.cc | 37 |
4 files changed, 103 insertions, 38 deletions
diff --git a/configs/GTX480/gpuwattch_gtx480.xml b/configs/GTX480/gpuwattch_gtx480.xml index 9a3f8a1..af24630 100755 --- a/configs/GTX480/gpuwattch_gtx480.xml +++ b/configs/GTX480/gpuwattch_gtx480.xml @@ -29,7 +29,37 @@ <param name="physical_address_width" value="32"/> <param name="virtual_memory_page_size" value="4096"/> <param name="idle_core_power" value="1.59"/><!-- idle core power for GTX479 --> - <param name="scaling_coefficients" value="10,0.0884816,10,10,8,10,4.12782,10,2.48832,10,10,10,4.29982,0.387764,0.0714269,0.14302,0.01,0.546811,0.485351,0.806633,0.818073,1.9207,100,100,100,87.9303,100,10,4.3548,10"/> + <!--param name="scaling_coefficients" value="10,0.0884816,10,10,8,10,4.12782,10,2.48832,10,10,10,4.29982,0.387764,0.0714269,0.14302,0.01,0.546811,0.485351,0.806633,0.818073,1.9207,100,100,100,87.9303,100,10,4.3548,10"/--> + <param name="TOT_INST" value="10"/> + <param name="FP_INT" value="0.0884816"/> + <param name="IC_H" value="10"/> + <param name="IC_M" value="10"/> + <param name="DC_RH" value="8"/> + <param name="DC_RM" value="10"/> + <param name="DC_WH" value="4.12782"/> + <param name="DC_WM" value="10"/> + <param name="TC_H" value="2.48832"/> + <param name="TC_M" value="10"/> + <param name="CC_H" value="10"/> + <param name="CC_M" value="10"/> + <param name="SHRD_ACC" value="4.29982"/> + <param name="REG_RD" value="0.387764"/> + <param name="REG_WR" value="0.0714269"/> + <param name="NON_REG_OPs" value="0.14302"/> + <param name="SP_ACC" value="0.01"/> + <param name="SFU_ACC" value="0.546811"/> + <param name="FPU_ACC" value="0.485351"/> + <param name="MEM_RD" value="0.806633"/> + <param name="MEM_WR" value="0.818073"/> + <param name="MEM_PRE" value="1.9207"/> + <param name="L2_RH" value="100"/> + <param name="L2_RM" value="100"/> + <param name="L2_WH" value="100"/> + <param name="L2_WM" value="87.9303"/> + <param name="NOC_A" value="100"/> + <param name="PIPE_A" value="10"/> + <param name="IDLE_CORE_N" value="4.3548"/> + <param name="CONST_DYNAMICN" value="10"/> <stat name="num_idle_cores" value="0"/><!-- Average Number of idle cores during this period --> <stat name="total_cycles" value="total_cycles_match_mcpat"/> <stat name="idle_cycles" value="idle_cycles_match_mcpat"/> diff --git a/src/gpuwattch/XML_Parse.cc b/src/gpuwattch/XML_Parse.cc index 0b82822..ef475d4 100644 --- a/src/gpuwattch/XML_Parse.cc +++ b/src/gpuwattch/XML_Parse.cc @@ -103,7 +103,39 @@ void ParseXML::parse(char* filepath) if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),"virtual_address_width")==0) {sys.virtual_address_width=atoi(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),"physical_address_width")==0) {sys.physical_address_width=atoi(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),"virtual_memory_page_size")==0) {sys.virtual_memory_page_size=atoi(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
- if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),"idle_core_power")==0) {sys.idle_core_power=(double)atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),"idle_core_power")==0) {sys.idle_core_power=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[TOT_INST])==0) {sys.scaling_coefficients[TOT_INST]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[FP_INT])==0) {sys.scaling_coefficients[FP_INT]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[IC_H])==0) {sys.scaling_coefficients[IC_H]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[IC_M])==0) {sys.scaling_coefficients[IC_M]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[DC_RH])==0) {sys.scaling_coefficients[DC_RH]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[DC_RM])==0) {sys.scaling_coefficients[DC_RM]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[DC_WH])==0) {sys.scaling_coefficients[DC_WH]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[DC_WM])==0) {sys.scaling_coefficients[DC_WM]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[TC_H])==0) {sys.scaling_coefficients[TC_H]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[TC_M])==0) {sys.scaling_coefficients[TC_M]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[CC_H])==0) {sys.scaling_coefficients[CC_H]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[CC_M])==0) {sys.scaling_coefficients[CC_M]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[SHRD_ACC])==0) {sys.scaling_coefficients[SHRD_ACC]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[REG_RD])==0) {sys.scaling_coefficients[REG_RD]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[REG_WR])==0) {sys.scaling_coefficients[REG_WR]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[NON_REG_OPs])==0) {sys.scaling_coefficients[NON_REG_OPs]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[SP_ACC])==0) {sys.scaling_coefficients[SP_ACC]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[SFU_ACC])==0) {sys.scaling_coefficients[SFU_ACC]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[FPU_ACC])==0) {sys.scaling_coefficients[FPU_ACC]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[MEM_RD])==0) {sys.scaling_coefficients[MEM_RD]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[MEM_WR])==0) {sys.scaling_coefficients[MEM_WR]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[MEM_PRE])==0) {sys.scaling_coefficients[MEM_PRE]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[L2_RH])==0) {sys.scaling_coefficients[L2_RH]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[L2_RM])==0) {sys.scaling_coefficients[L2_RM]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[L2_WH])==0) {sys.scaling_coefficients[L2_WH]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[L2_WM])==0) {sys.scaling_coefficients[L2_WM]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[NOC_A])==0) {sys.scaling_coefficients[NOC_A]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[PIPE_A])==0) {sys.scaling_coefficients[PIPE_A]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[IDLE_CORE_N])==0) {sys.scaling_coefficients[IDLE_CORE_N]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+ if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),perf_count_label[CONST_DYNAMICN])==0) {sys.scaling_coefficients[CONST_DYNAMICN]=atof(xNode2.getChildNode("param",i).getAttribute("value"));continue;}
+
+/*
if (strcmp(xNode2.getChildNode("param",i).getAttribute("name"),"scaling_coefficients")==0)
{
strtmp.assign(xNode2.getChildNode("param",i).getAttribute("value"));
@@ -126,6 +158,7 @@ void ParseXML::parse(char* filepath) chtmp1[0]='\0';
continue;
}
+*/
}
// if (sys.Private_L2 && sys.number_of_cores!=sys.number_of_L2s)
@@ -1701,6 +1734,7 @@ void ParseXML::initialize() //Initialize all sys.opt_clockrate=true;
sys.opt_area=false;
sys.interconnect_projection_type=1;
+ sys.idle_core_power=0;
int i,j;
for (i=0; i<=63; i++)
{
diff --git a/src/gpuwattch/XML_Parse.h b/src/gpuwattch/XML_Parse.h index 7921719..53e408b 100644 --- a/src/gpuwattch/XML_Parse.h +++ b/src/gpuwattch/XML_Parse.h @@ -56,6 +56,42 @@ ToXMLStringTool tx,tx2; */
//all subnodes at the level of system.core(0-n)
//cache_policy is added into cache property arrays;//0 no write or write-though with non-write allocate;1 write-back with write-allocate
+static const char * perf_count_label[] = {"TOT_INST,", "FP_INT,", "IC_H,", "IC_M,", "DC_RH,", "DC_RM,", "DC_WH,", "DC_WM,",
+ "TC_H,", "TC_M,", "CC_H,", "CC_M,", "SHRD_ACC,", "REG_RD,", "REG_WR,", "NON_REG_OPs,",
+ "SP_ACC,", "SFU_ACC,", "FPU_ACC,", "MEM_RD,","MEM_WR,", "MEM_PRE,", "L2_RH,", "L2_RM,", "L2_WH,",
+ "L2_WM,", "NOC_A,", "PIPE_A,", "IDLE_CORE_N,", "CONST_DYNAMICN"};
+enum perf_count_t {
+ TOT_INST=0,
+ FP_INT,
+ IC_H,
+ IC_M,
+ DC_RH,
+ DC_RM,
+ DC_WH,
+ DC_WM,
+ TC_H,
+ TC_M,
+ CC_H,
+ CC_M,
+ SHRD_ACC,
+ REG_RD,
+ REG_WR,
+ NON_REG_OPs,
+ SP_ACC,
+ SFU_ACC,
+ FPU_ACC,
+ MEM_RD,
+ MEM_WR,
+ MEM_PRE,
+ L2_RH,
+ L2_RM,
+ L2_WH,
+ L2_WM,
+ NOC_A,
+ PIPE_A,
+ IDLE_CORE_N,
+ CONST_DYNAMICN
+};
typedef struct{
int prediction_width;
diff --git a/src/gpuwattch/gpgpu_sim_wrapper.cc b/src/gpuwattch/gpgpu_sim_wrapper.cc index 2792da0..ffd4650 100644 --- a/src/gpuwattch/gpgpu_sim_wrapper.cc +++ b/src/gpuwattch/gpgpu_sim_wrapper.cc @@ -31,42 +31,7 @@ #define NUM_COMPONENTS_MODELLED 18 #define NUM_PERFORMANCE_COUNTERS 30 -static const char * perf_count_label[] = {"TOT_INST,", "FP_INT,", "IC_H,", "IC_M,", "DC_RH,", "DC_RM,", "DC_WH,", "DC_WM,", - "TC_H,", "TC_M,", "CC_H,", "CC_M,", "SHRD_ACC,", "REG_RD,", "REG_WR,", "NON_REG_OPs,", - "SP_ACC,", "SFU_ACC,", "FPU_ACC,", "MEM_RD,","MEM_WR,", "MEM_PRE,", "L2_RH,", "L2_RM,", "L2_WH,", - "L2_WM,", "NOC_A,", "PIPE_A,", "IDLE_CORE_N,", "CONST_DYNAMICN"}; -enum perf_count_t { - TOT_INST=0, - FP_INT, - IC_H, - IC_M, - DC_RH, - DC_RM, - DC_WH, - DC_WM, - TC_H, - TC_M, - CC_H, - CC_M, - SHRD_ACC, - REG_RD, - REG_WR, - NON_REG_OPs, - SP_ACC, - SFU_ACC, - FPU_ACC, - MEM_RD, - MEM_WR, - MEM_PRE, - L2_RH, - L2_RM, - L2_WH, - L2_WM, - NOC_A, - PIPE_A, - IDLE_CORE_N, - CONST_DYNAMICN -}; + static const char * pwr_cmp_label[] = {"IBP,", "ICP,", "DCP,", "TCP,", "CCP,", "SHRDP,", "RFP,", "SPP,", "SFUP,", "FPUP,", "SCHEDP,", "L2CP,", "MCP,", "NOCP,", "DRAMP,", |
