47#include <unordered_map>
55#include "enums/MemoryMode.hh"
60#include "params/System.hh"
97 panic(
"SystemPort does not receive timing!");
103 panic(
"SystemPort does not expect retry!");
111 std::unordered_map<RequestorID, std::vector<memory::AbstractMemory *>>
126 std::string
name()
const;
196 return !(*
this == other);
281 return memoryMode == enums::atomic_noncaching;
465 std::string subrequestor={});
500 const std::string& requestor_name);
507 const std::string& subrequestor);
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
FutexMap class holds a map of all futexes used in the system.
virtual std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
This object is a proxy for a port or other object which implements the functional response protocol,...
Ports are used to interface objects to each other.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Abstract superclass for simulation objects.
Private class for the system port which is only used as a requestor for debug access and for non-stru...
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
SystemPort(const std::string &_name)
Create a system port with a name and an owner.
const_iterator & operator++()
bool operator==(const const_iterator &other) const
std::forward_iterator_tag iterator_category
const_iterator(const Threads &_threads, int _pos)
bool operator!=(const const_iterator &other) const
const Thread & thread(ContextID id) const
const_iterator end() const
void quiesceTick(ContextID id, Tick when)
void markActive(ContextID id)
const_iterator begin() const
void quiesce(ContextID id)
Thread & thread(ContextID id)
void insert(ThreadContext *tc)
std::vector< Thread > threads
ThreadContext * operator[](ContextID id) const
void replace(ThreadContext *tc, ContextID id)
ThreadContext * findFree()
KvmVM * getKvmVM() const
Get a pointer to the Kernel Virtual Machine (KVM) SimObject, if present.
ThermalModel * getThermalModel() const
The thermal model used for this system (if any).
void setKvmVM(KvmVM *const vm)
Set the pointer to the Kernel Virtual Machine (KVM) SimObject.
void serialize(CheckpointOut &cp) const override
Serialize an object.
RequestorID lookupRequestorId(const SimObject *obj) const
Looks up the RequestorID for a given SimObject returns an invalid RequestorID (invldRequestorId) if n...
int markWorkItem(int index)
Called by pseudo_inst to mark the cpus actively executing work items.
bool remove(PCEvent *event) override
memory::PhysicalMemory & getPhysMem()
Get a pointer to access the physical memory of the system.
bool isAtomicMode() const
Is the system in atomic mode?
RequestorID _getRequestorId(const SimObject *requestor, const std::string &requestor_name)
helper function for getRequestorId
static int numSystemsRunning
void registerThreadContext(ThreadContext *tc)
enums::MemoryMode memoryMode
bool isTimingMode() const
Is the system in timing mode?
uint64_t incWorkItemsEnd()
Called by pseudo_inst to track the number of work items completed by this system.
std::string leafRequestorName(const SimObject *requestor, const std::string &subrequestor)
Helper function for constructing the full (sub)requestor name by providing the root requestor and the...
AddrRangeList getShadowRomRanges() const
std::set< int > PIDs
Process set to track which PIDs have already been allocated.
void addDeviceMemory(RequestorID requestorId, memory::AbstractMemory *deviceMemory)
Add a physical memory range for a device.
Addr memSize() const
Amount of physical memory that exists.
std::unordered_map< RequestorID, std::vector< memory::AbstractMemory * > > deviceMemMap
std::string getRequestorName(RequestorID requestor_id)
Get the name of an object for a given request id.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool isMemAddr(Addr addr) const
Check if a physical address is within a range of a memory that is part of the global address map.
RequestorID getRequestorId(const SimObject *requestor, std::string subrequestor={})
Request an id used to create a request object in the system.
uint64_t incWorkItemsBegin()
Called by pseudo_inst to track the number of work items started by this system.
bool schedule(PCEvent *event) override
const AddrRange & m5opRange() const
Range used by memory-mapped m5 pseudo-ops if enabled.
std::list< BasicSignal > signalList
bool isDeviceMemAddr(const PacketPtr &pkt) const
Similar to isMemAddr but for devices.
RequestorID maxRequestors()
Get the number of requestors registered in the system.
std::map< std::pair< uint32_t, uint32_t >, Tick > lastWorkItemStarted
memory::PhysicalMemory physmem
static void printSystems()
enums::MemoryMode getMemoryMode() const
Get the memory mode of the system.
bool bypassCaches() const
Should caches be bypassed?
std::map< uint32_t, statistics::Histogram * > workItemStats
std::string stripSystemName(const std::string &requestor_name) const
Strips off the system name from a requestor name.
void setMemoryMode(enums::MemoryMode mode)
Change the memory mode of the system.
void workItemEnd(uint32_t tid, uint32_t workid)
Workload * workload
OS kernel.
std::vector< RedirectPath * > redirectPaths
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
Addr cacheLineSize() const
Get the cache line size of the system.
const Addr _cacheLineSize
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Additional function to return the Port of a memory object.
RequestPort & getSystemPort()
Get a reference to the system port that can be used by non-structural simulation objects like process...
ThermalModel * thermalModel
ByteOrder getGuestByteOrder() const
Get the guest byte order.
void regStats() override
Callback to set stat parameters.
RequestorID getGlobalRequestorId(const std::string &requestor_name)
Registers a GLOBAL RequestorID, which is a RequestorID not related to any particular SimObject; since...
memory::AbstractMemory * getDeviceMemory(const PacketPtr &pkt) const
Return a pointer to the device memory.
std::list< PCEvent * > liveEvents
const memory::PhysicalMemory & getPhysMem() const
void workItemBegin(uint32_t tid, uint32_t workid)
std::vector< RequestorInfo > requestors
This array is a per-system list of all devices capable of issuing a memory system request and an asso...
static std::vector< System * > systemList
bool trapToGdb(GDBSignal signal, ContextID ctx_id) const
AddrRangeList ShadowRomRanges
void replaceThreadContext(ThreadContext *tc, ContextID context_id)
const AddrRange _m5opRange
Range for memory-mapped m5 pseudo ops.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual ByteOrder byteOrder() const =0
An abstract memory represents a contiguous block of physical memory, with an associated address range...
The physical memory encapsulates all memories in the system and provides basic functionality for acce...
void schedule(Event &event, Tick when)
#define panic(...)
This implements a cprintf based panic() function.
RequestorInfo declaration.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const PortID InvalidPortID
Tick curTick()
The universal simulation clock.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
uint64_t Tick
Tick count type.
int ContextID
Globally unique thread context ID.
PortProxy Object Declaration.
Declaration of Statistics objects.