[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Update legacy stats for Garnet
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/58529 ) Change subject: mem-garnet: Update legacy stats for Garnet .. mem-garnet: Update legacy stats for Garnet Update stats namespace to avoid warnings for Garnet. Change-Id: I5c575e2c6623cd1ffcb96c1d13a4d2767f7511b6 --- M src/mem/ruby/network/garnet/GarnetNetwork.cc M src/mem/ruby/network/garnet/GarnetNetwork.hh 2 files changed, 199 insertions(+), 166 deletions(-) diff --git a/src/mem/ruby/network/garnet/GarnetNetwork.cc b/src/mem/ruby/network/garnet/GarnetNetwork.cc index de566a5..32284a7 100644 --- a/src/mem/ruby/network/garnet/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/GarnetNetwork.cc @@ -63,10 +63,10 @@ GarnetNetwork::GarnetNetwork(const Params ) : Network(p) +garnetStats(this, m_virtual_networks, p.routers) { m_num_rows = p.num_rows; m_ni_flit_size = p.ni_flit_size; -m_max_vcs_per_vnet = 0; m_buffers_per_data_vc = p.buffers_per_data_vc; m_buffers_per_ctrl_vc = p.buffers_per_ctrl_vc; m_routing_algorithm = p.routing_algorithm; @@ -92,6 +92,8 @@ // initialize the router's network pointers router->init_net_ptr(this); +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, +(uint32_t) router->get_vc_per_vnet()); } // record the network interfaces @@ -177,8 +179,12 @@ PortDirection dst_inport_dirn = "Local"; +<<< HEAD m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, m_routers[dest]->get_vc_per_vnet()); +=== +assert((uint32_t)m_routers[dest]->get_vc_per_vnet() <= m_max_vcs_per_vnet); +>>> 60728161b6 (mem-garnet: Update stats for Garnet) /* * We check if a bridge was enabled at any end of the link. @@ -246,8 +252,12 @@ PortDirection src_outport_dirn = "Local"; +<<< HEAD m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, m_routers[src]->get_vc_per_vnet()); +=== +assert((uint32_t)m_routers[src]->get_vc_per_vnet() <= m_max_vcs_per_vnet); +>>> 60728161b6 (mem-garnet: Update stats for Garnet) /* * We check if a bridge was enabled at any end of the link. @@ -311,9 +321,14 @@ m_networklinks.push_back(net_link); m_creditlinks.push_back(credit_link); +<<< HEAD m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, std::max(m_routers[dest]->get_vc_per_vnet(), m_routers[src]->get_vc_per_vnet())); +=== +assert(std::max((uint32_t) m_routers[dest]->get_vc_per_vnet(), +(uint32_t) m_routers[src]->get_vc_per_vnet()) <= m_max_vcs_per_vnet); +>>> 60728161b6 (mem-garnet: Update stats for Garnet) /* * We check if a bridge was enabled at any end of the link. @@ -369,171 +384,157 @@ return m_nis[local_ni]->get_router_id(vnet); } -void -GarnetNetwork::regStats() +GarnetNetwork::GarnetStats::GarnetStats( +Stats::Group *parent, uint32_t num_virt_networks, +std::vector routers): +Stats::Group(parent), +ADD_STAT(packetsReceived, "packets_received"), +ADD_STAT(packetsInjected, "packets_injected"), +ADD_STAT(packetNetworkLatency, "packet_network_latency"), +ADD_STAT(packetQueueingLatency, "packet_queueing_latency"), +ADD_STAT(avgPacketVnetLatency, "average_packet_vnet_latency"), +ADD_STAT(avgPacketVqueueLatency, "average_packet_vqueue_latency"), +ADD_STAT(avgPacketNetworkLatency, "average_packet_network_latency"), +ADD_STAT(avgPacketQueueingLatency, "average_packet_queueing_latency"), +ADD_STAT(avgPacketLatency, "average_packet_latency"), +ADD_STAT(flitsReceived, "flits_received"), +ADD_STAT(flitsInjected, "flits_injected"), +ADD_STAT(flitNetworkLatency, "flit_network_latency"), +ADD_STAT(flitQueueingLatency, "flit_queueing_latency"), +ADD_STAT(avgFlitVnetLatency, "average_flit_vnet_latency"), +ADD_STAT(avgFlitVqueueLatency, "average_flit_vqueue_latency"), +ADD_STAT(avgFlitNetworkLatency, "average_flit_network_latency"), +ADD_STAT(avgFlitQueueingLatency, "average_flit_queueing_latency"), +ADD_STAT(avgFlitLatency, "average_flit_latency"), +ADD_STAT(totalExtInLinkUtilization, "ext_in_link_utilization"), +ADD_STAT(totalExtOutLinkUtilization, "ext_out_link_utilization"), +ADD_STAT(averageLinkUtilization, "avg_link_utilization"), +ADD_STAT(averageVcLoad, "avg_vc_load"), +ADD_STAT(totalHops, "total_hops"), +ADD_STAT(avgHops, "average_hops") { -Network::regStats(); - // Packets -m_packets_received -.init(m_virtual_networks) -.name(name() + ".packets_received") +packetsReceived +.init(num_virt_networks) .flags(statistics::pdf | statistics::total | statistics::nozero | statistics::oneline) ; -m_packets_injected -
[gem5-dev] Change in gem5/gem5[develop]: configs: Update memory port name in Ruby
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/58189 ) Change subject: configs: Update memory port name in Ruby .. configs: Update memory port name in Ruby Memory port for controllers is now called memory_out_port. 'memory' is a depracated param according to this change: https://gem5-review.googlesource.com/c/public/gem5/+/34417 Change-Id: I6a561f5603c7597a3974af1766ab642acb3e59de Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58189 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M configs/ruby/Ruby.py 1 file changed, 19 insertions(+), 2 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index 631c65c..ba94c15 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -130,7 +130,7 @@ if len(system.mem_ranges) > 1: crossbar = IOXBar() crossbars.append(crossbar) -dir_cntrl.memory = crossbar.cpu_side_ports +dir_cntrl.memory_out_port = crossbar.cpu_side_ports dir_ranges = [] for r in system.mem_ranges: @@ -152,7 +152,7 @@ if crossbar != None: mem_ctrl.port = crossbar.mem_side_ports else: -mem_ctrl.port = dir_cntrl.memory +mem_ctrl.port = dir_cntrl.memory_out_port # Enable low-power DRAM states if option is set if issubclass(mem_type, DRAMInterface): -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58189 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I6a561f5603c7597a3974af1766ab642acb3e59de Gerrit-Change-Number: 58189 Gerrit-PatchSet: 2 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: configs: Update memory port name in Ruby
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/58189 ) Change subject: configs: Update memory port name in Ruby .. configs: Update memory port name in Ruby Memory port for controllers is now called memory_out_port. 'memory' is a depracated param according to this change: https://gem5-review.googlesource.com/c/public/gem5/+/34417 Change-Id: I6a561f5603c7597a3974af1766ab642acb3e59de --- M configs/ruby/Ruby.py 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index 631c65c..ba94c15 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -130,7 +130,7 @@ if len(system.mem_ranges) > 1: crossbar = IOXBar() crossbars.append(crossbar) -dir_cntrl.memory = crossbar.cpu_side_ports +dir_cntrl.memory_out_port = crossbar.cpu_side_ports dir_ranges = [] for r in system.mem_ranges: @@ -152,7 +152,7 @@ if crossbar != None: mem_ctrl.port = crossbar.mem_side_ports else: -mem_ctrl.port = dir_cntrl.memory +mem_ctrl.port = dir_cntrl.memory_out_port # Enable low-power DRAM states if option is set if issubclass(mem_type, DRAMInterface): -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58189 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I6a561f5603c7597a3974af1766ab642acb3e59de Gerrit-Change-Number: 58189 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: configs: Python 3.2+ requires additional flag for makedirs
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/58190 ) Change subject: configs: Python 3.2+ requires additional flag for makedirs .. configs: Python 3.2+ requires additional flag for makedirs makedirs requires and additional flag for makedirs to ignore error when the directory exists. This change enables overwriting on existing output directories for a simulation. https://docs.python.org/3/library/os.html Change-Id: I1c7329ded1f5eef2c882e3224457e1d991d074fd --- M configs/common/FileSystemConfig.py 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/configs/common/FileSystemConfig.py b/configs/common/FileSystemConfig.py index 66a6315..d33389c 100644 --- a/configs/common/FileSystemConfig.py +++ b/configs/common/FileSystemConfig.py @@ -168,7 +168,7 @@ 'system', 'node') nodedir = joinpath(nodebasedir,'node%d' % node_number) -makedirs(nodedir) +makedirs(nodedir, exist_ok=True) file_append((nodedir, 'cpumap'), hex_mask(cpu_list)) file_append((nodedir, 'meminfo'), -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58190 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I1c7329ded1f5eef2c882e3224457e1d991d074fd Gerrit-Change-Number: 58190 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Enable bridge rescheduling for DVFS
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/44287 ) Change subject: mem-garnet: Enable bridge rescheduling for DVFS .. mem-garnet: Enable bridge rescheduling for DVFS The Bridge SimObject, which hosts the CDC and SerDes functionality, could be woken up out-of-order when changing frequencies in DVFS. This change ensures there is no packet drop during the transition times. Change-Id: I40240dcb3e957217abd2d7ad22cc4f78809f7b49 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44287 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/mem/ruby/network/garnet/NetworkBridge.cc 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet/NetworkBridge.cc b/src/mem/ruby/network/garnet/NetworkBridge.cc index ddb6f4e..db5ee7b 100644 --- a/src/mem/ruby/network/garnet/NetworkBridge.cc +++ b/src/mem/ruby/network/garnet/NetworkBridge.cc @@ -257,7 +257,10 @@ t_flit = link_srcQueue->getTopFlit(); DPRINTF(RubyNetwork, "Recieved flit %s\n", *t_flit); flitisizeAndSend(t_flit); -return; } -assert(!link_srcQueue->getSize()); + +// Reschedule in case there is a waiting flit. +if (!link_srcQueue->isEmpty()) { +scheduleEvent(Cycles(1)); +} } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44287 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I40240dcb3e957217abd2d7ad22cc4f78809f7b49 Gerrit-Change-Number: 44287 Gerrit-PatchSet: 3 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Jieming Yin Gerrit-Reviewer: Matthew Poremba Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Change flitbuffer structure to deque
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/44286 ) Change subject: mem-garnet: Change flitbuffer structure to deque .. mem-garnet: Change flitbuffer structure to deque Flitbuffers act as FIFOs for internal links and output queues in routers. This change replaces the use of vectors with deque for performance improvements. The older implementation of using a vector combined with a heap sort was both incorrect and inefficient. Incorrect because flit buffers should act strictly as FIFO, sorting them based on time changes the order which affects functionality in the case of DVFS enabled NoCs. Change-Id: Ieba40f85628b7c7255e86792d40b8ce3d7ac34b5 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44286 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/mem/ruby/network/garnet/flitBuffer.hh 1 file changed, 2 insertions(+), 4 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet/flitBuffer.hh b/src/mem/ruby/network/garnet/flitBuffer.hh index 40af826..91a3a86 100644 --- a/src/mem/ruby/network/garnet/flitBuffer.hh +++ b/src/mem/ruby/network/garnet/flitBuffer.hh @@ -55,8 +55,7 @@ getTopFlit() { flit *f = m_buffer.front(); -std::pop_heap(m_buffer.begin(), m_buffer.end(), flit::greater); -m_buffer.pop_back(); +m_buffer.pop_front(); return f; } @@ -70,13 +69,12 @@ insert(flit *flt) { m_buffer.push_back(flt); -std::push_heap(m_buffer.begin(), m_buffer.end(), flit::greater); } uint32_t functionalWrite(Packet *pkt); private: -std::vector m_buffer; +std::deque m_buffer; int max_size; }; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44286 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ieba40f85628b7c7255e86792d40b8ce3d7ac34b5 Gerrit-Change-Number: 44286 Gerrit-PatchSet: 2 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Jieming Yin Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Reduce complexity of data structures within SwitchAllocator
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/44285 ) Change subject: mem-garnet: Reduce complexity of data structures within SwitchAllocator .. mem-garnet: Reduce complexity of data structures within SwitchAllocator The switch allocator implements a two step separable allocator and utilizes port winner and vc winner data structures for functionality. This improves the data structures used and their operations to improve overall performance of the simulation. We start with an invalid output port(-1) and an invalid vc(-1) and then allocate the outports and vcs to inport. Change-Id: I38b70ebdc1a54b8f748c2a5d510814bf139b9eaa Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44285 Reviewed-by: Jason Lowe-Power Reviewed-by: Matthew Poremba Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/mem/ruby/network/garnet/SwitchAllocator.cc M src/mem/ruby/network/garnet/SwitchAllocator.hh 2 files changed, 12 insertions(+), 21 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, but someone else must approve; Looks good to me, approved Matthew Poremba: Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet/SwitchAllocator.cc b/src/mem/ruby/network/garnet/SwitchAllocator.cc index 0b3141e..316e5b1 100644 --- a/src/mem/ruby/network/garnet/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet/SwitchAllocator.cc @@ -55,22 +55,17 @@ m_num_outports = m_router->get_num_outports(); m_round_robin_inport.resize(m_num_outports); m_round_robin_invc.resize(m_num_inports); -m_port_requests.resize(m_num_outports); -m_vc_winners.resize(m_num_outports); +m_port_requests.resize(m_num_inports); +m_vc_winners.resize(m_num_inports); for (int i = 0; i < m_num_inports; i++) { m_round_robin_invc[i] = 0; +m_port_requests[i] = -1; +m_vc_winners[i] = -1; } for (int i = 0; i < m_num_outports; i++) { -m_port_requests[i].resize(m_num_inports); -m_vc_winners[i].resize(m_num_inports); - m_round_robin_inport[i] = 0; - -for (int j = 0; j < m_num_inports; j++) { -m_port_requests[i][j] = false; // [outport][inport] -} } } @@ -127,8 +122,8 @@ if (make_request) { m_input_arbiter_activity++; -m_port_requests[outport][inport] = true; -m_vc_winners[outport][inport]= invc; +m_port_requests[inport] = outport; +m_vc_winners[inport] = invc; break; // got one vc winner for this port } @@ -168,12 +163,12 @@ inport_iter++) { // inport has a request this cycle for outport -if (m_port_requests[outport][inport]) { +if (m_port_requests[inport] == outport) { auto output_unit = m_router->getOutputUnit(outport); auto input_unit = m_router->getInputUnit(inport); // grant this outport to this inport -int invc = m_vc_winners[outport][inport]; +int invc = m_vc_winners[inport]; int outvc = input_unit->get_outvc(invc); if (outvc == -1) { @@ -236,7 +231,7 @@ } // remove this request -m_port_requests[outport][inport] = false; +m_port_requests[inport] = -1; // Update Round Robin pointer m_round_robin_inport[outport] = inport + 1; @@ -382,11 +377,7 @@ void SwitchAllocator::clear_request_vector() { -for (int i = 0; i < m_num_outports; i++) { -for (int j = 0; j < m_num_inports; j++) { -m_port_requests[i][j] = false; -} -} +std::fill(m_port_requests.begin(), m_port_requests.end(), -1); } void diff --git a/src/mem/ruby/network/garnet/SwitchAllocator.hh b/src/mem/ruby/network/garnet/SwitchAllocator.hh index 82ee67e..e17bc6f 100644 --- a/src/mem/ruby/network/garnet/SwitchAllocator.hh +++ b/src/mem/ruby/network/garnet/SwitchAllocator.hh @@ -79,8 +79,8 @@ Router *m_router; std::vector m_round_robin_invc; std::vector m_round_robin_inport; -std::vector> m_port_requests; -std::vector> m_vc_winners; // a list for each outport +std::vector m_port_requests; +std::vector m_vc_winners; }; #endif // __MEM_RUBY_NETWORK_GARNET_0_SWITCHALLOCATOR_HH__ -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44285 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I38b70ebdc1a54b8f748c2a5d510814bf139b9eaa Gerrit-Change-Number: 44285 Gerrit-PatchSet: 2 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Reduce complexity of data structures within SwitchAllocator
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/44285 ) Change subject: mem-garnet: Reduce complexity of data structures within SwitchAllocator .. mem-garnet: Reduce complexity of data structures within SwitchAllocator The switch allocator implements a two step separable allocator and utilizes port winner and vc winner data structures for functionality. This improves the data structures used and their operations to improve overall performance of the simulation. We start with an invalid output port(-1) and an invalid vc(-1) and then allocate the outports and vcs to inport. Change-Id: I38b70ebdc1a54b8f748c2a5d510814bf139b9eaa --- M src/mem/ruby/network/garnet/SwitchAllocator.cc M src/mem/ruby/network/garnet/SwitchAllocator.hh 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/mem/ruby/network/garnet/SwitchAllocator.cc b/src/mem/ruby/network/garnet/SwitchAllocator.cc index 0b3141e..316e5b1 100644 --- a/src/mem/ruby/network/garnet/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet/SwitchAllocator.cc @@ -55,22 +55,17 @@ m_num_outports = m_router->get_num_outports(); m_round_robin_inport.resize(m_num_outports); m_round_robin_invc.resize(m_num_inports); -m_port_requests.resize(m_num_outports); -m_vc_winners.resize(m_num_outports); +m_port_requests.resize(m_num_inports); +m_vc_winners.resize(m_num_inports); for (int i = 0; i < m_num_inports; i++) { m_round_robin_invc[i] = 0; +m_port_requests[i] = -1; +m_vc_winners[i] = -1; } for (int i = 0; i < m_num_outports; i++) { -m_port_requests[i].resize(m_num_inports); -m_vc_winners[i].resize(m_num_inports); - m_round_robin_inport[i] = 0; - -for (int j = 0; j < m_num_inports; j++) { -m_port_requests[i][j] = false; // [outport][inport] -} } } @@ -127,8 +122,8 @@ if (make_request) { m_input_arbiter_activity++; -m_port_requests[outport][inport] = true; -m_vc_winners[outport][inport]= invc; +m_port_requests[inport] = outport; +m_vc_winners[inport] = invc; break; // got one vc winner for this port } @@ -168,12 +163,12 @@ inport_iter++) { // inport has a request this cycle for outport -if (m_port_requests[outport][inport]) { +if (m_port_requests[inport] == outport) { auto output_unit = m_router->getOutputUnit(outport); auto input_unit = m_router->getInputUnit(inport); // grant this outport to this inport -int invc = m_vc_winners[outport][inport]; +int invc = m_vc_winners[inport]; int outvc = input_unit->get_outvc(invc); if (outvc == -1) { @@ -236,7 +231,7 @@ } // remove this request -m_port_requests[outport][inport] = false; +m_port_requests[inport] = -1; // Update Round Robin pointer m_round_robin_inport[outport] = inport + 1; @@ -382,11 +377,7 @@ void SwitchAllocator::clear_request_vector() { -for (int i = 0; i < m_num_outports; i++) { -for (int j = 0; j < m_num_inports; j++) { -m_port_requests[i][j] = false; -} -} +std::fill(m_port_requests.begin(), m_port_requests.end(), -1); } void diff --git a/src/mem/ruby/network/garnet/SwitchAllocator.hh b/src/mem/ruby/network/garnet/SwitchAllocator.hh index 82ee67e..e17bc6f 100644 --- a/src/mem/ruby/network/garnet/SwitchAllocator.hh +++ b/src/mem/ruby/network/garnet/SwitchAllocator.hh @@ -79,8 +79,8 @@ Router *m_router; std::vector m_round_robin_invc; std::vector m_round_robin_inport; -std::vector> m_port_requests; -std::vector> m_vc_winners; // a list for each outport +std::vector m_port_requests; +std::vector m_vc_winners; }; #endif // __MEM_RUBY_NETWORK_GARNET_0_SWITCHALLOCATOR_HH__ -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44285 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I38b70ebdc1a54b8f748c2a5d510814bf139b9eaa Gerrit-Change-Number: 44285 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Change flitbuffer structure to deque
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/44286 ) Change subject: mem-garnet: Change flitbuffer structure to deque .. mem-garnet: Change flitbuffer structure to deque Flitbuffers act as FIFOs for internal links and output queues in routers. This change replaces the use of vectors with deque for performance improvements. The older implementation of using a vector combined with a heap sort was both incorrect and inefficient. Incorrect because flit buffers should act strictly as FIFO, sorting them based on time changes the order which affects functionality in the case of DVFS enabled NoCs. Change-Id: Ieba40f85628b7c7255e86792d40b8ce3d7ac34b5 --- M src/mem/ruby/network/garnet/flitBuffer.hh 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mem/ruby/network/garnet/flitBuffer.hh b/src/mem/ruby/network/garnet/flitBuffer.hh index 40af826..91a3a86 100644 --- a/src/mem/ruby/network/garnet/flitBuffer.hh +++ b/src/mem/ruby/network/garnet/flitBuffer.hh @@ -55,8 +55,7 @@ getTopFlit() { flit *f = m_buffer.front(); -std::pop_heap(m_buffer.begin(), m_buffer.end(), flit::greater); -m_buffer.pop_back(); +m_buffer.pop_front(); return f; } @@ -70,13 +69,12 @@ insert(flit *flt) { m_buffer.push_back(flt); -std::push_heap(m_buffer.begin(), m_buffer.end(), flit::greater); } uint32_t functionalWrite(Packet *pkt); private: -std::vector m_buffer; +std::deque m_buffer; int max_size; }; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44286 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ieba40f85628b7c7255e86792d40b8ce3d7ac34b5 Gerrit-Change-Number: 44286 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Enable bridge rescheduling for DVFS
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/44287 ) Change subject: mem-garnet: Enable bridge rescheduling for DVFS .. mem-garnet: Enable bridge rescheduling for DVFS The Bridge SimObject, which hosts the CDC and SerDes functionality, could be woken up out-of-order when changing frequencies in DVFS. This change ensures there is no packet drop during the transition times. Change-Id: I40240dcb3e957217abd2d7ad22cc4f78809f7b49 --- M src/mem/ruby/network/garnet/NetworkBridge.cc 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mem/ruby/network/garnet/NetworkBridge.cc b/src/mem/ruby/network/garnet/NetworkBridge.cc index ddb6f4e..1ad34d3 100644 --- a/src/mem/ruby/network/garnet/NetworkBridge.cc +++ b/src/mem/ruby/network/garnet/NetworkBridge.cc @@ -257,7 +257,10 @@ t_flit = link_srcQueue->getTopFlit(); DPRINTF(RubyNetwork, "Recieved flit %s\n", *t_flit); flitisizeAndSend(t_flit); -return; } -assert(!link_srcQueue->getSize()); + +// Reschedule in case there is a waiting flit. +if (!link_srcQueue->isEmpty()) { +scheduleEvent(Cycles(1));; +} } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44287 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I40240dcb3e957217abd2d7ad22cc4f78809f7b49 Gerrit-Change-Number: 44287 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Fix default value of network bridge
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/34257 ) Change subject: mem-garnet: Fix default value of network bridge .. mem-garnet: Fix default value of network bridge Initializing the network bridge with NULL causes it to have an class error when instatiating a link. The bridge is only needed whne either a CDC or SerDes is enabled. This is handled later during construction of the GarnetLink. Change-Id: If19a21a6d9bf49449b9c390467d08d3422ae991a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34257 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/mem/ruby/network/garnet2.0/GarnetLink.py 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet2.0/GarnetLink.py b/src/mem/ruby/network/garnet2.0/GarnetLink.py index 33a3d31..9f7fe8b 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetLink.py +++ b/src/mem/ruby/network/garnet2.0/GarnetLink.py @@ -140,14 +140,14 @@ # The network bridge encapsulates both the CDC and Ser-Des # units in HeteroGarnet. This is automatically enabled when # either CDC or Ser-Des is enabled. -ext_net_bridge = VectorParam.NetworkBridge(NULL, +ext_net_bridge = VectorParam.NetworkBridge([], "Network Bridge at external end") -ext_cred_bridge = VectorParam.NetworkBridge(NULL, +ext_cred_bridge = VectorParam.NetworkBridge([], "Credit Bridge at external end") -int_net_bridge = VectorParam.NetworkBridge(NULL, +int_net_bridge = VectorParam.NetworkBridge([], "Network Bridge at internal end") -int_cred_bridge = VectorParam.NetworkBridge(NULL, -"Credit Bridge at intternal end") +int_cred_bridge = VectorParam.NetworkBridge([], +"Credit Bridge at internal end") width = Param.UInt32(Parent.ni_flit_size, -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34257 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: If19a21a6d9bf49449b9c390467d08d3422ae991a Gerrit-Change-Number: 34257 Gerrit-PatchSet: 3 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Matthew Poremba Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Allow empty vnet list for garnet network links
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/34258 ) Change subject: mem-garnet: Allow empty vnet list for garnet network links .. mem-garnet: Allow empty vnet list for garnet network links An empty supporting_vnet list is the default and implies that all vnets are supported. This removes the assert which requires the list to have a minimum list size of 1. Change-Id: I6710ba06041164bbd597d98e75374a26a1aa5655 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34258 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/mem/ruby/network/garnet2.0/NetworkLink.cc 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet2.0/NetworkLink.cc b/src/mem/ruby/network/garnet2.0/NetworkLink.cc index 61baed4..e947781 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkLink.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkLink.cc @@ -44,7 +44,6 @@ link_consumer(nullptr), link_srcQueue(nullptr) { int num_vnets = (p->supported_vnets).size(); -assert(num_vnets > 0); mVnets.resize(num_vnets); bitWidth = p->width; for (int i = 0; i < num_vnets; i++) { -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34258 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I6710ba06041164bbd597d98e75374a26a1aa5655 Gerrit-Change-Number: 34258 Gerrit-PatchSet: 3 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Matthew Poremba Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Upgrade garnet version to 3.0
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/34259 ) Change subject: mem-garnet: Upgrade garnet version to 3.0 .. mem-garnet: Upgrade garnet version to 3.0 This version of garnet includes HeteroGarnet which supports heterogenous interconnect systems, flexible router and link configurations, and better debugging resources. Change-Id: Id4763421528305193ae0cd10c159b385a9513553 --- M configs/network/Network.py R src/mem/ruby/network/garnet3.0/CommonTypes.hh R src/mem/ruby/network/garnet3.0/Credit.cc R src/mem/ruby/network/garnet3.0/Credit.hh R src/mem/ruby/network/garnet3.0/CreditLink.hh R src/mem/ruby/network/garnet3.0/CrossbarSwitch.cc R src/mem/ruby/network/garnet3.0/CrossbarSwitch.hh R src/mem/ruby/network/garnet3.0/GarnetLink.cc R src/mem/ruby/network/garnet3.0/GarnetLink.hh R src/mem/ruby/network/garnet3.0/GarnetLink.py R src/mem/ruby/network/garnet3.0/GarnetNetwork.cc R src/mem/ruby/network/garnet3.0/GarnetNetwork.hh R src/mem/ruby/network/garnet3.0/GarnetNetwork.py R src/mem/ruby/network/garnet3.0/InputUnit.cc R src/mem/ruby/network/garnet3.0/InputUnit.hh R src/mem/ruby/network/garnet3.0/NetworkBridge.cc R src/mem/ruby/network/garnet3.0/NetworkBridge.hh R src/mem/ruby/network/garnet3.0/NetworkInterface.cc R src/mem/ruby/network/garnet3.0/NetworkInterface.hh R src/mem/ruby/network/garnet3.0/NetworkLink.cc R src/mem/ruby/network/garnet3.0/NetworkLink.hh R src/mem/ruby/network/garnet3.0/OutVcState.cc R src/mem/ruby/network/garnet3.0/OutVcState.hh R src/mem/ruby/network/garnet3.0/OutputUnit.cc R src/mem/ruby/network/garnet3.0/OutputUnit.hh R src/mem/ruby/network/garnet3.0/README.txt R src/mem/ruby/network/garnet3.0/Router.cc R src/mem/ruby/network/garnet3.0/Router.hh R src/mem/ruby/network/garnet3.0/RoutingUnit.cc R src/mem/ruby/network/garnet3.0/RoutingUnit.hh R src/mem/ruby/network/garnet3.0/SConscript R src/mem/ruby/network/garnet3.0/SwitchAllocator.cc R src/mem/ruby/network/garnet3.0/SwitchAllocator.hh R src/mem/ruby/network/garnet3.0/VirtualChannel.cc R src/mem/ruby/network/garnet3.0/VirtualChannel.hh R src/mem/ruby/network/garnet3.0/flit.cc R src/mem/ruby/network/garnet3.0/flit.hh R src/mem/ruby/network/garnet3.0/flitBuffer.cc R src/mem/ruby/network/garnet3.0/flitBuffer.hh 39 files changed, 184 insertions(+), 168 deletions(-) diff --git a/configs/network/Network.py b/configs/network/Network.py index 20d68c0..f52725e 100644 --- a/configs/network/Network.py +++ b/configs/network/Network.py @@ -31,7 +31,7 @@ import m5 from m5.objects import * from m5.defines import buildEnv -from m5.util import addToPath, fatal +from m5.util import addToPath, fatal, warn def define_options(parser): # By default, ruby uses the simple timing cpu @@ -42,8 +42,9 @@ parser.add_option("--mesh-rows", type="int", default=0, help="the number of rows in the mesh topology") parser.add_option("--network", type="choice", default="simple", - choices=['simple', 'garnet2.0'], - help="'simple'|'garnet2.0'") + choices=['simple', 'garnet2.0', 'garnet3.0'], + help="""'simple'|'garnet3.0' (garnet 2.0 will be + deprecated.)""") parser.add_option("--router-latency", action="store", type="int", default=1, help="""number of pipeline stages in the garnet router. @@ -65,8 +66,8 @@ default=0, help="""routing algorithm in network. 0: weight-based table -1: XY (for Mesh. see garnet2.0/RoutingUnit.cc) -2: Custom (see garnet2.0/RoutingUnit.cc""") +1: XY (for Mesh. see garnet3.0/RoutingUnit.cc) +2: Custom (see garnet3.0/RoutingUnit.cc""") parser.add_option("--network-fault-model", action="store_true", default=False, help="""enable network fault model: @@ -77,8 +78,15 @@ def create_network(options, ruby): -# Set the network classes based on the command line options +# Allow legacy users to use garnet through garnet2.0 option +# until next gem5 release. if options.network == "garnet2.0": +warn("garnet2.0 will be depracated. Please use garnet3.0 for" \ +" using the latest garnet version.") +options.network = "garnet3.0" + +# Set the network classes based on the command line options +if options.network == "garnet3.0": NetworkClass = GarnetNetwork IntLinkClass = GarnetIntLink ExtLinkClass = GarnetExtLink @@ -101,7 +109,7 @@ def init_network(options, network, InterfaceClass): -if options.network == "garnet2.0": +if options.network == "garnet3.0": network.num_rows = options.mesh_rows
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Fix default value of network bridge
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/34257 ) Change subject: mem-garnet: Fix default value of network bridge .. mem-garnet: Fix default value of network bridge Initializing the network bridge with NULL causes it to have an class error when instatiating a link. The bridge is only needed whne either a CDC or SerDes is enabled. This is handled later during construction of the GarnetLink. Change-Id: If19a21a6d9bf49449b9c390467d08d3422ae991a --- M src/mem/ruby/network/garnet2.0/GarnetLink.py 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/GarnetLink.py b/src/mem/ruby/network/garnet2.0/GarnetLink.py index 33a3d31..d133032 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetLink.py +++ b/src/mem/ruby/network/garnet2.0/GarnetLink.py @@ -90,10 +90,10 @@ # The network bridge encapsulates both the CDC and Ser-Des # units in HeteroGarnet. This is automatically enabled when # either CDC or Ser-Des is enabled. -src_net_bridge = Param.NetworkBridge(NULL, "Network Bridge at source") -dst_net_bridge = Param.NetworkBridge(NULL, "Network Bridge at dest") -src_cred_bridge = Param.NetworkBridge(NULL, "Credit Bridge at source") -dst_cred_bridge = Param.NetworkBridge(NULL, "Credit Bridge at dest") +src_net_bridge = Param.NetworkBridge("Network Bridge at source") +dst_net_bridge = Param.NetworkBridge("Network Bridge at dest") +src_cred_bridge = Param.NetworkBridge("Credit Bridge at source") +dst_cred_bridge = Param.NetworkBridge("Credit Bridge at dest") width = Param.UInt32(Parent.ni_flit_size, "bit width supported by the router") @@ -140,13 +140,13 @@ # The network bridge encapsulates both the CDC and Ser-Des # units in HeteroGarnet. This is automatically enabled when # either CDC or Ser-Des is enabled. -ext_net_bridge = VectorParam.NetworkBridge(NULL, +ext_net_bridge = VectorParam.NetworkBridge( "Network Bridge at external end") -ext_cred_bridge = VectorParam.NetworkBridge(NULL, +ext_cred_bridge = VectorParam.NetworkBridge( "Credit Bridge at external end") -int_net_bridge = VectorParam.NetworkBridge(NULL, +int_net_bridge = VectorParam.NetworkBridge( "Network Bridge at internal end") -int_cred_bridge = VectorParam.NetworkBridge(NULL, +int_cred_bridge = VectorParam.NetworkBridge( "Credit Bridge at intternal end") -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34257 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: If19a21a6d9bf49449b9c390467d08d3422ae991a Gerrit-Change-Number: 34257 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Allow empty vnet list for garnet network links
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/34258 ) Change subject: mem-garnet: Allow empty vnet list for garnet network links .. mem-garnet: Allow empty vnet list for garnet network links An empty supporting_vnet list is the default and implies that all vnets are supported. This removes the assert which requires the list to have a minimum list size of 1. Change-Id: I6710ba06041164bbd597d98e75374a26a1aa5655 --- M src/mem/ruby/network/garnet2.0/NetworkLink.cc 1 file changed, 0 insertions(+), 1 deletion(-) diff --git a/src/mem/ruby/network/garnet2.0/NetworkLink.cc b/src/mem/ruby/network/garnet2.0/NetworkLink.cc index 61baed4..e947781 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkLink.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkLink.cc @@ -44,7 +44,6 @@ link_consumer(nullptr), link_srcQueue(nullptr) { int num_vnets = (p->supported_vnets).size(); -assert(num_vnets > 0); mVnets.resize(num_vnets); bitWidth = p->width; for (int i = 0; i < num_vnets; i++) { -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34258 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I6710ba06041164bbd597d98e75374a26a1aa5655 Gerrit-Change-Number: 34258 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Check number of vnets when creating links
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/32603 ) Change subject: mem-ruby: Check number of vnets when creating links .. mem-ruby: Check number of vnets when creating links Added error checking to ensure that the system has sufficient virtual networks when setting latency and weight values. Change-Id: I1b28144bbe9fefab0c0a6227f1fdf4ea10403061 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32603 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- M src/mem/ruby/network/Topology.cc 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index 13219a5..c9a5811 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -163,6 +163,8 @@ } else { for (int v = 0; v < link->mVnets.size(); v++) { int vnet = link->mVnets[v]; +fatal_if(vnet >= m_vnets, "Not enough virtual networks " + "(setting latency and weight for vnet %d)", vnet); // Two links connecting same src and destination // cannot carry same vnets. fatal_if(vnet_done[vnet], "Two links connecting same src" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32603 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I1b28144bbe9fefab0c0a6227f1fdf4ea10403061 Gerrit-Change-Number: 32603 Gerrit-PatchSet: 10 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-CC: Bobby R. Bruce Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Flexible VCs per Vnet for each router
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/32599 ) Change subject: mem-garnet: Flexible VCs per Vnet for each router .. mem-garnet: Flexible VCs per Vnet for each router This change allows configuring each router with a certain number of VCs for each VNET. This is beneficial when dealing with heterogenous link widths in a system. Configuring VCs for each router allows one to ensure equal throughput within the network while avoiding head-of-line blocking. Changing a router's VCs number can be done in topology files using the vcs_per_vnet value argument of router. Change-Id: Icf4f510248128429a1a11f19f9802ee96f340611 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32599 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/mem/ruby/network/garnet2.0/GarnetNetwork.cc M src/mem/ruby/network/garnet2.0/GarnetNetwork.hh M src/mem/ruby/network/garnet2.0/NetworkBridge.cc M src/mem/ruby/network/garnet2.0/NetworkBridge.hh M src/mem/ruby/network/garnet2.0/NetworkInterface.cc M src/mem/ruby/network/garnet2.0/NetworkInterface.hh M src/mem/ruby/network/garnet2.0/NetworkLink.cc M src/mem/ruby/network/garnet2.0/NetworkLink.hh M src/mem/ruby/network/garnet2.0/OutVcState.cc M src/mem/ruby/network/garnet2.0/OutVcState.hh M src/mem/ruby/network/garnet2.0/OutputUnit.cc M src/mem/ruby/network/garnet2.0/OutputUnit.hh M src/mem/ruby/network/garnet2.0/Router.cc M src/mem/ruby/network/garnet2.0/Router.hh 14 files changed, 124 insertions(+), 61 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc index 63562cd..bcc476f 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc @@ -58,7 +58,7 @@ { m_num_rows = p->num_rows; m_ni_flit_size = p->ni_flit_size; -m_vcs_per_vnet = p->vcs_per_vnet; +m_max_vcs_per_vnet = 0; m_buffers_per_data_vc = p->buffers_per_data_vc; m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc; m_routing_algorithm = p->routing_algorithm; @@ -166,6 +166,9 @@ PortDirection dst_inport_dirn = "Local"; +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, + m_routers[dest]->get_vc_per_vnet()); + /* * We check if a bridge was enabled at any end of the link. * The bridge is enabled if either of clock domain @@ -185,9 +188,10 @@ m_nis[local_src]-> addOutPort(garnet_link->extNetBridge[LinkDirection_In], garnet_link->extCredBridge[LinkDirection_In], - dest); + dest, m_routers[dest]->get_vc_per_vnet()); } else { -m_nis[local_src]->addOutPort(net_link, credit_link, dest); +m_nis[local_src]->addOutPort(net_link, credit_link, dest, +m_routers[dest]->get_vc_per_vnet()); } if (garnet_link->intBridgeEn) { @@ -231,6 +235,9 @@ PortDirection src_outport_dirn = "Local"; +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, + m_routers[src]->get_vc_per_vnet()); + /* * We check if a bridge was enabled at any end of the link. * The bridge is enabled if either of clock domain @@ -261,12 +268,14 @@ addOutPort(src_outport_dirn, garnet_link->intNetBridge[LinkDirection_Out], routing_table_entry, link->m_weight, - garnet_link->intCredBridge[LinkDirection_Out]); + garnet_link->intCredBridge[LinkDirection_Out], + m_routers[src]->get_vc_per_vnet()); } else { m_routers[src]-> addOutPort(src_outport_dirn, net_link, routing_table_entry, - link->m_weight, credit_link); + link->m_weight, credit_link, + m_routers[src]->get_vc_per_vnet()); } } @@ -291,6 +300,10 @@ m_networklinks.push_back(net_link); m_creditlinks.push_back(credit_link); +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, + std::max(m_routers[dest]->get_vc_per_vnet(), + m_routers[src]->get_vc_per_vnet())); + /* * We check if a bridge was enabled at any end of the link. * The bridge is enabled if either of clock domain @@ -319,11 +332,13 @@ m_routers[src]-> addOutPort(src_outport_dirn, garnet_link->srcNetBridge, routing_table_entry, - link->m_weight, garnet_link->srcCredBridge); + link->m_weight, garnet_link->srcCredBridge, + m_routers[dest]->get_vc_per_vnet()); } else {
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Initialize unused Credit members
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/32598 ) Change subject: mem-garnet: Initialize unused Credit members .. mem-garnet: Initialize unused Credit members The Credit class doesn't initialize a number of its unused base class fields. This leads to non-determanistic traces when printing flits that are Credits. This patch initializes all unused fields to 0. Change-Id: Ib73c652c71a10be57b24c0d6e1ac22eafa421e11 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32598 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- M src/mem/ruby/network/garnet2.0/CommonTypes.hh M src/mem/ruby/network/garnet2.0/Credit.cc 2 files changed, 6 insertions(+), 3 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet2.0/CommonTypes.hh b/src/mem/ruby/network/garnet2.0/CommonTypes.hh index 94aa600..643ce8c 100644 --- a/src/mem/ruby/network/garnet2.0/CommonTypes.hh +++ b/src/mem/ruby/network/garnet2.0/CommonTypes.hh @@ -46,6 +46,11 @@ struct RouteInfo { +RouteInfo() +: vnet(0), src_ni(0), src_router(0), dest_ni(0), dest_router(0), + hops_traversed(0) +{} + // destination format for table-based routing int vnet; NetDest net_dest; diff --git a/src/mem/ruby/network/garnet2.0/Credit.cc b/src/mem/ruby/network/garnet2.0/Credit.cc index 3e56b4e..bde9484 100644 --- a/src/mem/ruby/network/garnet2.0/Credit.cc +++ b/src/mem/ruby/network/garnet2.0/Credit.cc @@ -37,11 +37,9 @@ // and m_is_free_signal (whether VC is free or not) Credit::Credit(int vc, bool is_free_signal, Tick curTime) +: flit(0, vc, 0, RouteInfo(), 0, nullptr, 0, 0, curTime) { -m_id = 0; -m_vc = vc; m_is_free_signal = is_free_signal; -m_time = curTime; m_type = CREDIT_; } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32598 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ib73c652c71a10be57b24c0d6e1ac22eafa421e11 Gerrit-Change-Number: 32598 Gerrit-PatchSet: 7 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Michael LeBeane Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Add a check to see if router is already scheduled
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/32600 ) Change subject: mem-garnet: Add a check to see if router is already scheduled .. mem-garnet: Add a check to see if router is already scheduled Currently the Switch Allocator takes up most of the simulation wall clock time. This function checks for all VCs to see if it should wakeup next. The input units which are simulated before the switch allocator could have scheduled it already. This patch adds a check for it. Change-Id: I8609d4e7f925aa5e97198f6cd07466530f6fcf4c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32600 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- M src/mem/ruby/network/garnet2.0/SwitchAllocator.cc 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 144f208..3241343 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -350,6 +350,10 @@ { Tick nextCycle = m_router->clockEdge(Cycles(1)); +if (m_router->alreadyScheduled(nextCycle)) { +return; +} + for (int i = 0; i < m_num_inports; i++) { for (int j = 0; j < m_num_vcs; j++) { if (m_router->getInputUnit(i)->need_stage(j, SA_, nextCycle)) { -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32600 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I8609d4e7f925aa5e97198f6cd07466530f6fcf4c Gerrit-Change-Number: 32600 Gerrit-PatchSet: 9 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Separable allocator in Garnet not fair enough.
Srikant Bharadwaj has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/32601 ) Change subject: mem-garnet: Separable allocator in Garnet not fair enough. .. mem-garnet: Separable allocator in Garnet not fair enough. Currently there are independent round robin arbiter at each input port and output port. Every time a VC is selected for output allocation round robin is incremented irrespective of if it is selected by its output port or not. This leads to unfair arbitration at input port and is well known[1]. This patch fixes it to increment only if the output port also selects it. [1] D. U. Becker and W. J. Dally, "Allocator implementations for network-on-chip routers," Proceedings of the Conference on High Performance Computing Networking, Storage and Analysis, Portland, OR, 2009, pp. 1-12 Change-Id: I65963fb8082c51c0e3c6e031a8b87b4f5c3626e1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32601 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- M src/mem/ruby/network/garnet2.0/SwitchAllocator.cc 1 file changed, 9 insertions(+), 5 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 3241343..1ed6de1 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -130,11 +130,6 @@ m_port_requests[outport][inport] = true; m_vc_winners[outport][inport]= invc; -// Update Round Robin pointer to the next VC -m_round_robin_invc[inport] = invc + 1; -if (m_round_robin_invc[inport] >= m_num_vcs) -m_round_robin_invc[inport] = 0; - break; // got one vc winner for this port } } @@ -248,6 +243,15 @@ if (m_round_robin_inport[outport] >= m_num_inports) m_round_robin_inport[outport] = 0; +// Update Round Robin pointer to the next VC +// We do it here to keep it fair. +// Only the VC which got switch traversal +// is updated. +m_round_robin_invc[inport] = invc + 1; +if (m_round_robin_invc[inport] >= m_num_vcs) +m_round_robin_invc[inport] = 0; + + break; // got a input winner for this outport } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32601 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I65963fb8082c51c0e3c6e031a8b87b4f5c3626e1 Gerrit-Change-Number: 32601 Gerrit-PatchSet: 9 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Srikant Bharadwaj Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Add example Mesh topologies exercising HeteroGarnet
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32681 ) Change subject: mem-garnet: Add example Mesh topologies exercising HeteroGarnet .. mem-garnet: Add example Mesh topologies exercising HeteroGarnet This patch adds two new topologies which show the use cases of HeteroGarnet. Users can start building their topologies using these example topologies. Change-Id: I655aa673b0de8436c4930e68861a703edf2320ec --- A configs/topologies/Mesh_SerDes.py A configs/topologies/Mesh_VF.py 2 files changed, 515 insertions(+), 0 deletions(-) diff --git a/configs/topologies/Mesh_SerDes.py b/configs/topologies/Mesh_SerDes.py new file mode 100644 index 000..db31840 --- /dev/null +++ b/configs/topologies/Mesh_SerDes.py @@ -0,0 +1,249 @@ +# Copyright (c) 2020 Advanced Micro Devices, Inc. +# All rights reserved. +# +# For use for simulation and test purposes only +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Srikant Bharadwaj + + +from m5.params import * +from m5.objects import * + +from BaseTopology import SimpleTopology + +# Creates a generic Mesh assuming an equal number of cache +# and directory controllers. +# XY routing is enforced (using link weights) +# to guarantee deadlock freedom. + +class Mesh_SerDes(SimpleTopology): +description='Mesh_SerDes' + +def __init__(self, controllers): +self.nodes = controllers + +# Makes a generic mesh +# assuming an equal number of cache and directory cntrls + +def makeTopology(self, options, network, IntLink, ExtLink, Router): +nodes = self.nodes + +num_routers = options.num_cpus +num_rows = options.mesh_rows + +# default values for link latency and router latency. +# Can be over-ridden on a per link/router basis +link_latency = options.link_latency # used by simple and garnet +router_latency = options.router_latency # only used by garnet + + +# There must be an evenly divisible number of cntrls to routers +# Also, obviously the number or rows must be <= the number of routers +cntrls_per_router, remainder = divmod(len(nodes), num_routers) +assert(num_rows > 0 and num_rows <= num_routers) +num_columns = int(num_routers / num_rows) +assert(num_columns * num_rows == num_routers) + +# This topology is supported only for a 4x4 mesh +assert(num_rows == 4 and num_columns == 4) + +# Create the routers in the mesh +routers = [Router(router_id=i, latency = router_latency) \ +for i in range(num_routers)] +network.routers = routers + +# link counter to set unique link ids +link_count = 0 + +# Add all but the remainder nodes to the list of nodes to be uniformly +# distributed across the network. +network_nodes = [] +remainder_nodes = [] +for node_index in xrange(len(nodes)): +if node_index < (len(nodes) - remainder): +network_nodes.append(nodes[node_index]) +else: +remainder_nodes.append(nodes[node_index]) + +# We create a Mesh of routers with 4 routers supporting 32B flits +# and rest supporting 64B. The four 32B routers will have a +# SerDes on the internal end of the external link. So the network +# interfaces will always recieve 64B flits in this example. + +
[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Check number of vnets when creating links
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32603 ) Change subject: mem-ruby: Check number of vnets when creating links .. mem-ruby: Check number of vnets when creating links Added error checking to ensure that the system has sufficient virtual networks when setting latency and weight values. Change-Id: I1b28144bbe9fefab0c0a6227f1fdf4ea10403061 --- M src/mem/ruby/network/Topology.cc 1 file changed, 2 insertions(+), 0 deletions(-) diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index b267db1..c45dd9d 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -165,6 +165,8 @@ } else { for (int v = 0; v < link->mVnets.size(); v++) { int vnet = link->mVnets[v]; +fatal_if(vnet >= m_vnets, "Not enough virtual networks " + "(setting latency and weight for vnet %d)", vnet); // Two links connecting same src and destination // cannot carry same vnets. fatal_if(vnet_done[vnet], "Two links connecting same src" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32603 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I1b28144bbe9fefab0c0a6227f1fdf4ea10403061 Gerrit-Change-Number: 32603 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Flexible VCs per Vnet for each router
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32599 ) Change subject: mem-garnet: Flexible VCs per Vnet for each router .. mem-garnet: Flexible VCs per Vnet for each router This change allows configuring each router with a certain number of VCs for each VNET. This is beneficial when dealing with heterogenous link widths in a system. Configuring VCs for each router allows one to ensure equal throuput within the network while avoiding head-of-line blocking. Changing a router's VCs number can be done in topology files using the vcs_per_vnet value argument of router. Change-Id: Icf4f510248128429a1a11f19f9802ee96f340611 --- M src/mem/ruby/network/garnet2.0/GarnetNetwork.cc M src/mem/ruby/network/garnet2.0/GarnetNetwork.hh M src/mem/ruby/network/garnet2.0/NetworkBridge.cc M src/mem/ruby/network/garnet2.0/NetworkBridge.hh M src/mem/ruby/network/garnet2.0/NetworkInterface.cc M src/mem/ruby/network/garnet2.0/NetworkInterface.hh M src/mem/ruby/network/garnet2.0/NetworkLink.cc M src/mem/ruby/network/garnet2.0/NetworkLink.hh M src/mem/ruby/network/garnet2.0/OutVcState.cc M src/mem/ruby/network/garnet2.0/OutVcState.hh M src/mem/ruby/network/garnet2.0/OutputUnit.cc M src/mem/ruby/network/garnet2.0/OutputUnit.hh M src/mem/ruby/network/garnet2.0/Router.cc M src/mem/ruby/network/garnet2.0/Router.hh 14 files changed, 126 insertions(+), 54 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc index ca9e26f..3e3852a 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc @@ -58,7 +58,7 @@ { m_num_rows = p->num_rows; m_ni_flit_size = p->ni_flit_size; -m_vcs_per_vnet = p->vcs_per_vnet; +m_max_vcs_per_vnet = 0; m_buffers_per_data_vc = p->buffers_per_data_vc; m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc; m_routing_algorithm = p->routing_algorithm; @@ -166,15 +166,19 @@ PortDirection dst_inport_dirn = "Local"; +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, + (uint32_t) m_routers[dest]->get_vc_per_vnet()); + if (garnet_link->extBridgeEn) { DPRINTF(RubyNetwork, "Enable external bridge for %s\n", garnet_link->name()); m_nis[local_src]-> addOutPort(garnet_link->extNetBridge[LinkDirection_In], garnet_link->extCredBridge[LinkDirection_In], - dest); + dest, m_routers[dest]->get_vc_per_vnet()); } else { -m_nis[local_src]->addOutPort(net_link, credit_link, dest); +m_nis[local_src]->addOutPort(net_link, credit_link, dest, +m_routers[dest]->get_vc_per_vnet()); } if (garnet_link->intBridgeEn) { @@ -218,6 +222,9 @@ PortDirection src_outport_dirn = "Local"; +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, + (uint32_t) m_routers[src]->get_vc_per_vnet()); + if (garnet_link->extBridgeEn) { DPRINTF(RubyNetwork, "Enable external bridge for %s\n", garnet_link->name()); @@ -235,12 +242,14 @@ addOutPort(src_outport_dirn, garnet_link->intNetBridge[LinkDirection_Out], routing_table_entry, link->m_weight, - garnet_link->intCredBridge[LinkDirection_Out]); + garnet_link->intCredBridge[LinkDirection_Out], + m_routers[src]->get_vc_per_vnet()); } else { m_routers[src]-> addOutPort(src_outport_dirn, net_link, routing_table_entry, - link->m_weight, credit_link); + link->m_weight, credit_link, + m_routers[src]->get_vc_per_vnet()); } } @@ -265,6 +274,10 @@ m_networklinks.push_back(net_link); m_creditlinks.push_back(credit_link); +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, +std::max((uint32_t) m_routers[dest]->get_vc_per_vnet(), +(uint32_t) m_routers[src]->get_vc_per_vnet())); + if (garnet_link->dstBridgeEn) { DPRINTF(RubyNetwork, "Enable destination bridge for %s\n", garnet_link->name()); @@ -280,11 +293,13 @@ m_routers[src]-> addOutPort(src_outport_dirn, garnet_link->srcNetBridge, routing_table_entry, - link->m_weight, garnet_link->srcCredBridge); + link->m_weight, garnet_link->srcCredBridge, + m_routers[dest]->get_vc_per_vnet()); } else { m_routers[src]->addOutPort(src_outport_dirn, net_link, routing_table_entry, -link->m_weight, credit_link); +link->m_weight, credit_link, +
[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: make simplenetwork compatible with garnet3.0 topologies
Hello John Alsop, I'd like you to do a code review. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/32602 to review the following change. Change subject: mem-ruby: make simplenetwork compatible with garnet3.0 topologies .. mem-ruby: make simplenetwork compatible with garnet3.0 topologies 1) To support controllers with multiple outgoing links (added in garnet 3.0), only connect a message buffer to a controller if the vnet in that message buffer matches the vnets assigned to the link. This is needed to support controllers with multiple outgoing links (added in garnet 3.0). Similarly, a separate routing table must be managed for each vnet at each simple network router. 2) Dummy parameters must be added for garnet-specific members in network base classes to prevent errors. Change-Id: I78cfce99edf73cd647c05ef7a3a619218493d9de --- M src/mem/ruby/network/BasicLink.py M src/mem/ruby/network/garnet2.0/GarnetLink.py M src/mem/ruby/network/simple/PerfectSwitch.cc M src/mem/ruby/network/simple/PerfectSwitch.hh M src/mem/ruby/network/simple/SimpleNetwork.cc M src/mem/ruby/network/simple/SimpleNetwork.py M src/mem/ruby/network/simple/Switch.cc M src/mem/ruby/network/simple/Switch.hh 8 files changed, 63 insertions(+), 30 deletions(-) diff --git a/src/mem/ruby/network/BasicLink.py b/src/mem/ruby/network/BasicLink.py index 2718aa6..b9ded1f 100644 --- a/src/mem/ruby/network/BasicLink.py +++ b/src/mem/ruby/network/BasicLink.py @@ -39,6 +39,16 @@ weight = Param.Int(1, "used to restrict routing in shortest path analysis") supported_vnets = VectorParam.Int([-1], "Vnets supported Default:All(-1)") +# dummy variables for compatibility with garnet topology +ext_cdc = Param.Bool(False, "Dummy") +int_cdc = Param.Bool(False, "Dummy") +ext_serdes = Param.Bool(False, "Dummy") +int_serdes = Param.Bool(False, "Dummy") +src_serdes = Param.Bool(False, "Dummy") +dst_serdes = Param.Bool(False, "Dummy") +width = Param.UInt32(0, "Dummy") +vcs_per_vnet = Param.Int(0, "Dummy") + class BasicExtLink(BasicLink): type = 'BasicExtLink' cxx_header = "mem/ruby/network/BasicLink.hh" @@ -46,6 +56,12 @@ int_node = Param.BasicRouter("ID of internal node") bandwidth_factor = 16 # only used by simple network +# only used by Garnet. +ext_cdc = Param.Bool(False, "Enable CDC") +int_cdc = Param.Bool(False, "Enable CDC") +ext_serdes = Param.Bool(False, "Enable CDC") +int_serdes = Param.Bool(False, "Enable CDC") + class BasicIntLink(BasicLink): type = 'BasicIntLink' cxx_header = "mem/ruby/network/BasicLink.hh" @@ -55,6 +71,10 @@ # only used by Garnet. src_outport = Param.String("", "Outport direction at src router") dst_inport = Param.String("", "Inport direction at dst router") +src_cdc = Param.Bool(False, "Enable CDC") +dst_cdc = Param.Bool(False, "Enable CDC") +src_serdes = Param.Bool(False, "Enable CDC") +dst_serdes = Param.Bool(False, "Enable CDC") # only used by simple network bandwidth_factor = 16 diff --git a/src/mem/ruby/network/garnet2.0/GarnetLink.py b/src/mem/ruby/network/garnet2.0/GarnetLink.py index 769680c..f356d97 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetLink.py +++ b/src/mem/ruby/network/garnet2.0/GarnetLink.py @@ -64,17 +64,11 @@ network_link = Param.NetworkLink(NetworkLink(), "forward link") credit_link = Param.CreditLink(CreditLink(), "backward flow-control link") -src_cdc = Param.Bool(False, "Enable CDC") -dst_cdc = Param.Bool(False, "Enable CDC") - src_net_bridge = Param.NetworkBridge("Network CDC at source") dst_net_bridge = Param.NetworkBridge("Network CDC at dest") src_cred_bridge = Param.NetworkBridge("Credit CDC at source") dst_cred_bridge = Param.NetworkBridge("Credit CDC at dest") -src_serdes = Param.Bool(False, "Enable CDC") -dst_serdes = Param.Bool(False, "Enable CDC") - width = Param.UInt32(Parent.ni_flit_size, "bit width supported by the router") @@ -100,16 +94,10 @@ _cls.append(CreditLink()); credit_links = VectorParam.CreditLink(_cls, "backward flow-control links") -ext_cdc = Param.Bool(False, "Enable CDC") -int_cdc = Param.Bool(False, "Enable CDC") - ext_net_bridge = VectorParam.NetworkBridge("CDC to reach the consumers") ext_cred_bridge = VectorParam.NetworkBridge("CDC to reach the consumers") int_net_bridge = VectorParam.NetworkBridge("CDC to reach the consumers") int_cred_bridge = VectorParam.NetworkBridge("CDC to reach the consumers") -ext_serdes = Param.Bool(False, "Enable CDC") -int_serdes = Param.Bool(False, "Enable CDC") - width = Param.UInt32(Parent.ni_flit_size, "bit width supported by the router") diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Separable allocator in Garnet not fair enough.
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32601 ) Change subject: mem-garnet: Separable allocator in Garnet not fair enough. .. mem-garnet: Separable allocator in Garnet not fair enough. Currently there are independent round robin arbiter at each input port and output port. Every time a VC is selected for output allocation round robin is incremented irrespective of if it is selected by its output port or not. This leads to unfair arbitration at input port and is well known[1]. This patch fixes it to increment only if the output port also selects it. [1] D. U. Becker and W. J. Dally, "Allocator implementations for network-on-chip routers," Proceedings of the Conference on High Performance Computing Networking, Storage and Analysis, Portland, OR, 2009, pp. 1-12 Change-Id: I65963fb8082c51c0e3c6e031a8b87b4f5c3626e1 --- M src/mem/ruby/network/garnet2.0/SwitchAllocator.cc 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 3241343..1ed6de1 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -130,11 +130,6 @@ m_port_requests[outport][inport] = true; m_vc_winners[outport][inport]= invc; -// Update Round Robin pointer to the next VC -m_round_robin_invc[inport] = invc + 1; -if (m_round_robin_invc[inport] >= m_num_vcs) -m_round_robin_invc[inport] = 0; - break; // got one vc winner for this port } } @@ -248,6 +243,15 @@ if (m_round_robin_inport[outport] >= m_num_inports) m_round_robin_inport[outport] = 0; +// Update Round Robin pointer to the next VC +// We do it here to keep it fair. +// Only the VC which got switch traversal +// is updated. +m_round_robin_invc[inport] = invc + 1; +if (m_round_robin_invc[inport] >= m_num_vcs) +m_round_robin_invc[inport] = 0; + + break; // got a input winner for this outport } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32601 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I65963fb8082c51c0e3c6e031a8b87b4f5c3626e1 Gerrit-Change-Number: 32601 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Add a check to see if router is already scheduled
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32600 ) Change subject: mem-garnet: Add a check to see if router is already scheduled .. mem-garnet: Add a check to see if router is already scheduled Currently the Switch Allocator takes up most of the simulation wall clock time. This function checks for all VCs to see if it should wakeup next. The input units which are simulated before the switch allocator could have scheduled it already. This patch adds a check for it. Change-Id: I8609d4e7f925aa5e97198f6cd07466530f6fcf4c --- M src/mem/ruby/network/garnet2.0/SwitchAllocator.cc 1 file changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 144f208..3241343 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -350,6 +350,10 @@ { Tick nextCycle = m_router->clockEdge(Cycles(1)); +if (m_router->alreadyScheduled(nextCycle)) { +return; +} + for (int i = 0; i < m_num_inports; i++) { for (int j = 0; j < m_num_vcs; j++) { if (m_router->getInputUnit(i)->need_stage(j, SA_, nextCycle)) { -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32600 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I8609d4e7f925aa5e97198f6cd07466530f6fcf4c Gerrit-Change-Number: 32600 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[develop]: mem-garnet: Initialize unused Credit members
Hello Michael LeBeane, I'd like you to do a code review. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/32598 to review the following change. Change subject: mem-garnet: Initialize unused Credit members .. mem-garnet: Initialize unused Credit members The Credit class doesn't initialize a number of its unused base class fields. This leads to non-determanistic traces when printing flits that are Credits. This patch initializes all unused fields to 0. Change-Id: Ib73c652c71a10be57b24c0d6e1ac22eafa421e11 --- M src/mem/ruby/network/garnet2.0/CommonTypes.hh M src/mem/ruby/network/garnet2.0/Credit.cc 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/CommonTypes.hh b/src/mem/ruby/network/garnet2.0/CommonTypes.hh index 72febed..bc80131 100644 --- a/src/mem/ruby/network/garnet2.0/CommonTypes.hh +++ b/src/mem/ruby/network/garnet2.0/CommonTypes.hh @@ -47,6 +47,11 @@ struct RouteInfo { +RouteInfo() +: vnet(0), src_ni(0), src_router(0), dest_ni(0), dest_router(0), + hops_traversed(0) +{} + // destination format for table-based routing int vnet; NetDest net_dest; diff --git a/src/mem/ruby/network/garnet2.0/Credit.cc b/src/mem/ruby/network/garnet2.0/Credit.cc index acb8b32..7619079 100644 --- a/src/mem/ruby/network/garnet2.0/Credit.cc +++ b/src/mem/ruby/network/garnet2.0/Credit.cc @@ -35,11 +35,9 @@ // and m_is_free_signal (whether VC is free or not) Credit::Credit(int vc, bool is_free_signal, Tick curTime) +: flit(0, vc, 0, RouteInfo(), 0, nullptr, 0, 0, curTime) { -m_id = 0; -m_vc = vc; m_is_free_signal = is_free_signal; -m_time = curTime; m_type = CREDIT_; } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32598 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ib73c652c71a10be57b24c0d6e1ac22eafa421e11 Gerrit-Change-Number: 32598 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Michael LeBeane Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-ruby: make simplenetwork compatible with garnet3.0 topologies
Hello John Alsop, I'd like you to do a code review. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/32306 to review the following change. Change subject: mem-ruby: make simplenetwork compatible with garnet3.0 topologies .. mem-ruby: make simplenetwork compatible with garnet3.0 topologies 1) To support controllers with multiple outgoing links (added in garnet 3.0), only connect a message buffer to a controller if the vnet in that message buffer matches the vnets assigned to the link. This is needed to support controllers with multiple outgoing links (added in garnet 3.0). Similarly, a separate routing table must be managed for each vnet at each simple network router. 2) Dummy parameters must be added for garnet-specific members in network base classes to prevent errors. Change-Id: I78cfce99edf73cd647c05ef7a3a619218493d9de --- M src/mem/ruby/network/BasicLink.py M src/mem/ruby/network/garnet2.0/GarnetLink.py M src/mem/ruby/network/simple/PerfectSwitch.cc M src/mem/ruby/network/simple/PerfectSwitch.hh M src/mem/ruby/network/simple/SimpleNetwork.cc M src/mem/ruby/network/simple/SimpleNetwork.py M src/mem/ruby/network/simple/Switch.cc M src/mem/ruby/network/simple/Switch.hh 8 files changed, 63 insertions(+), 30 deletions(-) diff --git a/src/mem/ruby/network/BasicLink.py b/src/mem/ruby/network/BasicLink.py index 2718aa6..b9ded1f 100644 --- a/src/mem/ruby/network/BasicLink.py +++ b/src/mem/ruby/network/BasicLink.py @@ -39,6 +39,16 @@ weight = Param.Int(1, "used to restrict routing in shortest path analysis") supported_vnets = VectorParam.Int([-1], "Vnets supported Default:All(-1)") +# dummy variables for compatibility with garnet topology +ext_cdc = Param.Bool(False, "Dummy") +int_cdc = Param.Bool(False, "Dummy") +ext_serdes = Param.Bool(False, "Dummy") +int_serdes = Param.Bool(False, "Dummy") +src_serdes = Param.Bool(False, "Dummy") +dst_serdes = Param.Bool(False, "Dummy") +width = Param.UInt32(0, "Dummy") +vcs_per_vnet = Param.Int(0, "Dummy") + class BasicExtLink(BasicLink): type = 'BasicExtLink' cxx_header = "mem/ruby/network/BasicLink.hh" @@ -46,6 +56,12 @@ int_node = Param.BasicRouter("ID of internal node") bandwidth_factor = 16 # only used by simple network +# only used by Garnet. +ext_cdc = Param.Bool(False, "Enable CDC") +int_cdc = Param.Bool(False, "Enable CDC") +ext_serdes = Param.Bool(False, "Enable CDC") +int_serdes = Param.Bool(False, "Enable CDC") + class BasicIntLink(BasicLink): type = 'BasicIntLink' cxx_header = "mem/ruby/network/BasicLink.hh" @@ -55,6 +71,10 @@ # only used by Garnet. src_outport = Param.String("", "Outport direction at src router") dst_inport = Param.String("", "Inport direction at dst router") +src_cdc = Param.Bool(False, "Enable CDC") +dst_cdc = Param.Bool(False, "Enable CDC") +src_serdes = Param.Bool(False, "Enable CDC") +dst_serdes = Param.Bool(False, "Enable CDC") # only used by simple network bandwidth_factor = 16 diff --git a/src/mem/ruby/network/garnet2.0/GarnetLink.py b/src/mem/ruby/network/garnet2.0/GarnetLink.py index 769680c..f356d97 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetLink.py +++ b/src/mem/ruby/network/garnet2.0/GarnetLink.py @@ -64,17 +64,11 @@ network_link = Param.NetworkLink(NetworkLink(), "forward link") credit_link = Param.CreditLink(CreditLink(), "backward flow-control link") -src_cdc = Param.Bool(False, "Enable CDC") -dst_cdc = Param.Bool(False, "Enable CDC") - src_net_bridge = Param.NetworkBridge("Network CDC at source") dst_net_bridge = Param.NetworkBridge("Network CDC at dest") src_cred_bridge = Param.NetworkBridge("Credit CDC at source") dst_cred_bridge = Param.NetworkBridge("Credit CDC at dest") -src_serdes = Param.Bool(False, "Enable CDC") -dst_serdes = Param.Bool(False, "Enable CDC") - width = Param.UInt32(Parent.ni_flit_size, "bit width supported by the router") @@ -100,16 +94,10 @@ _cls.append(CreditLink()); credit_links = VectorParam.CreditLink(_cls, "backward flow-control links") -ext_cdc = Param.Bool(False, "Enable CDC") -int_cdc = Param.Bool(False, "Enable CDC") - ext_net_bridge = VectorParam.NetworkBridge("CDC to reach the consumers") ext_cred_bridge = VectorParam.NetworkBridge("CDC to reach the consumers") int_net_bridge = VectorParam.NetworkBridge("CDC to reach the consumers") int_cred_bridge = VectorParam.NetworkBridge("CDC to reach the consumers") -ext_serdes = Param.Bool(False, "Enable CDC") -int_serdes = Param.Bool(False, "Enable CDC") - width = Param.UInt32(Parent.ni_flit_size, "bit width supported by the router") diff --git a/src/mem/ruby/network/simple/PerfectSwitch.cc
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Fix scheduling of links in case of multiple physical links
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32304 ) Change subject: mem-garnet: Fix scheduling of links in case of multiple physical links .. mem-garnet: Fix scheduling of links in case of multiple physical links Network Interface must be able to schedule flits in all physical links in every cycle. Earlier implementation did not allow it. This patch fixes to let NI schedule a flit for every link. Each output port maintains its own round robin arbiter. Change-Id: Ie41a2d03b0115f081d2cc5a5f9f1865eda88576e --- M src/mem/ruby/network/garnet2.0/NetworkInterface.cc M src/mem/ruby/network/garnet2.0/NetworkInterface.hh 2 files changed, 59 insertions(+), 38 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/NetworkInterface.cc b/src/mem/ruby/network/garnet2.0/NetworkInterface.cc index 85a161c..5cb61d3 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkInterface.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkInterface.cc @@ -48,7 +48,6 @@ : ClockedObject(p), Consumer(this), m_id(p->id), m_virtual_networks(p->virt_nets), m_vc_per_vnet(0), m_vc_allocator(m_virtual_networks, 0), -m_vc_round_robin(0), m_deadlock_threshold(p->garnet_deadlock_threshold), vc_busy_counter(m_virtual_networks, 0) { @@ -485,51 +484,59 @@ void NetworkInterface::scheduleOutputLink() { -int vc = m_vc_round_robin; +// Schedule each output link +for (auto : outPorts) { +int vc = oPort->vcRoundRobin(); -for (int i = 0; i < niOutVcs.size(); i++) { -vc++; -if (vc == niOutVcs.size()) -vc = 0; +for (int i = 0; i < m_num_vcs; i++) { +vc++; +if (vc == m_num_vcs) +vc = 0; -// model buffer backpressure -if (niOutVcs[vc].isReady(curTick()) && -outVcState[vc].has_credit()) { - -bool is_candidate_vc = true; int t_vnet = get_vnet(vc); -int vc_base = t_vnet * m_vc_per_vnet; +if (oPort->isVnetSupported(t_vnet)) { +// model buffer backpressure +if (m_ni_out_vcs[vc]->isReady(curTick()) && +m_out_vc_state[vc]->has_credit()) { -if (m_net_ptr->isVNetOrdered(t_vnet)) { -for (int vc_offset = 0; vc_offset < m_vc_per_vnet; - vc_offset++) { -int t_vc = vc_base + vc_offset; -if (niOutVcs[t_vc].isReady(curTick())) { -if (m_ni_out_vcs_enqueue_time[t_vc] < -m_ni_out_vcs_enqueue_time[vc]) { -is_candidate_vc = false; -break; +bool is_candidate_vc = true; +int vc_base = t_vnet * m_vc_per_vnet; + +if (m_net_ptr->isVNetOrdered(t_vnet)) { +for (int vc_offset = 0; vc_offset < m_vc_per_vnet; + vc_offset++) { +int t_vc = vc_base + vc_offset; +if (niOutVcs[t_vc].isReady(curTick())) { +if (m_ni_out_vcs_enqueue_time[t_vc] < +m_ni_out_vcs_enqueue_time[vc]) { +is_candidate_vc = false; +break; +} +} } } +if (!is_candidate_vc) +continue; + +// Update the round robin arbiter +oPort->vcRoundRobin(vc); + +outVcState[vc].decrement_credit(); +// Just removing the flit +flit *t_flit = m_ni_out_vcs[vc]->getTopFlit(); +t_flit->set_time(clockEdge(Cycles(1))); +scheduleFlit(t_flit); + +if (t_flit->get_type() == TAIL_ || + t_flit->get_type() == HEAD_TAIL_) { +m_ni_out_vcs_enqueue_time[vc] = Tick(INFINITE_); +} +goto donePort; } } -if (!is_candidate_vc) -continue; - -m_vc_round_robin = vc; - -outVcState[vc].decrement_credit(); -// Just removing the flit -flit *t_flit = niOutVcs[vc].getTopFlit(); -t_flit->set_time(clockEdge(Cycles(1))); -scheduleFlit(t_flit); - -if (t_flit->get_type() == TAIL_ || - t_flit->get_type() == HEAD_TAIL_) { -m_ni_out_vcs_enqueue_time[vc] = Tick(INFINITE_); -} -return; } +donePort: +continue; } } diff --git a/src/mem/ruby/network/garnet2.0/NetworkInterface.hh
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-ruby: Check number of vnets when creating links
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32307 ) Change subject: mem-ruby: Check number of vnets when creating links .. mem-ruby: Check number of vnets when creating links Added error checking to ensure that the system has sufficient virtual networks when setting latency and weight values. Change-Id: I1b28144bbe9fefab0c0a6227f1fdf4ea10403061 --- M src/mem/ruby/network/Topology.cc 1 file changed, 2 insertions(+), 0 deletions(-) diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index b267db1..c45dd9d 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -165,6 +165,8 @@ } else { for (int v = 0; v < link->mVnets.size(); v++) { int vnet = link->mVnets[v]; +fatal_if(vnet >= m_vnets, "Not enough virtual networks " + "(setting latency and weight for vnet %d)", vnet); // Two links connecting same src and destination // cannot carry same vnets. fatal_if(vnet_done[vnet], "Two links connecting same src" -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32307 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: I1b28144bbe9fefab0c0a6227f1fdf4ea10403061 Gerrit-Change-Number: 32307 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Add a check to see if router is already scheduled
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32302 ) Change subject: mem-garnet: Add a check to see if router is already scheduled .. mem-garnet: Add a check to see if router is already scheduled Currently the Switch Allocator takes up most of the simulation wall clock time. This function checks for all VCs to see if it should wakeup next. The input units which are simulated before the switch allocator could have scheduled it already. This patch adds a check for it. Change-Id: I8609d4e7f925aa5e97198f6cd07466530f6fcf4c --- M src/mem/ruby/network/garnet2.0/SwitchAllocator.cc 1 file changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 144f208..3241343 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -350,6 +350,10 @@ { Tick nextCycle = m_router->clockEdge(Cycles(1)); +if (m_router->alreadyScheduled(nextCycle)) { +return; +} + for (int i = 0; i < m_num_inports; i++) { for (int j = 0; j < m_num_vcs; j++) { if (m_router->getInputUnit(i)->need_stage(j, SA_, nextCycle)) { -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32302 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: I8609d4e7f925aa5e97198f6cd07466530f6fcf4c Gerrit-Change-Number: 32302 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Separable allocator in Garnet not fair enough.
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32303 ) Change subject: mem-garnet: Separable allocator in Garnet not fair enough. .. mem-garnet: Separable allocator in Garnet not fair enough. Currently there are independent round robin arbiter at each input port and output port. Every time a VC is selected for output allocation round robin is incremented irrespective of if it is selected by its output port or not. This leads to unfair arbitration at input port and is well known[1]. This patch fixes it to increment only if the output port also selects it. [1] D. U. Becker and W. J. Dally, "Allocator implementations for network-on-chip routers," Proceedings of the Conference on High Performance Computing Networking, Storage and Analysis, Portland, OR, 2009, pp. 1-12 Change-Id: I65963fb8082c51c0e3c6e031a8b87b4f5c3626e1 --- M src/mem/ruby/network/garnet2.0/SwitchAllocator.cc 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 3241343..1ed6de1 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -130,11 +130,6 @@ m_port_requests[outport][inport] = true; m_vc_winners[outport][inport]= invc; -// Update Round Robin pointer to the next VC -m_round_robin_invc[inport] = invc + 1; -if (m_round_robin_invc[inport] >= m_num_vcs) -m_round_robin_invc[inport] = 0; - break; // got one vc winner for this port } } @@ -248,6 +243,15 @@ if (m_round_robin_inport[outport] >= m_num_inports) m_round_robin_inport[outport] = 0; +// Update Round Robin pointer to the next VC +// We do it here to keep it fair. +// Only the VC which got switch traversal +// is updated. +m_round_robin_invc[inport] = invc + 1; +if (m_round_robin_invc[inport] >= m_num_vcs) +m_round_robin_invc[inport] = 0; + + break; // got a input winner for this outport } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32303 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: I65963fb8082c51c0e3c6e031a8b87b4f5c3626e1 Gerrit-Change-Number: 32303 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Allow simulataneous enqueue in case of multiple links
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32305 ) Change subject: mem-garnet: Allow simulataneous enqueue in case of multiple links .. mem-garnet: Allow simulataneous enqueue in case of multiple links HeteroGarnet allows multiple links connected to controllers. But we did not support multiple enqueue leading to bottlenecks after the flit reaches Network Interface. We should allow multiple enqueue for disjoint links. Change-Id: Id2bc56eada85c620d3eed9b3cc05af5ab5c33903 --- M src/mem/ruby/network/garnet2.0/NetworkInterface.cc M src/mem/ruby/network/garnet2.0/NetworkInterface.hh 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/NetworkInterface.cc b/src/mem/ruby/network/garnet2.0/NetworkInterface.cc index 5cb61d3..190aabe 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkInterface.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkInterface.cc @@ -219,7 +219,7 @@ // Check if there are flits stalling a virtual channel. Track if a // message is enqueued to restrict ejection to one message per cycle. -bool messageEnqueuedThisCycle = checkStallQueue(); +checkStallQueue(); /*** Check the incoming flit link **/ DPRINTF(RubyNetwork, "Number of input ports: %d\n", inPorts.size()); @@ -238,7 +238,7 @@ // credits. if (t_flit->get_type() == TAIL_ || t_flit->get_type() == HEAD_TAIL_) { -if (!messageEnqueuedThisCycle && +if (!iPort->messageEnqueuedThisCycle && outNode_ptr[vnet]->areNSlotsAvailable(1, curTime)) { // Space is available. Enqueue to protocol buffer. outNode_ptr[vnet]->enqueue(t_flit->get_msg_ptr(), curTime, @@ -257,7 +257,7 @@ // set up a callback for when protocol buffer is dequeued. // Stat update and flit pointer deletion will occur upon // unstall. -m_stall_queue.push_back(t_flit); +iPort->m_stall_queue.push_back(t_flit); m_stall_count[vnet]++; auto cb = std::bind(::dequeueCallback, @@ -311,55 +311,56 @@ checkReschedule(); } -bool +void NetworkInterface::checkStallQueue() { -bool messageEnqueuedThisCycle = false; -Tick curTime = clockEdge(); +// Check all stall queues. +// There is one stall queue for each input link +for (auto : inPorts) { +iPort->messageEnqueuedThisCycle = false; +Tick curTime = clockEdge(); -if (!m_stall_queue.empty()) { -for (auto stallIter = m_stall_queue.begin(); - stallIter != m_stall_queue.end(); ) { -flit *stallFlit = *stallIter; -int vnet = stallFlit->get_vnet(); +if (!iPort->m_stall_queue.empty()) { +for (auto stallIter = iPort->m_stall_queue.begin(); + stallIter != iPort->m_stall_queue.end(); ) { +flit *stallFlit = *stallIter; +int vnet = stallFlit->get_vnet(); -// If we can now eject to the protocol buffer, send back credits -if (outNode_ptr[vnet]->areNSlotsAvailable(1, curTime)) { -outNode_ptr[vnet]->enqueue(stallFlit->get_msg_ptr(), curTime, - cyclesToTicks(Cycles(1))); +// If we can now eject to the protocol buffer, +// send back credits +if (outNode_ptr[vnet]->areNSlotsAvailable(1, +curTime)) { +outNode_ptr[vnet]->enqueue(stallFlit->get_msg_ptr(), +curTime, cyclesToTicks(Cycles(1))); -// Send back a credit with free signal now that the VC is no -// longer stalled. -Credit *cFlit = new Credit(stallFlit->get_vc(), true, - curTick()); -InputPort *iPort = getInportForVnet(vnet); -assert(iPort); +// Send back a credit with free signal now that the +// VC is no longer stalled. +Credit *cFlit = new Credit(stallFlit->get_vc(), true, + curTick()); +iPort->sendCredit(cFlit); -iPort->sendCredit(cFlit); +// Update Stats +incrementStats(stallFlit); -// Update Stats -incrementStats(stallFlit); +// Flit can now safely be deleted and removed from stall +// queue +delete stallFlit; +iPort->m_stall_queue.erase(stallIter); +m_stall_count[vnet]--; -//
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Improve debug messages within Garnet
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32300 ) Change subject: mem-garnet: Improve debug messages within Garnet .. mem-garnet: Improve debug messages within Garnet This patch clears up some redundant debug messages and adds some more clarity in existing logs. Change-Id: I5d351e5a1d64234cc3880b59b1d5992f91b579f2 --- M src/mem/ruby/network/garnet2.0/NetworkInterface.cc M src/mem/ruby/network/garnet2.0/NetworkLink.cc M src/mem/ruby/network/garnet2.0/Router.cc 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/NetworkInterface.cc b/src/mem/ruby/network/garnet2.0/NetworkInterface.cc index 81c062f..85a161c 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkInterface.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkInterface.cc @@ -223,11 +223,9 @@ bool messageEnqueuedThisCycle = checkStallQueue(); /*** Check the incoming flit link **/ -DPRINTF(RubyNetwork, "Number of iPorts: %d\n", inPorts.size()); +DPRINTF(RubyNetwork, "Number of input ports: %d\n", inPorts.size()); for (auto : inPorts) { NetworkLink *inNetLink = iPort->inNetLink(); -DPRINTF(RubyNetwork, "Checking input port:%s with vnets %s\n", -inNetLink->name(), iPort->printVnets()); if (inNetLink->isReady(curTick())) { flit *t_flit = inNetLink->consumeLink(); DPRINTF(RubyNetwork, "Recieved flit:%s\n", *t_flit); @@ -286,8 +284,6 @@ for (auto : outPorts) { CreditLink *inCreditLink = oPort->inCreditLink(); -DPRINTF(RubyNetwork, "Checking input port:%s with vnets %s\n", -inCreditLink->name(), oPort->printVnets()); if (inCreditLink->isReady(curTick())) { Credit *t_credit = (Credit*) inCreditLink->consumeLink(); outVcState[t_credit->get_vc()].increment_credit(); @@ -306,7 +302,8 @@ // back. for (auto : inPorts) { if (iPort->outCreditQueue()->getSize() > 0) { -DPRINTF(RubyNetwork, "Sending a credit via %s at %ld\n", +DPRINTF(RubyNetwork, "Sending a credit %s via %s at %ld\n", +*(iPort->outCreditQueue()->peekTopFlit()), iPort->outCreditLink()->name(), clockEdge(Cycles(1))); iPort->outCreditLink()-> scheduleEventAbsolute(clockEdge(Cycles(1))); diff --git a/src/mem/ruby/network/garnet2.0/NetworkLink.cc b/src/mem/ruby/network/garnet2.0/NetworkLink.cc index 11ac4cb..cb00943 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkLink.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkLink.cc @@ -78,10 +78,10 @@ assert(curTick() == clockEdge()); if (link_srcQueue->isReady(curTick())) { flit *t_flit = link_srcQueue->getTopFlit(); +DPRINTF(RubyNetwork, "Transmission will finish at %ld :%s\n", +clockEdge(m_latency), *t_flit); if (m_type != NUM_LINK_TYPES_) { // Only for assertions and debug messages -DPRINTF(RubyNetwork, "Transmitting at %ld :%s\n", -clockEdge(m_latency), *t_flit); assert(t_flit->m_width == bitWidth); assert((std::find(mVnets.begin(), mVnets.end(), t_flit->get_vnet()) != mVnets.end()) || diff --git a/src/mem/ruby/network/garnet2.0/Router.cc b/src/mem/ruby/network/garnet2.0/Router.cc index 523680e..9802b69 100644 --- a/src/mem/ruby/network/garnet2.0/Router.cc +++ b/src/mem/ruby/network/garnet2.0/Router.cc @@ -93,9 +93,6 @@ Router::addInPort(PortDirection inport_dirn, NetworkLink *in_link, CreditLink *credit_link) { -DPRINTF(RubyNetwork, "%d == %d? %s\n", in_link->bitWidth, -m_bit_width, in_link->name()); - fatal_if(in_link->bitWidth != m_bit_width, "Widths of link %s(%d)does" " not match that of Router%d(%d). Consider inserting SerDes " "Units.", in_link->name(), in_link->bitWidth, m_id, m_bit_width); @@ -121,11 +118,6 @@ std::vector& routing_table_entry, int link_weight, CreditLink *credit_link, uint32_t consumerVcs) { -DPRINTF(RubyNetwork, "%d == %d? %s\n", out_link->bitWidth, -m_bit_width, out_link->name()); -DPRINTF(RubyNetwork, "Consumer %s VC: %d\n", out_link->name(), -consumerVcs); - fatal_if(out_link->bitWidth != m_bit_width, "Widths of units do not match." " Consider inserting SerDes Units"); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32300 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: I5d351e5a1d64234cc3880b59b1d5992f91b579f2 Gerrit-Change-Number: 32300 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType:
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-ruby: fix compilation error of uninitialized 'vnet_done'
Hello Xianwei Zhang, I'd like you to do a code review. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/32301 to review the following change. Change subject: mem-ruby: fix compilation error of uninitialized 'vnet_done' .. mem-ruby: fix compilation error of uninitialized 'vnet_done' Encountered compilation error: variable-sized object 'vnet_done' may not be initialized. To fix, this patch replaces the array with a vector. Change-Id: If72e52a023c75e2f6df871d339df0d0919dfe2d1 --- M src/mem/ruby/network/Topology.cc 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index e1622d8..b267db1 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -142,7 +142,7 @@ for (LinkMap::const_iterator i = m_link_map.begin(); i != m_link_map.end(); ++i) { std::pair src_dest = (*i).first; -bool vnet_done[m_vnets] = { 0 }; +vector vnet_done(m_vnets, 0); int src = src_dest.first; int dst = src_dest.second; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32301 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: If72e52a023c75e2f6df871d339df0d0919dfe2d1 Gerrit-Change-Number: 32301 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Xianwei Zhang Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Flexible VCs per Vnet for each router
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32299 ) Change subject: mem-garnet: Flexible VCs per Vnet for each router .. mem-garnet: Flexible VCs per Vnet for each router This change allows configuring each router with a certain number of VCs for each VNET. This is beneficial when dealing with heterogenous link widths in a system. Configuring VCs for each router allows one to ensure equal throuput within the network while avoiding head-of-line blocking. Changing a router's VCs number can be done in topology files using the vcs_per_vnet value argument of router. Change-Id: Icf4f510248128429a1a11f19f9802ee96f340611 --- M src/mem/ruby/network/garnet2.0/GarnetNetwork.cc M src/mem/ruby/network/garnet2.0/GarnetNetwork.hh M src/mem/ruby/network/garnet2.0/NetworkBridge.cc M src/mem/ruby/network/garnet2.0/NetworkBridge.hh M src/mem/ruby/network/garnet2.0/NetworkInterface.cc M src/mem/ruby/network/garnet2.0/NetworkInterface.hh M src/mem/ruby/network/garnet2.0/NetworkLink.cc M src/mem/ruby/network/garnet2.0/NetworkLink.hh M src/mem/ruby/network/garnet2.0/OutVcState.cc M src/mem/ruby/network/garnet2.0/OutVcState.hh M src/mem/ruby/network/garnet2.0/OutputUnit.cc M src/mem/ruby/network/garnet2.0/OutputUnit.hh M src/mem/ruby/network/garnet2.0/Router.cc M src/mem/ruby/network/garnet2.0/Router.hh 14 files changed, 127 insertions(+), 54 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc index ca9e26f..3e3852a 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc @@ -58,7 +58,7 @@ { m_num_rows = p->num_rows; m_ni_flit_size = p->ni_flit_size; -m_vcs_per_vnet = p->vcs_per_vnet; +m_max_vcs_per_vnet = 0; m_buffers_per_data_vc = p->buffers_per_data_vc; m_buffers_per_ctrl_vc = p->buffers_per_ctrl_vc; m_routing_algorithm = p->routing_algorithm; @@ -166,15 +166,19 @@ PortDirection dst_inport_dirn = "Local"; +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, + (uint32_t) m_routers[dest]->get_vc_per_vnet()); + if (garnet_link->extBridgeEn) { DPRINTF(RubyNetwork, "Enable external bridge for %s\n", garnet_link->name()); m_nis[local_src]-> addOutPort(garnet_link->extNetBridge[LinkDirection_In], garnet_link->extCredBridge[LinkDirection_In], - dest); + dest, m_routers[dest]->get_vc_per_vnet()); } else { -m_nis[local_src]->addOutPort(net_link, credit_link, dest); +m_nis[local_src]->addOutPort(net_link, credit_link, dest, +m_routers[dest]->get_vc_per_vnet()); } if (garnet_link->intBridgeEn) { @@ -218,6 +222,9 @@ PortDirection src_outport_dirn = "Local"; +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, + (uint32_t) m_routers[src]->get_vc_per_vnet()); + if (garnet_link->extBridgeEn) { DPRINTF(RubyNetwork, "Enable external bridge for %s\n", garnet_link->name()); @@ -235,12 +242,14 @@ addOutPort(src_outport_dirn, garnet_link->intNetBridge[LinkDirection_Out], routing_table_entry, link->m_weight, - garnet_link->intCredBridge[LinkDirection_Out]); + garnet_link->intCredBridge[LinkDirection_Out], + m_routers[src]->get_vc_per_vnet()); } else { m_routers[src]-> addOutPort(src_outport_dirn, net_link, routing_table_entry, - link->m_weight, credit_link); + link->m_weight, credit_link, + m_routers[src]->get_vc_per_vnet()); } } @@ -265,6 +274,10 @@ m_networklinks.push_back(net_link); m_creditlinks.push_back(credit_link); +m_max_vcs_per_vnet = std::max(m_max_vcs_per_vnet, +std::max((uint32_t) m_routers[dest]->get_vc_per_vnet(), +(uint32_t) m_routers[src]->get_vc_per_vnet())); + if (garnet_link->dstBridgeEn) { DPRINTF(RubyNetwork, "Enable destination bridge for %s\n", garnet_link->name()); @@ -280,11 +293,13 @@ m_routers[src]-> addOutPort(src_outport_dirn, garnet_link->srcNetBridge, routing_table_entry, - link->m_weight, garnet_link->srcCredBridge); + link->m_weight, garnet_link->srcCredBridge, + m_routers[dest]->get_vc_per_vnet()); } else { m_routers[src]->addOutPort(src_outport_dirn, net_link, routing_table_entry, -link->m_weight, credit_link); +link->m_weight, credit_link, +
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet:Fix Serdes credit bug
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32295 ) Change subject: mem-garnet:Fix Serdes credit bug .. mem-garnet:Fix Serdes credit bug This patch fixes the way we convert flits for the cases when message sizes are not multiples of link width sizes. Change-Id: I634ca8105d3025ba38b353da95dbd57389f2c0c9 --- M src/mem/ruby/network/garnet2.0/NetworkBridge.cc M src/mem/ruby/network/garnet2.0/OutputUnit.cc M src/mem/ruby/network/garnet2.0/Router.cc M src/mem/ruby/network/garnet2.0/flit.cc 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/NetworkBridge.cc b/src/mem/ruby/network/garnet2.0/NetworkBridge.cc index 3c834d9..0073c65 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkBridge.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkBridge.cc @@ -113,15 +113,15 @@ // Serialize-Deserialize only if it is enabled if (enSerDes) { // Calculate the target-width -uint32_t target_width = bitWidth; -uint32_t cur_width = nLink->bitWidth; +int target_width = bitWidth; +int cur_width = nLink->bitWidth; if (mType == TO_LINK_) { target_width = nLink->bitWidth; cur_width = bitWidth; } -DPRINTF(RubyNetwork, "Target width: %d Current: %d Native: %d\n", -target_width, cur_width, bitWidth); +DPRINTF(RubyNetwork, "Target width: %d Current: %d\n", +target_width, cur_width); assert(target_width != cur_width); int vc = t_flit->get_vc(); @@ -134,12 +134,17 @@ int num_flits = 0; if (t_flit->get_type() == CREDIT_) { num_flits = (int)ceil((float)target_width/(float)cur_width); +} else if (t_flit->get_type() == TAIL_ || + t_flit->get_type() == HEAD_TAIL_) { +num_flits = 1; } else { -num_flits = (int)ceil((float)t_flit->msgSize/(float)cur_width); +num_flits = (int)ceil((float)std::min(t_flit->msgSize, + target_width)/(float)cur_width); } assert(num_flits > 0); -DPRINTF(RubyNetwork, "Deserialize :%d -> %d num:%d vc:%d\n", +DPRINTF(RubyNetwork, "Deserialize :%d -> %d " +"num-flits-needed:%d vc:%d\n", cur_width, target_width, num_flits, vc); // lenBuffer acts as the buffer for deserialization @@ -154,6 +159,7 @@ // Schedule only if we are done deserializing if (fl) { +DPRINTF(RubyNetwork, "Scheduling a flit\n"); lenBuffer[vc] = 0; scheduleFlit(fl, serDesLatency); } @@ -161,8 +167,9 @@ delete t_flit; } else { // Serialize -DPRINTF(RubyNetwork, "Serialize :%d -> %d vc:%d\n", -cur_width, target_width); +DPRINTF(RubyNetwork, "Serializing flit :%d -> %d " +"(vc:%d, Original Message Size: %d)\n", +cur_width, target_width, vc, t_flit->msgSize); int num_parts = 0; if (t_flit->get_type() == CREDIT_) { @@ -170,11 +177,12 @@ num_parts = extraCredit[vc].front(); extraCredit[vc].pop(); } else { -num_parts = (int)ceil((float)t_flit->msgSize/ +num_parts = (int)ceil((float)cur_width/ (float)target_width); } assert(num_parts > 0); +DPRINTF(RubyNetwork, "Serialized into %d parts\n", num_parts); // Schedule all the flits // num_flits could be zero for credits for (int i = 0; i < num_parts; i++) { @@ -201,6 +209,7 @@ if (link_srcQueue->isReady(curTick())) { t_flit = link_srcQueue->getTopFlit(); +DPRINTF(RubyNetwork, "Recieved flit %s\n", *t_flit); flitisizeAndSend(t_flit); return; } diff --git a/src/mem/ruby/network/garnet2.0/OutputUnit.cc b/src/mem/ruby/network/garnet2.0/OutputUnit.cc index 787514f..d342eb1 100644 --- a/src/mem/ruby/network/garnet2.0/OutputUnit.cc +++ b/src/mem/ruby/network/garnet2.0/OutputUnit.cc @@ -51,12 +51,11 @@ void OutputUnit::decrement_credit(int out_vc) { -DPRINTF(RubyNetwork, "Router %d OutputUnit %d decrementing credit:%d for " -"outvc %d at time: %lld for %s\n", -m_router->get_id(), m_id, -outVcState[out_vc].get_credit_count(), -out_vc, m_router->curCycle(), -m_credit_link->name()); +DPRINTF(RubyNetwork, "Router %d OutputUnit %s decrementing credit:%d for " +"outvc %d at time: %lld for %s\n", m_router->get_id(), +
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Revamp SerDes execution.
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32298 ) Change subject: mem-garnet: Revamp SerDes execution. .. mem-garnet: Revamp SerDes execution. Earlier type of modelling creates problems when deserializing to non-multiple ratios. This change upgrades serdes to serialize and deserialize to exact message sizes. This commit also fixes some debug messages within garnet. Change-Id: I9606af75943f69fc97a768113f03e997cac92e0f --- M src/mem/ruby/network/garnet2.0/Credit.cc M src/mem/ruby/network/garnet2.0/Credit.hh M src/mem/ruby/network/garnet2.0/NetworkBridge.cc M src/mem/ruby/network/garnet2.0/NetworkBridge.hh M src/mem/ruby/network/garnet2.0/flit.cc M src/mem/ruby/network/garnet2.0/flit.hh 6 files changed, 102 insertions(+), 40 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/Credit.cc b/src/mem/ruby/network/garnet2.0/Credit.cc index 7c293cf..7619079 100644 --- a/src/mem/ruby/network/garnet2.0/Credit.cc +++ b/src/mem/ruby/network/garnet2.0/Credit.cc @@ -63,10 +63,20 @@ // So send a credit in any case return new Credit(m_vc, true, m_time); } -if (des_id % num_flits) { -return NULL; -} return new Credit(m_vc, false, m_time); } +void +Credit::print(std::ostream& out) const +{ +out << "[Credit:: "; +out << "Type=" << m_type << " "; +out << "VC=" << m_vc << " "; +out << "FreeVC=" << m_is_free_signal << " "; +out << "Set Time=" << m_time << " "; +out << "]"; +} + + + diff --git a/src/mem/ruby/network/garnet2.0/Credit.hh b/src/mem/ruby/network/garnet2.0/Credit.hh index ea5aee7..1f3c347 100644 --- a/src/mem/ruby/network/garnet2.0/Credit.hh +++ b/src/mem/ruby/network/garnet2.0/Credit.hh @@ -53,6 +53,7 @@ // Functions used by SerDes flit* serialize(int ser_id, int parts, uint32_t bWidth); flit* deserialize(int des_id, int num_flits, uint32_t bWidth); +void print(std::ostream& out) const; ~Credit() {}; diff --git a/src/mem/ruby/network/garnet2.0/NetworkBridge.cc b/src/mem/ruby/network/garnet2.0/NetworkBridge.cc index 0073c65..1cf560f 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkBridge.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkBridge.cc @@ -50,6 +50,7 @@ cdcLatency = p->cdc_latency; serDesLatency = p->serdes_latency; +lastScheduledAt = 0; nLink = p->link; if (mType == FROM_LINK_) { @@ -64,6 +65,8 @@ } lenBuffer.resize(p->vcs_per_vnet * p->virt_nets); +sizeSent.resize(p->vcs_per_vnet * p->virt_nets); +flitsSent.resize(p->vcs_per_vnet * p->virt_nets); extraCredit.resize(p->vcs_per_vnet * p->virt_nets); } @@ -96,9 +99,14 @@ totLatency = latency + cdcLatency; } -t_flit->set_time(link_consumer->getObject()->clockEdge(totLatency)); +Tick sendTime = link_consumer->getObject()->clockEdge(totLatency); +Tick nextAvailTick = lastScheduledAt + link_consumer->getObject()->\ +cyclesToTicks(Cycles(1)); +sendTime = std::max(nextAvailTick, sendTime); +t_flit->set_time(sendTime); +lastScheduledAt = sendTime; linkBuffer.insert(t_flit); -link_consumer->scheduleEvent(totLatency); +link_consumer->scheduleEventAbsolute(sendTime); } void @@ -130,29 +138,52 @@ // Deserialize // This deserializer combines flits from the // same message together -// TODO: Allow heterogenous flits int num_flits = 0; +int flitPossible = 0; if (t_flit->get_type() == CREDIT_) { -num_flits = (int)ceil((float)target_width/(float)cur_width); +lenBuffer[vc]++; +assert(extraCredit[vc].front()); +if (lenBuffer[vc] == extraCredit[vc].front()) { +flitPossible = 1; +extraCredit[vc].pop(); +lenBuffer[vc] = 0; +} } else if (t_flit->get_type() == TAIL_ || t_flit->get_type() == HEAD_TAIL_) { -num_flits = 1; +// If its the end of packet, then send whatever +// is available. +int sizeAvail = (t_flit->msgSize - sizeSent[vc]); +flitPossible = ceil((float)sizeAvail/(float)target_width); +assert (flitPossible < 2); +num_flits = (t_flit->get_id() + 1) - flitsSent[vc]; +// Stop tracking the packet. +flitsSent[vc] = 0; +sizeSent[vc] = 0; } else { -num_flits = (int)ceil((float)std::min(t_flit->msgSize, - target_width)/(float)cur_width); +// If we are yet to receive the complete packet +// track the size recieved and flits deserialized. +int sizeAvail = +
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Wakeup Router instead of input unit within router
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32297 ) Change subject: mem-garnet: Wakeup Router instead of input unit within router .. mem-garnet: Wakeup Router instead of input unit within router This fixes a wakeup call within router. Input Unit is not supposed to wake up on its own. In case there is another flit in the pipeline towards the input unit of a router, it should wakeup the entire Router to process it in the next possible cycle. Change-Id: If0ad5c75379cd4ae513b32e27ea821db76eb49f6 --- M src/mem/ruby/network/garnet2.0/InputUnit.cc 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mem/ruby/network/garnet2.0/InputUnit.cc b/src/mem/ruby/network/garnet2.0/InputUnit.cc index 7df296c..db24aef 100644 --- a/src/mem/ruby/network/garnet2.0/InputUnit.cc +++ b/src/mem/ruby/network/garnet2.0/InputUnit.cc @@ -127,7 +127,7 @@ } if (m_in_link->isReady(curTick())) { -scheduleEvent(Cycles(1)); +m_router->schedule_wakeup(Cycles(1)); } } } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32297 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: If0ad5c75379cd4ae513b32e27ea821db76eb49f6 Gerrit-Change-Number: 32297 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Fix scheduling time for CDC
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32294 ) Change subject: mem-garnet: Fix scheduling time for CDC .. mem-garnet: Fix scheduling time for CDC CDC does not wakeup a consumer according to its time. Instead it was waking up the consumer according to CDC's clock domain which creates bugs when CDCs are at set at the source. This patch fixes that problem. Change-Id: Id186a518c76909a4111ca524d3b392048ff3a2be --- M src/mem/ruby/common/Consumer.hh M src/mem/ruby/network/garnet2.0/NetworkBridge.cc 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mem/ruby/common/Consumer.hh b/src/mem/ruby/common/Consumer.hh index 3688021..c4332cf 100644 --- a/src/mem/ruby/common/Consumer.hh +++ b/src/mem/ruby/common/Consumer.hh @@ -81,6 +81,13 @@ return sem->name(); } +ClockedObject * +getObject() +{ +return em; +} + + void scheduleEventAbsolute(Tick timeAbs); void scheduleEvent(Cycles timeDelta); diff --git a/src/mem/ruby/network/garnet2.0/NetworkBridge.cc b/src/mem/ruby/network/garnet2.0/NetworkBridge.cc index 7438dd9..3c834d9 100644 --- a/src/mem/ruby/network/garnet2.0/NetworkBridge.cc +++ b/src/mem/ruby/network/garnet2.0/NetworkBridge.cc @@ -96,7 +96,7 @@ totLatency = latency + cdcLatency; } -t_flit->set_time(clockEdge(totLatency)); +t_flit->set_time(link_consumer->getObject()->clockEdge(totLatency)); linkBuffer.insert(t_flit); link_consumer->scheduleEvent(totLatency); } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32294 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: Id186a518c76909a4111ca524d3b392048ff3a2be Gerrit-Change-Number: 32294 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Initialize unused Credit members
Hello Michael LeBeane, I'd like you to do a code review. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/32296 to review the following change. Change subject: mem-garnet: Initialize unused Credit members .. mem-garnet: Initialize unused Credit members The Credit class doesn't initialize a number of its unused base class fields. This leads to non-determanistic traces when printing flits that are Credits. This patch initializes all unused fields to 0. Change-Id: Ib73c652c71a10be57b24c0d6e1ac22eafa421e11 --- M src/mem/ruby/network/garnet2.0/CommonTypes.hh M src/mem/ruby/network/garnet2.0/Credit.cc 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mem/ruby/network/garnet2.0/CommonTypes.hh b/src/mem/ruby/network/garnet2.0/CommonTypes.hh index 72febed..bc80131 100644 --- a/src/mem/ruby/network/garnet2.0/CommonTypes.hh +++ b/src/mem/ruby/network/garnet2.0/CommonTypes.hh @@ -47,6 +47,11 @@ struct RouteInfo { +RouteInfo() +: vnet(0), src_ni(0), src_router(0), dest_ni(0), dest_router(0), + hops_traversed(0) +{} + // destination format for table-based routing int vnet; NetDest net_dest; diff --git a/src/mem/ruby/network/garnet2.0/Credit.cc b/src/mem/ruby/network/garnet2.0/Credit.cc index 868f622..7c293cf 100644 --- a/src/mem/ruby/network/garnet2.0/Credit.cc +++ b/src/mem/ruby/network/garnet2.0/Credit.cc @@ -35,11 +35,9 @@ // and m_is_free_signal (whether VC is free or not) Credit::Credit(int vc, bool is_free_signal, Tick curTime) +: flit(0, vc, 0, RouteInfo(), 0, nullptr, 0, 0, curTime) { -m_id = 0; -m_vc = vc; m_is_free_signal = is_free_signal; -m_time = curTime; m_type = CREDIT_; } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32296 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: Ib73c652c71a10be57b24c0d6e1ac22eafa421e11 Gerrit-Change-Number: 32296 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Michael LeBeane Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: mem-garnet: Fix topology initialization bug
Hello Onur Kayıran, I'd like you to do a code review. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/32276 to review the following change. Change subject: mem-garnet: Fix topology initialization bug .. mem-garnet: Fix topology initialization bug This change fixes an issue when links are iterated during topology initialization. The bug falsely can cause an assert statement to be true when multiple physical links between the same source-destination pair are used. Change-Id: Idd3fcd1ade7bab6d24391cc20f79643167be087a --- M src/mem/ruby/network/Topology.cc 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index 1c8497f..e1622d8 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -167,7 +167,7 @@ int vnet = link->mVnets[v]; // Two links connecting same src and destination // cannot carry same vnets. -fatal_if(vnet_done[v], "Two links connecting same src" +fatal_if(vnet_done[vnet], "Two links connecting same src" " and destination cannot support same vnets"); component_latencies[src][dst][vnet] = link->m_latency; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/32276 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: feature-heterogarnet Gerrit-Change-Id: Idd3fcd1ade7bab6d24391cc20f79643167be087a Gerrit-Change-Number: 32276 Gerrit-PatchSet: 1 Gerrit-Owner: Srikant Bharadwaj Gerrit-Reviewer: Onur Kayıran Gerrit-MessageType: newchange ___ gem5-dev mailing list -- gem5-dev@gem5.org To unsubscribe send an email to gem5-dev-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-dev] Change in gem5/gem5[feature-heterogarnet]: ruby: Optimal matrix iteration for topology weight tree
Srikant Bharadwaj has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/32275 ) Change subject: ruby: Optimal matrix iteration for topology weight tree .. ruby: Optimal matrix iteration for topology weight tree This change updates the way we iterate the weight tree when calculating the shortest distance tree for a given topology. Instead of parsing over all vnets for a given pair of source and destination, we now split it into pairs for each vnet reflective of how the algorithm accesses values. Change-Id: Iad15c9b2406d2bf026b3ef2a70c0ba0fad4b03a5 --- M src/mem/ruby/network/Topology.cc 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index 3e8d00c..1c8497f 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -121,9 +121,9 @@ // Initialize weight, latency, and inter switched vectors int num_switches = max_switch_id+1; -Matrix topology_weights(num_switches, +Matrix topology_weights(m_vnets, vector>(num_switches, -vector(m_vnets, INFINITE_LATENCY))); +vector(num_switches, INFINITE_LATENCY))); Matrix component_latencies(num_switches, vector>(num_switches, vector(m_vnets, -1))); @@ -132,9 +132,9 @@ vector(m_vnets, 0))); // Set identity weights to zero -for (int i = 0; i < topology_weights.size(); i++) { +for (int i = 0; i < topology_weights[0].size(); i++) { for (int v = 0; v < m_vnets; v++) { -topology_weights[i][i][v] = 0; +topology_weights[v][i][i] = 0; } } @@ -159,7 +159,7 @@ " and destination cannot support same vnets"); component_latencies[src][dst][v] = link->m_latency; -topology_weights[src][dst][v] = link->m_weight; +topology_weights[v][src][dst] = link->m_weight; vnet_done[v] = true; } } else { @@ -171,7 +171,7 @@ " and destination cannot support same vnets"); component_latencies[src][dst][vnet] = link->m_latency; -topology_weights[src][dst][vnet] = link->m_weight; +topology_weights[vnet][src][dst] = link->m_weight; vnet_done[vnet] = true; } } @@ -182,8 +182,8 @@ Matrix dist = shortest_path(topology_weights, component_latencies, component_inter_switches); -for (int i = 0; i < topology_weights.size(); i++) { -for (int j = 0; j < topology_weights[i].size(); j++) { +for (int i = 0; i < topology_weights[0].size(); i++) { +for (int j = 0; j < topology_weights[0][i].size(); j++) { std::vector routingMap; routingMap.resize(m_vnets); @@ -193,7 +193,7 @@ bool realLink = false; for (int v = 0; v < m_vnets; v++) { -int weight = topology_weights[i][j][v]; +int weight = topology_weights[v][i][j]; if (weight > 0 && weight != INFINITE_LATENCY) { realLink = true; routingMap[v] = @@ -333,23 +333,37 @@ Topology::extend_shortest_path(Matrix _dist, Matrix , Matrix _switches) { -int nodes = current_dist.size(); +int nodes = current_dist[0].size(); // We find the shortest path for each vnet for a given pair of // source and destinations. This is done simply by traversing via // all other nodes and finding the minimum distance. for (int v = 0; v < m_vnets; v++) { +// There is a different topology for each vnet. Here we try to +// build a topology by finding the minimum number of intermediate +// switches needed to reach the destination bool change = true; while (change) { change = false; for (int i = 0; i < nodes; i++) { for (int j = 0; j < nodes; j++) { -int minimum = current_dist[i][j][v]; +// We follow an iterative process to build the shortest +// path tree: +// 1. Start from the direct connection (if there is one, +// otherwise assume a hypothetical infinite weight link). +// 2. Then we iterate through all other nodes considering +// new potential intermediate switches. If we find any +// lesser weight combination, we set(update) that as the +// new weight between the source and destination. +// 3. Repeat for all pairs of nodes. +// 4. Go to step 1 if there was any new update done in +// Step 2. +