CpuConfig.py (12564:2778478ca882) CpuConfig.py (12941:24771c7aee2e)
1# Copyright (c) 2012, 2017 ARM Limited
1# Copyright (c) 2012, 2017-2018 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
9# terms below provided that you ensure that this notice is replicated

--- 44 unchanged lines hidden (view full) ---

54 # and ProxyFactory classes have a tendency to confuse it.
55 try:
56 return issubclass(cls, m5.objects.BaseCPU) and \
57 not cls.abstract and \
58 not issubclass(cls, m5.objects.CheckerCPU)
59 except (TypeError, AttributeError):
60 return False
61
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
9# terms below provided that you ensure that this notice is replicated

--- 44 unchanged lines hidden (view full) ---

54 # and ProxyFactory classes have a tendency to confuse it.
55 try:
56 return issubclass(cls, m5.objects.BaseCPU) and \
57 not cls.abstract and \
58 not issubclass(cls, m5.objects.CheckerCPU)
59 except (TypeError, AttributeError):
60 return False
61
62def _cpu_subclass_tester(name):
63 cpu_class = getattr(m5.objects, name, None)
64
65 def tester(cls):
66 return cpu_class is not None and cls is not None and \
67 issubclass(cls, cpu_class)
68
69 return tester
70
71is_kvm_cpu = _cpu_subclass_tester("BaseKvmCPU")
72
62def get(name):
63 """Get a CPU class from a user provided class name or alias."""
64
65 try:
66 cpu_class = _cpu_classes[name]
67 return cpu_class
68 except KeyError:
69 print("%s is not a valid CPU model." % (name,))

--- 62 unchanged lines hidden ---
73def get(name):
74 """Get a CPU class from a user provided class name or alias."""
75
76 try:
77 cpu_class = _cpu_classes[name]
78 return cpu_class
79 except KeyError:
80 print("%s is not a valid CPU model." % (name,))

--- 62 unchanged lines hidden ---