Pau Cabre has uploaded this change for review. ( https://gem5-review.googlesource.com/2841

Change subject: arm,config: Added the VExpress_GEM5_V1_64 platform
......................................................................

arm,config: Added the VExpress_GEM5_V1_64 platform

With this change, now VExpress_GEM5_V1 is only for aarch32, and the new
VExpress_GEM5_V1_64 platforms is only for aarch64.
VExpress_GEM5_V1_64 is basically a subclass of VExpress_GEM5_V1, and it
only overrides the necessary methods to setup an aarch64 bootloader and
tell that it is aarch64 in order to set highest_el_is_64 to True.

This mechanism for setting highest_el_is_64 is also used by VExpress_EMM64,
which was not setting it by default.

Basic regression tests have been added for both VExpress_GEM5_V1* platforms.
These tests rely on the up-to-date ARM FullSystem files from here:
https://github.com/metempsy/gem5_arm_fullsystem_files_generator/releases/download/20170421/aarch-system-20170421.tar.xz

Updated the default kernel and DTBs to be used by the VExpress_EMM and
VExpress_EMM64 platforms in order to use the up-to-date ones from above.
If not found, fall back to the old names.

Signed-off-by: Pau Cabre
Change-Id: I7e1e7f5f58f2812a68861e3fdd347401e24ae05e
---
M configs/common/FSConfig.py
M src/dev/arm/RealView.py
A tests/configs/vexpress_gem5_v1-simple-atomic.py
A tests/configs/vexpress_gem5_v1_64-simple-atomic.py
A tests/long/fs/10.linux-boot/ref/arm/linux/vexpress_gem5_v1-simple-atomic/EMPTY A tests/long/fs/10.linux-boot/ref/arm/linux/vexpress_gem5_v1_64-simple-atomic/EMPTY
M tests/testing/tests.py
7 files changed, 140 insertions(+), 8 deletions(-)



diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index 3a169a4..892b67a 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -74,6 +74,19 @@
     kwargs.setdefault('script', mdesc.script())
     return template % kwargs

+def find_existing_binary(binary_file_or_list):
+    if isinstance(binary_file_or_list, list):
+        for binary_file in binary_file_or_list:
+            try:
+                return binary(binary_file)
+            except IOError:
+                pass
+
+        #Re-raise previous exception if no item in the list was found
+        raise
+    else:
+        return binary(binary_file_or_list)
+
 def makeLinuxAlphaSystem(mem_mode, mdesc=None, ruby=False, cmdline=None):

     class BaseTsunami(Tsunami):
@@ -206,18 +219,37 @@
                   external_memory="", ruby=False):
     assert machine_type

+ # When the value for a given key of these default_* dictionaries is a list, + # then iterate over the elements of the list and use the first one that is
+    # actually found (this is done by find_existing_binary)
+
+ # First try to use the values from aarch-system-20170421.tar.xz, and if not
+    # found, then use the ones from aarch-system-2014-10.tar.xz
+
     default_dtbs = {
         "RealViewEB": None,
         "RealViewPBX": None,
- "VExpress_EMM": "vexpress.aarch32.ll_20131205.0-gem5.%dcpu.dtb" % num_cpus,
-        "VExpress_EMM64": "vexpress.aarch64.20140821.dtb",
+        "VExpress_EMM":
+            ["vexpress-v2p-ca15-tc1-gem5_%dcpus.20170421.dtb" % num_cpus,
+             "vexpress.aarch32.ll_20131205.0-gem5.%dcpu.dtb"  % num_cpus],
+        "VExpress_EMM64":
+            ["aarch64_gem5_server.20170421.dtb",
+             "vexpress.aarch64.20140821.dtb"],
+ "VExpress_GEM5_V1": "armv7_gem5_v1_%dcpu.20170421.dtb" % num_cpus, + "VExpress_GEM5_V1_64": "armv8_gem5_v1_%dcpu.20170421.dtb" % num_cpus,
     }

     default_kernels = {
         "RealViewEB": "vmlinux.arm.smp.fb.2.6.38.8",
         "RealViewPBX": "vmlinux.arm.smp.fb.2.6.38.8",
-        "VExpress_EMM": "vmlinux.aarch32.ll_20131205.0-gem5",
-        "VExpress_EMM64": "vmlinux.aarch64.20140821",
+        "VExpress_EMM":
+            ["vmlinux.vexpress_emm.20170421",
+             "vmlinux.aarch32.ll_20131205.0-gem5"],
+        "VExpress_EMM64":
+            ["vmlinux.vexpress_emm64.20170421",
+             "vmlinux.aarch64.20140821"],
+        "VExpress_GEM5_V1":    "vmlinux.vexpress_gem5_v1.20170421",
+        "VExpress_GEM5_V1_64": "vmlinux.vexpress_gem5_v1_64.20170421",
     }

     pci_devices = []
@@ -255,7 +287,8 @@
             fatal("No DTB specified and no default DTB known for '%s'" % \
                   machine_type)

-    if isinstance(self.realview, VExpress_EMM64):
+    if self.realview.is_arm64():
+        self.highest_el_is_64 = True
         if os.path.split(mdesc.disk())[-1] == 'linux-aarch32-ael.img':
print "Selected 64-bit ARM architecture, updating default disk image..."
             mdesc.diskname = 'linaro-minimal-aarch64.img'
@@ -300,10 +333,10 @@
         self.realview.uart.end_on_eot = True
     else:
         if machine_type in default_kernels:
