From 6be16d84da969319e9e25e709474e968808f39f4 Mon Sep 17 00:00:00 2001 From: Michael LeBeane Date: Fri, 8 Mar 2019 14:12:36 -0500 Subject: [PATCH] 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 --- src/mem/ruby/network/garnet2.0/CommonTypes.hh | 5 +++++ src/mem/ruby/network/garnet2.0/Credit.cc | 4 +--- 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 94aa60096..643ce8cda 100644 --- a/src/mem/ruby/network/garnet2.0/CommonTypes.hh +++ b/src/mem/ruby/network/garnet2.0/CommonTypes.hh @@ -46,6 +46,11 @@ enum RoutingAlgorithm { TABLE_ = 0, XY_ = 1, CUSTOM_ = 2, 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 3e56b4ed5..bde9484b8 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_; } -- 2.30.2