42#include "debug/GIC.hh"
43#include "params/ArmInterruptPin.hh"
44#include "params/ArmPPI.hh"
45#include "params/ArmSigInterruptPin.hh"
46#include "params/ArmSPI.hh"
47#include "params/BaseGic.hh"
62 fatal_if(!rv,
"GIC model can't register with platform code");
107 panic_if(!tc,
"Invalid Thread Context\n");
110 auto pin_it =
pins.find(cid);
112 if (pin_it !=
pins.end()) {
114 return pin_it->second;
119 pins.insert({cid, pin});
138 if (if_name ==
"irq") {
140 if (idx >=
pin->sigPin.size())
141 pin->sigPin.resize(idx + 1);
142 if (!
pin->sigPin.at(idx))
143 pin->sigPin.at(idx).reset(
146 return *
pin->sigPin.at(idx);
163 "InterruptLine::setThreadContext called twice\n");
172 "call to InterruptLine::setThreadContext.\n");
189 const ArmSPIParams &
p)
Base class for ARM GIC implementations.
ArmInterruptPinGen(const ArmInterruptPinParams &p)
Generic representation of an Arm interrupt pin.
const ArmInterruptType triggerType
Interrupt triggering type.
RealView *const platform
Arm platform to use for interrupt generation.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
ContextID targetContext() const
Get the target context ID of this interrupt.
const uint32_t intNum
Interrupt number to generate.
bool _active
True if interrupt pin is active, false otherwise.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void setThreadContext(ThreadContext *tc)
Set the thread context owning this interrupt.
ArmInterruptPin(const ArmInterruptPinParams &p, ThreadContext *tc)
const ThreadContext * threadContext
Pointer to the thread context that owns this interrupt in case it is a thread-/CPU-private interrupt.
uint32_t num() const
Get interrupt number.
ArmInterruptPin * get(ThreadContext *tc=nullptr) override
std::unordered_map< ContextID, ArmPPI * > pins
ArmPPIGen(const Params &p)
void clear() override
Clear a signalled interrupt.
ArmPPI(const ArmPPIParams &p, ThreadContext *tc)
void raise() override
Signal an interrupt.
ArmSPIGen(const ArmSPIParams &p)
ArmInterruptPin * get(ThreadContext *tc=nullptr) override
void raise() override
Signal an interrupt.
ArmSPI(const ArmSPIParams &p)
void clear() override
Clear a signalled interrupt.
ArmInterruptPin * get(ThreadContext *tc=nullptr) override
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
ArmSigInterruptPinGen(const ArmSigInterruptPinParams &p)
std::vector< std::unique_ptr< IntSourcePin< ArmSigInterruptPinGen > > > sigPin
ArmSigInterruptPin(const ArmSigInterruptPinParams &p)
void raise() override
Signal an interrupt.
void clear() override
Clear a signalled interrupt.
void setGIC(BaseGic *gic)
Sets the pointer to the GIC.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
const Params & params() const
Platform * platform
Platform this GIC belongs to.
ArmSystem * getSystem() const
virtual std::string name() const
PioDevice(const Params &p)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Ports are used to interface objects to each other.
void setGic(BaseGic *_gic)
Give platform a pointer to interrupt controller.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual ContextID contextId() const =0
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
const Params & params() const
SimObject(const Params &p)
const SimObjectParams & _params
Cached copy of the object parameters.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Copyright (c) 2024 Arm Limited All rights reserved.
const PortID InvalidPortID
IntSourcePinBase IntSourcePin
std::ostream CheckpointOut
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
int ContextID
Globally unique thread context ID.
std::string csprintf(const char *format, const Args &...args)
Declaration of top level class for the RealView platform chips.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)