From 6a0ad7a64460ba8471494612eaeb56a3f71a1a1d Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 20 Mar 2020 19:07:45 +0000 Subject: [PATCH] configs: Make --disk-image optional in baremetal.py Since the script could be used to run baremetal applications, we don't have to enforce the presence of a disk image Change-Id: I511515361cfd7a2e06ede0df3ddcc595de15f38b Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26992 Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com> Tested-by: kokoro Reviewed-by: Jason Lowe-Power Reviewed-by: Ciro Santilli Maintainer: Jason Lowe-Power --- configs/example/arm/baremetal.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/configs/example/arm/baremetal.py b/configs/example/arm/baremetal.py index c1628934b..c691a7d82 100644 --- a/configs/example/arm/baremetal.py +++ b/configs/example/arm/baremetal.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017,2019 ARM Limited +# Copyright (c) 2016-2017,2019-2020 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -104,22 +104,23 @@ def create(args): MemConfig.config_mem(args, system) - # Add the PCI devices we need for this system. The base system # doesn't have any PCI devices by default since they are assumed # to be added by the configurastion scripts needin them. - system.pci_devices = [ + pci_devices = [] + if args.disk_image: # Create a VirtIO block device for the system's boot # disk. Attach the disk image using gem5's Copy-on-Write # functionality to avoid writing changes to the stored copy of # the disk image. - PciVirtIO(vio=VirtIOBlock(image=create_cow_image(args.disk_image))), - ] + system.disk = PciVirtIO(vio=VirtIOBlock( + image=create_cow_image(args.disk_image))) + pci_devices.append(system.disk) # Attach the PCI devices to the system. The helper method in the # system assigns a unique PCI bus ID to each of the devices and # connects them to the IO bus. - for dev in system.pci_devices: + for dev in pci_devices: system.attach_pci(dev) # Wire up the system's memory system -- 2.30.2