• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/portals4_sm/trig_cpu/portals_types.h

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

Generated on Fri Oct 22 2010 11:02:25 for SST by  doxygen 1.7.1