int vnet = t_flit->get_vnet();
m_net_ptr->increment_received_flits(vnet);
- Cycles network_delay = curCycle() - t_flit->get_enqueue_time();
+ Cycles network_delay = curCycle() - t_flit->get_creation_time();
Cycles queueing_delay = t_flit->get_delay();
m_net_ptr->increment_network_latency(network_delay, vnet);
#include "mem/ruby/network/garnet/flexible-pipeline/flit.hh"
flit::flit(int id, int vc, int vnet, int size, MsgPtr msg_ptr, Cycles curTime)
+ : m_id(id), m_vnet(vnet), m_vc(vc), m_size(size), m_creation_time(curTime)
{
- m_size = size;
m_msg_ptr = msg_ptr;
- m_enqueue_time = curTime;
m_time = curTime;
- m_id = id;
- m_vnet = vnet;
- m_vc = vc;
if (size == 1) {
m_type = HEAD_TAIL_;
m_type = BODY_;
}
-int
-flit::get_size()
-{
- return m_size;
-}
-
-int
-flit::get_id()
-{
- return m_id;
-}
-
-Cycles
-flit::get_time()
-{
- return m_time;
-}
-
-Cycles
-flit::get_enqueue_time()
-{
- return m_enqueue_time;
-}
-
-void
-flit::set_time(Cycles time)
-{
- m_time = time;
-}
-
-int
-flit::get_vnet()
-{
- return m_vnet;
-}
-
-int
-flit::get_vc()
-{
- return m_vc;
-}
-
-void
-flit::set_vc(int vc)
-{
- m_vc = vc;
-}
-
-MsgPtr&
-flit::get_msg_ptr()
-{
- return m_msg_ptr;
-}
-
-flit_type
-flit::get_type()
-{
- return m_type;
-}
-
-void
-flit::set_delay(Cycles delay)
-{
- src_delay = delay;
-}
-
-Cycles
-flit::get_delay()
-{
- return src_delay;
-}
-
void
flit::print(std::ostream& out) const
{
out << "Type=" << m_type << " ";
out << "Vnet=" << m_vnet << " ";
out << "VC=" << m_vc << " ";
- out << "Enqueue Time=" << m_enqueue_time << " ";
+ out << "Creation Time=" << m_creation_time << " ";
out << "]";
}
public:
flit(int id, int vc, int vnet, int size, MsgPtr msg_ptr, Cycles curTime);
- int get_size();
- int get_id();
- Cycles get_time();
- Cycles get_enqueue_time();
- void set_time(Cycles time);
- int get_vnet();
- int get_vc();
- void set_vc(int vc);
- MsgPtr& get_msg_ptr();
- flit_type get_type();
- void set_delay(Cycles delay);
- Cycles get_delay();
+ int get_size() const { return m_size; }
+ int get_id() const { return m_id; }
+ Cycles get_time() const { return m_time; }
+ Cycles get_creation_time() const { return m_creation_time; }
+ void set_time(Cycles time) { m_time = time; }
+ int get_vnet() const { return m_vnet; }
+ int get_vc() const { return m_vc; }
+ void set_vc(int vc) { m_vc = vc; }
+ MsgPtr& get_msg_ptr() { return m_msg_ptr; }
+ flit_type get_type() const { return m_type; }
+ void set_delay(Cycles delay) { src_delay = delay; }
+ Cycles get_delay() const { return src_delay; }
void print(std::ostream& out) const;
static bool
bool functionalWrite(Packet *pkt);
private:
- int m_id;
- int m_vnet;
+ const int m_id;
+ const int m_vnet;
int m_vc;
- int m_size;
- Cycles m_enqueue_time, m_time;
+ const int m_size;
+ const Cycles m_creation_time;
+ Cycles m_time;
flit_type m_type;
MsgPtr m_msg_ptr;
Cycles src_delay;