SST/macro
packet_flow_packetizer.h
Go to the documentation of this file.
1 #ifndef PACKET_FLOW_PACKETIZER_H
2 #define PACKET_FLOW_PACKETIZER_H
3 
11 
12 namespace sstmac {
13 namespace hw {
14 
16  public packetizer
17 {
18  public:
19  void handle(event *ev);
20 
21  private:
22  virtual void recv_credit(packet_flow_credit* ev) = 0;
23 
24  virtual void recv_packet(packet_flow_payload* ev) = 0;
25 
26 };
27 
28 /**
29  @class packet_flow_nic
30  Network interface compatible with sending packet trains
31  */
34 {
35 
36  public:
38 
39  std::string
40  to_string() const {
41  return sprockit::printf("packet_flow_nic_packetizer");
42  }
43 
44  virtual void
45  init_factory_params(sprockit::sim_parameters* params);
46 
47  virtual ~packet_flow_nic_packetizer();
48 
49  void setNotify(event_handler *handler);
50 
51  /**
52  * We assume the injection buffer has infinite occupancy
53  */
54  bool
55  spaceToSend(int vn, int num_bits) const;
56 
57  void inject(int vn, long bytes, long byte_offset, message *payload);
58 
59  /**
60  Set up the injection/ejection links to the switch the NIC is connected to
61  @param sw The switch that injects/ejects
62  */
63  void
64  set_output(int port, connectable* output, int credits);
65 
66  void
67  set_input(int port, connectable* input);
68 
69  virtual void
71 
72  virtual void
73  finalize_init();
74 
75  void
76  set_acker(event_handler* handler);
77 
78  double
80  return inj_bw_;
81  }
82 
83  protected:
84  void
85  recv_packet_common(packet_flow_payload* pkt);
86 
87  virtual void
88  recv_credit(packet_flow_credit* credit);
89 
90  protected:
91  double inj_bw_;
92  double ej_bw_;
96 
98 
100 
104 
105 };
106 
108 {
109  public:
110  void recv_packet(packet_flow_payload* pkt);
111 
112 };
113 
115 {
116  public:
117  void recv_packet(packet_flow_payload* pkt);
118 
119 };
120 
121 }
122 } // end of namespace sstmac
123 
124 #endif // PACKET_FLOW_PACKETIZER_H
virtual void recv_packet(packet_flow_payload *ev)=0
A class describing an event.
Definition: sst_message.h:42
virtual void set_event_parent(event_scheduler *m)
Set the eventmanager for this scheduler.
The packet_allocator class Factory for creating packets.
void setNotify(packetizer_callback *handler)
Definition: packetizer.h:39
std::string printf(const char *fmt,...)
virtual void finalize_init()
Definition: factory.h:34
virtual bool spaceToSend(int vn, int num_bits) const =0
The main interface for something that can respond to an event (sst_message).
Definition: event_handler.h:24
virtual void recv_credit(packet_flow_credit *ev)=0
packet_flow_injection_buffer * inj_buffer_
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
virtual void init_factory_params(sprockit::sim_parameters *params)
virtual void inject(int vn, long bytes, long byte_offset, message *payload)=0
The interface for something that can schedule messages.
endpoint_id node_id
Definition: node_address.h:20