configs: Fix NULL dram-lowp regressions
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 19 Jun 2019 12:03:38 +0000 (13:03 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 20 Jun 2019 08:30:14 +0000 (08:30 +0000)
The problem arises since there are some scripts (like NULL dram
regressions) which are making use of MemConfig.py without using
Opions.py so they won't have the new enable-dram-powerdown option

Change-Id: Id9769cce2e8a25b57da76f07eeebd279a6e00440
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19268
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
configs/common/MemConfig.py

index d09869285854f50b60344c10bc6245b63692783d..3910cacbd18fa565b87e6361163e2a2fbe7290ed 100644 (file)
@@ -165,6 +165,7 @@ def config_mem(options, system):
                                          None)
     opt_elastic_trace_en = getattr(options, "elastic_trace_en", False)
     opt_mem_ranks = getattr(options, "mem_ranks", None)
+    opt_dram_powerdown = getattr(options, "enable_dram_powerdown", None)
 
     if opt_mem_type == "HMC_2500_1x32":
         HMChost = HMC.config_hmc_host_ctrl(options, system)
@@ -226,8 +227,7 @@ def config_mem(options, system):
 
             # Enable low-power DRAM states if option is set
             if issubclass(cls, m5.objects.DRAMCtrl):
-                mem_ctrl.enable_dram_powerdown = \
-                        options.enable_dram_powerdown
+                mem_ctrl.enable_dram_powerdown = opt_dram_powerdown
 
             if opt_elastic_trace_en:
                 mem_ctrl.latency = '1ns'