summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-02-10 21:26:24 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2013-02-10 21:26:24 -0600
commitd3aebe1f91aa166329c8ee102fdcb2c9734fdceb (patch)
treef6f7807c24eccde98ee1e4bfe4c9c24b3c9392b2 /src/mem/ruby/network
parentaffd77ea77860fa9231aba8e43ad95dea06a114a (diff)
downloadgem5-d3aebe1f91aa166329c8ee102fdcb2c9734fdceb.tar.xz
ruby: replaces Time with Cycles in many places
The patch started of with replacing Time with Cycles in the Consumer class. But to get ruby to compile, the rest of the changes had to be carried out. Subsequent patches will further this process, till we completely replace Time with Cycles.
Diffstat (limited to 'src/mem/ruby/network')
-rw-r--r--src/mem/ruby/network/BasicLink.hh2
-rw-r--r--src/mem/ruby/network/BasicLink.py2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc10
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc6
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc2
-rw-r--r--src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc2
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py2
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc12
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh3
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/Router.cc16
-rw-r--r--src/mem/ruby/network/garnet/flexible-pipeline/Router.hh2
-rw-r--r--src/mem/ruby/network/simple/PerfectSwitch.cc2
-rw-r--r--src/mem/ruby/network/simple/Switch.cc6
-rw-r--r--src/mem/ruby/network/simple/Switch.hh2
-rw-r--r--src/mem/ruby/network/simple/Throttle.cc10
-rw-r--r--src/mem/ruby/network/simple/Throttle.hh17
21 files changed, 53 insertions, 53 deletions
diff --git a/src/mem/ruby/network/BasicLink.hh b/src/mem/ruby/network/BasicLink.hh
index 11832f9c3..634b9143e 100644
--- a/src/mem/ruby/network/BasicLink.hh
+++ b/src/mem/ruby/network/BasicLink.hh
@@ -52,7 +52,7 @@ class BasicLink : public SimObject
void print(std::ostream& out) const;
- int m_latency;
+ Cycles m_latency;
int m_bandwidth_factor;
int m_weight;
};
diff --git a/src/mem/ruby/network/BasicLink.py b/src/mem/ruby/network/BasicLink.py
index 841208578..8fc83c9e2 100644
--- a/src/mem/ruby/network/BasicLink.py
+++ b/src/mem/ruby/network/BasicLink.py
@@ -34,7 +34,7 @@ class BasicLink(SimObject):
type = 'BasicLink'
cxx_header = "mem/ruby/network/BasicLink.hh"
link_id = Param.Int("ID in relation to other links")
- latency = Param.Int(1, "latency")
+ latency = Param.Cycles(1, "latency")
# The following banwidth factor does not translate to the same value for
# both the simple and Garnet models. For the most part, the bandwidth
# factor is the width of the link in bytes, expect for certain situations
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py
index bbd785e2c..14c3f543c 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py
@@ -37,7 +37,7 @@ class NetworkLink_d(ClockedObject):
type = 'NetworkLink_d'
cxx_header = "mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh"
link_id = Param.Int(Parent.link_id, "link id")
- link_latency = Param.Int(Parent.latency, "link latency")
+ link_latency = Param.Cycles(Parent.latency, "link latency")
vcs_per_vnet = Param.Int(Parent.vcs_per_vnet,
"virtual channels per virtual network")
virt_nets = Param.Int(Parent.number_of_virtual_networks,
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh
index 3ebf7c6e9..07c6bec3a 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh
@@ -90,7 +90,7 @@ class InputUnit_d : public Consumer
{
flit_d *t_flit = new flit_d(in_vc, free_signal, curTime);
creditQueue->insert(t_flit);
- m_credit_link->scheduleEvent(1);
+ m_credit_link->scheduleEvent(Cycles(1));
}
inline int
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
index f0e117aad..c58b38c52 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc
@@ -244,14 +244,14 @@ NetworkInterface_d::wakeup()
free_signal = true;
outNode_ptr[t_flit->get_vnet()]->enqueue(
- t_flit->get_msg_ptr(), 1);
+ t_flit->get_msg_ptr(), Cycles(1));
}
// Simply send a credit back since we are not buffering
// this flit in the NI
flit_d *credit_flit = new flit_d(t_flit->get_vc(), free_signal,
m_net_ptr->curCycle());
creditQueue->insert(credit_flit);
- m_ni_credit_link->scheduleEvent(1);
+ m_ni_credit_link->scheduleEvent(Cycles(1));
int vnet = t_flit->get_vnet();
m_net_ptr->increment_received_flits(vnet);
@@ -324,7 +324,7 @@ NetworkInterface_d::scheduleOutputLink()
t_flit->set_time(m_net_ptr->curCycle() + 1);
outSrcQueue->insert(t_flit);
// schedule the out link
- outNetLink->scheduleEvent(1);
+ outNetLink->scheduleEvent(Cycles(1));
if (t_flit->get_type() == TAIL_ ||
t_flit->get_type() == HEAD_TAIL_) {
@@ -351,13 +351,13 @@ NetworkInterface_d::checkReschedule()
{
for (int vnet = 0; vnet < m_virtual_networks; vnet++) {
if (inNode_ptr[vnet]->isReady()) { // Is there a message waiting
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
return;
}
}
for (int vc = 0; vc < m_num_vcs; vc++) {
if (m_ni_buffers[vc]->isReadyForNext(m_net_ptr->curCycle())) {
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
return;
}
}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
index c52c903e0..14f6a6527 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkLink_d.hh
@@ -72,7 +72,7 @@ class NetworkLink_d : public ClockedObject, public Consumer
protected:
int m_id;
- int m_latency;
+ Cycles m_latency;
int channel_width;
GarnetNetwork_d *m_net_ptr;
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh
index 4fa7dcb90..4b5b851e2 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh
@@ -84,7 +84,7 @@ class OutputUnit_d : public Consumer
insert_flit(flit_d *t_flit)
{
m_out_buffer->insert(t_flit);
- m_out_link->scheduleEvent(1);
+ m_out_link->scheduleEvent(Cycles(1));
}
private:
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
index 2a759eb87..eaa147c41 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
@@ -135,13 +135,13 @@ Router_d::route_req(flit_d *t_flit, InputUnit_d *in_unit, int invc)
void
Router_d::vcarb_req()
{
- m_vc_alloc->scheduleEvent(1);
+ m_vc_alloc->scheduleEvent(Cycles(1));
}
void
Router_d::swarb_req()
{
- m_sw_alloc->scheduleEvent(1);
+ m_sw_alloc->scheduleEvent(Cycles(1));
}
void
@@ -154,7 +154,7 @@ void
Router_d::update_sw_winner(int inport, flit_d *t_flit)
{
m_switch->update_sw_winner(inport, t_flit);
- m_switch->scheduleEvent(1);
+ m_switch->scheduleEvent(Cycles(1));
}
void
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc
index ab3f4b761..49f2e8c57 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.cc
@@ -220,7 +220,7 @@ SWallocator_d::check_for_wakeup()
for (int j = 0; j < m_num_vcs; j++) {
if (m_input_unit[i]->need_stage_nextcycle(j, ACTIVE_, SA_,
m_router->curCycle())) {
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
return;
}
}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc
index db7446f7a..0b2c3a227 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/Switch_d.cc
@@ -90,7 +90,7 @@ Switch_d::check_for_wakeup()
{
for (int inport = 0; inport < m_num_inports; inport++) {
if (m_switch_buffer[inport]->isReadyForNext(m_router->curCycle())) {
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
break;
}
}
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
index 012837362..9569810e8 100644
--- a/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
+++ b/src/mem/ruby/network/garnet/fixed-pipeline/VCallocator_d.cc
@@ -260,7 +260,7 @@ VCallocator_d::check_for_wakeup()
for (int j = 0; j < m_num_vcs; j++) {
if (m_input_unit[i]->need_stage_nextcycle(j, VC_AB_, VA_,
m_router->curCycle())) {
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
return;
}
}
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py
index 41049884f..9903c9cd6 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py
@@ -37,7 +37,7 @@ class NetworkLink(ClockedObject):
type = 'NetworkLink'
cxx_header = "mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh"
link_id = Param.Int(Parent.link_id, "link id")
- link_latency = Param.Int(Parent.latency, "link latency")
+ link_latency = Param.Cycles(Parent.latency, "link latency")
vcs_per_vnet = Param.Int(Parent.vcs_per_vnet,
"virtual channels per virtual network")
virt_nets = Param.Int(Parent.number_of_virtual_networks,
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
index 7267da36d..f0d59f4b4 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkInterface.cc
@@ -193,7 +193,7 @@ NetworkInterface::grant_vc(int out_port, int vc, Time grant_time)
{
assert(m_out_vc_state[vc]->isInState(VC_AB_, grant_time));
m_out_vc_state[vc]->grant_vc(grant_time);
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
}
// The tail flit corresponding to this vc has been buffered at the next hop
@@ -203,7 +203,7 @@ NetworkInterface::release_vc(int out_port, int vc, Time release_time)
{
assert(m_out_vc_state[vc]->isInState(ACTIVE_, release_time));
m_out_vc_state[vc]->setState(IDLE_, release_time);
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
}
// Looking for a free output vc
@@ -270,7 +270,7 @@ NetworkInterface::wakeup()
m_id, m_net_ptr->curCycle());
outNode_ptr[t_flit->get_vnet()]->enqueue(
- t_flit->get_msg_ptr(), 1);
+ t_flit->get_msg_ptr(), Cycles(1));
// signal the upstream router that this vc can be freed now
inNetLink->release_vc_link(t_flit->get_vc(),
@@ -316,7 +316,7 @@ NetworkInterface::scheduleOutputLink()
outSrcQueue->insert(t_flit);
// schedule the out link
- outNetLink->scheduleEvent(1);
+ outNetLink->scheduleEvent(Cycles(1));
return;
}
}
@@ -328,13 +328,13 @@ NetworkInterface::checkReschedule()
{
for (int vnet = 0; vnet < m_virtual_networks; vnet++) {
if (inNode_ptr[vnet]->isReady()) { // Is there a message waiting
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
return;
}
}
for (int vc = 0; vc < m_num_vcs; vc++) {
if (m_ni_buffers[vc]->isReadyForNext(m_net_ptr->curCycle())) {
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
return;
}
}
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh
index 45dbe7f52..3bee9f659 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh
@@ -81,7 +81,8 @@ class NetworkLink : public ClockedObject, public FlexibleConsumer
uint32_t functionalWrite(Packet *);
protected:
- int m_id, m_latency;
+ int m_id;
+ Cycles m_latency;
int m_in_port, m_out_port;
int m_link_utilized;
std::vector<int> m_vc_load;
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
index ca82f0757..71ee1d0bf 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc
@@ -130,7 +130,7 @@ Router::isBufferNotFull(int vc, int inport)
// This has to be updated and arbitration performed
void
Router::request_vc(int in_vc, int in_port, NetDest destination,
- Time request_time)
+ Cycles request_time)
{
assert(m_in_vc_state[in_port][in_vc]->isInState(IDLE_, request_time));
@@ -231,7 +231,7 @@ Router::grant_vc(int out_port, int vc, Time 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);
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
}
void
@@ -239,7 +239,7 @@ Router::release_vc(int out_port, int vc, Time 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);
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
}
// This function calculated the output port for a particular destination.
@@ -274,7 +274,8 @@ Router::routeCompute(flit *m_flit, int inport)
m_router_buffers[outport][outvc]->insert(m_flit);
if (m_net_ptr->getNumPipeStages() > 1)
- scheduleEvent(m_net_ptr->getNumPipeStages() - 1 );
+ scheduleEvent(Cycles(m_net_ptr->getNumPipeStages() - 1));
+
if ((m_flit->get_type() == HEAD_) || (m_flit->get_type() == HEAD_TAIL_)) {
NetworkMessage *nm =
safe_cast<NetworkMessage*>(m_flit->get_msg_ptr().get());
@@ -290,6 +291,7 @@ Router::routeCompute(flit *m_flit, int inport)
curCycle());
}
}
+
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);
@@ -361,7 +363,7 @@ Router::scheduleOutputLinks()
m_router_buffers[port][vc_tolookat]->getTopFlit();
t_flit->set_time(curCycle() + 1 );
m_out_src_queue[port]->insert(t_flit);
- m_out_link[port]->scheduleEvent(1);
+ m_out_link[port]->scheduleEvent(Cycles(1));
break; // done for this port
}
}
@@ -383,7 +385,7 @@ Router::checkReschedule()
for (int port = 0; port < m_out_link.size(); port++) {
for (int vc = 0; vc < m_num_vcs; vc++) {
if (m_router_buffers[port][vc]->isReadyForNext(curCycle())) {
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
return;
}
}
@@ -396,7 +398,7 @@ 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)) {
- m_vc_arbiter->scheduleEvent(1);
+ m_vc_arbiter->scheduleEvent(Cycles(1));
return;
}
}
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh b/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh
index 988ec3a55..aa31fd939 100644
--- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh
+++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.hh
@@ -60,7 +60,7 @@ class Router : public BasicRouter, public FlexibleConsumer
int link_weight);
void wakeup();
void request_vc(int in_vc, int in_port, NetDest destination,
- Time request_time);
+ 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);
diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc b/src/mem/ruby/network/simple/PerfectSwitch.cc
index 37035f95f..687bdbd86 100644
--- a/src/mem/ruby/network/simple/PerfectSwitch.cc
+++ b/src/mem/ruby/network/simple/PerfectSwitch.cc
@@ -267,7 +267,7 @@ PerfectSwitch::wakeup()
// There were not enough resources
if (!enough) {
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
DPRINTF(RubyNetwork, "Can't deliver message since a node "
"is blocked\n");
DPRINTF(RubyNetwork, "Message: %s\n", (*net_msg_ptr));
diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc
index d9abc4cc7..76d37c321 100644
--- a/src/mem/ruby/network/simple/Switch.cc
+++ b/src/mem/ruby/network/simple/Switch.cc
@@ -72,12 +72,12 @@ Switch::addInPort(const vector<MessageBuffer*>& in)
void
Switch::addOutPort(const vector<MessageBuffer*>& out,
- const NetDest& routing_table_entry, int link_latency, int bw_multiplier)
+ const NetDest& routing_table_entry, Cycles link_latency, int bw_multiplier)
{
// Create a throttle
Throttle* throttle_ptr = new Throttle(m_id, m_throttles.size(),
- link_latency, bw_multiplier, m_network_ptr->getEndpointBandwidth(),
- this);
+ link_latency, bw_multiplier, m_network_ptr->getEndpointBandwidth(),
+ this);
m_throttles.push_back(throttle_ptr);
// Create one buffer per vnet (these are intermediaryQueues)
diff --git a/src/mem/ruby/network/simple/Switch.hh b/src/mem/ruby/network/simple/Switch.hh
index 2757e6511..8c265a4bf 100644
--- a/src/mem/ruby/network/simple/Switch.hh
+++ b/src/mem/ruby/network/simple/Switch.hh
@@ -63,7 +63,7 @@ class Switch : public BasicRouter
void init();
void addInPort(const std::vector<MessageBuffer*>& in);
void addOutPort(const std::vector<MessageBuffer*>& out,
- const NetDest& routing_table_entry, int link_latency,
+ const NetDest& routing_table_entry, Cycles link_latency,
int bw_multiplier);
const Throttle* getThrottle(LinkID link_number) const;
const std::vector<Throttle*>* getThrottles() const;
diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc
index b591cc81b..bb5d9cf53 100644
--- a/src/mem/ruby/network/simple/Throttle.cc
+++ b/src/mem/ruby/network/simple/Throttle.cc
@@ -48,7 +48,7 @@ const int PRIORITY_SWITCH_LIMIT = 128;
static int network_message_to_size(NetworkMessage* net_msg_ptr);
-Throttle::Throttle(int sID, NodeID node, int link_latency,
+Throttle::Throttle(int sID, NodeID node, Cycles link_latency,
int link_bandwidth_multiplier, int endpoint_bandwidth,
ClockedObject *em)
: Consumer(em)
@@ -57,7 +57,7 @@ Throttle::Throttle(int sID, NodeID node, int link_latency,
m_sID = sID;
}
-Throttle::Throttle(NodeID node, int link_latency,
+Throttle::Throttle(NodeID node, Cycles link_latency,
int link_bandwidth_multiplier, int endpoint_bandwidth,
ClockedObject *em)
: Consumer(em)
@@ -67,8 +67,8 @@ Throttle::Throttle(NodeID node, int link_latency,
}
void
-Throttle::init(NodeID node, int link_latency, int link_bandwidth_multiplier,
- int endpoint_bandwidth)
+Throttle::init(NodeID node, Cycles link_latency,
+ int link_bandwidth_multiplier, int endpoint_bandwidth)
{
m_node = node;
m_vnets = 0;
@@ -222,7 +222,7 @@ Throttle::wakeup()
// We are out of bandwidth for this cycle, so wakeup next
// cycle and continue
- scheduleEvent(1);
+ scheduleEvent(Cycles(1));
}
}
diff --git a/src/mem/ruby/network/simple/Throttle.hh b/src/mem/ruby/network/simple/Throttle.hh
index 077382041..b75161164 100644
--- a/src/mem/ruby/network/simple/Throttle.hh
+++ b/src/mem/ruby/network/simple/Throttle.hh
@@ -52,10 +52,10 @@ class MessageBuffer;
class Throttle : public Consumer
{
public:
- Throttle(int sID, NodeID node, int link_latency,
+ Throttle(int sID, NodeID node, Cycles link_latency,
int link_bandwidth_multiplier, int endpoint_bandwidth,
ClockedObject *em);
- Throttle(NodeID node, int link_latency, int link_bandwidth_multiplier,
+ Throttle(NodeID node, Cycles link_latency, int link_bandwidth_multiplier,
int endpoint_bandwidth, ClockedObject *em);
~Throttle() {}
@@ -70,13 +70,10 @@ class Throttle : public Consumer
void clearStats();
// The average utilization (a percent) since last clearStats()
double getUtilization() const;
- int
- getLinkBandwidth() const
- {
- return m_endpoint_bandwidth * m_link_bandwidth_multiplier;
- }
- int getLatency() const { return m_link_latency; }
+ int getLinkBandwidth() const
+ { return m_endpoint_bandwidth * m_link_bandwidth_multiplier; }
+ Cycles getLatency() const { return m_link_latency; }
const std::vector<std::vector<int> >&
getCounters() const
{
@@ -88,7 +85,7 @@ class Throttle : public Consumer
void print(std::ostream& out) const;
private:
- void init(NodeID node, int link_latency, int link_bandwidth_multiplier,
+ void init(NodeID node, Cycles link_latency, int link_bandwidth_multiplier,
int endpoint_bandwidth);
void addVirtualNetwork(MessageBuffer* in_ptr, MessageBuffer* out_ptr,
ClockedObject *em);
@@ -106,7 +103,7 @@ class Throttle : public Consumer
int m_sID;
NodeID m_node;
int m_link_bandwidth_multiplier;
- int m_link_latency;
+ Cycles m_link_latency;
int m_wakeups_wo_switch;
int m_endpoint_bandwidth;