Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/52489 )

Change subject: cpu: Set up _*_ports values in BaseCPU in __init__.
......................................................................

cpu: Set up _*_ports values in BaseCPU in __init__.

This means that if ArchMMU came from the CPU class itself, subclasses
would have a chance to define their own version before the BaseCPU
method consumed it.

The intention is that Arch* *will* be defined in subclasses in later
changes, which will make this more important.

Change-Id: Ib20d5b10aeb26d33840cca4b5a1085d9c73f10de
---
M src/cpu/BaseCPU.py
1 file changed, 32 insertions(+), 6 deletions(-)



diff --git a/src/cpu/BaseCPU.py b/src/cpu/BaseCPU.py
index 72a5fe3..994ec1c 100644
--- a/src/cpu/BaseCPU.py
+++ b/src/cpu/BaseCPU.py
@@ -172,14 +172,8 @@
     dcache_port = RequestPort("Data Port")
     _cached_ports = ['icache_port', 'dcache_port']

-    _cached_ports += ArchMMU.walkerPorts()
-
     _uncached_interrupt_response_ports = []
     _uncached_interrupt_request_ports = []
-    if buildEnv['TARGET_ISA'] == 'x86':
-        _uncached_interrupt_response_ports += ["interrupts[0].pio",
-                                  "interrupts[0].int_responder"]
- _uncached_interrupt_request_ports += ["interrupts[0].int_requestor"]

     def createInterruptController(self):
self.interrupts = [ArchInterrupts() for i in range(self.numThreads)]
@@ -301,3 +295,19 @@
     def __init__(self, **kwargs):
         super(BaseCPU, self).__init__(**kwargs)
         self.power_state.possible_states=['ON', 'CLK_GATED', 'OFF']
+
+        self._cached_ports = self._cached_ports + ArchMMU.walkerPorts()
+
+        # Practically speaking, these ports will exist on the x86 interrupt
+        # controller class.
+        if "pio" in ArchInterrupts._ports:
+            self._uncached_interrupt_response_ports = \
+ self._uncached_interrupt_response_ports + ["interrupts[0].pio"]
+        if "int_responder" in ArchInterrupts._ports:
+            self._uncached_interrupt_response_ports = \
+                    self._uncached_interrupt_response_ports + [
+                    "interrupts[0].int_responder"]
+        if "int_requestor" in ArchInterrupts._ports:
+            self._uncached_interrupt_request_ports = \
+                    self._uncached_interrupt_request_ports + [
+                    "interrupts[0].int_requestor"]

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52489
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib20d5b10aeb26d33840cca4b5a1085d9c73f10de
Gerrit-Change-Number: 52489
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to