From: Gabe Black Date: Tue, 1 Sep 2020 06:00:27 +0000 (-0700) Subject: configs,tests: Update configs to use compatible SE workloads. X-Git-Tag: develop-gem5-snapshot~636 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b489e49c6828f4a81d73cd1172243cf3ce542ff3;p=gem5.git configs,tests: Update configs to use compatible SE workloads. If there's no more compatible workload than the base SEWorkload class it will fall back to that for now. Change-Id: Id27172c3074a7976823a891878ab9eecf6246c47 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33901 Reviewed-by: Matthew Poremba Maintainer: Gabe Black Tested-by: kokoro --- diff --git a/configs/example/apu_se.py b/configs/example/apu_se.py index 18640c809..ba0d9ea15 100644 --- a/configs/example/apu_se.py +++ b/configs/example/apu_se.py @@ -501,7 +501,7 @@ system = System(cpu = cpu_list, mem_ranges = [AddrRange(options.mem_size)], cache_line_size = options.cacheline_size, mem_mode = mem_mode, - workload = SEWorkload()) + workload = SEWorkload.init_compatible(executable)) if fast_forward: system.future_cpu = future_cpu_list system.voltage_domain = VoltageDomain(voltage = options.sys_voltage) diff --git a/configs/example/arm/starter_se.py b/configs/example/arm/starter_se.py index d342420b5..8b1dbd2a0 100644 --- a/configs/example/arm/starter_se.py +++ b/configs/example/arm/starter_se.py @@ -171,7 +171,7 @@ def create(args): (len(processes), args.num_cores)) sys.exit(1) - system.workload = SEWorkload() + system.workload = SEWorkload.init_compatible(processes[0].executable) # Assign one workload to each CPU for cpu, workload in zip(system.cpu_cluster.cpus, processes): diff --git a/configs/example/hmc_hello.py b/configs/example/hmc_hello.py index 706fc2b68..4e4623509 100644 --- a/configs/example/hmc_hello.py +++ b/configs/example/hmc_hello.py @@ -50,7 +50,6 @@ HMC.add_options(parser) options = parser.parse_args() # create the system we are going to simulate system = System() -system.workload = SEWorkload() # use timing mode for the interaction between master-slave ports system.mem_mode = 'timing' # set the clock fequency of the system @@ -77,6 +76,8 @@ binary = 'tests/test-progs/hello/bin/' + isa + '/linux/hello' process = Process() # cmd is a list which begins with the executable (like argv) process.cmd = [binary] +# set the system workload +system.workload = SEWorkload.init_compatible(binary) # set the cpu workload system.cpu.workload = process # create thread contexts diff --git a/configs/example/se.py b/configs/example/se.py index f3fea61bd..d30679f2a 100644 --- a/configs/example/se.py +++ b/configs/example/se.py @@ -169,11 +169,12 @@ if options.smt and options.num_cpus > 1: fatal("You cannot use SMT with multiple CPUs!") np = options.num_cpus +mp0_path = multiprocesses[0].executable system = System(cpu = [CPUClass(cpu_id=i) for i in range(np)], mem_mode = test_mem_mode, mem_ranges = [AddrRange(options.mem_size)], cache_line_size = options.cacheline_size, - workload = SEWorkload()) + workload = SEWorkload.init_compatible(mp0_path)) if numThreads > 1: system.multi_thread = True diff --git a/configs/learning_gem5/part1/simple.py b/configs/learning_gem5/part1/simple.py index cb785b6e7..3e90c624a 100644 --- a/configs/learning_gem5/part1/simple.py +++ b/configs/learning_gem5/part1/simple.py @@ -94,7 +94,7 @@ thispath = os.path.dirname(os.path.realpath(__file__)) binary = os.path.join(thispath, '../../../', 'tests/test-progs/hello/bin/', isa, 'linux/hello') -system.workload = SEWorkload() +system.workload = SEWorkload.init_compatible(binary) # Create a process for a simple "Hello World" application process = Process() diff --git a/configs/learning_gem5/part1/two_level.py b/configs/learning_gem5/part1/two_level.py index 50d1d5f9e..79f87955f 100644 --- a/configs/learning_gem5/part1/two_level.py +++ b/configs/learning_gem5/part1/two_level.py @@ -137,7 +137,7 @@ system.mem_ctrl.dram = DDR3_1600_8x8() system.mem_ctrl.dram.range = system.mem_ranges[0] system.mem_ctrl.port = system.membus.master -system.workload = SEWorkload() +system.workload = SEWorkload.init_compatible(binary) # Create a process for a simple "Hello World" application process = Process() diff --git a/configs/learning_gem5/part2/simple_cache.py b/configs/learning_gem5/part2/simple_cache.py index 391de8ba7..7303a73fa 100644 --- a/configs/learning_gem5/part2/simple_cache.py +++ b/configs/learning_gem5/part2/simple_cache.py @@ -84,8 +84,6 @@ system.mem_ctrl.port = system.membus.master # Connect the system up to the membus system.system_port = system.membus.slave -system.workload = SEWorkload() - # Create a process for a simple "Hello World" application process = Process() # Set the command @@ -99,6 +97,8 @@ process.cmd = [binpath] system.cpu.workload = process system.cpu.createThreads() +system.workload = SEWorkload.init_compatible(binpath) + # 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 diff --git a/configs/learning_gem5/part2/simple_memobj.py b/configs/learning_gem5/part2/simple_memobj.py index 80f660221..ae8639670 100644 --- a/configs/learning_gem5/part2/simple_memobj.py +++ b/configs/learning_gem5/part2/simple_memobj.py @@ -82,8 +82,6 @@ system.mem_ctrl.port = system.membus.master # Connect the system up to the membus system.system_port = system.membus.slave -system.workload = SEWorkload() - # Create a process for a simple "Hello World" application process = Process() # Set the command @@ -97,6 +95,8 @@ process.cmd = [binpath] system.cpu.workload = process system.cpu.createThreads() +system.workload = SEWorkload.init_compatible(binpath) + # 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 diff --git a/configs/learning_gem5/part3/simple_ruby.py b/configs/learning_gem5/part3/simple_ruby.py index f0a9e08c2..8e9f18691 100644 --- a/configs/learning_gem5/part3/simple_ruby.py +++ b/configs/learning_gem5/part3/simple_ruby.py @@ -89,8 +89,6 @@ thispath = os.path.dirname(os.path.realpath(__file__)) binary = os.path.join(thispath, '../../../', 'tests/test-progs/threads/bin/', isa, 'linux/threads') -system.workload = SEWorkload() - # Create a process for a simple "multi-threaded" application process = Process() # Set the command @@ -101,6 +99,8 @@ for cpu in system.cpu: cpu.workload = process cpu.createThreads() +system.workload = SEWorkload.init_compatible(binary) + # Set up the pseudo file system for the threads function above config_filesystem(system) diff --git a/configs/splash2/cluster.py b/configs/splash2/cluster.py index 2b36c825d..67f64f34f 100644 --- a/configs/splash2/cluster.py +++ b/configs/splash2/cluster.py @@ -216,8 +216,6 @@ system.clock = '1GHz' system.toL2bus = L2XBar(clock = busFrequency) system.l2 = L2(size = options.l2size, assoc = 8) -system.workload = SEWorkload() - # ---------------------- # Connect the L2 cache and memory together # ---------------------- @@ -284,6 +282,8 @@ for cluster in clusters: for cpu in cluster.cpus: cpu.workload = root.workload +system.workload = SEWorkload.init_compatible(root.workload.executable) + # ---------------------- # Run the simulation # ---------------------- diff --git a/configs/splash2/run.py b/configs/splash2/run.py index b3b878703..3da73d509 100644 --- a/configs/splash2/run.py +++ b/configs/splash2/run.py @@ -195,8 +195,7 @@ else: # Create a system, and add system wide objects # ---------------------- system = System(cpu = cpus, physmem = SimpleMemory(), - membus = SystemXBar(clock = busFrequency), - workload = SEWorkload()) + membus = SystemXBar(clock = busFrequency)) system.clock = '1GHz' system.toL2bus = L2XBar(clock = busFrequency) @@ -268,6 +267,8 @@ else: for cpu in cpus: cpu.workload = root.workload +system.workload = SEWorkload.init_compatible(root.workload.executable) + # ---------------------- # Run the simulation # ---------------------- diff --git a/tests/gem5/cpu_tests/run.py b/tests/gem5/cpu_tests/run.py index b893b80ad..f6a1cf665 100644 --- a/tests/gem5/cpu_tests/run.py +++ b/tests/gem5/cpu_tests/run.py @@ -119,7 +119,7 @@ args = parser.parse_args() system = System() -system.workload = SEWorkload() +system.workload = SEWorkload.init_compatible(args.binary) system.clk_domain = SrcClockDomain() system.clk_domain.clock = '1GHz' diff --git a/tests/gem5/m5threads_test_atomic/atomic_system.py b/tests/gem5/m5threads_test_atomic/atomic_system.py index a08be5c5f..f5c53e530 100644 --- a/tests/gem5/m5threads_test_atomic/atomic_system.py +++ b/tests/gem5/m5threads_test_atomic/atomic_system.py @@ -40,7 +40,7 @@ args = parser.parse_args() root = Root(full_system = False) root.system = System() -root.system.workload = SEWorkload() +root.system.workload = SEWorkload.init_compatible(args.cmd) root.system.clk_domain = SrcClockDomain() root.system.clk_domain.clock = '3GHz'