From a9e40fd03af814629932468820235318da45a167 Mon Sep 17 00:00:00 2001 From: Michael Boyer Date: Tue, 28 Apr 2020 14:02:41 -0400 Subject: [PATCH] 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 --- src/mem/ruby/network/Topology.cc | 2 ++ 1 file changed, 2 insertions(+) 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" -- 2.30.2