From: Michael Boyer Date: Tue, 28 Apr 2020 18:02:41 +0000 (-0400) Subject: mem-ruby: Check number of vnets when creating links X-Git-Tag: v20.1.0.0~62 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a9e40fd03af814629932468820235318da45a167;p=gem5.git 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 --- diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index 13219a547..c9a581106 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -163,6 +163,8 @@ Topology::createLinks(Network *net) } 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"