From f7857867ae54fc868e265d1aa2ea171b413c1776 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 12 Jan 2023 01:05:32 -0800 Subject: [PATCH] fastmodel: Export the "reset_in" reset signal from the PL330. This is essentially the same as how the reset signals were exported from the CortexR52 which I used as an example, except here there is only one reset. I passed through with the same name rather than calling it "model_reset" as in the CortexR52 since the pass through is trivial, and renaming the signal with no additional functionality seemed like it would just create confusion. In the CortexR52 case it makes more sense since there are multiple reset lines that need to be toggled to actually cause a reset, and a level of abstraction is actually helpful. Change-Id: I6b61fed6eb1566d131d4b0367fe4ae65031b25f8 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67351 Maintainer: Gabe Black Reviewed-by: Yu-hsin Wang Tested-by: kokoro --- src/arch/arm/fastmodel/PL330_DMAC/FastModelPL330.py | 3 +++ src/arch/arm/fastmodel/PL330_DMAC/PL330.lisa | 5 +++++ src/arch/arm/fastmodel/PL330_DMAC/pl330.cc | 8 +++++++- src/arch/arm/fastmodel/PL330_DMAC/pl330.hh | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/arch/arm/fastmodel/PL330_DMAC/FastModelPL330.py b/src/arch/arm/fastmodel/PL330_DMAC/FastModelPL330.py index ad43fed237..21ead525d3 100644 --- a/src/arch/arm/fastmodel/PL330_DMAC/FastModelPL330.py +++ b/src/arch/arm/fastmodel/PL330_DMAC/FastModelPL330.py @@ -26,6 +26,7 @@ from m5.params import * from m5.objects.FastModel import AmbaInitiatorSocket, AmbaTargetSocket from m5.objects.IntPin import IntSourcePin +from m5.objects.ResetPort import ResetResponsePort from m5.objects.SystemC import SystemC_ScModule @@ -197,6 +198,8 @@ class FastModelPL330(SystemC_ScModule): pio_s = AmbaTargetSocket(64, "Register accesses (secure)") pio_ns = AmbaTargetSocket(64, "Register accesses (non-secure)") + reset_in = ResetResponsePort("System reset") + # irq_abort_master_port # irq_master_port # pvbus_m diff --git a/src/arch/arm/fastmodel/PL330_DMAC/PL330.lisa b/src/arch/arm/fastmodel/PL330_DMAC/PL330.lisa index 3c31c90d87..d57dfdad3d 100644 --- a/src/arch/arm/fastmodel/PL330_DMAC/PL330.lisa +++ b/src/arch/arm/fastmodel/PL330_DMAC/PL330.lisa @@ -64,6 +64,9 @@ component PL330 // Interrupts. pl330.irq_master_port => self.irq; pl330.irq_abort_master_port => self.irq_abort; + + // Reset signals. + self.reset_in => pl330.reset_in; } properties @@ -85,4 +88,6 @@ component PL330 master port irq[32]; master port irq_abort; + + slave port reset_in; } diff --git a/src/arch/arm/fastmodel/PL330_DMAC/pl330.cc b/src/arch/arm/fastmodel/PL330_DMAC/pl330.cc index e582404c8c..13162bd409 100644 --- a/src/arch/arm/fastmodel/PL330_DMAC/pl330.cc +++ b/src/arch/arm/fastmodel/PL330_DMAC/pl330.cc @@ -45,7 +45,8 @@ PL330::PL330(const FastModelPL330Params ¶ms, dma(amba_m, params.name + ".dma", -1), pioS(amba_s, params.name + ".pio_s", -1), pioNs(amba_s_ns, params.name + ".pio_ns", -1), - irqAbortReceiver("irq_abort_receiver") + irqAbortReceiver("irq_abort_receiver"), + resetIn("reset_in", 0) { set_parameter("pl330.fifo_size", params.fifo_size); set_parameter("pl330.max_transfer", params.max_transfer); @@ -211,6 +212,9 @@ PL330::PL330(const FastModelPL330Params ¶ms, // And install it. irqAbortReceiver.onChange(abort_change); + + // Plumb the reset signal. + resetIn.signal_out.bind(this->reset_in); } void @@ -250,6 +254,8 @@ PL330::gem5_getPort(const std::string &if_name, int idx) } if (port != -1 && port < irqPort.size()) return *irqPort[port].at(idx); + } else if (if_name == "reset_in") { + return resetIn; } return scx_evs_PL330::gem5_getPort(if_name, idx); diff --git a/src/arch/arm/fastmodel/PL330_DMAC/pl330.hh b/src/arch/arm/fastmodel/PL330_DMAC/pl330.hh index 3af56f2e6e..389f7047c7 100644 --- a/src/arch/arm/fastmodel/PL330_DMAC/pl330.hh +++ b/src/arch/arm/fastmodel/PL330_DMAC/pl330.hh @@ -39,6 +39,7 @@ #include "arch/arm/fastmodel/amba_ports.hh" #include "arch/arm/fastmodel/common/signal_receiver.hh" +#include "arch/arm/fastmodel/common/signal_sender.hh" #include "arch/arm/fastmodel/protocol/exported_clock_rate_control.hh" #include "dev/intpin.hh" #include "params/FastModelPL330.hh" @@ -73,6 +74,8 @@ class PL330 : public scx_evs_PL330 void allocateIrq(int idx, int count); + SignalSender resetIn; + public: PL330(const FastModelPL330Params ¶ms, sc_core::sc_module_name _name); PL330(const FastModelPL330Params ¶ms) :