From e49a072c7d632e8f4b533d7e478b740969e61235 Mon Sep 17 00:00:00 2001 From: Kyle Roarty Date: Mon, 30 Nov 2020 14:41:59 -0600 Subject: [PATCH] gpu-compute: Use dict.get syntax for accessing buildEnv keys 37775 removed SmartDict, which is the type buildEnv used to be. Because of that change, doing buildEnv[key] with a key not in the dict returns KeyError instead of False. By using buildEnv(key, False), we are able to return False when the key isn't in the dict. Change-Id: I4aae29b95b082efb2b021f21d608f9cd1c196379 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38135 Reviewed-by: Matt Sinclair Reviewed-by: Matthew Poremba Maintainer: Matt Sinclair Maintainer: Matthew Poremba Tested-by: kokoro --- src/gpu-compute/X86GPUTLB.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpu-compute/X86GPUTLB.py b/src/gpu-compute/X86GPUTLB.py index fee9b9a9b..7e5d93222 100644 --- a/src/gpu-compute/X86GPUTLB.py +++ b/src/gpu-compute/X86GPUTLB.py @@ -36,7 +36,7 @@ from m5.proxy import * from m5.objects.ClockedObject import ClockedObject from m5.SimObject import SimObject -if buildEnv['FULL_SYSTEM']: +if buildEnv.get('FULL_SYSTEM', False): class X86PagetableWalker(SimObject): type = 'X86PagetableWalker' cxx_class = 'X86ISA::Walker' @@ -50,7 +50,7 @@ class X86GPUTLB(ClockedObject): size = Param.Int(64, "TLB size (number of entries)") assoc = Param.Int(64, "TLB associativity") - if buildEnv['FULL_SYSTEM']: + if buildEnv.get('FULL_SYSTEM', False): walker = Param.X86PagetableWalker(X86PagetableWalker(), "page table walker") -- 2.30.2