Go to the documentation of this file.
46 #include <unordered_map>
50 #include "arch/isa_traits.hh"
54 #include "config/the_isa.hh"
57 #include "enums/MemoryMode.hh"
62 #include "params/System.hh"
93 {
panic(
"SystemPort does not receive timing!\n");
return false; }
95 {
panic(
"SystemPort does not expect retry!\n"); }
117 std::string
name()
const;
190 return !(*
this == other);
229 void init()
override;
280 return memoryMode == Enums::atomic_noncaching;
473 std::string subrequestor = std::string());
508 const std::string& requestor_name);
515 const std::string& subrequestor);
637 #endif // __SYSTEM_HH__
const_iterator & operator=(const const_iterator &)=default
std::set< int > PIDs
Process set to track which PIDs have already been allocated.
std::list< BasicSignal > signalList
std::unordered_map< RequestorID, AbstractMemory * > deviceMemMap
RequestorID getRequestorId(const SimObject *requestor, std::string subrequestor=std::string())
Request an id used to create a request object in the system.
std::list< PCEvent * > liveEvents
RequestPort & getSystemPort()
Get a reference to the system port that can be used by non-structural simulation objects like process...
bool isTimingMode() const
Is the system in timing mode?
void startup() override
startup() is the final initialization call before simulation.
const PortID InvalidPortID
Addr getPageBytes() const
Get the page bytes for the ISA.
void workItemEnd(uint32_t tid, uint32_t workid)
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
Bitfield< 23, 20 > atomic
const AddrRange & m5opRange() const
Range used by memory-mapped m5 pseudo-ops if enabled.
ByteOrder getGuestByteOrder() const
Get the guest byte order.
void init() override
After all objects have been created and all ports are connected, check that the system port is connec...
int ContextID
Globally unique thread context ID.
RequestorID _getRequestorId(const SimObject *requestor, const std::string &requestor_name)
helper function for getRequestorId
void markActive(ContextID id)
uint64_t Tick
Tick count type.
ContextID registerThreadContext(ThreadContext *tc, ContextID assigned=InvalidContextID)
std::vector< RedirectPath * > redirectPaths
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
const unsigned int _cacheLineSize
FutexMap class holds a map of all futexes used in the system.
RequestorID getGlobalRequestorId(const std::string &requestor_name)
Registers a GLOBAL RequestorID, which is a RequestorID not related to any particular SimObject; since...
const ContextID InvalidContextID
KvmVM * getKvmVM()
Get a pointer to the Kernel Virtual Machine (KVM) SimObject, if present.
bool validKvmEnvironment() const
Verify gem5 configuration will support KVM emulation.
void replaceThreadContext(ThreadContext *tc, ContextID context_id)
int markWorkItem(int index)
Called by pseudo_inst to mark the cpus actively executing work items.
void workItemBegin(uint32_t tid, uint32_t workid)
uint64_t incWorkItemsEnd()
Called by pseudo_inst to track the number of work items completed by this system.
void replace(ThreadContext *tc, ContextID id)
PhysicalMemory & getPhysMem()
Get a pointer to access the physical memory of the system.
ThreadContext * findFree()
static void printSystems()
std::string stripSystemName(const std::string &requestor_name) const
Strips off the system name from a requestor name.
RequestorID lookupRequestorId(const SimObject *obj) const
Looks up the RequestorID for a given SimObject returns an invalid RequestorID (invldRequestorId) if n...
Enums::MemoryMode memoryMode
Arch getArch() const
Get the architecture.
static std::vector< System * > systemList
An abstract memory represents a contiguous block of physical memory, with an associated address range...
int64_t Counter
Statistics counter type.
Private class for the system port which is only used as a requestor for debug access and for non-stru...
void schedule(Event &event, Tick when)
Workload * workload
OS kernel.
void setMemoryMode(Enums::MemoryMode mode)
Change the memory mode of the system.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
const_iterator begin() const
const_iterator(const Threads &_threads, int _pos)
Ports are used to interface objects to each other.
void quiesceTick(ContextID id, Tick when)
void quiesce(ContextID id)
const_iterator end() const
ContextID insert(ThreadContext *tc, ContextID id=InvalidContextID)
bool schedule(PCEvent *event) override
bool bypassCaches() const
Should caches be bypassed?
uint64_t incWorkItemsBegin()
Called by pseudo_inst to track the number of work items started 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...
Addr memSize() const
Amount of physical memory that exists.
static int numSystemsRunning
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
ThermalModel * getThermalModel() const
The thermal model used for this system (if any).
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Thread & thread(ContextID id)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
ThreadContext * operator[](ContextID id) const
SystemPort(const std::string &_name, SimObject *_owner)
Create a system port with a name and an owner.
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.
const Thread & thread(ContextID id) const
Addr getPageShift() const
Get the number of bits worth of in-page address for the ISA.
Addr freeMemSize() const
Amount of physical memory that is still free.
virtual const std::string name() const
std::map< std::pair< uint32_t, uint32_t >, Tick > lastWorkItemStarted
Enums::MemoryMode getMemoryMode() const
Get the memory mode of the system.
bool operator==(const const_iterator &other) const
The physical memory encapsulates all memories in the system and provides basic functionality for acce...
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Additional function to return the Port of a memory object.
std::map< uint32_t, Stats::Histogram * > workItemStats
const AddrRange _m5opRange
Range for memory-mapped m5 pseudo ops.
This object is a proxy for a port or other object which implements the functional response protocol,...
bool isDeviceMemAddr(PacketPtr pkt) const
Similar to isMemAddr but for devices.
RequestorID maxRequestors()
Get the number of requestors registered in the system.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool operator!=(const const_iterator &other) const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::vector< RequestorInfo > requestors
This array is a per-system list of all devices capable of issuing a memory system request and an asso...
std::ostream CheckpointOut
void addDeviceMemory(RequestorID requestorId, AbstractMemory *deviceMemory)
Add a physical memory range for a device.
bool remove(PCEvent *event) override
std::string getRequestorName(RequestorID requestor_id)
Get the name of an object for a given request id.
Addr allocPhysPages(int npages)
Allocate npages contiguous unused physical pages.
AbstractMemory * getDeviceMemory(RequestorID _id) const
Return a pointer to the device memory.
unsigned int cacheLineSize() const
Get the cache line size of the system.
void regStats() override
Callback to set stat parameters.
bool isAtomicMode() const
Is the system in atomic mode?
const Params * params() const
const_iterator & operator++()
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.
std::vector< Thread > threads
#define panic(...)
This implements a cprintf based panic() function.
std::forward_iterator_tag iterator_category
void drainResume() override
Resume execution after a successful drain.
Tick curTick()
The current simulated tick.
ThermalModel * thermalModel
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:01 for gem5 by doxygen 1.8.17