summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpgpu-sim/gpu-sim.cc2
-rw-r--r--src/gpgpu-sim/l2cache.cc2
-rw-r--r--src/gpuwattch/cacti/basic_circuit.cc2
-rw-r--r--src/gpuwattch/cacti/wire.cc14
-rw-r--r--src/gpuwattch/cacti/wire.h2
-rw-r--r--src/gpuwattch/gpgpu_sim_wrapper.cc61
-rw-r--r--src/gpuwattch/gpgpu_sim_wrapper.h2
-rw-r--r--src/gpuwattch/interconnect.h4
-rw-r--r--src/gpuwattch/processor.cc4
9 files changed, 57 insertions, 36 deletions
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index bea0ad9..5b946d3 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -487,7 +487,7 @@ gpgpu_sim::gpgpu_sim( const gpgpu_sim_config &config )
ptx_file_line_stats_create_exposed_latency_tracker(m_config.num_shader());
#ifdef GPGPUSIM_POWER_MODEL
- m_gpgpusim_wrapper = new gpgpu_sim_wrapper();
+ m_gpgpusim_wrapper = new gpgpu_sim_wrapper(config.g_power_config_name);
#endif
m_shader_stats = new shader_core_stats(m_shader_config);
diff --git a/src/gpgpu-sim/l2cache.cc b/src/gpgpu-sim/l2cache.cc
index 281da7f..56b145c 100644
--- a/src/gpgpu-sim/l2cache.cc
+++ b/src/gpgpu-sim/l2cache.cc
@@ -76,11 +76,11 @@ memory_partition_unit::memory_partition_unit( unsigned partition_id,
if(!m_config->m_L2_config.disabled())
m_L2cache = new l2_cache(L2c_name,m_config->m_L2_config,-1,-1,m_L2interface,m_mf_allocator,IN_PARTITION_L2_MISS_QUEUE);
+ n_mem_to_simt=0;
unsigned int icnt_L2;
unsigned int L2_dram;
unsigned int dram_L2;
unsigned int L2_icnt;
-
sscanf(m_config->gpgpu_L2_queue_config,"%u:%u:%u:%u", &icnt_L2,&L2_dram,&dram_L2,&L2_icnt );
m_icnt_L2_queue = new fifo_pipeline<mem_fetch>("icnt-to-L2",0,icnt_L2);
m_L2_dram_queue = new fifo_pipeline<mem_fetch>("L2-to-dram",0,L2_dram);
diff --git a/src/gpuwattch/cacti/basic_circuit.cc b/src/gpuwattch/cacti/basic_circuit.cc
index 788b663..9aeb4e7 100644
--- a/src/gpuwattch/cacti/basic_circuit.cc
+++ b/src/gpuwattch/cacti/basic_circuit.cc
@@ -170,7 +170,7 @@ double drain_C_(
bool _is_cell,
bool _is_wl_tr)
{
- double w_folded_tr;
+ double w_folded_tr=0;
const TechnologyParameter::DeviceType * dt;
if ((_is_dram) && (_is_cell))
diff --git a/src/gpuwattch/cacti/wire.cc b/src/gpuwattch/cacti/wire.cc
index 765d49f..9b0f19c 100644
--- a/src/gpuwattch/cacti/wire.cc
+++ b/src/gpuwattch/cacti/wire.cc
@@ -39,11 +39,19 @@ Wire::Wire(
double w_s,
double s_s,
enum Wire_placement wp,
- double resistivity,
+ double _resistivity,
TechnologyParameter::DeviceType *dt
- ):wt(wire_model), wire_length(wl*1e-6), nsense(n), w_scale(w_s), s_scale(s_s),
- resistivity(resistivity), deviceType(dt)
+ )
{
+
+ wt= wire_model;
+ wire_length=1e-6;
+ nsense=n;
+ w_scale=w_s;
+ s_scale=s_s;
+ resistivity=_resistivity;
+ deviceType=dt;
+
wire_placement = wp;
min_w_pmos = deviceType->n_to_p_eff_curr_drv_ratio*g_tp.min_w_nmos_;
in_rise_time = 0;
diff --git a/src/gpuwattch/cacti/wire.h b/src/gpuwattch/cacti/wire.h
index 36e2ece..fb82c5f 100644
--- a/src/gpuwattch/cacti/wire.h
+++ b/src/gpuwattch/cacti/wire.h
@@ -45,7 +45,7 @@
class Wire : public Component
{
public:
- Wire(enum Wire_type wire_model, double len /* in u*/,
+ Wire(enum Wire_type wire_model, double len = 0 /* in u*/,
int nsense = 1/* no. of sense amps connected to the low-swing wire */,
double width_scaling = 1,
double spacing_scaling = 1,
diff --git a/src/gpuwattch/gpgpu_sim_wrapper.cc b/src/gpuwattch/gpgpu_sim_wrapper.cc
index 1b06e26..cf658cd 100644
--- a/src/gpuwattch/gpgpu_sim_wrapper.cc
+++ b/src/gpuwattch/gpgpu_sim_wrapper.cc
@@ -94,7 +94,7 @@ enum pwr_cmp_t {
};
-gpgpu_sim_wrapper::gpgpu_sim_wrapper() {
+gpgpu_sim_wrapper::gpgpu_sim_wrapper( char* xmlfile) {
count=0;
gcount=0;
@@ -120,13 +120,44 @@ gpgpu_sim_wrapper::gpgpu_sim_wrapper() {
const_dynamic_power=0;
gpu_min_power=0;
gpu_tot_min_power=0;
+ proc_power=0;
+ g_power_filename = NULL;
+ g_power_trace_filename = NULL;
+ g_metric_trace_filename = NULL;
+ g_steady_state_tracking_filename = NULL;
+ xml_filename= xmlfile;
+ g_power_simulation_enabled= false;
+ g_power_trace_enabled= false;
+ g_steady_power_levels_enabled= false;
+ g_power_trace_zlevel= 0;
+ g_power_per_cycle_dump= false;
+ gpu_steady_power_deviation= 0;
+ gpu_steady_min_period= 0;
+
+ gpu_stat_sample_freq=0;
+ p=new ParseXML();
+ p->parse(xml_filename);
+ proc = new Processor(p);
+ power_trace_file = NULL;
+ metric_trace_file = NULL;
+ steady_state_tacking_file = NULL;
+ has_written_avg=false;
+ init_inst_val=false;
}
gpgpu_sim_wrapper::~gpgpu_sim_wrapper() { }
+bool gpgpu_sim_wrapper::sanity_check(double a, double b)
+{
+ if (b == 0)
+ return (abs(a-b)<0.00001);
+ else
+ return (abs(a-b)/abs(b)<0.00001);
+ return false;
+}
void gpgpu_sim_wrapper::init_mcpat(char* xmlfile, char* powerfilename, char* power_trace_filename,char* metric_trace_filename,
char * steady_state_filename, bool power_sim_enabled,bool trace_enabled,
bool steady_state_enabled,bool power_per_cycle_dump,double steady_power_deviation,
@@ -138,12 +169,6 @@ void gpgpu_sim_wrapper::init_mcpat(char* xmlfile, char* powerfilename, char* pow
gpu_max_power=0;
pavg=0;
- pwr_cmp_avg=(double *)calloc(100,sizeof(double));
- pwr_cmp_min=(double *)calloc(100,sizeof(double));
- pwr_cmp_max=(double *)calloc(100,sizeof(double));
- perf_count_avg=(double *)calloc(100,sizeof(double));
- perf_count_min=(double *)calloc(100,sizeof(double));
- perf_count_max=(double *)calloc(100,sizeof(double));
gpu_min_power=0;
static bool mcpat_init=true;
@@ -176,10 +201,6 @@ void gpgpu_sim_wrapper::init_mcpat(char* xmlfile, char* powerfilename, char* pow
gpu_stat_sample_freq=stat_sample_freq;
-
- p=new ParseXML();
- p->parse(xml_filename);
- proc = new Processor(p);
//p->sys.total_cycles=gpu_stat_sample_freq*4;
p->sys.total_cycles=gpu_stat_sample_freq;
power_trace_file = NULL;
@@ -382,21 +403,8 @@ void gpgpu_sim_wrapper::set_NoC_power(double noc_tot_reads,double noc_tot_writes
{
p->sys.NoC[0].total_accesses = noc_tot_reads * p->sys.scaling_coefficients[NOC_A] + noc_tot_writes * p->sys.scaling_coefficients[NOC_A];
perf_count[NOC_A]=noc_tot_reads+noc_tot_writes;
-
-
}
-bool gpgpu_sim_wrapper::sanity_check(double a, double b)
-{
- if (b == 0)
- return (abs(a-b)<0.00001);
- else if(abs(a-b)/abs(b)<0.00001) {
- return true;
- }
-
- printf("a = %f, b = %f a-b = %f\n", a,b,a-b);
- return false;
-}
void gpgpu_sim_wrapper::power_metrics_calculations()
{
@@ -591,6 +599,7 @@ void gpgpu_sim_wrapper::update_components_power()
pwr_cmp[IDLE_COREP]=proc->cores[0]->IdleCoreEnergy/(proc->cores[0]->executionTime);
//this constant dynamic part is estimated via regression model
+ pwr_cmp[CONST_DYNAMICP]=0;
pwr_cmp[CONST_DYNAMICP]=p->sys.scaling_coefficients[CONST_DYNAMICN]-proc->get_const_dynamic_power()/(proc->cores[0]->executionTime);
pwr_cmp[CONST_DYNAMICP]= (pwr_cmp[CONST_DYNAMICP]>0)? pwr_cmp[CONST_DYNAMICP]:0;
@@ -600,7 +609,9 @@ void gpgpu_sim_wrapper::update_components_power()
for(unsigned i=0; i<num_pwr_cmps; i++){
sum_pwr_cmp+=pwr_cmp[i];
}
- assert("Total Power does not equal the sum of the components\n" && sanity_check(sum_pwr_cmp,proc_power));
+ bool check=false;
+ check=sanity_check(sum_pwr_cmp,proc_power);
+ assert("Total Power does not equal the sum of the components\n" && (check));
}
diff --git a/src/gpuwattch/gpgpu_sim_wrapper.h b/src/gpuwattch/gpgpu_sim_wrapper.h
index 5ef6f05..b88af66 100644
--- a/src/gpuwattch/gpgpu_sim_wrapper.h
+++ b/src/gpuwattch/gpgpu_sim_wrapper.h
@@ -46,7 +46,7 @@ using namespace std;
class gpgpu_sim_wrapper {
public:
- gpgpu_sim_wrapper();
+ gpgpu_sim_wrapper(char* xmlfile);
~gpgpu_sim_wrapper();
void init_mcpat(char* xmlfile, char* powerfile, char* power_trace_file,char* metric_trace_file,
diff --git a/src/gpuwattch/interconnect.h b/src/gpuwattch/interconnect.h
index 19940d5..9471c7a 100644
--- a/src/gpuwattch/interconnect.h
+++ b/src/gpuwattch/interconnect.h
@@ -51,8 +51,8 @@ class interconnect : public Component
interconnect(
string name_,
enum Device_ty device_ty_,
- double base_w, double base_h, int data_w, double len,
- const InputParameter *configure_interface, int start_wiring_level_,
+ double base_w =0, double base_h =0, int data_w =0, double len =0,
+ const InputParameter *configure_interface = NULL, int start_wiring_level_ =0,
bool pipelinable_ = false,
double route_over_perc_ =0.5,
bool opt_local_=true,
diff --git a/src/gpuwattch/processor.cc b/src/gpuwattch/processor.cc
index 1fb37c1..5dda9fc 100644
--- a/src/gpuwattch/processor.cc
+++ b/src/gpuwattch/processor.cc
@@ -64,6 +64,7 @@ Processor::Processor(ParseXML *XML_interface)
* There is no point to have heterogeneous memory controller on chip,
* thus McPAT only support homogeneous memory controllers.
*/
+ rt_power.reset();
int i;
double pppm_t[4] = {1,1,1,1};
l2_power=0;
@@ -1019,7 +1020,6 @@ void Processor::set_proc_param()
}
-
Processor::~Processor(){
while (!cores.empty())
{
@@ -1058,3 +1058,5 @@ Processor::~Processor(){
delete flashcontroller;
}
};
+
+