SST/macro
packet_flow_tiled_switch.h
Go to the documentation of this file.
1 #ifndef PACKET_FLOW_TILED_SWITCH_H
2 #define PACKET_FLOW_TILED_SWITCH_H
3 
9 
10 namespace sstmac {
11 namespace hw {
12 
13 /**
14  @class packet_flow_switch
15  A switch in the network that arbitrates/routes packet_trains
16  to the next link in the network
17  */
20 {
21 
22  public:
23 #if !SSTMAC_INTEGRATED_SST_CORE
25 #endif
26 
27  virtual void
28  initialize();
29 
30  virtual void
31  init_factory_params(sprockit::sim_parameters* params);
32 
33  int
34  queue_length(int port) const;
35 
36  virtual void
37  connect(
38  int src_outport,
39  int dst_inport,
40  connection_type_t ty,
41  connectable* mod,
42  config* cfg);
43 
44  virtual void
45  connect_output(int src_outport, int dst_inport, connectable* mod, config *cfg);
46 
47  virtual void
48  connect_input(int src_outport, int dst_inport, connectable* mod, config *cfg);
49 
50  std::vector<switch_id>
51  connected_switches() const;
52 
53  /**
54  Cast message and pass to #send
55  @param msg Incoming message (should cast to packet_train)
56  */
57  void
58  handle(event* ev);
59 
60  /**
61  Set the link to use when ejecting packets at their endpoint. A packet_flow_switch
62  can have any number of ejectors, corresponding to the number of nodes
63  per switch.
64  @param addr The compute node address of the endpoint to eject to
65  @param link The link to the compute node for ejection
66  */
67  void
68  add_ejector(node_id addr, event_handler* link);
69 
70  virtual void
72 
73  virtual std::string
74  to_string() const;
75 
76  int
77  initial_credits() const {
78  return row_buffer_num_bytes;
79  }
80 
81  virtual
83 
85  demuxer(int port) const {
86  return row_input_demuxers_[port];
87  }
88 
89  void
91 
92  protected:
93  virtual void
94  connect_injector(int src_outport, int dst_inport, event_handler* nic);
95 
96  virtual void
97  connect_ejector(int src_outport, int dst_inport, event_handler* nic);
98 
99  protected:
100  std::vector<packet_flow_demuxer*> row_input_demuxers_;
101 
102  std::vector<packet_flow_crossbar*> xbar_tiles_;
103 
104  std::vector<packet_flow_muxer*> col_output_muxers_;
105 
106  int nrows_;
107 
108  int ncols_;
109 
110  private:
111  int
112  row_col_to_tile(int row, int col);
113 
114  void
115  tile_to_row_col(int tile, int& row, int& col);
116 
117  void resize_buffers();
118 
119  void init_components();
120 
121  void
123  int src_outport,
124  int dst_inport,
125  event_handler* mod,
126  config* cfg);
127 
128  void
130  int src_outport,
131  int dst_inport,
132  event_handler* mod,
133  config* cfg);
134 
135 };
136 
137 }
138 }
139 
140 #endif // PACKET_FLOW_TILED_SWITCH_H
std::vector< packet_flow_demuxer * > row_input_demuxers_
virtual std::string to_string() const
std::vector< packet_flow_crossbar * > xbar_tiles_
event_handler * demuxer(int port) const
Base type for implementations of an engine that is able to schedule events and advance simulation tim...
Definition: event_manager.h:47
virtual void connect_injector(int src_outport, int dst_inport, event_handler *nic)
virtual void connect_input(int src_outport, int dst_inport, connectable *mod, config *cfg)
virtual void set_event_manager(event_manager *m)
virtual void init_factory_params(sprockit::sim_parameters *params)
std::vector< switch_id > connected_switches() const
The main interface for something that can respond to an event (sst_message).
Definition: event_handler.h:24
virtual void connect_ejector(int src_outport, int dst_inport, event_handler *nic)
virtual void connect_output(int src_outport, int dst_inport, connectable *mod, config *cfg)
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
void handle(event *ev)
Cast message and pass to #send.
int row_col_to_tile(int row, int col)
virtual void connect(int src_outport, int dst_inport, connection_type_t ty, connectable *mod, config *cfg)
A networkinterface is a delegate between a node and a server module.
Definition: nic.h:45
void add_ejector(node_id addr, event_handler *link)
Set the link to use when ejecting packets at their endpoint.
void tile_to_row_col(int tile, int &row, int &col)
std::vector< packet_flow_muxer * > col_output_muxers_
endpoint_id node_id
Definition: node_address.h:20