At https://www.mail-archive.com/gem5-users@gem5.org/msg15233.html Jason mentioned the technique of attaching two disk images to restore a checkpoint and run a different benchmark.
Is it possible to specify multiple disk images when using fs.py
? From
the source code I don't think it is currently supported, but just
double checking before I decided to patch it or not.
It seems that multiple --disk-image=
options just overwrite one another.
fs_bigLITTLE.py
seems to support it however.
gem5 60600f09c25255b3c8f72da7fb49100e2682093a
https://www.mail-archive.com/gem5-users@gem5.org/msg15675.html
I replied here: https://www.mail-archive.com/gem5-users@gem5.org/msg15714.html
Basically, http://www.gem5.org/AsimBench shows an example of how to do it with fs.py. You can try this with this patch:
diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index e2b6616..e01cc13 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -266,15 +266,17 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,
self.cf0 = CowIdeDisk(driveID='master')
self.cf0.childImage(mdesc.disk())
+ self.disk2 = CowIdeDisk(driveID='master')
+ self.disk2.childImage(disk('workloads.img'))
# Old platforms have a built-in IDE or CF controller. Default to
# the IDE controller if both exist. New platforms expect the
# storage controller to be added from the config script.
if hasattr(self.realview, "ide"):
- self.realview.ide.disks = [self.cf0]
+ self.realview.ide.disks = [self.cf0, self.disk2]
elif hasattr(self.realview, "cf_ctrl"):
- self.realview.cf_ctrl.disks = [self.cf0]
+ self.realview.cf_ctrl.disks = [self.cf0, self.disk2]
else:
- self.pci_ide = IdeController(disks=[self.cf0])
+ self.pci_ide = IdeController(disks=[self.cf0, self.disk2])
pci_devices.append(self.pci_ide)
self.mem_ranges = []
Note that in this example, you have to supply an image called workloads.img in your M5_PATH (an environment variable for gem5 pointing the a directorycontaining system files). Of course you can change this to any value youwant or pass it via an option.
Also note that when booted, you have to mount the second disk first by using the normal tools to mount a disk. This can be done by e.g.
sudo mount /dev/sdb1 /mnt
All files in the second disk image will then be present under /mnt
来源:https://stackoverflow.com/questions/50862906/how-to-attach-multiple-disk-images-in-a-simulation-with-gem5-fs-py