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/learning_gem5/part3/simple_ruby.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'configs/learning_gem5/part3') diff --git a/configs/learning_gem5/part3/simple_ruby.py b/configs/learning_gem5/part3/simple_ruby.py index bcd5044a1..0c622d070 100644 --- a/configs/learning_gem5/part3/simple_ruby.py +++ b/configs/learning_gem5/part3/simple_ruby.py @@ -45,6 +45,10 @@ import m5 # import all of the SimObjects from m5.objects import * +# Needed for running C++ threads +m5.util.addToPath('../../') +from common.FileSystemConfig import config_filesystem + # You can import ruby_caches_MI_example to use the MI_example protocol instead # of the MSI protocol from msi_caches import MyCacheSystem @@ -95,6 +99,9 @@ for cpu in system.cpu: cpu.workload = process cpu.createThreads() +# Set up the pseudo file system for the threads function above +config_filesystem(system) + # set up the root SimObject and start the simulation root = Root(full_system = False, system = system) # instantiate all of the objects we've created above -- cgit v1.2.3