00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _RESIL_H
00014 #define _RESIL_H
00015
00016 #include <sst/core/event.h>
00017 #include <sst/core/component.h>
00018 #include <sst/core/link.h>
00019
00020 #define MAX_LINKS 10
00021
00022 using namespace SST;
00023
00024 enum comp_type {LEAF,SCHEDULER,REL_COMP,INFREQ};
00025 enum fail_dist {GAUSS,EXP};
00026 enum link_type {DISCON,INCOME,OUTGO};
00027
00028
00029
00030 class resil : public Component {
00031 public:
00032 resil ( ComponentId_t id, Params_t& params );
00033 ~resil () ;
00034
00035 bool clock ( Cycle_t cycle );
00036 void processEvent( Event* event );
00037 void processfailEvent( Event* event );
00038 int my_id;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 private:
00056 resil() : Component(-1) {}
00057 friend class boost::serialization::access;
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 float lambda;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 Link* linkToSelf;
00079 Link* link0;
00080 Link* link1;
00081 Link* link2;
00082 Link* link3;
00083 Link* link4;
00084 Link* sched_link;
00085 Link* link_array[MAX_LINKS];
00086 Link* uplink;
00087
00088 int counter;
00089 link_type link_state[MAX_LINKS];
00090 int count_to;
00091 bool fail_assigned;
00092 bool failknow;
00093
00094 Params_t params ;
00095 std::string frequency;
00096 std::string links[MAX_LINKS];
00097 std::string id_str;
00098 };
00099
00100 float genexp(float lambda);
00101
00102 float urand();
00103
00104 #endif