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") {
154 : threadContext(tc), platform(dynamic_cast<
RealView*>(
p.platform)),
155 intNum(
p.num), triggerType(
p.int_type), _active(false)
163 "InterruptLine::setThreadContext called twice\n");
172 "call to InterruptLine::setThreadContext.\n");
189 const ArmSPIParams &
p)
Base class for ARM GIC implementations.
This SimObject is instantiated in the python world and serves as an ArmInterruptPin generator.
ArmInterruptPinGen(const ArmInterruptPinParams &p)
Generic representation of an Arm interrupt pin.
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.
virtual void raise()=0
Signal an 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.
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.
virtual void sendPPInt(uint32_t num, uint32_t cpu)=0
Interface call for private peripheral interrupts.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
const Params & params() const
virtual void clearPPInt(uint32_t num, uint32_t cpu)=0
virtual void clearInt(uint32_t num)=0
Clear an interrupt from a device that is connected to the GIC.
ArmSystem * getSystem() const
virtual void sendInt(uint32_t num)=0
Post an interrupt from a device that is connected to the GIC.
virtual std::string name() const
This device is the base class which all devices senstive to an address range inherit from.
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.
Abstract superclass for simulation objects.
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
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 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
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)