using namespace std;
BaseGarnetNetwork::BaseGarnetNetwork(const Params *p)
- : Network(p)
+ : Network(p), m_ruby_start(0)
{
m_ni_flit_size = p->ni_flit_size;
m_vcs_per_vnet = p->vcs_per_vnet;
if (m_enable_fault_model)
fault_model = p->fault_model;
- m_ruby_start = 0;
-
// Currently Garnet only supports uniform bandwidth for all
// links and network interfaces.
for (std::vector<BasicExtLink*>::const_iterator i =
m_ruby_start = curCycle();
}
-Time
+Cycles
BaseGarnetNetwork::getRubyStartTime()
{
return m_ruby_start;
#include "mem/ruby/network/Network.hh"
#include "mem/ruby/network/fault_model/FaultModel.hh"
#include "params/BaseGarnetNetwork.hh"
-#include "math.h"
class BaseGarnetNetwork : public Network
{
void increment_received_flits(int vnet) { m_flits_received[vnet]++; }
void
- increment_network_latency(Time latency, int vnet)
+ increment_network_latency(Cycles latency, int vnet)
{
m_network_latency[vnet] += latency;
}
void
- increment_queueing_latency(Time latency, int vnet)
+ increment_queueing_latency(Cycles latency, int vnet)
{
m_queueing_latency[vnet] += latency;
}
virtual void checkNetworkAllocation(NodeID id, bool ordered,
int network_num, std::string vnet_type) = 0;
- Time getRubyStartTime();
+ Cycles getRubyStartTime();
void clearStats();
void printStats(std::ostream& out) const;
void printPerformanceStats(std::ostream& out) const;
std::vector<std::vector<MessageBuffer*> > m_toNetQueues;
std::vector<std::vector<MessageBuffer*> > m_fromNetQueues;
- Time m_ruby_start;
+ Cycles m_ruby_start;
};
#endif // __MEM_RUBY_NETWORK_GARNET_BASEGARNETNETWORK_HH__
inline int get_inlink_id() { return m_in_link->get_id(); }
inline void
- set_vc_state(VC_state_type state, int vc, Time curTime)
+ set_vc_state(VC_state_type state, int vc, Cycles curTime)
{
m_vcs[vc]->set_state(state, curTime);
}
inline void
- set_enqueue_time(int invc, Time time)
+ set_enqueue_time(int invc, Cycles time)
{
m_vcs[invc]->set_enqueue_time(time);
}
- inline Time
+ inline Cycles
get_enqueue_time(int invc)
{
return m_vcs[invc]->get_enqueue_time();
}
inline void
- increment_credit(int in_vc, bool free_signal, Time curTime)
+ increment_credit(int in_vc, bool free_signal, Cycles curTime)
{
flit_d *t_flit = new flit_d(in_vc, free_signal, curTime);
creditQueue->insert(t_flit);
}
inline void
- updateRoute(int vc, int outport, Time curTime)
+ updateRoute(int vc, int outport, Cycles curTime)
{
m_vcs[vc]->set_outport(outport);
m_vcs[vc]->set_state(VC_AB_, curTime);
}
inline void
- grant_vc(int in_vc, int out_vc, Time curTime)
+ grant_vc(int in_vc, int out_vc, Cycles curTime)
{
m_vcs[in_vc]->grant_vc(out_vc, curTime);
}
}
inline bool
- need_stage(int vc, VC_state_type state, flit_stage stage, Time curTime)
+ need_stage(int vc, VC_state_type state, flit_stage stage, Cycles curTime)
{
return m_vcs[vc]->need_stage(state, stage, curTime);
}
inline bool
need_stage_nextcycle(int vc, VC_state_type state, flit_stage stage,
- Time curTime)
+ Cycles curTime)
{
return m_vcs[vc]->need_stage_nextcycle(state, stage, curTime);
}
inline bool
- isReady(int invc, Time curTime)
+ isReady(int invc, Cycles curTime)
{
return m_vcs[invc]->isReady(curTime);
}
int vnet = t_flit->get_vnet();
m_net_ptr->increment_received_flits(vnet);
- int network_delay = m_net_ptr->curCycle() -
- t_flit->get_enqueue_time();
- int queueing_delay = t_flit->get_delay();
+ Cycles network_delay = m_net_ptr->curCycle() -
+ t_flit->get_enqueue_time();
+ Cycles queueing_delay = t_flit->get_delay();
+
m_net_ptr->increment_network_latency(network_delay, vnet);
m_net_ptr->increment_queueing_latency(queueing_delay, vnet);
delete t_flit;
m_out_vc_state[vc]->decrement_credit();
// Just removing the flit
flit_d *t_flit = m_ni_buffers[vc]->getTopFlit();
- t_flit->set_time(m_net_ptr->curCycle() + 1);
+ t_flit->set_time(m_net_ptr->curCycle() + Cycles(1));
outSrcQueue->insert(t_flit);
// schedule the out link
outNetLink->scheduleEvent(Cycles(1));
double calculate_power();
- inline bool isReady(Time curTime) { return linkBuffer->isReady(curTime); }
+ inline bool isReady(Cycles curTime)
+ { return linkBuffer->isReady(curTime); }
inline flit_d* peekLink() { return linkBuffer->peekTopFlit(); }
inline flit_d* consumeLink() { return linkBuffer->getTopFlit(); }
void init_net_ptr(GarnetNetwork_d* net_ptr)
void set_inport(int port) { m_in_port = port; }
void set_invc(int vc) { m_in_vc = vc; }
inline bool
- isInState(VC_state_type state, Time request_time)
+ isInState(VC_state_type state, Cycles request_time)
{
return ((m_vc_state == state) && (request_time >= m_time) );
}
inline void
- setState(VC_state_type state, Time time)
+ setState(VC_state_type state, Cycles time)
{
m_vc_state = state;
m_time = time;
private:
GarnetNetwork_d *m_network_ptr;
int m_id ;
- Time m_time;
+ Cycles m_time;
VC_state_type m_vc_state;
int m_in_port;
int m_in_vc;
void
OutputUnit_d::update_vc(int vc, int in_port, int in_vc)
{
- m_outvc_state[vc]->setState(ACTIVE_, m_router->curCycle() + 1);
+ m_outvc_state[vc]->setState(ACTIVE_, m_router->curCycle() + Cycles(1));
m_outvc_state[vc]->set_inport(in_port);
m_outvc_state[vc]->set_invc(in_vc);
m_router->update_incredit(in_port, in_vc,
}
inline void
- set_vc_state(VC_state_type state, int vc, Time curTime)
+ set_vc_state(VC_state_type state, int vc, Cycles curTime)
{
- m_outvc_state[vc]->setState(state, curTime + 1);
+ m_outvc_state[vc]->setState(state, curTime + Cycles(1));
}
inline bool
- is_vc_idle(int vc, Time curTime)
+ is_vc_idle(int vc, Cycles curTime)
{
return (m_outvc_state[vc]->isInState(IDLE_, curTime));
}
t_flit->advance_stage(ST_, m_router->curCycle());
t_flit->set_vc(outvc);
t_flit->set_outport(outport);
- t_flit->set_time(m_router->curCycle() + 1);
+ t_flit->set_time(m_router->curCycle() + Cycles(1));
+
m_output_unit[outport]->decrement_credit(outvc);
m_router->update_sw_winner(inport, t_flit);
m_global_arbiter_activity++;
m_input_unit[inport]->set_vc_state(IDLE_, invc,
m_router->curCycle());
- m_input_unit[inport]->set_enqueue_time(invc, INFINITE_);
+ m_input_unit[inport]->set_enqueue_time(invc,
+ Cycles(INFINITE_));
} else {
// Send a credit back
// but do not indicate that the VC is idle
if (t_flit->is_stage(ST_, m_router->curCycle())) {
int outport = t_flit->get_outport();
t_flit->advance_stage(LT_, m_router->curCycle());
- t_flit->set_time(m_router->curCycle() + 1);
+ t_flit->set_time(m_router->curCycle() + Cycles(1));
// This will take care of waking up the Network Link
m_output_unit[outport]->insert_flit(t_flit);
#include "mem/ruby/network/garnet/fixed-pipeline/VirtualChannel_d.hh"
-VirtualChannel_d::VirtualChannel_d(int id, Time curTime)
+VirtualChannel_d::VirtualChannel_d(int id, Cycles curTime)
+ : m_enqueue_time(INFINITE_)
{
m_id = id;
m_input_buffer = new flitBuffer_d();
m_vc_state.first = IDLE_;
m_vc_state.second = curTime;
- m_enqueue_time = INFINITE_;
}
VirtualChannel_d::~VirtualChannel_d()
}
void
-VirtualChannel_d::grant_vc(int out_vc, Time curTime)
+VirtualChannel_d::grant_vc(int out_vc, Cycles curTime)
{
m_output_vc = out_vc;
m_vc_state.first = ACTIVE_;
- m_vc_state.second = curTime + 1;
+ m_vc_state.second = curTime + Cycles(1);
flit_d *t_flit = m_input_buffer->peekTopFlit();
t_flit->advance_stage(SA_, curTime);
}
bool
VirtualChannel_d::need_stage(VC_state_type state, flit_stage stage,
- Time curTime)
+ Cycles curTime)
{
if ((m_vc_state.first == state) && (curTime >= m_vc_state.second)) {
if (m_input_buffer->isReady(curTime)) {
bool
VirtualChannel_d::need_stage_nextcycle(VC_state_type state, flit_stage stage,
- Time curTime)
+ Cycles curTime)
{
if ((m_vc_state.first == state) && ((curTime + 1) >= m_vc_state.second)) {
if (m_input_buffer->isReadyForNext(curTime)) {
class VirtualChannel_d
{
public:
- VirtualChannel_d(int id, Time curTime);
+ VirtualChannel_d(int id, Cycles curTime);
~VirtualChannel_d();
- bool need_stage(VC_state_type state, flit_stage stage, Time curTime);
+ bool need_stage(VC_state_type state, flit_stage stage, Cycles curTime);
bool need_stage_nextcycle(VC_state_type state, flit_stage stage,
- Time curTime);
+ Cycles curTime);
void set_outport(int outport);
- void grant_vc(int out_vc, Time curTime);
+ void grant_vc(int out_vc, Cycles curTime);
- inline Time get_enqueue_time() { return m_enqueue_time; }
- inline void set_enqueue_time(Time time) { m_enqueue_time = time; }
+ inline Cycles get_enqueue_time() { return m_enqueue_time; }
+ inline void set_enqueue_time(Cycles time) { m_enqueue_time = time; }
inline VC_state_type get_state() { return m_vc_state.first; }
inline int get_outvc() { return m_output_vc; }
inline bool has_credits() { return (m_credit_count > 0); }
inline void update_credit(int credit) { m_credit_count = credit; }
inline void increment_credit() { m_credit_count++; }
- inline bool isReady(Time curTime)
+ inline bool isReady(Cycles curTime)
{
return m_input_buffer->isReady(curTime);
}
}
inline void
- set_state(VC_state_type m_state, Time curTime)
+ set_state(VC_state_type m_state, Cycles curTime)
{
m_vc_state.first = m_state;
- m_vc_state.second = curTime + 1;
+ m_vc_state.second = curTime + Cycles(1);
}
inline flit_d*
private:
int m_id;
flitBuffer_d *m_input_buffer;
- std::pair<VC_state_type, Time> m_vc_state; // I/R/V/A/C
+ std::pair<VC_state_type, Cycles> m_vc_state; // I/R/V/A/C
int route;
- Time m_enqueue_time;
+ Cycles m_enqueue_time;
int m_output_vc;
int m_credit_count;
};
}
bool
-flitBuffer_d::isReady(Time curTime)
+flitBuffer_d::isReady(Cycles curTime)
{
if (m_buffer.size() != 0 ) {
flit_d *t_flit = peekTopFlit();
}
bool
-flitBuffer_d::isReadyForNext(Time curTime)
+flitBuffer_d::isReadyForNext(Cycles curTime)
{
if (m_buffer.size() != 0 ) {
flit_d *t_flit = peekTopFlit();
flitBuffer_d();
flitBuffer_d(int maximum_size);
- bool isReady(Time curTime);
- bool isReadyForNext(Time curTime);
+ bool isReady(Cycles curTime);
+ bool isReadyForNext(Cycles curTime);
bool isEmpty();
void print(std::ostream& out) const;
bool isFull();
#include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh"
flit_d::flit_d(int id, int vc, int vnet, int size, MsgPtr msg_ptr,
- Time curTime)
+ Cycles curTime)
{
m_size = size;
m_msg_ptr = msg_ptr;
m_type = BODY_;
}
-flit_d::flit_d(int vc, bool is_free_signal, Time curTime)
+flit_d::flit_d(int vc, bool is_free_signal, Cycles curTime)
{
m_id = 0;
m_vc = vc;
#include <cassert>
#include <iostream>
-#include "mem/ruby/common/TypeDefines.hh"
+#include "base/types.hh"
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/slicc_interface/Message.hh"
class flit_d
{
public:
- flit_d(int id, int vc, int vnet, int size, MsgPtr msg_ptr, Time curTime);
- flit_d(int vc, bool is_free_signal, Time curTime);
+ flit_d(int id, int vc, int vnet, int size, MsgPtr msg_ptr, Cycles curTime);
+ flit_d(int vc, bool is_free_signal, Cycles curTime);
void set_outport(int port) { m_outport = port; }
int get_outport() {return m_outport; }
void print(std::ostream& out) const;
bool is_free_signal() { return m_is_free_signal; }
int get_size() { return m_size; }
- Time get_enqueue_time() { return m_enqueue_time; }
+ Cycles get_enqueue_time() { return m_enqueue_time; }
int get_id() { return m_id; }
- Time get_time() { return m_time; }
- void set_time(Time time) { m_time = time; }
+ Cycles get_time() { return m_time; }
+ void set_time(Cycles time) { m_time = time; }
int get_vnet() { return m_vnet; }
int get_vc() { return m_vc; }
void set_vc(int vc) { m_vc = vc; }
flit_type get_type() { return m_type; }
bool
- is_stage(flit_stage t_stage, Time curTime)
+ is_stage(flit_stage t_stage, Cycles curTime)
{
return (m_stage.first == t_stage &&
curTime >= m_stage.second);
}
bool
- is_next_stage(flit_stage t_stage, Time curTime)
+ is_next_stage(flit_stage t_stage, Cycles curTime)
{
return (m_stage.first == t_stage &&
(curTime + 1) >= m_stage.second);
}
void
- advance_stage(flit_stage t_stage, Time curTime)
+ advance_stage(flit_stage t_stage, Cycles curTime)
{
m_stage.first = t_stage;
- m_stage.second = curTime + 1;
+ m_stage.second = curTime + Cycles(1);
}
- std::pair<flit_stage, Time>
+ std::pair<flit_stage, Cycles>
get_stage()
{
return m_stage;
}
- void
- set_delay(int delay)
- {
- src_delay = delay;
- }
-
- int
- get_delay()
- {
- return src_delay;
- }
+ void set_delay(Cycles delay) { src_delay = delay; }
+ Cycles get_delay() { return src_delay; }
static bool
greater(flit_d* n1, flit_d* n2)
int m_vc;
int m_size;
bool m_is_free_signal;
- Time m_enqueue_time, m_time;
+ Cycles m_enqueue_time, m_time;
flit_type m_type;
MsgPtr m_msg_ptr;
int m_outport;
- int src_delay;
- std::pair<flit_stage, Time> m_stage;
+ Cycles src_delay;
+ std::pair<flit_stage, Cycles> m_stage;
};
inline std::ostream&
public:
FlexibleConsumer(ClockedObject *em) : Consumer(em) {}
virtual bool isBufferNotFull(int vc, int inport) { return true; }
- virtual void grant_vc(int out_port, int vc, Time grant_time) {}
- virtual void release_vc(int out_port, int vc, Time release_time) {}
+ virtual void grant_vc(int out_port, int vc, Cycles grant_time) {}
+ virtual void release_vc(int out_port, int vc, Cycles release_time) {}
virtual void request_vc(int vc, int in_port, NetDest destination,
- Time request_time) {}
+ Cycles request_time) {}
};
#endif // __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_FLEXIBLE_CONSUMER_HH__
}
bool
-InVcState::isInState(VC_state_type state, Time request_time)
+InVcState::isInState(VC_state_type state, Cycles request_time)
{
return ((m_vc_state == state) && (request_time >= m_time) );
}
}
void
-InVcState::setState(VC_state_type state, Time time)
+InVcState::setState(VC_state_type state, Cycles time)
{
m_vc_state = state;
m_time = time;
}
void
-InVcState::grant_vc(int out_vc, Time grant_time)
+InVcState::grant_vc(int out_vc, Cycles grant_time)
{
m_vc_state = ACTIVE_;
m_time = grant_time;
#ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_IN_VC_STATE_HH__
#define __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_IN_VC_STATE_HH__
-#include "mem/ruby/common/TypeDefines.hh"
+#include "base/types.hh"
#include "mem/ruby/network/garnet/NetworkHeader.hh"
class InVcState
InVcState(int id);
void setRoute(int route);
- void setState(VC_state_type state, Time time);
+ void setState(VC_state_type state, Cycles time);
int get_outport();
int get_outvc();
- void grant_vc(int out_vc, Time grant_time);
- bool isInState(VC_state_type state, Time time);
+ void grant_vc(int out_vc, Cycles grant_time);
+ bool isInState(VC_state_type state, Cycles time);
private:
int m_id;
int m_route;
int m_output_vc;
VC_state_type m_vc_state;
- Time m_time;
+ Cycles m_time;
};
#endif // __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_IN_VC_STATE_HH__
void
NetworkInterface::request_vc(int in_vc, int in_port, NetDest destination,
- Time request_time)
+ Cycles request_time)
{
inNetLink->grant_vc_link(in_vc, request_time);
}
// An output vc has been granted at the next hop to one of the vc's.
// We have to update the state of the vc to reflect this
void
-NetworkInterface::grant_vc(int out_port, int vc, Time grant_time)
+NetworkInterface::grant_vc(int out_port, int vc, Cycles grant_time)
{
assert(m_out_vc_state[vc]->isInState(VC_AB_, grant_time));
m_out_vc_state[vc]->grant_vc(grant_time);
// The tail flit corresponding to this vc has been buffered at the next hop
// and thus this vc is now free
void
-NetworkInterface::release_vc(int out_port, int vc, Time release_time)
+NetworkInterface::release_vc(int out_port, int vc, Cycles release_time)
{
assert(m_out_vc_state[vc]->isInState(ACTIVE_, release_time));
m_out_vc_state[vc]->setState(IDLE_, release_time);
// signal the upstream router that this vc can be freed now
inNetLink->release_vc_link(t_flit->get_vc(),
- m_net_ptr->curCycle() + 1);
+ m_net_ptr->curCycle() + Cycles(1));
}
+
int vnet = t_flit->get_vnet();
m_net_ptr->increment_received_flits(vnet);
- int network_delay = m_net_ptr->curCycle() -
- t_flit->get_enqueue_time();
- int queueing_delay = t_flit->get_delay();
+ Cycles network_delay = m_net_ptr->curCycle() -
+ t_flit->get_enqueue_time();
+ Cycles queueing_delay = t_flit->get_delay();
+
m_net_ptr->increment_network_latency(network_delay, vnet);
m_net_ptr->increment_queueing_latency(queueing_delay, vnet);
delete t_flit;
// Just removing the flit
flit *t_flit = m_ni_buffers[vc]->getTopFlit();
- t_flit->set_time(m_net_ptr->curCycle() + 1);
+ t_flit->set_time(m_net_ptr->curCycle() + Cycles(1));
outSrcQueue->insert(t_flit);
// schedule the out link
void wakeup();
void addNode(std::vector<MessageBuffer *> &inNode,
std::vector<MessageBuffer *> &outNode);
- void grant_vc(int out_port, int vc, Time grant_time);
- void release_vc(int out_port, int vc, Time release_time);
+ void grant_vc(int out_port, int vc, Cycles grant_time);
+ void release_vc(int out_port, int vc, Cycles release_time);
bool
isBufferNotFull(int vc, int inport)
return true;
}
void request_vc(int in_vc, int in_port, NetDest destination,
- Time request_time);
+ Cycles request_time);
void print(std::ostream& out) const;
}
void
-NetworkLink::request_vc_link(int vc, NetDest destination, Time request_time)
+NetworkLink::request_vc_link(int vc, NetDest destination, Cycles request_time)
{
link_consumer->request_vc(vc, m_in_port, destination, request_time);
}
}
void
-NetworkLink::grant_vc_link(int vc, Time grant_time)
+NetworkLink::grant_vc_link(int vc, Cycles grant_time)
{
link_source->grant_vc(m_out_port, vc, grant_time);
}
void
-NetworkLink::release_vc_link(int vc, Time release_time)
+NetworkLink::release_vc_link(int vc, Cycles release_time)
{
link_source->release_vc(m_out_port, vc, release_time);
}
void setOutPort(int port);
void wakeup();
bool isReady();
- void grant_vc_link(int vc, Time grant_time);
- void release_vc_link(int vc, Time release_time);
- void request_vc_link(int vc, NetDest destination, Time request_time);
+ void grant_vc_link(int vc, Cycles grant_time);
+ void release_vc_link(int vc, Cycles release_time);
+ void request_vc_link(int vc, NetDest destination, Cycles request_time);
bool isBufferNotFull_link(int vc);
void setSource(FlexibleConsumer *source);
double getLinkUtilization();
}
bool
-OutVcState::isInState(VC_state_type state, Time request_time)
+OutVcState::isInState(VC_state_type state, Cycles request_time)
{
return ((m_vc_state == state) && (request_time >= m_time));
}
void
-OutVcState::grant_vc(Time grant_time)
+OutVcState::grant_vc(Cycles grant_time)
{
m_time = grant_time;
m_vc_state = ACTIVE_;
}
void
-OutVcState::setState(VC_state_type state, Time time)
+OutVcState::setState(VC_state_type state, Cycles time)
{
m_vc_state = state;
m_time = time;
#ifndef __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_OUT_VC_STATE_HH__
#define __MEM_RUBY_NETWORK_GARNET_FLEXIBLE_PIPELINE_OUT_VC_STATE_HH__
-#include "mem/ruby/common/TypeDefines.hh"
+#include "base/types.hh"
#include "mem/ruby/network/garnet/NetworkHeader.hh"
class OutVcState
public:
OutVcState(int id);
- bool isInState(VC_state_type state, Time request_time);
- void setState(VC_state_type state, Time time);
- void grant_vc(Time grant_time);
+ bool isInState(VC_state_type state, Cycles request_time);
+ void setState(VC_state_type state, Cycles time);
+ void grant_vc(Cycles grant_time);
private:
int m_id ;
- Time m_time;
+ Cycles m_time;
VC_state_type m_vc_state;
};
}
void
-Router::grant_vc(int out_port, int vc, Time grant_time)
+Router::grant_vc(int out_port, int vc, Cycles grant_time)
{
assert(m_out_vc_state[out_port][vc]->isInState(VC_AB_, grant_time));
m_out_vc_state[out_port][vc]->grant_vc(grant_time);
}
void
-Router::release_vc(int out_port, int vc, Time release_time)
+Router::release_vc(int out_port, int vc, Cycles release_time)
{
assert(m_out_vc_state[out_port][vc]->isInState(ACTIVE_, release_time));
m_out_vc_state[out_port][vc]->setState(IDLE_, release_time);
assert(m_net_ptr->getNumPipeStages() >= 1);
// Subtract 1 as 1 cycle will be consumed in scheduling the output link
- m_flit->set_time(curCycle() + (m_net_ptr->getNumPipeStages() - 1));
+ m_flit->set_time(curCycle() + Cycles((m_net_ptr->getNumPipeStages() - 1)));
m_flit->set_vc(outvc);
m_router_buffers[outport][outvc]->insert(m_flit);
NetDest destination = nm->getInternalDestination();
if (m_net_ptr->getNumPipeStages() > 1) {
- m_out_vc_state[outport][outvc]->setState(VC_AB_, curCycle() + 1);
+ m_out_vc_state[outport][outvc]->setState(VC_AB_, curCycle() +
+ Cycles(1));
m_out_link[outport]->request_vc_link(outvc, destination,
- curCycle() + 1);
+ curCycle() + Cycles(1));
} else {
m_out_vc_state[outport][outvc]->setState(VC_AB_, curCycle());
m_out_link[outport]->request_vc_link(outvc, destination,
}
if ((m_flit->get_type() == TAIL_) || (m_flit->get_type() == HEAD_TAIL_)) {
- m_in_vc_state[inport][invc]->setState(IDLE_, curCycle() + 1);
- m_in_link[inport]->release_vc_link(invc, curCycle() + 1);
+ m_in_vc_state[inport][invc]->setState(IDLE_, curCycle() + Cycles(1));
+ m_in_link[inport]->release_vc_link(invc, curCycle() + Cycles(1));
}
}
flit *t_flit =
m_router_buffers[port][vc_tolookat]->getTopFlit();
- t_flit->set_time(curCycle() + 1 );
+ t_flit->set_time(curCycle() + Cycles(1));
m_out_src_queue[port]->insert(t_flit);
m_out_link[port]->scheduleEvent(Cycles(1));
break; // done for this port
{
for (int port = 0; port < m_in_link.size(); port++) {
for (int vc = 0; vc < m_num_vcs; vc++) {
- if (m_in_vc_state[port][vc]->isInState(VC_AB_, curCycle() + 1)) {
+ if (m_in_vc_state[port][vc]->isInState(VC_AB_, curCycle() +
+ Cycles(1))) {
m_vc_arbiter->scheduleEvent(Cycles(1));
return;
}
void request_vc(int in_vc, int in_port, NetDest destination,
Cycles request_time);
bool isBufferNotFull(int vc, int inport);
- void grant_vc(int out_port, int vc, Time grant_time);
- void release_vc(int out_port, int vc, Time release_time);
+ void grant_vc(int out_port, int vc, Cycles grant_time);
+ void release_vc(int out_port, int vc, Cycles release_time);
void vc_arbitrate();
int get_vnet(int vc);
#include "mem/ruby/network/garnet/flexible-pipeline/flit.hh"
-flit::flit(int id, int vc, int vnet, int size, MsgPtr msg_ptr, Time curTime)
+flit::flit(int id, int vc, int vnet, int size, MsgPtr msg_ptr, Cycles curTime)
{
m_size = size;
m_msg_ptr = msg_ptr;
return m_id;
}
-Time
+Cycles
flit::get_time()
{
return m_time;
}
-Time
+Cycles
flit::get_enqueue_time()
{
return m_enqueue_time;
}
void
-flit::set_time(Time time)
+flit::set_time(Cycles time)
{
m_time = time;
}
}
void
-flit::set_delay(int delay)
+flit::set_delay(Cycles delay)
{
src_delay = delay;
}
-int
+Cycles
flit::get_delay()
{
return src_delay;
#include <cassert>
#include <iostream>
-#include "mem/ruby/common/TypeDefines.hh"
+#include "base/types.hh"
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/slicc_interface/Message.hh"
class flit
{
public:
- flit(int id, int vc, int vnet, int size, MsgPtr msg_ptr, Time curTime);
+ flit(int id, int vc, int vnet, int size, MsgPtr msg_ptr, Cycles curTime);
int get_size();
int get_id();
- Time get_time();
- Time get_enqueue_time();
- void set_time(Time time);
+ 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(int delay);
- int get_delay();
+ void set_delay(Cycles delay);
+ Cycles get_delay();
void print(std::ostream& out) const;
static bool
int m_vnet;
int m_vc;
int m_size;
- Time m_enqueue_time, m_time;
+ Cycles m_enqueue_time, m_time;
flit_type m_type;
MsgPtr m_msg_ptr;
- int src_delay;
+ Cycles src_delay;
};
inline std::ostream&
}
bool
-flitBuffer::isReady(Time curTime)
+flitBuffer::isReady(Cycles curTime)
{
if (m_buffer.size() != 0 ) {
flit *t_flit = m_buffer.front();
}
bool
-flitBuffer::isReadyForNext(Time curTime)
+flitBuffer::isReadyForNext(Cycles curTime)
{
if (m_buffer.size() != 0 ) {
flit *t_flit = m_buffer.front();
flitBuffer();
flitBuffer(int maximum_size);
- bool isReady(Time curTime);
- bool isReadyForNext(Time curTime);
+ bool isReady(Cycles curTime);
+ bool isReadyForNext(Cycles curTime);
bool isFull();
bool isEmpty();
void setMaxSize(int maximum);
int m_endpoint_bandwidth;
// For tracking utilization
- Time m_ruby_start;
+ Cycles m_ruby_start;
double m_links_utilized;
};