Go to the documentation of this file.
35 #include "debug/RubyNetwork.hh"
52 int link_bandwidth_multiplier,
int endpoint_bandwidth,
54 :
Consumer(
em), m_switch_id(sID), m_switch(
em), m_node(node),
59 assert(link_bandwidth_multiplier > 0);
73 assert(in_vec.size() == out_vec.size());
75 for (
int vnet = 0; vnet < in_vec.size(); ++vnet) {
81 m_in.push_back(in_ptr);
82 m_out.push_back(out_ptr);
95 if (out ==
nullptr || in ==
nullptr) {
102 while (bw_remaining > 0 && (in->
isReady(current_time) ||
110 Message *net_msg_ptr = msg_ptr.get();
114 DPRINTF(RubyNetwork,
"throttle: %d my bw %d bw spent "
115 "enqueueing net msg %d time: %lld.\n",
121 out->
enqueue(msg_ptr, current_time,
126 DPRINTF(RubyNetwork,
"%s\n", *out);
132 bw_remaining = max(0, -diff);
135 if (bw_remaining > 0 && (in->
isReady(current_time) ||
138 DPRINTF(RubyNetwork,
"vnet: %d", vnet);
142 schedule_wakeup =
true;
154 bool schedule_wakeup =
false;
157 bool iteration_direction =
false;
163 iteration_direction =
true;
166 if (iteration_direction) {
167 for (
int vnet = 0; vnet <
m_vnets; ++vnet) {
172 for (
int vnet =
m_vnets-1; vnet >= 0; --vnet) {
188 if (bw_remaining > 0 && !schedule_wakeup) {
192 DPRINTF(RubyNetwork,
"%s not scheduled again\n", *
this);
194 DPRINTF(RubyNetwork,
"%s scheduled again\n", *
this);
208 for (MessageSizeType
type = MessageSizeType_FIRST;
209 type < MessageSizeType_NUM; ++
type) {
213 MessageSizeType_to_string(
type))
218 MessageSizeType_to_string(
type))
251 assert(net_msg_ptr != NULL);
const int MESSAGE_SIZE_MULTIPLIER
std::vector< MessageBuffer * > m_out
Tick dequeue(Tick current_time, bool decrement_messages=true)
Updates the delay cycles of the message at the head of the queue, removes it from the queue and retur...
virtual const NetDest & getDestination() const
double m_link_utilization_proxy
const std::string to_string(sc_enc enc)
int m_link_bandwidth_multiplier
uint64_t Tick
Tick count type.
static int network_message_to_size(Message *net_msg_ptr)
Throttle(int sID, RubySystem *rs, NodeID node, Cycles link_latency, int link_bandwidth_multiplier, int endpoint_bandwidth, Switch *em)
void print(std::ostream &out) const
virtual const MessageSizeType & getMessageSize() const
void setConsumer(Consumer *consumer)
void enqueue(MsgPtr message, Tick curTime, Tick delta)
void regStats(std::string name)
const MsgPtr & peekMsgPtr() const
Stats::Formula m_msg_bytes[MessageSizeType_NUM]
Tick cyclesToTicks(Cycles c) const
const int PRIORITY_SWITCH_LIMIT
RubySystem * m_ruby_system
bool isReady(Tick current_time) const
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
Stats::Scalar m_link_utilization
static uint32_t MessageSizeType_to_int(MessageSizeType size_type)
const int BROADCAST_SCALING
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
static uint32_t getNumberOfVirtualNetworks()
std::shared_ptr< Message > MsgPtr
bool areNSlotsAvailable(unsigned int n, Tick curTime)
const FlagsType nozero
Don't print if this is zero.
Overload hash function for BasicBlockRange type.
std::vector< MessageBuffer * > m_in
void ccprintf(cp::Print &print)
Cycles is a wrapper class for representing cycle counts, i.e.
void addLinks(const std::vector< MessageBuffer * > &in_vec, const std::vector< MessageBuffer * > &out_vec)
int getLinkBandwidth() const
void operateVnet(int vnet, int &bw_remainin, bool &schedule_wakeup, MessageBuffer *in, MessageBuffer *out)
std::vector< int > m_units_remaining
Stats::Vector m_msg_counts[MessageSizeType_NUM]
std::string csprintf(const char *format, const Args &...args)
void init(NodeID node, Cycles link_latency, int link_bandwidth_multiplier, int endpoint_bandwidth)
void scheduleEvent(Cycles timeDelta)
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17