44 i <
p.port_local_interrupt_pins_connection_count;
46 uint8_t interruptID =
p.local_interrupt_ids[
i];
47 assert(interruptID <= 47);
49 csprintf(
"%s.local_interrupt_pins[%d]",
p.name,
i);
57std::bitset<NumInterruptTypes>
64 if (misa.rvs || misa.rvn) {
68 if (misa.rvs && misa.rvn) {
76 mask.local = ~sideleg.local;
78 mask.local =
mask.local | sideleg.local;
79 mask.mei = (!sideleg.mei) | (sideleg.mei &
status.uie);
80 mask.mti = (!sideleg.mti) | (sideleg.mti &
status.uie);
81 mask.msi = (!sideleg.msi) | (sideleg.msi &
status.uie);
82 mask.sei = (!sideleg.sei) | (sideleg.sei &
status.uie);
83 mask.sti = (!sideleg.sti) | (sideleg.sti &
status.uie);
84 mask.ssi = (!sideleg.ssi) | (sideleg.ssi &
status.uie);
90 mask.local = ~mideleg.local;
92 mask.local =
mask.local | mideleg.local;
93 mask.mei = (!mideleg.mei) | (mideleg.mei &
status.uie);
94 mask.mti = (!mideleg.mti) | (mideleg.mti &
status.uie);
95 mask.msi = (!mideleg.msi) | (mideleg.msi &
status.uie);
102 mask.local = ~mideleg.local;
103 mask.mei = (!mideleg.mei) | (mideleg.mei &
status.sie);
104 mask.mti = (!mideleg.mti) | (mideleg.mti &
status.sie);
105 mask.msi = (!mideleg.msi) | (mideleg.msi &
status.sie);
108 mask.local =
mask.local | mideleg.local;
122 panic(
"Unknown privilege mode %d.", prv);
126 return std::bitset<NumInterruptTypes>(
mask);
134 return std::make_shared<NonMaskableInterruptFault>();
154 for (
const int &
id : interrupt_order) {
156 return std::make_shared<InterruptFault>(
id);
169 for (
const int &
id : interrupt_order) {
171 return std::make_shared<InterruptFault>(
id);
217 unsigned long ip_ulong =
ip.to_ulong();
218 unsigned long ie_ulong =
ie.to_ulong();
226 unsigned long ip_ulong;
227 unsigned long ie_ulong;
void postInterrupt(ThreadID tid, int int_num, int index)
Ports are used to interface objects to each other.
std::vector< gem5::IntSinkPin< Interrupts > * > localInterruptPins
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Interrupts(const Params &p)
void clear(int int_num, int index) override
bool checkInterrupts() const override
bool checkNonMaskableInterrupt() const
void post(int int_num, int index) override
void serialize(CheckpointOut &cp) const override
Serialize an object.
void raiseInterruptPin(uint32_t num)
Port & getPort(const std::string &if_name, PortID idx) override
Get a port with a given name and index.
RiscvInterruptsParams Params
std::bitset< NumInterruptTypes > globalMask() const
std::bitset< NumInterruptTypes > ip
bool checkInterrupt(int num) const
Fault getInterrupt() override
std::bitset< NumInterruptTypes > ie
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual BaseISA * getIsaPtr() const =0
virtual BaseCPU * getCpuPtr()=0
virtual int threadId() const =0
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
#define panic(...)
This implements a cprintf based panic() function.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
constexpr enums::RiscvType RV32
constexpr enums::RiscvType RV64
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< FaultBase > Fault
std::ostream CheckpointOut
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
std::string csprintf(const char *format, const Args &...args)
IntSinkPinBase IntSinkPin
constexpr decltype(nullptr) NoFault
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)