00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _PATTERN_COMMON_H
00015 #define _PATTERN_COMMON_H
00016
00017 #ifndef FALSE
00018 #define FALSE (0)
00019 #endif
00020 #ifndef TRUE
00021 #define TRUE (1)
00022 #endif
00023
00024 #include <sst_config.h>
00025 #include <sst/core/sst_types.h>
00026 #include <sst/core/link.h>
00027
00028
00029
00030
00031 typedef enum {START,
00032 COMPUTE_DONE,
00033 RECEIVE,
00034 CHCKPT_DONE,
00035 FAIL,
00036 LOG_MSG_DONE,
00037 ENV_LOG_DONE,
00038 ENTER_WAIT,
00039
00040
00041 BIT_BUCKET_WRITE_START= 200,
00042 BIT_BUCKET_WRITE_DONE,
00043 BIT_BUCKET_READ_START,
00044 BIT_BUCKET_READ_DONE
00045 } pattern_event_t;
00046
00047
00048
00049 typedef enum {CHCKPT_NONE, CHCKPT_COORD, CHCKPT_UNCOORD, CHCKPT_RAID} chckpt_t;
00050
00051 class Patterns {
00052 public:
00053 Patterns() {
00054
00055 my_net_link= NULL;
00056 my_self_link= NULL;
00057 mesh_width= -1;
00058 mesh_height= -1;
00059 NoC_width= -1;
00060 NoC_height= -1;
00061 total_cores= 1;
00062 my_rank= -1;
00063 net_latency= 0;
00064 net_bandwidth= 0;
00065 msg_seq= 1;
00066 }
00067
00068 int init(int x, int y, int NoC_x_dim, int NoC_y_dim, int rank, int cores,
00069 SST::Link *net_link, SST::Link *self_link,
00070 SST::Link *NoC_link, SST::Link *nvram_link, SST::Link *storage_link,
00071 SST::SimTime_t net_lat, SST::SimTime_t net_bw, SST::SimTime_t node_lat,
00072 SST::SimTime_t node_bw, chckpt_t method, int chckpt_size,
00073 SST::SimTime_t chckpt_interval, int envelope_size);
00074
00075 void send(int dest, int len);
00076 void event_send(int dest, pattern_event_t event, SST::SimTime_t delay= 0,
00077 uint32_t msg_len= 0);
00078 void storage_write(int data_size, pattern_event_t return_event);
00079 void nvram_write(int data_size, pattern_event_t return_event);
00080
00081
00082 private:
00083 SST::Link *my_net_link;
00084 SST::Link *my_self_link;
00085 SST::Link *my_NoC_link;
00086 SST::Link *my_nvram_link;
00087 SST::Link *my_storage_link;
00088 int mesh_width;
00089 int mesh_height;
00090 int NoC_width;
00091 int NoC_height;
00092 int my_rank;
00093 int total_cores;
00094 int cores_per_router;
00095 int cores_per_node;
00096 SST::SimTime_t net_bandwidth;
00097 SST::SimTime_t node_bandwidth;
00098 SST::SimTime_t net_latency;
00099 SST::SimTime_t node_latency;
00100 uint64_t msg_seq;
00101
00102 } ;
00103
00104
00105 #endif