-            self.kernel = binary(default_kernels[machine_type])
+ self.kernel = find_existing_binary(default_kernels[machine_type])

         if dtb_filename:
-            self.dtb_filename = binary(dtb_filename)
+            self.dtb_filename = find_existing_binary(dtb_filename)

self.machine_type = machine_type if machine_type in ArmMachineType.map \
                             else "DTOnly"
diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py
index 20112d4..f839ccd 100644
--- a/src/dev/arm/RealView.py
+++ b/src/dev/arm/RealView.py
@@ -363,6 +363,9 @@
         cur_sys.load_addr_mask = 0xfffffff
         cur_sys.load_offset = 0

+    def is_arm64(self):
+        return False
+

 # Reference for memory map and interrupt number
# RealView Platform Baseboard Explore for Cortex-A9 User Guide(ARM DUI 0440A)
@@ -787,6 +790,9 @@
         cur_sys.load_addr_mask = 0xfffffff
         cur_sys.load_offset = 0x80000000

+    def is_arm64(self):
+        return True
+

 class VExpress_GEM5_V1(RealView):
     """
@@ -952,7 +958,22 @@
         self.nvmem = SimpleMemory(range=AddrRange(0, size='64MB'),
                                   conf_table_reported=False)
         self.nvmem.port = mem_bus.master
- cur_sys.boot_loader = [ loc('boot_emm.arm64'), loc('boot_emm.arm') ]
+        cur_sys.boot_loader = loc('boot_emm.arm')
         cur_sys.atags_addr = 0x8000000
         cur_sys.load_addr_mask = 0xfffffff
         cur_sys.load_offset = 0x80000000
+
+
+class VExpress_GEM5_V1_64(VExpress_GEM5_V1):
+
+    def setupBootLoader(self, mem_bus, cur_sys, loc):
+        self.nvmem = SimpleMemory(range=AddrRange(0, size='64MB'),
+                                  conf_table_reported=False)
+        self.nvmem.port = mem_bus.master
+        cur_sys.boot_loader = loc('boot_emm.arm64')
+        cur_sys.atags_addr = 0x8000000
+        cur_sys.load_addr_mask = 0xfffffff
+        cur_sys.load_offset = 0x80000000
+
+    def is_arm64(self):
+        return True
diff --git a/tests/configs/vexpress_gem5_v1-simple-atomic.py b/tests/configs/vexpress_gem5_v1-simple-atomic.py
new file mode 100644
index 0000000..b56378d
--- /dev/null
+++ b/tests/configs/vexpress_gem5_v1-simple-atomic.py
@@ -0,0 +1,38 @@
+# Copyright (c) 2017 Metempsy Technology Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Pau Cabre
+#
+# Mostly copied from ./realview64-simple-atomic.py
+
+from m5.objects import *
+from arm_generic import *
+
+root = LinuxArmFSSystemUniprocessor(machine_type='VExpress_GEM5_V1',
+                                    mem_mode='atomic',
+                                    mem_class=SimpleMemory,
+ cpu_class=AtomicSimpleCPU).create_root()
+
diff --git a/tests/configs/vexpress_gem5_v1_64-simple-atomic.py b/tests/configs/vexpress_gem5_v1_64-simple-atomic.py
new file mode 100644
index 0000000..b889333
--- /dev/null
+++ b/tests/configs/vexpress_gem5_v1_64-simple-atomic.py
@@ -0,0 +1,38 @@
+# Copyright (c) 2017 Metempsy Technology Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Pau Cabre
+#
+# Mostly copied from ./realview64-simple-atomic.py
+
+from m5.objects import *
+from arm_generic import *
+
+root = LinuxArmFSSystemUniprocessor(machine_type='VExpress_GEM5_V1_64',
+                                    mem_mode='atomic',
+                                    mem_class=SimpleMemory,
+ cpu_class=AtomicSimpleCPU).create_root()
+
diff --git a/tests/long/fs/10.linux-boot/ref/arm/linux/vexpress_gem5_v1-simple-atomic/EMPTY b/tests/long/fs/10.linux-boot/ref/arm/linux/vexpress_gem5_v1-simple-atomic/EMPTY
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/long/fs/10.linux-boot/ref/arm/linux/vexpress_gem5_v1-simple-atomic/EMPTY diff --git a/tests/long/fs/10.linux-boot/ref/arm/linux/vexpress_gem5_v1_64-simple-atomic/EMPTY b/tests/long/fs/10.linux-boot/ref/arm/linux/vexpress_gem5_v1_64-simple-atomic/EMPTY
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/long/fs/10.linux-boot/ref/arm/linux/vexpress_gem5_v1_64-simple-atomic/EMPTY
diff --git a/tests/testing/tests.py b/tests/testing/tests.py
index c9a2a06..e4859a8 100644
--- a/tests/testing/tests.py
+++ b/tests/testing/tests.py
@@ -118,6 +118,8 @@
         'realview64-switcheroo-timing',
         'realview64-switcheroo-o3',
         'realview64-switcheroo-full',
+        'vexpress_gem5_v1-simple-atomic',
+        'vexpress_gem5_v1_64-simple-atomic',
     ),

     ("sparc", None) : (

--
To view, visit https://gem5-review.googlesource.com/2841
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e1e7f5f58f2812a68861e3fdd347401e24ae05e
Gerrit-Change-Number: 2841
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Cabre <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to