style: remove trailing whitespace
Result of running 'hg m5style --skip-all --fix-white -a'.
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
/*
|
||||
* This file defines a port class which is used for sending and receiving
|
||||
* messages. These messages are atomic units which don't interact and
|
||||
* should be smaller than a cache block. This class is based on
|
||||
* should be smaller than a cache block. This class is based on
|
||||
* the underpinnings of SimpleTimingPort, but it tweaks some of the external
|
||||
* functions.
|
||||
*/
|
||||
|
||||
@@ -57,7 +57,7 @@ Topology::Topology(uint32_t num_routers,
|
||||
|
||||
// analyze both the internal and external links, create data structures
|
||||
// Note that the python created links are bi-directional, but that the
|
||||
// topology and networks utilize uni-directional links. Thus each
|
||||
// topology and networks utilize uni-directional links. Thus each
|
||||
// BasicLink is converted to two calls to add link, on for each direction
|
||||
for (vector<BasicExtLink*>::const_iterator i = ext_links.begin();
|
||||
i != ext_links.end(); ++i) {
|
||||
@@ -106,7 +106,7 @@ Topology::createLinks(Network *net)
|
||||
i != m_link_map.end(); ++i) {
|
||||
std::pair<SwitchID, SwitchID> src_dest = (*i).first;
|
||||
max_switch_id = max(max_switch_id, src_dest.first);
|
||||
max_switch_id = max(max_switch_id, src_dest.second);
|
||||
max_switch_id = max(max_switch_id, src_dest.second);
|
||||
}
|
||||
|
||||
// Initialize weight, latency, and inter switched vectors
|
||||
@@ -133,7 +133,7 @@ Topology::createLinks(Network *net)
|
||||
component_latencies[src][dst] = link->m_latency;
|
||||
topology_weights[src][dst] = link->m_weight;
|
||||
}
|
||||
|
||||
|
||||
// Walk topology and hookup the links
|
||||
Matrix dist = shortest_path(topology_weights, component_latencies,
|
||||
component_inter_switches);
|
||||
@@ -151,12 +151,12 @@ Topology::createLinks(Network *net)
|
||||
}
|
||||
|
||||
void
|
||||
Topology::addLink(SwitchID src, SwitchID dest, BasicLink* link,
|
||||
Topology::addLink(SwitchID src, SwitchID dest, BasicLink* link,
|
||||
LinkDirection dir)
|
||||
{
|
||||
assert(src <= m_number_of_switches+m_nodes+m_nodes);
|
||||
assert(dest <= m_number_of_switches+m_nodes+m_nodes);
|
||||
|
||||
|
||||
std::pair<int, int> src_dest_pair;
|
||||
LinkEntry link_entry;
|
||||
|
||||
@@ -176,7 +176,7 @@ Topology::makeLink(Network *net, SwitchID src, SwitchID dest,
|
||||
assert(src >= 2 * m_nodes || dest >= 2 * m_nodes);
|
||||
|
||||
std::pair<int, int> src_dest;
|
||||
LinkEntry link_entry;
|
||||
LinkEntry link_entry;
|
||||
|
||||
if (src < m_nodes) {
|
||||
src_dest.first = src;
|
||||
|
||||
@@ -53,7 +53,7 @@ class Network;
|
||||
|
||||
typedef std::vector<std::vector<int> > Matrix;
|
||||
|
||||
struct LinkEntry
|
||||
struct LinkEntry
|
||||
{
|
||||
BasicLink *link;
|
||||
LinkDirection direction;
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -55,7 +55,7 @@ class GarnetIntLink_d(BasicIntLink):
|
||||
# forward links and two backward flow-control links, one per direction
|
||||
nls = []
|
||||
# In uni-directional link
|
||||
nls.append(NetworkLink_d());
|
||||
nls.append(NetworkLink_d());
|
||||
# Out uni-directional link
|
||||
nls.append(NetworkLink_d());
|
||||
network_links = VectorParam.NetworkLink_d(nls, "forward links")
|
||||
|
||||
@@ -71,9 +71,9 @@ class Router_d : public BasicRouter
|
||||
int get_num_outports() { return m_output_unit.size(); }
|
||||
int get_id() { return m_id; }
|
||||
|
||||
void init_net_ptr(GarnetNetwork_d* net_ptr)
|
||||
{
|
||||
m_network_ptr = net_ptr;
|
||||
void init_net_ptr(GarnetNetwork_d* net_ptr)
|
||||
{
|
||||
m_network_ptr = net_ptr;
|
||||
}
|
||||
|
||||
GarnetNetwork_d* get_net_ptr() { return m_network_ptr; }
|
||||
@@ -95,13 +95,13 @@ class Router_d : public BasicRouter
|
||||
void collateStats();
|
||||
void resetStats();
|
||||
|
||||
bool get_fault_vector(int temperature, float fault_vector[]){
|
||||
return m_network_ptr->fault_model->fault_vector(m_id, temperature,
|
||||
fault_vector);
|
||||
bool get_fault_vector(int temperature, float fault_vector[]){
|
||||
return m_network_ptr->fault_model->fault_vector(m_id, temperature,
|
||||
fault_vector);
|
||||
}
|
||||
bool get_aggregate_fault_probability(int temperature,
|
||||
bool get_aggregate_fault_probability(int temperature,
|
||||
float *aggregate_fault_prob){
|
||||
return m_network_ptr->fault_model->fault_prob(m_id, temperature,
|
||||
return m_network_ptr->fault_model->fault_prob(m_id, temperature,
|
||||
aggregate_fault_prob);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class GarnetIntLink(BasicIntLink):
|
||||
# forward links and no backward flow-control links
|
||||
nls = []
|
||||
# In uni-directional link
|
||||
nls.append(NetworkLink());
|
||||
nls.append(NetworkLink());
|
||||
# Out uni-directional link
|
||||
nls.append(NetworkLink());
|
||||
network_links = VectorParam.NetworkLink(nls, "forward links")
|
||||
|
||||
@@ -60,14 +60,14 @@ class GarnetNetwork : public BaseGarnetNetwork
|
||||
void print(std::ostream& out) const;
|
||||
|
||||
// Methods used by Topology to setup the network
|
||||
void makeOutLink(SwitchID src, NodeID dest, BasicLink* link,
|
||||
LinkDirection direction,
|
||||
void makeOutLink(SwitchID src, NodeID dest, BasicLink* link,
|
||||
LinkDirection direction,
|
||||
const NetDest& routing_table_entry);
|
||||
void makeInLink(NodeID src, SwitchID dest, BasicLink* link,
|
||||
LinkDirection direction,
|
||||
void makeInLink(NodeID src, SwitchID dest, BasicLink* link,
|
||||
LinkDirection direction,
|
||||
const NetDest& routing_table_entry);
|
||||
void makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
|
||||
LinkDirection direction,
|
||||
LinkDirection direction,
|
||||
const NetDest& routing_table_entry);
|
||||
|
||||
//! Function for performing a functional read. The return value
|
||||
|
||||
@@ -68,9 +68,9 @@ class Router : public BasicRouter, public FlexibleConsumer
|
||||
|
||||
void print(std::ostream& out) const;
|
||||
|
||||
void init_net_ptr(GarnetNetwork* net_ptr)
|
||||
{
|
||||
m_net_ptr = net_ptr;
|
||||
void init_net_ptr(GarnetNetwork* net_ptr)
|
||||
{
|
||||
m_net_ptr = net_ptr;
|
||||
}
|
||||
|
||||
bool functionalRead(Packet *);
|
||||
|
||||
@@ -32,9 +32,9 @@ SimpleExtLink::SimpleExtLink(const Params *p)
|
||||
: BasicExtLink(p)
|
||||
{
|
||||
// For the simple links, the bandwidth factor translates to the
|
||||
// bandwidth multiplier. The multipiler, in combination with the
|
||||
// endpoint bandwidth multiplier - message size multiplier ratio,
|
||||
// determines the link bandwidth in bytes
|
||||
// bandwidth multiplier. The multipiler, in combination with the
|
||||
// endpoint bandwidth multiplier - message size multiplier ratio,
|
||||
// determines the link bandwidth in bytes
|
||||
m_bw_multiplier = p->bandwidth_factor;
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ SimpleIntLink::SimpleIntLink(const Params *p)
|
||||
: BasicIntLink(p)
|
||||
{
|
||||
// For the simple links, the bandwidth factor translates to the
|
||||
// bandwidth multiplier. The multipiler, in combination with the
|
||||
// endpoint bandwidth multiplier - message size multiplier ratio,
|
||||
// determines the link bandwidth in bytes
|
||||
// bandwidth multiplier. The multipiler, in combination with the
|
||||
// endpoint bandwidth multiplier - message size multiplier ratio,
|
||||
// determines the link bandwidth in bytes
|
||||
m_bw_multiplier = p->bandwidth_factor;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class StallAndWaitStatementAST(StatementAST):
|
||||
super(StatementAST, self).__init__(slicc)
|
||||
self.in_port = in_port
|
||||
self.address = address
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return "[StallAndWaitStatementAst: %r]" % self.in_port
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class TypeFieldEnumAST(TypeFieldAST):
|
||||
def generate(self, type):
|
||||
if str(type) == "State":
|
||||
self.error("States must in a State Declaration, not a normal enum.")
|
||||
|
||||
|
||||
# Add enumeration
|
||||
if not type.addEnum(self.field_id, self.pairs_ast.pairs):
|
||||
self.error("Duplicate enumeration: %s:%s" % (type, self.field_id))
|
||||
|
||||
@@ -43,7 +43,7 @@ class TypeFieldStateAST(TypeFieldAST):
|
||||
def generate(self, type):
|
||||
if not str(type) == "State":
|
||||
self.error("State Declaration must be of type State.")
|
||||
|
||||
|
||||
# Add enumeration
|
||||
if not type.addEnum(self.field_id, self.pairs_ast.pairs):
|
||||
self.error("Duplicate enumeration: %s:%s" % (type, self.field_id))
|
||||
|
||||
Reference in New Issue
Block a user