00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef COMPONENTS_TRIG_CPU_PORTALS_TYPES_H
00014 #define COMPONENTS_TRIG_CPU_PORTALS_TYPES_H
00015
00016 #include "sst/sst_stdint.h"
00017
00018 typedef uint32_t ptl_size_t;
00019
00020 typedef int32_t ptl_handle_ct_t;
00021 typedef int32_t ptl_handle_eq_t;
00022 typedef int16_t ptl_pt_index_t;
00023 typedef uint32_t ptl_ack_req_t;
00024
00025 typedef uint64_t ptl_process_id_t;
00026
00027 typedef uint64_t ptl_hdr_data_t;
00028
00029 typedef uint64_t ptl_match_bits_t;
00030
00031 typedef struct {
00032 ptl_size_t success;
00033 ptl_size_t failure;
00034 } ptl_ct_event_t;
00035
00036 typedef enum {
00037 PTL_CT_OPERATION, PTL_CT_BYTE
00038 } ptl_ct_type_t;
00039
00040
00041 #define PTL_OP_PUT 0
00042 #define PTL_OP_GET 1
00043 #define PTL_OP_GET_RESP 2
00044 #define PTL_OP_ATOMIC 3
00045 #define PTL_OP_CT_INC 4
00046
00047 #define PTL_EQ_NONE (-1)
00048 #define PTL_CT_NONE (-1)
00049
00050 typedef enum {
00051 PTL_PRIORITY_LIST, PTL_OVERFLOW, PTL_PROBE_ONLY
00052 } ptl_list_t;
00053
00054 typedef enum {
00055 PTL_MIN, PTL_MAX,
00056 PTL_SUM, PTL_PROD,
00057 PTL_LOR, PTL_LAND,
00058 PLT_BOR, PTL_BAND,
00059 PTL_LXOR, PTL_BXOR,
00060 PTL_SWAP, PTL_CSWAP, PTL_MSWAP
00061 } ptl_op_t;
00062
00063 typedef enum {
00064 PTL_CHAR, PTL_UCHAR,
00065 PTL_SHORT, PTL_USHORT,
00066 PTL_INT, PTL_UINT,
00067 PTL_LONG, PTL_ULONG,
00068 PTL_FLOAT, PTL_DOUBLE
00069 } ptl_datatype_t;
00070
00071
00072 typedef struct {
00073 void *start;
00074 ptl_size_t length;
00075 unsigned int options;
00076 ptl_handle_eq_t eq_handle;
00077 ptl_handle_ct_t ct_handle;
00078 } ptl_md_t;
00079
00080 typedef ptl_md_t* ptl_handle_md_t;
00081
00082
00083
00084 typedef struct {
00085 void *start;
00086 ptl_size_t length;
00087 ptl_handle_ct_t ct_handle;
00088 ptl_size_t min_free;
00089
00090 unsigned int options;
00091
00092 ptl_match_bits_t match_bits;
00093 ptl_match_bits_t ignore_bits;
00094 } ptl_me_t;
00095
00096
00097
00098 typedef uint32_t ptl_op_type_t;
00099
00100 typedef struct {
00101 ptl_me_t me;
00102 bool active;
00103 void *user_ptr;
00104 ptl_handle_ct_t handle_ct;
00105 ptl_pt_index_t pt_index;
00106 ptl_list_t ptl_list;
00107 } ptl_int_me_t;
00108
00109 typedef ptl_int_me_t* ptl_handle_me_t;
00110
00111 typedef struct {
00112 void* start;
00113 ptl_size_t length;
00114 ptl_size_t offset;
00115 ptl_process_id_t target_id;
00116 ptl_handle_ct_t ct_handle;
00117 bool end;
00118 int stream;
00119 } ptl_int_dma_t;
00120
00121 typedef struct {
00122 ptl_pt_index_t pt_index;
00123 uint16_t op;
00124 uint32_t length;
00125 ptl_match_bits_t match_bits;
00126 ptl_size_t remote_offset;
00127 ptl_handle_ct_t get_ct_handle;
00128 void * get_start;
00129 } ptl_header_t;
00130
00131 typedef struct {
00132 ptl_op_type_t op_type;
00133 ptl_process_id_t target_id;
00134 ptl_pt_index_t pt_index;
00135 ptl_match_bits_t match_bits;
00136 ptl_handle_ct_t ct_handle;
00137 ptl_size_t increment;
00138 ptl_int_dma_t* dma;
00139 ptl_header_t* ptl_header;
00140 } ptl_int_op_t;
00141
00142 typedef struct {
00143 ptl_size_t threshold;
00144 ptl_handle_ct_t trig_ct_handle;
00145 ptl_int_op_t* op;
00146 } ptl_int_trig_op_t;
00147
00148
00149 typedef std::list<ptl_int_me_t*> me_list_t;
00150 typedef std::list<ptl_int_trig_op_t*> trig_op_list_t;
00151
00152 typedef struct {
00153 bool allocated;
00154 ptl_ct_event_t ct_event;
00155 ptl_ct_type_t ct_type;
00156 trig_op_list_t trig_op_list;
00157 } ptl_int_ct_t;
00158
00159 typedef struct {
00160 ptl_ct_event_t ct_event;
00161 ptl_handle_ct_t ct_handle;
00162 } ptl_update_ct_event_t;
00163
00164 typedef struct {
00165 me_list_t* priority_list;
00166 me_list_t* overflow;
00167 } ptl_entry_t;
00168
00169
00170 typedef enum {
00171 PTL_NO_OP, PTL_DMA, PTL_DMA_RESPONSE,
00172 PTL_CREDIT_RETURN,
00173 PTL_NIC_PROCESS_MSG,
00174 PTL_NIC_ME_APPEND, PTL_NIC_TRIG,
00175 PTL_NIC_PROCESS_TRIG, PTL_NIC_POST_CT,
00176 PTL_NIC_CT_SET, PTL_NIC_CT_INC,
00177 PTL_NIC_UPDATE_CPU_CT, PTL_NIC_INIT_FOR_SEND_RECV
00178 } ptl_int_nic_op_type_t;
00179
00180
00181 typedef struct {
00182 ptl_int_nic_op_type_t op_type;
00183 union {
00184 ptl_int_me_t* me;
00185 ptl_int_trig_op_t* trig;
00186 ptl_update_ct_event_t* ct;
00187 ptl_handle_ct_t ct_handle;
00188 ptl_int_dma_t* dma;
00189 } data;
00190 } ptl_int_nic_op_t;
00191
00192
00193
00194 #define PTL_HDR_PORTALS 0x1
00195 #define PTL_HDR_HEAD_PACKET 0x2
00196 #define PTL_HDR_STREAM_PIO 0x10000000
00197 #define PTL_HDR_STREAM_DMA 0x20000000
00198 #define PTL_HDR_STREAM_TRIG 0x30000000
00199 #define PTL_HDR_STREAM_GET 0x40000000
00200
00201 #endif // COMPONENTS_TRIG_CPU_PORTALS_TYPES_H