summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/garnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/network/garnet')
-rw-r--r--src/mem/ruby/network/garnet/BaseGarnetNetwork.cc3
-rw-r--r--src/mem/ruby/network/garnet/BaseGarnetNetwork.hh4
-rw-r--r--src/mem/ruby/network/garnet/BaseGarnetNetwork.py2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc17
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh1
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc29
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh12
7 files changed, 68 insertions, 0 deletions
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
index e3eb73b0a..cd4ca0af1 100644
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
@@ -38,6 +38,9 @@ BaseGarnetNetwork::BaseGarnetNetwork(const Params *p)
{
m_ni_flit_size = p->ni_flit_size;
m_vcs_per_vnet = p->vcs_per_vnet;
+ m_enable_fault_model = p->enable_fault_model;
+ if (m_enable_fault_model)
+ fault_model = p->fault_model;
m_ruby_start = 0;
m_flits_received = 0;
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh
index 95d4c5f5c..52079d8f6 100644
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.hh
@@ -38,6 +38,7 @@
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/network/Network.hh"
+#include "mem/ruby/network/fault_model/FaultModel.hh"
#include "params/BaseGarnetNetwork.hh"
#include "math.h"
@@ -50,10 +51,13 @@ class BaseGarnetNetwork : public Network
void init();
int getNiFlitSize() {return m_ni_flit_size; }
int getVCsPerVnet() {return m_vcs_per_vnet; }
+ bool isFaultModelEnabled() {return m_enable_fault_model;}
+ FaultModel* fault_model;
protected:
int m_ni_flit_size;
int m_vcs_per_vnet;
+ bool m_enable_fault_model;
int m_flits_received;
int m_flits_injected;
diff --git a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py
index 8073131f4..2431db203 100644
--- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.py
+++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.py
@@ -36,3 +36,5 @@ class BaseGarnetNetwork(RubyNetwork):
abstract = True
ni_flit_size = Param.Int(16, "network interface flit size in bytes")
vcs_per_vnet = Param.Int(4, "virtual channels per virtual network");
+ enable_fault_model = Param.Bool(False, "enable network fault model");
+ fault_model = Param.FaultModel(NULL, "network fault model");
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
index be9a92305..fccd73ee2 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.cc
@@ -97,6 +97,23 @@ GarnetNetwork_d::init()
NetworkLink_d* net_link = safe_cast<NetworkLink_d*>(*i);
net_link->init_net_ptr(this);
}
+
+ // FaultModel: declare each router to the fault model
+ if(isFaultModelEnabled()){
+ for (vector<Router_d*>::const_iterator i= m_router_ptr_vector.begin();
+ i != m_router_ptr_vector.end(); ++i) {
+ Router_d* router = safe_cast<Router_d*>(*i);
+ int router_id=fault_model->declare_router(router->get_num_inports(),
+ router->get_num_outports(),
+ router->get_vc_per_vnet(),
+ getBuffersPerDataVC(),
+ getBuffersPerCtrlVC());
+ assert(router_id == router->get_id());
+ router->printAggregateFaultProbability(cout);
+ router->printFaultVector(cout);
+ }
+ }
+
}
GarnetNetwork_d::~GarnetNetwork_d()
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
index 2030bb4f0..a7fe05a64 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh
@@ -39,6 +39,7 @@
#include "mem/ruby/network/Network.hh"
#include "params/GarnetNetwork_d.hh"
+class FaultModel;
class NetworkInterface_d;
class MessageBuffer;
class Router_d;
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
index 62ab5ce07..b638c9aca 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
@@ -189,6 +189,35 @@ Router_d::printConfig(ostream& out)
out << "]" << endl;
}
+void
+Router_d::printFaultVector(ostream& out)
+{
+ int temperature_celcius = BASELINE_TEMPERATURE_CELCIUS;
+ int num_fault_types = m_network_ptr->fault_model->number_of_fault_types;
+ float fault_vector[num_fault_types];
+ get_fault_vector(temperature_celcius, fault_vector);
+ out << "Router-" << m_id << " fault vector: " << endl;
+ for (int fault_type_index = 0; fault_type_index < num_fault_types;
+ fault_type_index++){
+ out << " - probability of (";
+ out <<
+ m_network_ptr->fault_model->fault_type_to_string(fault_type_index);
+ out << ") = ";
+ out << fault_vector[fault_type_index] << endl;
+ }
+}
+
+void
+Router_d::printAggregateFaultProbability(std::ostream& out)
+{
+ int temperature_celcius = BASELINE_TEMPERATURE_CELCIUS;
+ float aggregate_fault_prob;
+ get_aggregate_fault_probability(temperature_celcius,
+ &aggregate_fault_prob);
+ out << "Router-" << m_id << " fault probability: ";
+ out << aggregate_fault_prob << endl;
+}
+
Router_d *
GarnetRouter_dParams::create()
{
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
index e5a3a0ce2..babc0d443 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh
@@ -50,6 +50,7 @@ class RoutingUnit_d;
class VCallocator_d;
class SWallocator_d;
class Switch_d;
+class FaultModel;
class Router_d : public BasicRouter
{
@@ -86,6 +87,8 @@ class Router_d : public BasicRouter
void vcarb_req();
void swarb_req();
void printConfig(std::ostream& out);
+ void printFaultVector(std::ostream& out);
+ void printAggregateFaultProbability(std::ostream& out);
double calculate_power();
void calculate_performance_numbers();
@@ -93,6 +96,15 @@ class Router_d : public BasicRouter
double get_dynamic_power(){return m_power_dyn;}
double get_static_power(){return m_power_sta;}
double get_clk_power(){return m_clk_power;}
+ 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,
+ float *aggregate_fault_prob){
+ return m_network_ptr->fault_model->fault_prob(m_id, temperature,
+ aggregate_fault_prob);
+ }
private:
int m_virtual_networks, m_num_vcs, m_vc_per_vnet;