From: Michael LeBeane Date: Fri, 8 Mar 2019 19:12:36 +0000 (-0500) Subject: mem-garnet: Initialize unused Credit members X-Git-Tag: v20.1.0.0~131 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6be16d84da969319e9e25e709474e968808f39f4;p=gem5.git 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 --- 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_; }