41#include "debug/SMMUv3.hh"
49 const SMMUv3DeviceInterfaceParams &
p) :
60 microTLBEnable(
p.utlb_enable),
61 mainTLBEnable(
p.tlb_enable),
63 microTLBSem(
p.utlb_slots),
64 mainTLBSem(
p.tlb_slots),
65 microTLBLat(
p.utlb_lat),
66 mainTLBLat(
p.tlb_lat),
69 atsDevicePort(
name() +
".atsDevicePort", *this),
70 atsMemPort(
name() +
".atsMemPort", *this),
71 portWidth(
p.port_width),
72 wrBufSlotsRemaining(
p.wrbuf_slots),
73 xlateSlotsRemaining(
p.xlate_slots),
74 pendingMemAccesses(0),
75 prefetchEnable(
p.prefetch_enable),
76 prefetchReserveLastWay(
77 p.prefetch_reserve_last_way),
78 deviceNeedsRetry(false),
79 atsDeviceNeedsRetry(false),
80 sendDeviceRetryEvent(*this),
81 atsSendDeviceRetryEvent(*this)
92 fatal(
"Device port is not connected.\n");
99 if (
name ==
"ats_mem_side_port") {
101 }
else if (
name ==
"device_port") {
103 }
else if (
name ==
"ats_dev_side_port") {
182 const bool ats_request =
true;
184 proc_name, *
smmu, *
this);
208 const bool ats_request =
true;
221 DPRINTF(
SMMUv3,
"[t] ATS requestor resp addr=%#x size=%#x\n",
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
virtual std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
Ports are used to interface objects to each other.
Port & getPeer()
Return a reference to this port's peer.
bool isConnected() const
Is this port currently connected to a peer?
void schedTimingResp(PacketPtr pkt, Tick when)
Schedule the sending of a timing response.
void sendRangeChange() const
Called by the owner to send a range change.
void sendRetryReq()
Send a retry to the request port that previously attempted a sendTimingReq to this response port and ...
void beginTransaction(const SMMUTranslRequest &req)
SMMUATSMemoryPort atsMemPort
void atsSendDeviceRetry()
SMMUATSDevicePort atsDevicePort
void scheduleDeviceRetry()
void schedAtsTimingResp(PacketPtr pkt)
friend class SMMUTranslationProcess
Port & getPort(const std::string &name, PortID id) override
Get a port with a given name and index.
SMMUDeviceRetryEvent sendDeviceRetryEvent
Tick atsRecvAtomic(PacketPtr pkt)
void schedTimingResp(PacketPtr pkt)
SMMUv3DeviceInterface(const Params &p)
MemberEventWrapper<&SMMUv3DeviceInterface::atsSendDeviceRetry > atsSendDeviceRetryEvent
bool atsRecvTimingResp(PacketPtr pkt)
Tick recvAtomic(PacketPtr pkt)
bool atsRecvTimingReq(PacketPtr pkt)
SMMUDevicePort * devicePort
DrainState drain() override
Provide a default implementation of the drain interface for objects that don't need draining.
unsigned wrBufSlotsRemaining
unsigned xlateSlotsRemaining
bool recvTimingReq(PacketPtr pkt)
SMMUAction runProcessAtomic(SMMUProcess *proc, PacketPtr pkt)
SMMUAction runProcessTiming(SMMUProcess *proc, PacketPtr pkt)
DrainState
Object drain/handover states.
@ Draining
Draining buffers pending serialization/handover.
@ Drained
Buffers drained, ready for serialization/handover.
bool scheduled() const
Determine if the current event is scheduled.
void schedule(Event &event, Tick when)
#define fatal(...)
This implements a cprintf based fatal() function.
const Params & params() const
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.
T safe_cast(U &&ref_or_ptr)
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)
This is an implementation of the SMMUv3 architecture.
static SMMUTranslRequest fromPacket(PacketPtr pkt, bool ats=false)
const std::string & name()