Go to the documentation of this file.
44 #include "debug/GIC.hh"
45 #include "debug/Interrupt.hh"
63 DPRINTF(GIC,
"copy dist 0x%x 0x%08x\n", daddr,
val);
64 to->writeDistributor(daddr,
val);
70 const ArmISA::Affinity &aff,
Addr daddr)
74 "copy redist (aff3: %d, aff2: %d, aff1: %d, aff0: %d) "
76 aff.aff3, aff.aff2, aff.aff1, aff.aff0, daddr,
val);
78 to->writeRedistributor(aff, daddr,
val);
84 const ArmISA::Affinity &aff,
89 "copy cpu (aff3: %d, aff2: %d, aff1: %d, aff0: %d) "
91 aff.aff3, aff.aff2, aff.aff1, aff.aff0,
94 to->writeCpu(aff, misc_reg,
val);
99 const ArmISA::Affinity &aff,
Addr daddr)
101 to->writeRedistributor(aff, daddr, 0xFFFFFFFF);
107 const ArmISA::Affinity &aff,
108 Addr daddr,
size_t size)
110 for (
auto a = daddr;
a < daddr + size;
a += 4)
117 Addr daddr,
size_t size)
119 for (
auto a = daddr;
a < daddr + size;
a += 4)
126 for (
auto a = daddr;
a < daddr + size;
a += 4)
127 to->writeDistributor(
a, 0xFFFFFFFF);
145 "Exceeding maximum number of PEs supported by GICv3: "
146 "using %u while maximum is %u.", threads,
params().cpu_max);
148 for (
int i = 0;
i < threads;
i++) {
163 for (
int i = 0;
i < threads;
i++) {
179 const size_t size = pkt->
getSize();
180 bool is_secure_access = pkt->
isSecure();
188 delay =
params().dist_pio_delay;
189 DPRINTF(GIC,
"Gicv3::read(): (distributor) context_id %d register %#x "
190 "size %d is_secure_access %d (value %#x)\n",
191 pkt->
req->contextId(), daddr, size, is_secure_access, resp);
196 resp = redist->
read(daddr, size, is_secure_access);
198 delay =
params().redist_pio_delay;
199 DPRINTF(GIC,
"Gicv3::read(): (redistributor %d) context_id %d "
200 "register %#x size %d is_secure_access %d (value %#x)\n",
202 is_secure_access, resp);
204 panic(
"Gicv3::read(): unknown address %#x\n",
addr);
207 pkt->
setUintX(resp, ByteOrder::little);
215 const size_t size = pkt->
getSize();
218 bool is_secure_access = pkt->
isSecure();
224 DPRINTF(GIC,
"Gicv3::write(): (distributor) context_id %d "
225 "register %#x size %d is_secure_access %d value %#x\n",
226 pkt->
req->contextId(), daddr, size, is_secure_access,
data);
228 delay =
params().dist_pio_delay;
233 DPRINTF(GIC,
"Gicv3::write(): (redistributor %d) context_id %d "
234 "register %#x size %d is_secure_access %d value %#x\n",
236 is_secure_access,
data);
238 redist->
write(daddr,
data, size, is_secure_access);
240 delay =
params().redist_pio_delay;
242 panic(
"Gicv3::write(): unknown address %#x\n",
addr);
285 tc->getCpuPtr()->postInterrupt(tc->threadId(),
int_type, 0);
300 tc->getCpuPtr()->clearInterrupt(tc->threadId(),
int_type, 0);
307 tc->getCpuPtr()->clearInterrupts(tc->threadId());
314 return tc->getCpuPtr()->checkInterrupts(tc->threadId());
327 if (redistributor->getAffinity() == aff) {
328 return redistributor;
339 "Address not pointing to a valid redistributor\n");
342 const uint32_t redistributor_id = daddr /
redistSize;
345 "Invalid redistributor_id!");
361 assert(redistributor);
362 return redistributor->read(daddr, 4,
false);
369 assert(cpu_interface);
370 return cpu_interface->readMiscReg(misc_reg);
383 assert(redistributor);
384 redistributor->write(daddr,
data,
sizeof(
data),
false);
392 assert(cpu_interface);
393 cpu_interface->setMiscReg(misc_reg,
data);
401 redistributor->copy(from,
to);
404 cpu_interface->copy(from,
to);
413 for (uint32_t redistributor_id = 0;
416 csprintf(
"redistributors.%i", redistributor_id));
418 for (uint32_t cpu_interface_id = 0;
421 csprintf(
"cpuInterface.%i", cpu_interface_id));
431 for (uint32_t redistributor_id = 0;
434 csprintf(
"redistributors.%i", redistributor_id));
436 for (uint32_t cpu_interface_id = 0;
439 csprintf(
"cpuInterface.%i", cpu_interface_id));
void writeRedistributor(const ArmISA::Affinity &aff, Addr daddr, uint32_t data) override
ArmSystem * getSystem() const
Addr start() const
Get the start address of the range.
static void copyDistRange(Gicv3Registers *from, Gicv3Registers *to, Addr daddr, size_t size)
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
bool haveAsserted(uint32_t cpu) const
static void copyRedistRange(Gicv3Registers *from, Gicv3Registers *to, const ArmISA::Affinity &aff, Addr daddr, size_t size)
AddrRange RangeSize(Addr start, Addr size)
uint64_t read(Addr addr, size_t size, bool is_secure_access)
RequestPtr req
A pointer to the original request.
bool contains(const Addr &a) const
Determine if the range contains an address.
void serializeSection(CheckpointOut &cp, const char *name) const
Serialize an object into a new section.
Gicv3Redistributor * getRedistributorByAddr(Addr address) const
void deassertAll(uint32_t cpu)
void clearPPInt(uint32_t int_id, uint32_t cpu) override
const char *const miscRegName[]
std::string csprintf(const char *format, const Args &...args)
void makeAtomicResponse()
void write(Addr addr, uint64_t data, size_t size, bool is_secure_access)
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Gicv3Redistributor * getRedistributorByAffinity(const ArmISA::Affinity &aff) const
virtual uint32_t readRedistributor(const ArmISA::Affinity &aff, Addr daddr)=0
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
static void copyRedistRegister(Gicv3Registers *from, Gicv3Registers *to, const ArmISA::Affinity &aff, Addr daddr)
void copy(Gicv3Registers *from, Gicv3Registers *to)
void writeCpu(const ArmISA::Affinity &aff, ArmISA::MiscRegIndex misc_reg, RegVal data) override
void sendPPInt(uint32_t int_id, uint32_t cpu) override
Interface call for private peripheral interrupts.
uint32_t readDistributor(Addr daddr) override
void postInt(uint32_t cpu, ArmISA::InterruptTypes int_type)
void write(Addr addr, uint64_t data, size_t size, bool is_secure_access)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Gicv3CPUInterface * getCPUInterface() const
void sendInt(uint32_t int_id)
void unserializeSection(CheckpointIn &cp, const char *name)
Unserialize an a child object.
std::vector< Gicv3CPUInterface * > cpuInterfaces
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
uint64_t Tick
Tick count type.
uint32_t processorNumber() const
Gicv3Distributor * distributor
virtual RegVal readCpu(const ArmISA::Affinity &aff, ArmISA::MiscRegIndex misc_reg)=0
std::vector< Gicv3Redistributor * > redistributors
friend class Gicv3Redistributor
const Params & params() const
static void copyCpuRegister(Gicv3Registers *from, Gicv3Registers *to, const ArmISA::Affinity &aff, ArmISA::MiscRegIndex misc_reg)
friend class Gicv3CPUInterface
uint64_t read(Addr addr, size_t size, bool is_secure_access)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void sendInt(uint32_t int_id) override
Post an interrupt from a device that is connected to the GIC.
RegVal readCpu(const ArmISA::Affinity &aff, ArmISA::MiscRegIndex misc_reg) override
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
static void callClearStandByWfi(ThreadContext *tc)
Make a call to notify the power controller of STANDBYWFI deassertion.
void clearInt(uint32_t int_id)
Gicv3CPUInterface * getCPUInterfaceByAffinity(const ArmISA::Affinity &aff) const
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
void copyGicState(Gicv3Registers *from, Gicv3Registers *to)
static void copyDistRegister(Gicv3Registers *from, Gicv3Registers *to, Addr daddr)
friend class Gicv3Distributor
void setGIC(BaseGic *gic)
Sets the pointer to the GIC.
std::ostream CheckpointOut
void writeDistributor(Addr daddr, uint32_t data) override
uint32_t readRedistributor(const ArmISA::Affinity &aff, Addr daddr) override
void deassertInt(uint32_t cpu, ArmISA::InterruptTypes int_type)
static void clearRedistRegister(Gicv3Registers *to, const ArmISA::Affinity &aff, Addr daddr)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
static const uint32_t ADDR_RANGE_SIZE
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
virtual uint32_t readDistributor(Addr daddr)=0
void clearInt(uint32_t int_id) override
Clear an interrupt from a device that is connected to the GIC.
#define panic(...)
This implements a cprintf based panic() function.
bool supportsVersion(GicVersion version) override
Check if version supported.
static void clearDistRange(Gicv3Registers *to, Addr daddr, size_t size)
Generated on Wed Jul 13 2022 10:39:18 for gem5 by doxygen 1.8.17