misc: Replace TARGET_ISA with USE_${ISA} variables.
The TARGET_ISA variable would let you select one ISA from a list of possible ISAs. That has now been replaced with USE_ARM_ISA, USE_X86_ISA, etc, variables which are boolean on or off. That will allow any number of ISAs to be enabled or disabled individually. Enabling something other than exactly one of these will probably prevent you from getting a working gem5 binary, but those problems are being addressed in other, parallel change series. I decided to use the USE_ prefix since it was consistent with most other on/off variables we have in gem5. One noteable exception is the BUILD_GPU setting which, you could convincingly argue, is a better prefix than USE_. Another option would be to use CONFIG_, in anticipation of using a kconfig style config mechanism in gem5. It seemed premature to start using a CONFIG_ prefix here, and if we decide to switch to some other prefix like BUILD_, it should be a purposeful choice and not something somebody just starts using. Change-Id: I90fef2835aa4712782e6c1313fbf564d0ed45538 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52491 Tested-by: kokoro <noreply+kokoro@google.com> Maintainer: Gabe Black <gabe.black@gmail.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from gem5.runtime import get_supported_isas
|
||||
import m5.objects
|
||||
import m5.internal.params
|
||||
import inspect
|
||||
@@ -139,13 +140,14 @@ class CPUList(ObjectList):
|
||||
def _add_objects(self):
|
||||
super(CPUList, self)._add_objects()
|
||||
|
||||
from m5.defines import buildEnv
|
||||
from importlib import import_module
|
||||
|
||||
for package in ["generic", buildEnv["TARGET_ISA"]]:
|
||||
for isa in {
|
||||
"generic",
|
||||
} | {isa.name.lower() for isa in get_supported_isas()}:
|
||||
try:
|
||||
package = import_module(
|
||||
".cores." + package, package=__name__.rpartition(".")[0]
|
||||
".cores." + isa, package=__name__.rpartition(".")[0]
|
||||
)
|
||||
except ImportError:
|
||||
# No timing models for this ISA
|
||||
|
||||
Reference in New Issue
Block a user