summaryrefslogtreecommitdiff
path: root/src/dev/arm
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2019-10-16 13:02:13 +0100
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2019-10-22 10:24:54 +0000
commit8e36db16ce5915afdeac5b21e47b505385a5916b (patch)
treef673616b06058de79337d2f143ab735acd1fd20f /src/dev/arm
parent9a8d60da0e6bc416fc53606aae60167506e75c4e (diff)
downloadgem5-8e36db16ce5915afdeac5b21e47b505385a5916b.tar.xz
dev-arm, configs: Using _on_chip_memory for on chip memory
This patch is pulling the on-chip memory outside of the on_chip_devices list. The external interface will be more or less the same: configuration scripts will still use the attachOnChipIO method; a new kw argument has been added in order to store mem_ports. We want to provide to on-chip memory the same mechanism used when collecting on-chip dma ports. This is needed when using Ruby, since we need to pass a non None mem_ports to prevent the bootmem to be wired to the bus. Change-Id: Ifc519c3072dc5de1530772c70c80dc2094e2c54c Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22000 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/dev/arm')
-rw-r--r--src/dev/arm/RealView.py30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py
index 1ff098e79..d24dbe2ad 100644
--- a/src/dev/arm/RealView.py
+++ b/src/dev/arm/RealView.py
@@ -550,9 +550,14 @@ class RealView(Platform):
_off_chip_ranges = []
+ def _attach_memory(self, mem, bus, mem_ports=None):
+ if hasattr(mem, "port"):
+ if mem_ports is None:
+ mem.port = bus.master
+ else:
+ mem_ports.append(mem.port)
+
def _attach_device(self, device, bus, dma_ports=None):
- if hasattr(device, "port"):
- device.port = bus.master
if hasattr(device, "pio"):
device.pio = bus.master
if hasattr(device, "dma"):
@@ -565,6 +570,10 @@ class RealView(Platform):
for d in devices:
self._attach_device(d, *args, **kwargs)
+ def _attach_mem(self, memories, *args, **kwargs):
+ for mem in memories:
+ self._attach_memory(mem, *args, **kwargs)
+
def _attach_clk(self, devices, clkdomain):
for d in devices:
if hasattr(d, "clk_domain"):
@@ -582,8 +591,9 @@ class RealView(Platform):
def offChipIOClkDomain(self, clkdomain):
self._attach_clk(self._off_chip_devices(), clkdomain)
- def attachOnChipIO(self, bus, bridge=None, *args, **kwargs):
- self._attach_io(self._on_chip_devices(), bus, *args, **kwargs)
+ def attachOnChipIO(self, bus, bridge=None, dma_ports=None, mem_ports=None):
+ self._attach_mem(self._on_chip_memory(), bus, mem_ports)
+ self._attach_io(self._on_chip_devices(), bus, dma_ports)
if bridge:
bridge.ranges = self._off_chip_ranges
@@ -643,7 +653,6 @@ class VExpress_EMM(RealView):
def _on_chip_devices(self):
devices = [
self.gic, self.vgic,
- self.bootmem,
self.local_cpu_timer
]
if hasattr(self, "gicv2m"):
@@ -651,6 +660,12 @@ class VExpress_EMM(RealView):
devices.append(self.hdlcd)
return devices
+ def _on_chip_memory(self):
+ memories = [
+ self.bootmem,
+ ]
+ return memories
+
### Off-chip devices ###
uart = Pl011(pio_addr=0x1c090000, int_num=37)
pci_host = GenericPciHost(
@@ -882,8 +897,13 @@ Interrupts:
def _on_chip_devices(self):
return [
self.generic_timer,
+ ]
+
+ def _on_chip_memory(self):
+ memories = [
self.bootmem,
]
+ return memories
### Off-chip devices ###
clock24MHz = SrcClockDomain(clock="24MHz",