SST/macro
connectable_wrapper.h
Go to the documentation of this file.
1 #ifndef CONNECTABLE_WRAPPER_H
2 #define CONNECTABLE_WRAPPER_H
3 
5 #include <sprockit/unordered.h>
6 #include <sst/core/link.h>
7 #include <Python.h>
8 
9 namespace sstmac {
10 
12 {
13  public:
14  typedef enum {
17  } endpoint_t;
18 
20  int src_id;
21  int dst_id;
22  int src_port;
23  int dst_port;
24  endpoint_t src_type;
25  endpoint_t dst_type;
27 
28  void parse_type_id(const std::string& str, endpoint_t& ep, int& id);
29  void parse_src(const std::string& str);
30  void parse_dst(const std::string& str);
31 
32 };
33 
34 void
35 parse_port_name(const std::string& port_name, connection_details* dets);
36 
38  : public hw::connectable,
39  public event_handler
40 {
41  public:
42  std::string to_string() const { return "integrated_connectable_wrapper"; }
43 
44  integrated_connectable_wrapper(SST::Link* link) :
45  event_handler(link_handler),
46  link_(link)
47  {
48  }
49 
50  void
51  handle(event* ev){
53  "integrated_connectable_wrapper::handle: should never be called");
54  }
55 
56  void connect(
57  int src_outport,
58  int dst_inport,
60  connectable *mod,
61  config *cfg);
62 
64  event_location() const {
65  return event_loc_id::null;
66  }
67 
68  SST::Link*
69  link() const {
70  return link_;
71  }
72 
73  private:
74  SST::Link* link_;
75 };
76 
78  : public hw::connectable
79 {
80  public:
81 
82  static PyObject* sst;
83  typedef spkt_unordered_map<switch_id, connectable_proxy_component*> switch_map;
84  static switch_map registered_switches;
85  typedef spkt_unordered_map<endpoint_id, connectable_proxy_component*> endpoint_map;
86  static endpoint_map registered_endpoints;
87 
88  std::string to_string() const
89  {
90  return "connectable_proxy";
91  }
92 
93  typedef enum {
96  Other
98 
101  {
102  return event_loc_id::null;
103  }
104 
105  void
106  connect(
107  int src_outport,
108  int dst_inport,
110  connectable* other,
111  config* cfg);
112 
114 
115  PyObject* component_proxy;
116  std::string component_name;
117  std::string hop_latency;
118  std::string injection_latency;
119  component_category_t category;
120 };
121 
122 }
123 
124 #endif // CONNECTABLE_WRAPPER_H
void parse_type_id(const std::string &str, endpoint_t &ep, int &id)
static event_loc_id null
The main interface for something that can respond to an event (sst_message).
Definition: event_handler.h:24
hw::connectable::config cfg
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
void parse_port_name(const std::string &port_name, connection_details *dets)
void parse_src(const std::string &str)
spkt_unordered_map< endpoint_id, connectable_proxy_component * > endpoint_map
spkt_unordered_map< switch_id, connectable_proxy_component * > switch_map
#define spkt_throw(exc,...)
Definition: errors.h:44
void parse_dst(const std::string &str)
A function was intentionally unimplemented because it doesn&#39;t make sense, or it is ongoing work...
Definition: errors.h:181
hw::connectable::connection_type_t type