diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2016-02-06 17:21:18 -0800 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2016-02-06 17:21:18 -0800 |
commit | dc8018a5c3482008232e6faaa2d96cf20aed7485 (patch) | |
tree | a972ac4544e227397595baf6eeb30e1854f480fc /src/mem/ruby/network/fault_model | |
parent | c8c82f09a282832d919f7eb073a47be838e65b29 (diff) | |
download | gem5-dc8018a5c3482008232e6faaa2d96cf20aed7485.tar.xz |
style: remove trailing whitespace
Result of running 'hg m5style --skip-all --fix-white -a'.
Diffstat (limited to 'src/mem/ruby/network/fault_model')
-rw-r--r-- | src/mem/ruby/network/fault_model/FaultModel.cc | 62 | ||||
-rw-r--r-- | src/mem/ruby/network/fault_model/FaultModel.hh | 26 | ||||
-rw-r--r-- | src/mem/ruby/network/fault_model/FaultModel.py | 6 | ||||
-rw-r--r-- | src/mem/ruby/network/fault_model/SConscript | 2 |
4 files changed, 48 insertions, 48 deletions
diff --git a/src/mem/ruby/network/fault_model/FaultModel.cc b/src/mem/ruby/network/fault_model/FaultModel.cc index 83679984d..7be5bcd49 100644 --- a/src/mem/ruby/network/fault_model/FaultModel.cc +++ b/src/mem/ruby/network/fault_model/FaultModel.cc @@ -31,7 +31,7 @@ /* * Official Tool Website: www.mit.edu/~kaisopos/FaultModel * - * If you use our tool for academic research, we request that you cite: + * If you use our tool for academic research, we request that you cite: * Konstantinos Aisopos, Chia-Hsin Owen Chen, and Li-Shiuan Peh. Enabling * System-Level Modeling of Variation-Induced Faults in Networks-on-Chip. * Proceedings of the 48th Design Automation Conference (DAC'11) @@ -45,7 +45,7 @@ // GEM5 includes #include "FaultModel.hh" -#include "base/misc.hh" +#include "base/misc.hh" using namespace std; @@ -55,18 +55,18 @@ using namespace std; FaultModel::FaultModel(const Params *p) : SimObject(p) { // read configurations into "configurations" vector - // format: <buff/vc> <vcs> <10 fault types> + // format: <buff/vc> <vcs> <10 fault types> bool more_records = true; for (int i = 0; more_records; i += (fields_per_conf_record)){ system_conf configuration; - configuration.buff_per_vc = + configuration.buff_per_vc = p->baseline_fault_vector_database[i + conf_record_buff_per_vc]; - configuration.vcs = + configuration.vcs = p->baseline_fault_vector_database[i + conf_record_vcs]; - for (int fault_index = 0; fault_index < number_of_fault_types; + for (int fault_index = 0; fault_index < number_of_fault_types; fault_index++){ - configuration.fault_type[fault_index] = - p->baseline_fault_vector_database[i + + configuration.fault_type[fault_index] = + p->baseline_fault_vector_database[i + conf_record_first_fault_type + fault_index] / 100; } configurations.push_back(configuration); @@ -79,13 +79,13 @@ FaultModel::FaultModel(const Params *p) : SimObject(p) // format: <temperature> <weight> more_records = true; for (int i = 0; more_records; i += (fields_per_temperature_record)){ - int record_temperature = + int record_temperature = p->temperature_weights_database[i + temperature_record_temp]; int record_weight = p->temperature_weights_database[i + temperature_record_weight]; static int first_record = true; if (first_record){ - for (int temperature = 0; temperature < record_temperature; + for (int temperature = 0; temperature < record_temperature; temperature++){ temperature_weights.push_back(0); } @@ -93,7 +93,7 @@ FaultModel::FaultModel(const Params *p) : SimObject(p) } assert(record_temperature == temperature_weights.size()); temperature_weights.push_back(record_weight); - if (p->temperature_weights_database[i + + if (p->temperature_weights_database[i + fields_per_temperature_record] < 0){ more_records = false; } @@ -131,16 +131,16 @@ FaultModel::fault_type_to_string(int ft) } -int -FaultModel::declare_router(int number_of_inputs, - int number_of_outputs, - int number_of_vcs_per_input, - int number_of_buff_per_data_vc, +int +FaultModel::declare_router(int number_of_inputs, + int number_of_outputs, + int number_of_vcs_per_input, + int number_of_buff_per_data_vc, int number_of_buff_per_ctrl_vc) { // check inputs (are they legal?) if (number_of_inputs <= 0 || number_of_outputs <= 0 || - number_of_vcs_per_input <= 0 || number_of_buff_per_data_vc <= 0 || + number_of_vcs_per_input <= 0 || number_of_buff_per_data_vc <= 0 || number_of_buff_per_ctrl_vc <= 0){ fatal("Fault Model: ERROR in argument of FaultModel_declare_router!"); } @@ -156,7 +156,7 @@ FaultModel::declare_router(int number_of_inputs, // link the router to a DB record int record_hit = -1; - for (int record = 0; record < configurations.size(); record++){ + for (int record = 0; record < configurations.size(); record++){ if ((configurations[record].buff_per_vc == number_of_buffers_per_vc)&& (configurations[record].vcs == total_vcs)){ record_hit = record; @@ -172,8 +172,8 @@ FaultModel::declare_router(int number_of_inputs, return router_index++; } -bool -FaultModel::fault_vector(int routerID, +bool +FaultModel::fault_vector(int routerID, int temperature_input, float fault_vector[]) { @@ -182,7 +182,7 @@ FaultModel::fault_vector(int routerID, // is the routerID recorded? if (routerID < 0 || routerID >= ((int) routers.size())){ warn("Fault Model: ERROR! unknown router ID argument."); - fatal("Fault Model: Did you enable the fault model flag)?"); + fatal("Fault Model: Did you enable the fault model flag)?"); } // is the temperature too high/too low? @@ -201,14 +201,14 @@ FaultModel::fault_vector(int routerID, // recover the router record and return its fault vector for (int i = 0; i < number_of_fault_types; i++){ - fault_vector[i] = routers[routerID].fault_type[i] * + fault_vector[i] = routers[routerID].fault_type[i] * ((float)temperature_weights[temperature]); } return ok; } -bool -FaultModel::fault_prob(int routerID, +bool +FaultModel::fault_prob(int routerID, int temperature_input, float *aggregate_fault_prob) { @@ -218,7 +218,7 @@ FaultModel::fault_prob(int routerID, // is the routerID recorded? if (routerID < 0 || routerID >= ((int) routers.size())){ warn("Fault Model: ERROR! unknown router ID argument."); - fatal("Fault Model: Did you enable the fault model flag)?"); + fatal("Fault Model: Did you enable the fault model flag)?"); } // is the temperature too high/too low? @@ -237,8 +237,8 @@ FaultModel::fault_prob(int routerID, // recover the router record and return its aggregate fault probability for (int i = 0; i < number_of_fault_types; i++){ - *aggregate_fault_prob= *aggregate_fault_prob * - ( 1.0 - (routers[routerID].fault_type[i] * + *aggregate_fault_prob= *aggregate_fault_prob * + ( 1.0 - (routers[routerID].fault_type[i] * ((float)temperature_weights[temperature])) ); } *aggregate_fault_prob = 1.0 - *aggregate_fault_prob; @@ -246,7 +246,7 @@ FaultModel::fault_prob(int routerID, } // this function is used only for debugging purposes -void +void FaultModel::print(void) { cout << "--- PRINTING configurations ---\n"; @@ -254,10 +254,10 @@ FaultModel::print(void) cout << "(" << record << ") "; cout << "VCs=" << configurations[record].vcs << " "; cout << "Buff/VC=" << configurations[record].buff_per_vc << " ["; - for (int fault_type_num = 0; - fault_type_num < number_of_fault_types; + for (int fault_type_num = 0; + fault_type_num < number_of_fault_types; fault_type_num++){ - cout << (100 * configurations[record].fault_type[fault_type_num]); + cout << (100 * configurations[record].fault_type[fault_type_num]); cout << "% "; } cout << "]\n"; diff --git a/src/mem/ruby/network/fault_model/FaultModel.hh b/src/mem/ruby/network/fault_model/FaultModel.hh index c099220ca..f2f355b3c 100644 --- a/src/mem/ruby/network/fault_model/FaultModel.hh +++ b/src/mem/ruby/network/fault_model/FaultModel.hh @@ -31,7 +31,7 @@ /* * Official Tool Website: www.mit.edu/~kaisopos/FaultModel * - * If you use our tool for academic research, we request that you cite: + * If you use our tool for academic research, we request that you cite: * Konstantinos Aisopos, Chia-Hsin Owen Chen, and Li-Shiuan Peh. Enabling * System-Level Modeling of Variation-Induced Faults in Networks-on-Chip. * Proceedings of the 48th Design Automation Conference (DAC'11) @@ -63,7 +63,7 @@ class FaultModel : public SimObject /********** THE FAULT TYPES SUPPORTED BY THE FAULT MODEL ***************/ /************************************************************************/ - enum fault_type + enum fault_type { data_corruption__few_bits, data_corruption__all_bits, @@ -105,27 +105,27 @@ class FaultModel : public SimObject float fault_type[number_of_fault_types]; }; - int declare_router(int number_of_inputs, - int number_of_outputs, - int number_of_vcs_per_vnet, - int number_of_buff_per_data_vc, + int declare_router(int number_of_inputs, + int number_of_outputs, + int number_of_vcs_per_vnet, + int number_of_buff_per_data_vc, int number_of_buff_per_ctrl_vc); std::string fault_type_to_string(int fault_type_index); - - // the following 2 functions are called at runtime, to get the probability - // of each fault type (fault_vector) or the aggregate fault probability + + // the following 2 functions are called at runtime, to get the probability + // of each fault type (fault_vector) or the aggregate fault probability // (fault_prob). Note: the probability values are provided by reference // (in the variables fault_vector[] & aggregate_fault_prob respectively). - // Both functions also return a success flag (which is always true if + // Both functions also return a success flag (which is always true if // temperature ranges from 0C to 125C) - bool fault_vector(int routerID, - int temperature, + bool fault_vector(int routerID, + int temperature, float fault_vector[]); bool fault_prob(int routerID, - int temperature, + int temperature, float *aggregate_fault_prob); // for debugging purposes diff --git a/src/mem/ruby/network/fault_model/FaultModel.py b/src/mem/ruby/network/fault_model/FaultModel.py index b1532150b..ef6447ef9 100644 --- a/src/mem/ruby/network/fault_model/FaultModel.py +++ b/src/mem/ruby/network/fault_model/FaultModel.py @@ -28,7 +28,7 @@ # Official Tool Website: www.mit.edu/~kaisopos/FaultModel # -# If you use our tool for academic research, we request that you cite: +# If you use our tool for academic research, we request that you cite: # Konstantinos Aisopos, Chia-Hsin Owen Chen, and Li-Shiuan Peh. Enabling # System-Level Modeling of Variation-Induced Faults in Networks-on-Chip. # Proceedings of the 48th Design Automation Conference (DAC'11) @@ -38,9 +38,9 @@ from m5.SimObject import SimObject class FaultModel(SimObject): type = 'FaultModel' - cxx_class = 'FaultModel' + cxx_class = 'FaultModel' cxx_header = "mem/ruby/network/fault_model/FaultModel.hh" - + baseline_fault_vector_database = VectorParam.Float([ 5, 40, 0.080892, 0.109175, 0.018864, 0.130408, 0.059724, 0.077571, 0.034830, 0.083430, 0.067500, 0.121500, 5, 39, 0.062640, 0.089100, 0.016821, 0.109620, 0.051462, 0.060210, 0.029700, 0.076140, 0.062100, 0.116100, diff --git a/src/mem/ruby/network/fault_model/SConscript b/src/mem/ruby/network/fault_model/SConscript index ade3eca64..0f390bd6f 100644 --- a/src/mem/ruby/network/fault_model/SConscript +++ b/src/mem/ruby/network/fault_model/SConscript @@ -28,7 +28,7 @@ # Official Tool Website: www.mit.edu/~kaisopos/FaultModel # -# If you use our tool for academic research, we request that you cite: +# If you use our tool for academic research, we request that you cite: # Konstantinos Aisopos, Chia-Hsin Owen Chen, and Li-Shiuan Peh. Enabling # System-Level Modeling of Variation-Induced Faults in Networks-on-Chip. # Proceedings of the 48th Design Automation Conference (DAC'11) |