CpuConfig.py (11251:a15c86af004a) | CpuConfig.py (11688:725fef71f376) |
---|---|
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 --- 56 unchanged lines hidden (view full) --- 65 """Determine if a class is a CPU that can be instantiated""" 66 67 # We can't use the normal inspect.isclass because the ParamFactory 68 # and ProxyFactory classes have a tendency to confuse it. 69 try: 70 return issubclass(cls, m5.objects.BaseCPU) and \ 71 not cls.abstract and \ 72 not issubclass(cls, m5.objects.CheckerCPU) | 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 --- 56 unchanged lines hidden (view full) --- 65 """Determine if a class is a CPU that can be instantiated""" 66 67 # We can't use the normal inspect.isclass because the ParamFactory 68 # and ProxyFactory classes have a tendency to confuse it. 69 try: 70 return issubclass(cls, m5.objects.BaseCPU) and \ 71 not cls.abstract and \ 72 not issubclass(cls, m5.objects.CheckerCPU) |
73 except TypeError: | 73 except (TypeError, AttributeError): |
74 return False 75 76def get(name): 77 """Get a CPU class from a user provided class name or alias.""" 78 79 real_name = _cpu_aliases.get(name, name) 80 81 try: --- 77 unchanged lines hidden --- | 74 return False 75 76def get(name): 77 """Get a CPU class from a user provided class name or alias.""" 78 79 real_name = _cpu_aliases.get(name, name) 80 81 try: --- 77 unchanged lines hidden --- |