arm_generic.py (10406:3819b85ff21a) | arm_generic.py (10512:b423e1d0735e) |
---|---|
1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 30 unchanged lines hidden (view full) --- 39import m5 40from m5.objects import * 41from m5.proxy import * 42m5.util.addToPath('../configs/common') 43import FSConfig 44from Caches import * 45from base_config import * 46from O3_ARM_v7a import * | 1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 30 unchanged lines hidden (view full) --- 39import m5 40from m5.objects import * 41from m5.proxy import * 42m5.util.addToPath('../configs/common') 43import FSConfig 44from Caches import * 45from base_config import * 46from O3_ARM_v7a import * |
47from Benchmarks import SysConfig |
|
47 48class ArmSESystemUniprocessor(BaseSESystemUniprocessor): 49 """Syscall-emulation builder for ARM uniprocessor systems. 50 51 A small tweak of the syscall-emulation builder to use more 52 representative cache configurations. 53 """ 54 --- 10 unchanged lines hidden (view full) --- 65 66class LinuxArmSystemBuilder(object): 67 """Mix-in that implements create_system. 68 69 This mix-in is intended as a convenient way of adding an 70 ARM-specific create_system method to a class deriving from one of 71 the generic base systems. 72 """ | 48 49class ArmSESystemUniprocessor(BaseSESystemUniprocessor): 50 """Syscall-emulation builder for ARM uniprocessor systems. 51 52 A small tweak of the syscall-emulation builder to use more 53 representative cache configurations. 54 """ 55 --- 10 unchanged lines hidden (view full) --- 66 67class LinuxArmSystemBuilder(object): 68 """Mix-in that implements create_system. 69 70 This mix-in is intended as a convenient way of adding an 71 ARM-specific create_system method to a class deriving from one of 72 the generic base systems. 73 """ |
73 def __init__(self, machine_type): | 74 def __init__(self, machine_type, **kwargs): |
74 """ 75 Arguments: 76 machine_type -- String describing the platform to simulate | 75 """ 76 Arguments: 77 machine_type -- String describing the platform to simulate |
78 num_cpus -- integer number of CPUs in the system |
|
77 """ 78 self.machine_type = machine_type | 79 """ 80 self.machine_type = machine_type |
81 self.num_cpus = kwargs.get('num_cpus', 1) 82 self.mem_size = kwargs.get('mem_size', '256MB') |
|
79 80 def create_system(self): | 83 84 def create_system(self): |
85 sc = SysConfig(None, self.mem_size, None) |
|
81 system = FSConfig.makeArmSystem(self.mem_mode, | 86 system = FSConfig.makeArmSystem(self.mem_mode, |
82 self.machine_type, None, False) | 87 self.machine_type, self.num_cpus, 88 sc, False) |
83 84 # We typically want the simulator to panic if the kernel 85 # panics or oopses. This prevents the simulator from running 86 # an obviously failed test case until the end of time. 87 system.panic_on_panic = True 88 system.panic_on_oops = True 89 90 self.init_system(system) 91 return system 92 93class LinuxArmFSSystem(LinuxArmSystemBuilder, 94 BaseFSSystem): 95 """Basic ARM full system builder.""" 96 | 89 90 # We typically want the simulator to panic if the kernel 91 # panics or oopses. This prevents the simulator from running 92 # an obviously failed test case until the end of time. 93 system.panic_on_panic = True 94 system.panic_on_oops = True 95 96 self.init_system(system) 97 return system 98 99class LinuxArmFSSystem(LinuxArmSystemBuilder, 100 BaseFSSystem): 101 """Basic ARM full system builder.""" 102 |
97 def __init__(self, machine_type='RealView_PBX', **kwargs): | 103 def __init__(self, machine_type='VExpress_EMM', **kwargs): |
98 """Initialize an ARM system that supports full system simulation. 99 100 Note: Keyword arguments that are not listed below will be 101 passed to the BaseFSSystem. 102 103 Keyword Arguments: 104 machine_type -- String describing the platform to simulate 105 """ 106 BaseSystem.__init__(self, **kwargs) | 104 """Initialize an ARM system that supports full system simulation. 105 106 Note: Keyword arguments that are not listed below will be 107 passed to the BaseFSSystem. 108 109 Keyword Arguments: 110 machine_type -- String describing the platform to simulate 111 """ 112 BaseSystem.__init__(self, **kwargs) |
107 LinuxArmSystemBuilder.__init__(self, machine_type) | 113 LinuxArmSystemBuilder.__init__(self, machine_type, **kwargs) |
108 109 def create_caches_private(self, cpu): 110 # Use the more representative cache configuration 111 cpu.addTwoLevelCacheHierarchy(O3_ARM_v7a_ICache(), 112 O3_ARM_v7a_DCache(), 113 O3_ARM_v7aL2()) 114 115class LinuxArmFSSystemUniprocessor(LinuxArmSystemBuilder, 116 BaseFSSystemUniprocessor): 117 """Basic ARM full system builder for uniprocessor systems. 118 119 Note: This class is a specialization of the ArmFSSystem and is 120 only really needed to provide backwards compatibility for existing 121 test cases. 122 """ 123 | 114 115 def create_caches_private(self, cpu): 116 # Use the more representative cache configuration 117 cpu.addTwoLevelCacheHierarchy(O3_ARM_v7a_ICache(), 118 O3_ARM_v7a_DCache(), 119 O3_ARM_v7aL2()) 120 121class LinuxArmFSSystemUniprocessor(LinuxArmSystemBuilder, 122 BaseFSSystemUniprocessor): 123 """Basic ARM full system builder for uniprocessor systems. 124 125 Note: This class is a specialization of the ArmFSSystem and is 126 only really needed to provide backwards compatibility for existing 127 test cases. 128 """ 129 |
124 def __init__(self, machine_type='RealView_PBX', **kwargs): | 130 def __init__(self, machine_type='VExpress_EMM', **kwargs): |
125 BaseFSSystemUniprocessor.__init__(self, **kwargs) | 131 BaseFSSystemUniprocessor.__init__(self, **kwargs) |
126 LinuxArmSystemBuilder.__init__(self, machine_type) | 132 LinuxArmSystemBuilder.__init__(self, machine_type, **kwargs) |
127 128class LinuxArmFSSwitcheroo(LinuxArmSystemBuilder, BaseFSSwitcheroo): 129 """Uniprocessor ARM system prepared for CPU switching""" 130 | 133 134class LinuxArmFSSwitcheroo(LinuxArmSystemBuilder, BaseFSSwitcheroo): 135 """Uniprocessor ARM system prepared for CPU switching""" 136 |
131 def __init__(self, machine_type='RealView_PBX', **kwargs): | 137 def __init__(self, machine_type='VExpress_EMM', **kwargs): |
132 BaseFSSwitcheroo.__init__(self, **kwargs) | 138 BaseFSSwitcheroo.__init__(self, **kwargs) |
133 LinuxArmSystemBuilder.__init__(self, machine_type) | 139 LinuxArmSystemBuilder.__init__(self, machine_type, **kwargs) |