Go to the documentation of this file.
39 #include "debug/RubyNetwork.hh"
40 #include "params/GarnetIntLink.hh"
54 if (
mType == Enums::LINK_OBJECT) {
57 }
else if (
mType == Enums::OBJECT_LINK) {
62 panic(
"CDC type must be set");
69 DPRINTF(RubyNetwork,
"VcsPerVnet VC: %d\n", consumerVcs);
94 Cycles totLatency = latency;
103 sendTime = std::max(nextAvailTick, sendTime);
124 if (
mType == Enums::OBJECT_LINK) {
129 DPRINTF(RubyNetwork,
"Target width: %d Current: %d\n",
130 target_width, cur_width);
131 assert(target_width != cur_width);
133 int vc = t_flit->
get_vc();
135 if (target_width > cur_width) {
140 int flitPossible = 0;
154 flitPossible = ceil((
float)sizeAvail/(
float)target_width);
155 assert (flitPossible < 2);
165 flitPossible = floor((
float)sizeAvail/(
float)target_width);
166 assert (flitPossible < 2);
174 DPRINTF(RubyNetwork,
"Deserialize :%dB -----> %dB "
175 " vc:%d\n", cur_width, target_width, vc);
191 DPRINTF(RubyNetwork,
"Scheduling a flit\n");
199 DPRINTF(RubyNetwork,
"Serializing flit :%d -----> %d "
200 "(vc:%d, Original Message Size: %d)\n",
201 cur_width, target_width, vc, t_flit->
msgSize);
203 int flitPossible = 0;
215 flitPossible = floor((
float)sizeAvail/(
float)target_width);
217 sizeSent[vc] += flitPossible*target_width;
222 flitPossible = ceil((
float)sizeAvail/(
float)target_width);
226 assert(flitPossible > 0);
230 for (
int i = 0;
i < flitPossible;
i++) {
234 DPRINTF(RubyNetwork,
"Serialized to flit[%d of %d parts]:"
235 " %s\n",
i+1, flitPossible, *fl);
257 DPRINTF(RubyNetwork,
"Recieved flit %s\n", *t_flit);
std::vector< int > sizeSent
std::vector< int > lenBuffer
void flitisizeAndSend(flit *t_flit)
virtual void setVcsPerVnet(uint32_t consumerVcs)
uint64_t Tick
Tick count type.
void setVcsPerVnet(uint32_t consumerVcs)
std::vector< int > flitsSent
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...
std::vector< std::queue< int > > extraCredit
flitBuffer * link_srcQueue
void neutralize(int vc, int eCredit)
void setLinkConsumer(Consumer *consumer)
void initBridge(NetworkBridge *coBrid, bool cdc_en, bool serdes_en)
void scheduleEventAbsolute(Tick timeAbs)
void setSourceQueue(flitBuffer *src_queue, ClockedObject *srcClockObject)
bool isReady(Tick curTime)
virtual flit * deserialize(int des_id, int num_flits, uint32_t bWidth)
Cycles is a wrapper class for representing cycle counts, i.e.
Tick curTick()
The universal simulation clock.
NetworkBridge(const Params &p)
ClockedObject * getObject()
virtual flit * serialize(int ser_id, int parts, uint32_t bWidth)
#define panic(...)
This implements a cprintf based panic() function.
void scheduleFlit(flit *t_flit, Cycles latency)
Generated on Tue Jun 22 2021 15:28:29 for gem5 by doxygen 1.8.17