summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAhmed El-Shafiey <[email protected]>2012-12-26 09:00:14 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:49:24 -0700
commit16843c3d564ceb47e58c8f1ed7df98fc0638adec (patch)
treed5284605199453620ee1263cc9dabbd19d9d0661 /src
parentf2d7b79e26f8766a220ab07f8de3df603de9263c (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]
Diffstat (limited to 'src')
-rw-r--r--src/gpuwattch/XML_Parse.cc36
-rw-r--r--src/gpuwattch/XML_Parse.h36
-rw-r--r--src/gpuwattch/gpgpu_sim_wrapper.cc37
3 files changed, 72 insertions, 37 deletions
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,",