ruby: replace Time with Cycles in garnet fixed and flexible
This commit is contained in:
parent
9d6d6c6718
commit
f6e3ab7bd4
32 changed files with 144 additions and 148 deletions
|
@ -36,7 +36,7 @@
|
|||
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;
|
||||
|
@ -44,8 +44,6 @@ BaseGarnetNetwork::BaseGarnetNetwork(const Params *p)
|
|||
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 =
|
||||
|
@ -130,7 +128,7 @@ BaseGarnetNetwork::clearStats()
|
|||
m_ruby_start = curCycle();
|
||||
}
|
||||
|
||||
Time
|
||||
Cycles
|
||||
BaseGarnetNetwork::getRubyStartTime()
|
||||
{
|
||||
return m_ruby_start;
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#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
|
||||
{
|
||||
|
@ -58,13 +57,13 @@ 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;
|
||||
}
|
||||
|
@ -81,7 +80,7 @@ class BaseGarnetNetwork : public Network
|
|||
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;
|
||||
|
@ -104,7 +103,7 @@ class BaseGarnetNetwork : public Network
|
|||
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__
|
||||
|
|
|
@ -56,18 +56,18 @@ class InputUnit_d : public Consumer
|
|||
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();
|
||||
|
@ -86,7 +86,7 @@ class InputUnit_d : public Consumer
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -100,14 +100,14 @@ class InputUnit_d : public Consumer
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -125,20 +125,20 @@ class InputUnit_d : public Consumer
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -255,9 +255,10 @@ NetworkInterface_d::wakeup()
|
|||
|
||||
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;
|
||||
|
@ -321,7 +322,7 @@ NetworkInterface_d::scheduleOutputLink()
|
|||
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));
|
||||
|
|
|
@ -62,7 +62,8 @@ class NetworkLink_d : public ClockedObject, public Consumer
|
|||
|
||||
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)
|
||||
|
|
|
@ -46,12 +46,12 @@ class OutVcState_d
|
|||
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;
|
||||
|
@ -63,7 +63,7 @@ class OutVcState_d
|
|||
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;
|
||||
|
|
|
@ -102,7 +102,7 @@ OutputUnit_d::set_credit_link(CreditLink_d *credit_link)
|
|||
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,
|
||||
|
|
|
@ -69,13 +69,13 @@ class OutputUnit_d : public Consumer
|
|||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
|
|
@ -181,7 +181,8 @@ SWallocator_d::arbitrate_outports()
|
|||
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++;
|
||||
|
@ -200,7 +201,8 @@ SWallocator_d::arbitrate_outports()
|
|||
|
||||
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
|
||||
|
|
|
@ -74,7 +74,7 @@ Switch_d::wakeup()
|
|||
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);
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
|
||||
#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()
|
||||
|
@ -51,18 +51,18 @@ VirtualChannel_d::set_outport(int outport)
|
|||
}
|
||||
|
||||
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)) {
|
||||
|
@ -75,7 +75,7 @@ VirtualChannel_d::need_stage(VC_state_type state, flit_stage stage,
|
|||
|
||||
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)) {
|
||||
|
|
|
@ -39,17 +39,17 @@
|
|||
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); }
|
||||
|
@ -57,7 +57,7 @@ class VirtualChannel_d
|
|||
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);
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ class VirtualChannel_d
|
|||
}
|
||||
|
||||
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*
|
||||
|
@ -90,9 +90,9 @@ class VirtualChannel_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;
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ flitBuffer_d::isEmpty()
|
|||
}
|
||||
|
||||
bool
|
||||
flitBuffer_d::isReady(Time curTime)
|
||||
flitBuffer_d::isReady(Cycles curTime)
|
||||
{
|
||||
if (m_buffer.size() != 0 ) {
|
||||
flit_d *t_flit = peekTopFlit();
|
||||
|
@ -58,7 +58,7 @@ flitBuffer_d::isReady(Time curTime)
|
|||
}
|
||||
|
||||
bool
|
||||
flitBuffer_d::isReadyForNext(Time curTime)
|
||||
flitBuffer_d::isReadyForNext(Cycles curTime)
|
||||
{
|
||||
if (m_buffer.size() != 0 ) {
|
||||
flit_d *t_flit = peekTopFlit();
|
||||
|
|
|
@ -44,8 +44,8 @@ class flitBuffer_d
|
|||
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();
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#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;
|
||||
|
@ -55,7 +55,7 @@ flit_d::flit_d(int id, int vc, int vnet, int size, MsgPtr 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;
|
||||
|
|
|
@ -34,24 +34,24 @@
|
|||
#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; }
|
||||
|
@ -59,43 +59,34 @@ class flit_d
|
|||
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)
|
||||
|
@ -114,12 +105,12 @@ class flit_d
|
|||
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&
|
||||
|
|
|
@ -40,10 +40,10 @@ class FlexibleConsumer : public Consumer
|
|||
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__
|
||||
|
|
|
@ -37,7 +37,7 @@ InVcState::InVcState(int id)
|
|||
}
|
||||
|
||||
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) );
|
||||
}
|
||||
|
@ -49,14 +49,14 @@ InVcState::setRoute(int route)
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#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
|
||||
|
@ -40,18 +40,18 @@ 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__
|
||||
|
|
|
@ -112,7 +112,7 @@ NetworkInterface::addNode(vector<MessageBuffer*>& in,
|
|||
|
||||
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);
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ NetworkInterface::flitisizeMessage(MsgPtr msg_ptr, int vnet)
|
|||
// 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);
|
||||
|
@ -199,7 +199,7 @@ NetworkInterface::grant_vc(int out_port, int vc, Time 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);
|
||||
|
@ -274,13 +274,15 @@ NetworkInterface::wakeup()
|
|||
|
||||
// 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;
|
||||
|
@ -312,7 +314,7 @@ NetworkInterface::scheduleOutputLink()
|
|||
|
||||
// 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
|
||||
|
|
|
@ -59,8 +59,8 @@ class NetworkInterface : public FlexibleConsumer
|
|||
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)
|
||||
|
@ -68,7 +68,7 @@ class NetworkInterface : public FlexibleConsumer
|
|||
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;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ NetworkLink::setSource(FlexibleConsumer *source)
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -90,13 +90,13 @@ NetworkLink::isBufferNotFull_link(int vc)
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -64,9 +64,9 @@ class NetworkLink : public ClockedObject, public FlexibleConsumer
|
|||
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();
|
||||
|
|
|
@ -37,20 +37,20 @@ OutVcState::OutVcState(int id)
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#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
|
||||
|
@ -39,13 +39,13 @@ 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;
|
||||
};
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ Router::get_valid_vcs(int invc)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -235,7 +235,7 @@ Router::grant_vc(int out_port, int vc, Time 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);
|
||||
|
@ -269,7 +269,7 @@ Router::routeCompute(flit *m_flit, int inport)
|
|||
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);
|
||||
|
||||
|
@ -282,9 +282,10 @@ Router::routeCompute(flit *m_flit, int inport)
|
|||
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,
|
||||
|
@ -293,8 +294,8 @@ Router::routeCompute(flit *m_flit, int inport)
|
|||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,7 +362,7 @@ Router::scheduleOutputLinks()
|
|||
|
||||
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
|
||||
|
@ -397,7 +398,8 @@ Router::check_arbiter_reschedule()
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -62,8 +62,8 @@ class Router : public BasicRouter, public FlexibleConsumer
|
|||
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);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#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;
|
||||
|
@ -64,20 +64,20 @@ flit::get_id()
|
|||
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;
|
||||
}
|
||||
|
@ -113,12 +113,12 @@ flit::get_type()
|
|||
}
|
||||
|
||||
void
|
||||
flit::set_delay(int delay)
|
||||
flit::set_delay(Cycles delay)
|
||||
{
|
||||
src_delay = delay;
|
||||
}
|
||||
|
||||
int
|
||||
Cycles
|
||||
flit::get_delay()
|
||||
{
|
||||
return src_delay;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#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"
|
||||
|
||||
|
@ -41,20 +41,20 @@
|
|||
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
|
||||
|
@ -75,10 +75,10 @@ class flit
|
|||
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&
|
||||
|
|
|
@ -51,7 +51,7 @@ flitBuffer::isEmpty()
|
|||
}
|
||||
|
||||
bool
|
||||
flitBuffer::isReady(Time curTime)
|
||||
flitBuffer::isReady(Cycles curTime)
|
||||
{
|
||||
if (m_buffer.size() != 0 ) {
|
||||
flit *t_flit = m_buffer.front();
|
||||
|
@ -62,7 +62,7 @@ flitBuffer::isReady(Time curTime)
|
|||
}
|
||||
|
||||
bool
|
||||
flitBuffer::isReadyForNext(Time curTime)
|
||||
flitBuffer::isReadyForNext(Cycles curTime)
|
||||
{
|
||||
if (m_buffer.size() != 0 ) {
|
||||
flit *t_flit = m_buffer.front();
|
||||
|
|
|
@ -43,8 +43,8 @@ class flitBuffer
|
|||
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);
|
||||
|
|
|
@ -108,7 +108,7 @@ class Throttle : public Consumer
|
|||
int m_endpoint_bandwidth;
|
||||
|
||||
// For tracking utilization
|
||||
Time m_ruby_start;
|
||||
Cycles m_ruby_start;
|
||||
double m_links_utilized;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue