Hello Andreas Sandberg,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/c/public/gem5/+/20050
to review the following change.
Change subject: python: FdtState using interrupt-cells
......................................................................
python: FdtState using interrupt-cells
Change-Id: I37813748f518b442d2b53c2bc4f381edb2e26146
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
---
M src/python/m5/util/fdthelper.py
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/python/m5/util/fdthelper.py
b/src/python/m5/util/fdthelper.py
index c876050..27d6f84 100644
--- a/src/python/m5/util/fdthelper.py
+++ b/src/python/m5/util/fdthelper.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 ARM Limited
+# Copyright (c) 2016,2019 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
@@ -87,13 +87,14 @@
phandle_counter = 0
phandles = dict()
- def __init__(self, addr_cells, size_cells, cpu_cells):
+ def __init__(self, **kwargs):
"""Instantiate values of this state. The state can only be
initialized
once."""
- self.addr_cells = addr_cells
- self.size_cells = size_cells
- self.cpu_cells = cpu_cells
+ self.addr_cells = kwargs.pop('addr_cells', 0)
+ self.size_cells = kwargs.pop('size_cells', 0)
+ self.cpu_cells = kwargs.pop('cpu_cells', 0)
+ self.interrupt_cells = kwargs.pop('interrupt_cells', 0)
def phandle(self, obj):
"""Return a unique phandle number for a key. The key can be a
SimObject
@@ -142,6 +143,11 @@
state."""
return self.int_to_cells(size, self.size_cells)
+ def interruptCells(self, interrupt):
+ """Format an integer type according to the interrupt_cells value
+ of this state."""
+ return self.int_to_cells(interrupt, self.interrupt_cells)
+
def addrCellsProperty(self):
"""Return an #address-cells property with the value of this
state."""
return FdtPropertyWords("#address-cells", self.addr_cells)
@@ -155,6 +161,12 @@
of this state."""
return FdtPropertyWords("#address-cells", self.cpu_cells)
+ def interruptCellsProperty(self):
+ """Return an #interrupt-cells property for cpu nodes with the value
+ of this state."""
+ return FdtPropertyWords("#interrupt-cells", self.interrupt_cells)
+
+
class FdtNop(pyfdt.FdtNop):
"""Create an empty node."""
pass
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/20050
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I37813748f518b442d2b53c2bc4f381edb2e26146
Gerrit-Change-Number: 20050
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev