diff options
| author | Ahmed El-Shafiey <[email protected]> | 2012-12-19 06:52:31 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:49:23 -0700 |
| commit | 7c67c73a642794e2f95cb9b7f5b8377363adc0f2 (patch) | |
| tree | 7bf867e60550a888480a5ae613019de76ec272f1 /src/gpuwattch | |
| parent | ecdbb77acbbc8613aefa2f2e5408ff3a6bf84865 (diff) | |
fixig more valgrind errors in CACTI due to uinitialized variables + fixing a bug in the interconect stats (initializing the n_mem_to_simt metric to zero)
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14843]
Diffstat (limited to 'src/gpuwattch')
| -rw-r--r-- | src/gpuwattch/cacti/basic_circuit.cc | 2 | ||||
| -rw-r--r-- | src/gpuwattch/cacti/wire.cc | 14 | ||||
| -rw-r--r-- | src/gpuwattch/cacti/wire.h | 2 | ||||
| -rw-r--r-- | src/gpuwattch/gpgpu_sim_wrapper.cc | 61 | ||||
| -rw-r--r-- | src/gpuwattch/gpgpu_sim_wrapper.h | 2 | ||||
| -rw-r--r-- | src/gpuwattch/interconnect.h | 4 | ||||
| -rw-r--r-- | src/gpuwattch/processor.cc | 4 |
7 files changed, 55 insertions, 34 deletions
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; } }; + + |
