Wing Li has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/54783 )

Change subject: fastmodel: export wake request ports from GIC
......................................................................

fastmodel: export wake request ports from GIC

Change-Id: I561ef876a4e873501ed2e9775b5bdb59707521a9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54783
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/arm/fastmodel/GIC/GIC.sgproj
M src/arch/arm/fastmodel/GIC/FastModelGIC.py
M src/arch/arm/fastmodel/GIC/GIC.lisa
M src/arch/arm/fastmodel/GIC/gic.cc
M src/arch/arm/fastmodel/GIC/gic.hh
5 files changed, 47 insertions(+), 1 deletion(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/arm/fastmodel/GIC/FastModelGIC.py b/src/arch/arm/fastmodel/GIC/FastModelGIC.py
index 5a551df..8a94d59 100644
--- a/src/arch/arm/fastmodel/GIC/FastModelGIC.py
+++ b/src/arch/arm/fastmodel/GIC/FastModelGIC.py
@@ -41,6 +41,7 @@

 from m5.objects.FastModel import AmbaInitiatorSocket, AmbaTargetSocket
 from m5.objects.Gic import BaseGic
+from m5.objects.IntPin import VectorIntSourcePin
 from m5.objects.SystemC import SystemC_ScModule

 GICV3_COMMS_TARGET_ROLE = 'GICV3 COMMS TARGET'
@@ -473,6 +474,8 @@
     redistributor = VectorGicv3CommsInitiatorSocket(
             'GIC communication initiator')

+    wake_request = VectorIntSourcePin('GIC wake request initiator')
+
     # Used for DTB autogeneration
     _state = FdtState(addr_cells=2, size_cells=2, interrupt_cells=3)

diff --git a/src/arch/arm/fastmodel/GIC/GIC.lisa b/src/arch/arm/fastmodel/GIC/GIC.lisa
index 9e4d917..34b09c8 100644
--- a/src/arch/arm/fastmodel/GIC/GIC.lisa
+++ b/src/arch/arm/fastmodel/GIC/GIC.lisa
@@ -53,6 +53,9 @@
         // For the CPU interface.
         gic.redistributor_m => self.redistributor;

+        // Outgoing wake requests.
+        gic.wake_request => self.wake_request;
+
         // Internal ports for PPI and SPI programmatic access.
         self.ppi_0 => gic.ppi_in_0;
         self.ppi_1 => gic.ppi_in_1;
@@ -324,6 +327,8 @@

     master port<GICv3Comms> redistributor[256];

+    master port<Signal> wake_request[256];
+
     #define setPPI(C) \
           case C: ppi_##C[num].setValue(state); \
           break
diff --git a/src/arch/arm/fastmodel/GIC/GIC.sgproj b/src/arch/arm/fastmodel/GIC/GIC.sgproj
index c835356..7c503b2 100644
--- a/src/arch/arm/fastmodel/GIC/GIC.sgproj
+++ b/src/arch/arm/fastmodel/GIC/GIC.sgproj
@@ -16,6 +16,7 @@
     SIMGEN_COMMAND_LINE = "--num-comps-file 50";
     TARGET_MAXVIEW = "0";
     TARGET_SYSTEMC = "1";
+    TARGET_SYSTEMC_AUTO = "1";
 }
 files
 {
diff --git a/src/arch/arm/fastmodel/GIC/gic.cc b/src/arch/arm/fastmodel/GIC/gic.cc
index d1b5980..fbe863a 100644
--- a/src/arch/arm/fastmodel/GIC/gic.cc
+++ b/src/arch/arm/fastmodel/GIC/gic.cc
@@ -77,6 +77,12 @@
 {
     signalInterrupt.bind(signal_interrupt);

+    for (int i = 0; i < wake_request.size(); i++) {
+        wakeRequests.emplace_back(
+            new SignalReceiver(csprintf("%s.wakerequest[%d]", name(), i)));
+        wake_request[i].bind(wakeRequests[i]->signal_in);
+    }
+
     set_parameter("gic.enabled", params.enabled);
     set_parameter("gic.has-gicv3", params.has_gicv3);
     set_parameter("gic.has-gicv4.1", params.has_gicv4_1);
@@ -306,7 +312,18 @@
     ambaS(params.sc_gic->amba_s, params.name + ".amba_s", -1),
     redistributors(params.port_redistributor_connection_count),
     scGIC(params.sc_gic)
-{}
+{
+    for (int i = 0; i < params.port_wake_request_connection_count; i++) {
+        wakeRequestPorts.emplace_back(new IntSourcePin<GIC>(
+            csprintf("%s.wakerequestport[%d]", name(), i), i, this));
+        auto handler = [this, i](bool status)
+        {
+            auto &port = wakeRequestPorts[i];
+            status ? port->raise() : port->lower();
+        };
+        scGIC->wakeRequests[i]->onChange(handler);
+    }
+}

 Port &
 GIC::getPort(const std::string &if_name, PortID idx)
@@ -323,6 +340,8 @@
                                                    name(), idx), idx));
         }
         return *ptr;
+    } else if (if_name == "wake_request") {
+        return *wakeRequestPorts.at(idx);
     } else {
         return BaseGic::getPort(if_name, idx);
     }
diff --git a/src/arch/arm/fastmodel/GIC/gic.hh b/src/arch/arm/fastmodel/GIC/gic.hh
index 27eccd4..33a172d 100644
--- a/src/arch/arm/fastmodel/GIC/gic.hh
+++ b/src/arch/arm/fastmodel/GIC/gic.hh
@@ -36,7 +36,9 @@
 #include <memory>

 #include "arch/arm/fastmodel/amba_ports.hh"
+#include "arch/arm/fastmodel/common/signal_receiver.hh"
 #include "dev/arm/base_gic.hh"
+#include "dev/intpin.hh"
 #include "params/FastModelGIC.hh"
 #include "params/SCFastModelGIC.hh"
 #include "scx_evs_GIC.h"
@@ -92,6 +94,8 @@

     SignalInterruptInitiatorSocket signalInterrupt;

+    std::vector<std::unique_ptr<SignalReceiver>> wakeRequests;
+
     void before_end_of_elaboration() override;

     void
@@ -118,6 +122,7 @@
     AmbaInitiator ambaM;
     AmbaTarget ambaS;
     std::vector<std::unique_ptr<TlmGicInitiator>> redistributors;
+    std::vector<std::unique_ptr<IntSourcePin<GIC>>> wakeRequestPorts;

     SCGIC *scGIC;


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/54783
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: I561ef876a4e873501ed2e9775b5bdb59707521a9
Gerrit-Change-Number: 54783
Gerrit-PatchSet: 5
Gerrit-Owner: Wing Li <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Wing Li <[email protected]>
Gerrit-Reviewer: Yu-hsin Wang <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-CC: Earl Ou <[email protected]>
Gerrit-CC: Gabe Black <[email protected]>
Gerrit-CC: Philip Metzler <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
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