From a74695f5bcc3dd6c424e4d708732cc686a98794d Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 30 May 2023 10:43:52 -0700 Subject: [PATCH] stdlib: Fix incorrect path and checks for DRAMsim3 There are three bugs fixed in this patch: 1. The `dram_3_dir` was missing the "dramsim3" directory. 2. Missing `not` when checking if configs is a directory. 3. Missing `not` when checking if input file is a file. Change-Id: I185f4832c1c2f1ecc4e138c148ad7969ef9b6fd4 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71058 Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power Tested-by: kokoro --- src/python/gem5/components/memory/dramsim_3.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/gem5/components/memory/dramsim_3.py b/src/python/gem5/components/memory/dramsim_3.py index e5c1877fb5..f154ba354f 100644 --- a/src/python/gem5/components/memory/dramsim_3.py +++ b/src/python/gem5/components/memory/dramsim_3.py @@ -32,6 +32,7 @@ def config_ds3(mem_type: str, num_chnls: int) -> Tuple[str, str]: os.pardir, os.pardir, "ext", + "dramsim3", "DRAMsim3", ) @@ -47,11 +48,11 @@ def config_ds3(mem_type: str, num_chnls: int) -> Tuple[str, str]: "Please navigate to `ext` and run:\n" "git clone git@github.com:umd-memsys/DRAMsim3.git" ) - elif os.path.isdir(dramsim_3_mem_configs): + elif not os.path.isdir(dramsim_3_mem_configs): raise Exception( "The `ext/DRAMsim3/configs` directory cannot be found." ) - elif os.path.isfile(input_file): + elif not os.path.isfile(input_file): raise Exception( "The configuration file '" + input_file + "' cannot be found." )