From e2656006df442a995bf80ee03fa9700d6ec14537 Mon Sep 17 00:00:00 2001 From: Jason Lowe-Power Date: Thu, 16 May 2019 19:09:56 -0700 Subject: configs: Generalize FileSystemConfig for non se.py This patch updates the FileSystemConfig so it works with more kinds of config scripts (e.g., the Learning gem5 scripts). There are 4 main changes: - Added system as a parameter to the config_filesystem function so the function can search the system for the number of CPUs instead of relying on options from Options.py - Instead of calling redirect_paths everywhere config_filesystem is used, now it is implicitly called. - Cleaned up the Ruby scripts a bit to remove redundant calls to config_filesystem - Added a config_filesystem call to the Ruby Learning gem5 script (currently the only Learning gem5 script that requires it). In the future, I think it would be better to move the config_filesystem call into simulate.py, probably into the instantiate function. I tried to use the per-CPU configuration parameters instead of options from Options.py, but that's not possible until after the SimObject params have been finalized in instantiate. Change-Id: Ie6501a7435cfb3ac9d2b45be3722388b34063b1e Signed-off-by: Jason Lowe-Power Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18848 Reviewed-by: Daniel Carvalho Tested-by: kokoro --- configs/ruby/GPU_VIPER.py | 1 - configs/ruby/MESI_Three_Level.py | 2 -- configs/ruby/MOESI_AMD_Base.py | 1 - configs/ruby/MOESI_hammer.py | 2 -- configs/ruby/Ruby.py | 2 +- 5 files changed, 1 insertion(+), 7 deletions(-) (limited to 'configs/ruby') diff --git a/configs/ruby/GPU_VIPER.py b/configs/ruby/GPU_VIPER.py index e8e781562..52b6c28ab 100644 --- a/configs/ruby/GPU_VIPER.py +++ b/configs/ruby/GPU_VIPER.py @@ -501,7 +501,6 @@ def create_system(options, full_system, system, dma_devices, bootmem, # Register CPUs and caches for each CorePair and directory (SE mode only) if not full_system: - FileSystemConfig.config_filesystem(options) for i in xrange((options.num_cpus + 1) // 2): FileSystemConfig.register_cpu(physical_package_id = 0, core_siblings = \ diff --git a/configs/ruby/MESI_Three_Level.py b/configs/ruby/MESI_Three_Level.py index 90e9190cb..20f48db32 100644 --- a/configs/ruby/MESI_Three_Level.py +++ b/configs/ruby/MESI_Three_Level.py @@ -263,8 +263,6 @@ def create_system(options, full_system, system, dma_ports, bootmem, all_cntrls = all_cntrls + [io_controller] # Register configuration with filesystem else: - FileSystemConfig.config_filesystem(options) - for i in xrange(options.num_clusters): for j in xrange(num_cpus_per_cluster): FileSystemConfig.register_cpu(physical_package_id = 0, diff --git a/configs/ruby/MOESI_AMD_Base.py b/configs/ruby/MOESI_AMD_Base.py index a1faf1dfd..0475dcb0c 100644 --- a/configs/ruby/MOESI_AMD_Base.py +++ b/configs/ruby/MOESI_AMD_Base.py @@ -328,7 +328,6 @@ def create_system(options, full_system, system, dma_devices, bootmem, # Register CPUs and caches for each CorePair and directory (SE mode only) if not full_system: - FileSystemConfig.config_filesystem(options) for i in xrange((options.num_cpus + 1) // 2): FileSystemConfig.register_cpu(physical_package_id = 0, core_siblings = diff --git a/configs/ruby/MOESI_hammer.py b/configs/ruby/MOESI_hammer.py index 0b04980a3..9ec7124df 100644 --- a/configs/ruby/MOESI_hammer.py +++ b/configs/ruby/MOESI_hammer.py @@ -258,8 +258,6 @@ def create_system(options, full_system, system, dma_ports, bootmem, all_cntrls = all_cntrls + [io_controller] # Register configuration with filesystem else: - FileSystemConfig.config_filesystem(options) - for i in xrange(options.num_cpus): FileSystemConfig.register_cpu(physical_package_id = 0, core_siblings = [], diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index 369a4e355..2d69ac19a 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -156,7 +156,7 @@ def create_system(options, full_system, system, piobus = None, dma_ports = [], ruby = system.ruby # Generate pseudo filesystem - FileSystemConfig.config_filesystem(options) + FileSystemConfig.config_filesystem(system, options) # Create the network object (network, IntLinkClass, ExtLinkClass, RouterClass, InterfaceClass) = \ -- cgit v1.2.3