46 #include <unordered_map> 50 #include "arch/isa_traits.hh" 54 #include "config/the_isa.hh" 56 #include "enums/MemoryMode.hh" 61 #include "params/System.hh" 92 {
panic(
"SystemPort does not receive timing!\n");
return false; }
94 {
panic(
"SystemPort does not expect retry!\n"); }
102 void init()
override;
153 return memoryMode == Enums::atomic_noncaching;
188 return threadContexts[tid];
256 #if THE_ISA != NULL_ISA 259 panic(
"The NULL ISA has no endianness.");
343 std::string submaster = std::string());
378 const std::string& master_name);
385 const std::string& submaster);
419 assert(index < activeCpus.size());
420 activeCpus[
index] =
true;
422 i < activeCpus.end();
i++) {
514 #endif // __SYSTEM_HH__ bool schedule(PCEvent *event) override
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
#define panic(...)
This implements a cprintf based panic() function.
Ports are used to interface objects to each other.
ThermalModel * getThermalModel() const
The thermal model used for this system (if any).
const PortID InvalidPortID
std::string getMasterName(MasterID master_id)
Get the name of an object for a given request id.
Enums::MemoryMode memoryMode
ContextID registerThreadContext(ThreadContext *tc, ContextID assigned=InvalidContextID)
Bitfield< 23, 20 > atomic
std::vector< RedirectPath * > redirectPaths
MasterPort & getSystemPort()
Get a reference to the system port that can be used by non-structural simulation objects like process...
const Params * params() const
Addr freeMemSize() const
Amount of physical memory that is still free.
static void printSystems()
uint64_t incWorkItemsEnd()
Called by pseudo_inst to track the number of work items completed by this system. ...
Addr allocPhysPages(int npages)
Allocate npages contiguous unused physical pages.
void workItemEnd(uint32_t tid, uint32_t workid)
Addr getPageShift() const
Get the number of bits worth of in-page address for the ISA.
ByteOrder getGuestByteOrder() const
Get the guest byte order.
std::list< PCEvent * > liveEvents
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Declaration of Statistics objects.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
int numRunningContexts()
Return number of running (non-halted) thread contexts in system.
ThreadContext * getThreadContext(ContextID tid) const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
void regStats() override
Callback to set stat parameters.
PortProxy Object Declaration.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
bool isAtomicMode() const
Is the system in atomic mode?
Tick curTick()
The current simulated tick.
Addr memSize() const
Amount of physical memory that exists.
MasterID getGlobalMasterId(const std::string &master_name)
Registers a GLOBAL MasterID, which is a MasterID not related to any particular SimObject; since no Si...
void drainResume() override
Resume execution after a successful drain.
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...
uint64_t Tick
Tick count type.
std::set< int > PIDs
Process set to track which PIDs have already been allocated.
const unsigned int _cacheLineSize
int markWorkItem(int index)
Called by pseudo_inst to mark the cpus actively executing work items.
void serialize(CheckpointOut &cp) const override
Serialize an object.
MasterID getMasterId(const SimObject *master, std::string submaster=std::string())
Request an id used to create a request object in the system.
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
const AddrRange _m5opRange
Range for memory-mapped m5 pseudo ops.
KvmVM * getKvmVM()
Get a pointer to the Kernel Virtual Machine (KVM) SimObject, if present.
std::vector< ThreadContext * > threadContexts
ThermalModel * thermalModel
unsigned numContexts() const
void schedule(Event &event, Tick when)
ThreadContext * findFreeContext()
std::map< uint32_t, Stats::Histogram * > workItemStats
Workload * workload
OS kernel.
The physical memory encapsulates all memories in the system and provides basic functionality for acce...
Enums::MemoryMode getMemoryMode() const
Get the memory mode of the system.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int64_t Counter
Statistics counter type.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
std::list< BasicSignal > signalList
std::vector< bool > activeCpus
MasterID maxMasters()
Get the number of masters registered in the system.
MasterID lookupMasterId(const SimObject *obj) const
Looks up the MasterID for a given SimObject returns an invalid MasterID (invldMasterId) if not found...
SystemPort(const std::string &_name, SimObject *_owner)
Create a system port with a name and an owner.
This object is a proxy for a port or other object which implements the functional response protocol...
const AddrRange & m5opRange() const
Range used by memory-mapped m5 pseudo-ops if enabled.
std::vector< MasterInfo > masters
This array is a per-system list of all devices capable of issuing a memory system request and an asso...
bool validKvmEnvironment() const
Verify gem5 configuration will support KVM emulation.
uint64_t incWorkItemsBegin()
Called by pseudo_inst to track the number of work items started by this system.
std::ostream CheckpointOut
static int numSystemsRunning
void workItemBegin(uint32_t tid, uint32_t workid)
bool bypassCaches() const
Should caches be bypassed?
Private class for the system port which is only used as a master for debug access and for non-structu...
MasterID _getMasterId(const SimObject *master, const std::string &master_name)
helper function for getMasterId
const std::string name() const
Return port name (for DPRINTF).
FutexMap class holds a map of all futexes used in the system.
PhysicalMemory & getPhysMem()
Get a pointer to access the physical memory of the system.
const ContextID InvalidContextID
void replaceThreadContext(ThreadContext *tc, ContextID context_id)
std::map< std::pair< uint32_t, uint32_t >, Tick > lastWorkItemStarted
std::vector< BaseRemoteGDB * > remoteGDB
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
std::string stripSystemName(const std::string &master_name) const
Strips off the system name from a master name.
const ByteOrder GuestByteOrder
bool isTimingMode() const
Is the system in timing mode?
Abstract superclass for simulation objects.
int ContextID
Globally unique thread context ID.
void startup() override
startup() is the final initialization call before simulation.
Addr getPageBytes() const
Get the page bytes for the ISA.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Additional function to return the Port of a memory object.
Arch getArch() const
Get the architecture.
std::string leafMasterName(const SimObject *master, const std::string &submaster)
Helper function for constructing the full (sub)master name by providing the root master and the relat...
void setMemoryMode(Enums::MemoryMode mode)
Change the memory mode of the system.
unsigned int cacheLineSize() const
Get the cache line size of the system.
static std::vector< System * > systemList