SST/macro
packet_flow_nic.h
Go to the documentation of this file.
1 #ifndef sstmac_hardware_nic_packet_flow_nic_H
2 #define sstmac_hardware_nic_packet_flow_nic_H
3 
10 
11 namespace sstmac {
12 namespace hw {
13 
14 /**
15  @class packet_flow_nic
16  Network interface compatible with sending packet trains
17  */
19  public nic,
20  public packet_flow_component,
21  public packetizer_callback
22 {
23 
24  public:
26  nic(interconn),
27  packetizer_(0),
29  {
30  }
31 
32  std::string
33  to_string() const {
34  return sprockit::printf("packet flow nic(%d)", int(addr()));
35  }
36 
37 #if SSTMAC_INTEGRATED_SST_CORE
38  virtual void
39  init_sst_params(SST::Params &params, SST::Component* parent);
40 #endif
41 
42  virtual void
43  init_factory_params(sprockit::sim_parameters* params);
44 
45  virtual ~packet_flow_nic() throw ();
46 
47  void handle(event *ev);
48 
49  void notify(int vn, message* msg){
50  recv_message(msg);
51  }
52 
53  virtual void
54  connect(
55  int src_outport,
56  int dst_inport,
58  connectable* mod,
59  config* cfg);
60 
61  virtual void
63 
64  timestamp
66  return inj_lat_;
67  }
68 
69  double
70  injection_bandwidth() const;
71 
72  int
73  initial_credits() const {
74  return injection_credits_;
75  }
76 
77  protected:
78  virtual void
80 
81  protected:
85 
86 };
87 
89  public netlink,
91 {
92  public:
94  netlink(interconn),
95  block_(nullptr),
96  tile_rotater_(0),
97  inited_(false)
98  {
99  }
100 
101  virtual ~packet_flow_netlink();
102 
103  std::string
104  to_string() const {
105  return "packet flow netlink";
106  }
107 
108  void
109  init_factory_params(sprockit::sim_parameters *params);
110 
111  void
112  connect(
113  int src_outport,
114  int dst_inport,
116  connectable *mod,
117  config* cfg);
118 
119  void
120  deadlock_check();
121 
122  void
124 
125  void
126  handle(event* ev);
127 
130  init();
131  return block_;
132  }
133 
134  int
135  initial_credits() const {
136  return really_big_buffer;
137  }
138 
141  init();
142  return block_;
143  }
144 
145  private:
146  void init();
147 
148  private:
149  static const int really_big_buffer;
152  bool inited_;
153 };
154 
155 }
156 } // end of namespace sstmac
157 
158 
159 #endif // packet_flow_nic_H
160 
A class describing an event.
Definition: sst_message.h:42
virtual void init_factory_params(sprockit::sim_parameters *params)
Initialize all member variables from the parameters object.
void recv_message(message *msg)
The NIC can either receive an entire message (bypass the byte-transfer layer) or it can receive packe...
Network interface compatible with sending packet trains.
node_id addr() const
Definition: nic.h:71
timestamp injection_latency() const
std::string printf(const char *fmt,...)
virtual void do_send(network_message *payload)
Start the message sending and inject it into the network This performs all model-specific work...
event_scheduler * parent() const
The main interface for something that can respond to an event (sst_message).
Definition: event_handler.h:24
A basic container for time (subject to future transplant).
Definition: timestamp.h:29
parallel_runtime * init()
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
A networkinterface is a delegate between a node and a server module.
Definition: nic.h:45
packet_flow_nic(sprockit::factory_type *interconn)
virtual void deadlock_check()
Definition: event_handler.h:86
The interface for something that can schedule messages.
void notify(int vn, message *msg)
double injection_bandwidth() const
virtual void connect(int src_outport, int dst_inport, connection_type_t ty, connectable *mod, config *cfg)
connect
std::string to_string() const
virtual void set_event_parent(event_scheduler *m)
Set the eventmanager for this scheduler.