gem5
v19.0.0.0
|
#include <system.hh>
Classes | |
class | SystemPort |
Private class for the system port which is only used as a master for debug access and for non-structural entities that do not have a port of their own. More... | |
Public Types | |
typedef SystemParams | Params |
![]() | |
typedef SimObjectParams | Params |
Public Member Functions | |
void | init () override |
After all objects have been created and all ports are connected, check that the system port is connected. More... | |
MasterPort & | getSystemPort () |
Get a reference to the system port that can be used by non-structural simulation objects like processes or threads, or external entities like loaders and debuggers, etc, to access the memory system. More... | |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Additional function to return the Port of a memory object. More... | |
unsigned int | cacheLineSize () const |
Get the cache line size of the system. More... | |
ThreadContext * | findFreeContext () |
ThreadContext * | getThreadContext (ContextID tid) const |
bool | schedule (PCEvent *event) override |
bool | remove (PCEvent *event) override |
unsigned | numContexts () const |
int | numRunningContexts () |
Return number of running (non-halted) thread contexts in system. More... | |
KvmVM * | getKvmVM () |
Get a pointer to the Kernel Virtual Machine (KVM) SimObject, if present. More... | |
bool | validKvmEnvironment () const |
Verify gem5 configuration will support KVM emulation. More... | |
PhysicalMemory & | getPhysMem () |
Get a pointer to access the physical memory of the system. More... | |
Addr | freeMemSize () const |
Amount of physical memory that is still free. More... | |
Addr | memSize () const |
Amount of physical memory that exists. More... | |
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. More... | |
Arch | getArch () const |
Get the architecture. More... | |
ByteOrder | getGuestByteOrder () const |
Get the guest byte order. More... | |
Addr | getPageBytes () const |
Get the page bytes for the ISA. More... | |
Addr | getPageShift () const |
Get the number of bits worth of in-page address for the ISA. More... | |
ThermalModel * | getThermalModel () const |
The thermal model used for this system (if any). More... | |
MasterID | getMasterId (const SimObject *master, std::string submaster=std::string()) |
Request an id used to create a request object in the system. More... | |
MasterID | getGlobalMasterId (const std::string &master_name) |
Registers a GLOBAL MasterID, which is a MasterID not related to any particular SimObject; since no SimObject is passed, the master gets registered by providing the full master name. More... | |
std::string | getMasterName (MasterID master_id) |
Get the name of an object for a given request id. More... | |
MasterID | lookupMasterId (const SimObject *obj) const |
Looks up the MasterID for a given SimObject returns an invalid MasterID (invldMasterId) if not found. More... | |
MasterID | lookupMasterId (const std::string &name) const |
Looks up the MasterID for a given object name string returns an invalid MasterID (invldMasterId) if not found. More... | |
MasterID | maxMasters () |
Get the number of masters registered in the system. More... | |
void | regStats () override |
Callback to set stat parameters. More... | |
uint64_t | incWorkItemsBegin () |
Called by pseudo_inst to track the number of work items started by this system. More... | |
uint64_t | incWorkItemsEnd () |
Called by pseudo_inst to track the number of work items completed by this system. More... | |
int | markWorkItem (int index) |
Called by pseudo_inst to mark the cpus actively executing work items. More... | |
void | workItemBegin (uint32_t tid, uint32_t workid) |
void | workItemEnd (uint32_t tid, uint32_t workid) |
virtual Addr | fixFuncEventAddr (Addr addr) |
Fix up an address used to match PCs for hooking simulator events on to target function executions. More... | |
bool | breakpoint () |
System (Params *p) | |
~System () | |
void | initState () override |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
const Params * | params () const |
const AddrRange & | m5opRange () const |
Range used by memory-mapped m5 pseudo-ops if enabled. More... | |
Addr | getKernelStart () const |
Returns the address the kernel starts at. More... | |
Addr | getKernelEnd () const |
Returns the address the kernel ends at. More... | |
Addr | getKernelEntry () const |
Returns the address the entry point to the kernel code. More... | |
Addr | allocPhysPages (int npages) |
Allocate npages contiguous unused physical pages. More... | |
ContextID | registerThreadContext (ThreadContext *tc, ContextID assigned=InvalidContextID) |
void | replaceThreadContext (ThreadContext *tc, ContextID context_id) |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
void | drainResume () override |
Resume execution after a successful drain. More... | |
bool | isAtomicMode () const |
Is the system in atomic mode? More... | |
bool | isTimingMode () const |
Is the system in timing mode? More... | |
bool | bypassCaches () const |
Should caches be bypassed? More... | |
Enums::MemoryMode | getMemoryMode () const |
Get the memory mode of the system. More... | |
void | setMemoryMode (Enums::MemoryMode mode) |
Change the memory mode of the system. More... | |
template<class T , typename... Args> | |
T * | addFuncEvent (const SymbolTable *symtab, const char *lbl, const std::string &desc, Args... args) |
Add a function-based event to the given function, to be looked up in the specified symbol table. More... | |
template<class T > | |
T * | addFuncEvent (const SymbolTable *symtab, const char *lbl) |
template<class T , typename... Args> | |
T * | addFuncEventOrPanic (const SymbolTable *symtab, const char *lbl, Args... args) |
template<class T , typename... Args> | |
T * | addKernelFuncEvent (const char *lbl, Args... args) |
Add a function-based event to a kernel symbol. More... | |
template<class T , typename... Args> | |
T * | addKernelFuncEventOrPanic (const char *lbl, Args... args) |
![]() | |
const Params * | params () const |
SimObject (const Params *_params) | |
virtual | ~SimObject () |
virtual const std::string | name () const |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | regProbePoints () |
Register probe points for this object. More... | |
virtual void | regProbeListeners () |
Register probe listeners for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. More... | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. More... | |
![]() | |
EventManager (EventManager &em) | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
void | setCurTick (Tick newVal) |
![]() | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
![]() | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
![]() | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | resetStats () |
Callback to reset stats. More... | |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (Stats::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
Static Public Member Functions | |
static void | printSystems () |
![]() | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
![]() | |
static const std::string & | currentSection () |
Get the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
static void | unserializeGlobals (CheckpointIn &cp) |
Public Attributes | |
std::vector< ThreadContext * > | threadContexts |
const bool | multiThread |
Addr | pagePtr |
uint64_t | init_param |
PortProxy | physProxy |
Port to physical memory used for writing object files into ram at boot. More... | |
SymbolTable * | kernelSymtab |
kernel symbol table More... | |
ObjectFile * | kernel |
Object pointer for the kernel code. More... | |
MemoryImage | kernelImage |
std::vector< ObjectFile * > | kernelExtras |
Additional object files. More... | |
Addr | kernelStart |
Beginning of kernel code. More... | |
Addr | kernelEnd |
End of kernel code. More... | |
Addr | kernelEntry |
Entry point in the kernel to start at. More... | |
Addr | loadAddrMask |
Mask that should be anded for binary/symbol loading. More... | |
Addr | loadAddrOffset |
Offset that should be used for binary/symbol loading. More... | |
std::vector< BaseRemoteGDB * > | remoteGDB |
Counter | totalNumInsts |
std::map< std::pair< uint32_t, uint32_t >, Tick > | lastWorkItemStarted |
std::map< uint32_t, Stats::Histogram * > | workItemStats |
FutexMap | futexMap |
std::set< int > | PIDs |
Process set to track which PIDs have already been allocated. More... | |
std::list< BasicSignal > | signalList |
std::vector< RedirectPath * > | redirectPaths |
Static Public Attributes | |
static std::vector< System * > | systemList |
static int | numSystemsRunning = 0 |
static const int | maxPID = 32768 |
![]() | |
static int | ckptCount = 0 |
static int | ckptMaxCount = 0 |
static int | ckptPrevCount = -1 |
Protected Member Functions | |
std::string | stripSystemName (const std::string &master_name) const |
Strips off the system name from a master name. More... | |
MasterID | _getMasterId (const SimObject *master, const std::string &master_name) |
helper function for getMasterId More... | |
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 relative submaster name. More... | |
virtual void | serializeSymtab (CheckpointOut &os) const |
If needed, serialize additional symbol table entries for a specific subclass of this system. More... | |
virtual void | unserializeSymtab (CheckpointIn &cp) |
If needed, unserialize additional symbol table entries for a specific subclass of this system. More... | |
![]() | |
Drainable () | |
virtual | ~Drainable () |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
Protected Attributes | |
KvmVM *const | kvmVM |
PhysicalMemory | physmem |
Enums::MemoryMode | memoryMode |
const unsigned int | _cacheLineSize |
uint64_t | workItemsBegin |
uint64_t | workItemsEnd |
uint32_t | numWorkIds |
std::vector< bool > | activeCpus |
std::vector< MasterInfo > | masters |
This array is a per-system list of all devices capable of issuing a memory system request and an associated string for each master id. More... | |
ThermalModel * | thermalModel |
Params * | _params |
const AddrRange | _m5opRange |
Range for memory-mapped m5 pseudo ops. More... | |
![]() | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
![]() | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Private Attributes | |
std::list< PCEvent * > | liveEvents |
SystemPort | _systemPort |
typedef SystemParams System::Params |
System::System | ( | Params * | p | ) |
Definition at line 91 of file system.cc.
References _cacheLineSize, ArmISA::a, ImageFile::buildImage(), createObjectFile(), debugSymbolTable, ObjectFile::entryPoint(), fatal, fatal_if, findMsbSet(), FullSystem, Request::funcMasterId, getMasterId(), inform, Request::intMasterId, kernel, kernelEnd, kernelEntry, kernelExtras, kernelImage, kernelStart, kernelSymtab, kvmVM, loadAddrMask, loadAddrOffset, ObjectFile::loadGlobalSymbols(), ObjectFile::loadLocalSymbols(), M5_VAR_USED, MemoryImage::maxAddr(), MaxAddr, MemoryImage::minAddr(), MemoryImage::move(), numSystemsRunning, params(), KvmVM::setSystem(), systemList, warn_once, Request::wbMasterId, and X86ISA::x.
Referenced by getMasterName().
System::~System | ( | ) |
Definition at line 220 of file system.cc.
References ArmISA::j, kernel, kernelSymtab, numWorkIds, and workItemStats.
|
protected |
helper function for getMasterId
Definition at line 610 of file system.cc.
References Stats::enabled(), fatal, ArmISA::i, masters, SimObject::name(), and stripSystemName().
Referenced by getGlobalMasterId(), getMasterId(), and maxMasters().
|
inline |
Add a function-based event to the given function, to be looked up in the specified symbol table.
The ...OrPanic flavor of the method causes the simulator to panic if the symbol can't be found.
symtab | Symbol table to use for look up. |
lbl | Function to hook the event to. |
desc | Description to be passed to the event. |
args | Arguments to be forwarded to the event constructor. |
Definition at line 499 of file system.hh.
References SymbolTable::findAddress(), fixFuncEventAddr(), and M5_VAR_USED.
|
inline |
|
inline |
|
inline |
Add a function-based event to a kernel symbol.
These functions work like their addFuncEvent() and addFuncEventOrPanic() counterparts. The only difference is that they automatically use the kernel symbol table. All arguments are forwarded to the underlying method.
lbl | Function to hook the event to. |
args | Arguments to be passed to addFuncEvent |
Definition at line 546 of file system.hh.
References kernelSymtab.
|
inline |
Addr System::allocPhysPages | ( | int | npages | ) |
Allocate npages contiguous unused physical pages.
Definition at line 428 of file system.cc.
References _m5opRange, AddrRange::contains(), fatal, pagePtr, AlphaISA::PageShift, physmem, PhysicalMemory::totalSize(), and warn.
Referenced by Process::allocateMem(), getKernelEntry(), X86ISA::X86_64Process::initState(), and Process::replicatePage().
|
inline |
Should caches be bypassed?
Some CPUs need to bypass caches to allow direct memory accesses, which is required for hardware virtualization.
Definition at line 160 of file system.hh.
References memoryMode.
Referenced by HDLcd::cmdDisable(), HDLcd::cmdEnable(), HDLcd::drainResume(), CoherentXBar::forwardAtomic(), CoherentXBar::forwardFunctional(), CoherentXBar::forwardTiming(), RubyPort::MemSlavePort::recvAtomic(), RubyPort::PioSlavePort::recvAtomic(), BaseCache::CpuSidePort::recvAtomic(), CoherentXBar::recvAtomicBackdoor(), BaseCache::MemSidePort::recvAtomicSnoop(), BaseCache::CpuSidePort::recvFunctional(), CoherentXBar::recvFunctional(), BaseCache::MemSidePort::recvFunctionalSnoop(), BaseCache::CpuSidePort::recvTimingReq(), CoherentXBar::recvTimingReq(), CoherentXBar::recvTimingResp(), BaseCache::MemSidePort::recvTimingSnoopReq(), BaseCache::CpuSidePort::recvTimingSnoopResp(), DmaReadFifo::resumeFill(), BaseCache::CpuSidePort::tryTiming(), NonCachingSimpleCPU::verifyMemoryMode(), and BaseKvmCPU::verifyMemoryMode().
|
inline |
Get the cache line size of the system.
Definition at line 188 of file system.hh.
References _cacheLineSize.
Referenced by DmaDevice::cacheBlockSize(), BaseTrafficGen::createDram(), BaseTrafficGen::createDramRot(), BaseTrafficGen::createLinear(), BaseTrafficGen::createRandom(), DmaPort::dmaAction(), DRAMSim2::init(), MemFootprintProbe::MemFootprintProbe(), ArmSemihosting::physProxy(), ArmISA::ISA::readMiscReg(), and DmaReadFifo::resumeFillFunctional().
|
overridevirtual |
Resume execution after a successful drain.
Reimplemented from Drainable.
Definition at line 465 of file system.cc.
References totalNumInsts.
Referenced by getKernelEntry().
ThreadContext * System::findFreeContext | ( | ) |
Definition at line 306 of file system.cc.
References ThreadContext::Halted, and threadContexts.
Referenced by cloneFunc().
Fix up an address used to match PCs for hooking simulator events on to target function executions.
See comment in system.cc for details.
Reimplemented in ArmSystem, SparcSystem, AlphaSystem, X86System, RiscvSystem, and MipsSystem.
Definition at line 480 of file system.hh.
References panic.
Referenced by addFuncEvent().
Addr System::freeMemSize | ( | ) | const |
Amount of physical memory that is still free.
Definition at line 453 of file system.cc.
References pagePtr, AlphaISA::PageShift, physmem, and PhysicalMemory::totalSize().
Referenced by getPhysMem(), and Linux::procMeminfo().
|
inline |
Get the architecture.
Definition at line 287 of file system.hh.
Referenced by Sequencer::makeRequest().
MasterID System::getGlobalMasterId | ( | const std::string & | master_name | ) |
Registers a GLOBAL MasterID, which is a MasterID not related to any particular SimObject; since no SimObject is passed, the master gets registered by providing the full master name.
masterName | full name of the master |
Definition at line 597 of file system.cc.
References _getMasterId().
|
inline |
Get the guest byte order.
Definition at line 293 of file system.hh.
References AlphaISA::GuestByteOrder, and panic.
Referenced by _llseekFunc(), dumpDmesgEntry(), and rmdirFunc().
|
inline |
Returns the address the kernel ends at.
Definition at line 605 of file system.hh.
References kernelEnd.
Referenced by AlphaBackdoor::startup().
|
inline |
Returns the address the entry point to the kernel code.
Definition at line 611 of file system.hh.
References allocPhysPages(), drainResume(), InvalidContextID, kernelEntry, registerThreadContext(), replaceThreadContext(), serialize(), and unserialize().
Referenced by AlphaBackdoor::startup().
|
inline |
Returns the address the kernel starts at.
Definition at line 599 of file system.hh.
References kernelStart.
Referenced by AlphaBackdoor::startup().
|
inline |
Get a pointer to the Kernel Virtual Machine (KVM) SimObject, if present.
Definition at line 259 of file system.hh.
References kvmVM, and validKvmEnvironment().
Referenced by MuxingKvmGic::MuxingKvmGic().
Request an id used to create a request object in the system.
All objects that intend to issues requests into the memory system must request an id in the init() phase of startup. All master ids must be fixed by the regStats() phase that immediately precedes it. This allows objects in the memory system to understand how many masters may exist and appropriately name the bins of their per-master stats before the stats are finalized.
Registers a MasterID: This method takes two parameters, one of which is optional. The first one is the master object, and it is compulsory; in case a object has multiple (sub)masters, a second parameter must be provided and it contains the name of the submaster. The method will create a master's name by concatenating the SimObject name with the eventual submaster string, separated by a dot.
As an example: For a cpu having two masters: a data master and an instruction master, the method must be called twice:
instMasterId = getMasterId(cpu, "inst"); dataMasterId = getMasterId(cpu, "data");
and the masters' names will be:
master | SimObject related to the master |
submaster | String containing the submaster's name |
Definition at line 603 of file system.cc.
References _getMasterId(), and leafMasterName().
Referenced by BaseTrafficGen::BaseTrafficGen(), and System().
std::string System::getMasterName | ( | MasterID | master_id | ) |
Get the name of an object for a given request id.
Definition at line 652 of file system.cc.
References fatal, masters, and System().
Referenced by QoS::MemCtrl::addMaster(), AbstractMemory::checkLockedAddrList(), QoS::MemSinkCtrl::processNextReqEvent(), QoS::MemCtrl::qosSchedule(), QoS::MemSinkCtrl::recvTimingReq(), BaseTags::BaseTagStats::regStats(), QoS::MemCtrl::MemCtrlStats::regStats(), AbstractMemory::MemStats::regStats(), BaseCache::CacheStats::regStats(), DRAMCtrl::DRAMStats::regStats(), BaseCache::CacheCmdStats::regStatsFromParent(), QoS::FixedPriorityPolicy::schedule(), and MemTraceProbe::startup().
|
inline |
Get the memory mode of the system.
This should only be used by the Python world. The C++ world should use one of the query functions above (isAtomicMode(), isTimingMode(), bypassCaches()).
Definition at line 173 of file system.hh.
References memoryMode, ArmISA::mode, and setMemoryMode().
Referenced by MinorCPU::init().
|
inline |
Get the page bytes for the ISA.
Definition at line 305 of file system.hh.
References AlphaISA::PageBytes.
Referenced by IdeController::IdeController(), and AbstractMemory::init().
|
inline |
Get the number of bits worth of in-page address for the ISA.
Definition at line 310 of file system.hh.
References AlphaISA::PageShift.
|
inline |
Get a pointer to access the physical memory of the system.
Definition at line 267 of file system.hh.
References addr, freeMemSize(), isMemAddr(), memSize(), and physmem.
Referenced by KvmVM::delayedStartup(), ArmSemihosting::readString(), and NonCachingSimpleCPU::sendPacket().
|
overridevirtual |
Additional function to return the Port of a memory object.
Reimplemented from SimObject.
Definition at line 238 of file system.cc.
References _systemPort.
Referenced by getSystemPort().
|
inline |
Get a reference to the system port that can be used by non-structural simulation objects like processes or threads, or external entities like loaders and debuggers, etc, to access the memory system.
Definition at line 121 of file system.hh.
References _systemPort, getPort(), and InvalidPortID.
Referenced by ArmSemihosting::physProxy().
|
inline |
The thermal model used for this system (if any).
Definition at line 315 of file system.hh.
References thermalModel.
|
inline |
Definition at line 194 of file system.hh.
Referenced by AlphaProcess::argsInit(), MipsProcess::argsInit(), RiscvProcess::argsInit(), PowerProcess::argsInit(), SparcProcess::argsInit(), ArmProcess::argsInit(), X86ISA::X86Process::argsInit(), ArmProcess64::armHwcapImpl(), ArmISA::TLBIOp::broadcast(), AbstractMemory::checkLockedAddrList(), KvmVM::contextIdToVCpuId(), GenericTimer::createTimers(), LinuxArmSystem::dumpDmesg(), Gicv3Redistributor::getAffinity(), CpuLocalTimer::init(), AlphaProcess::initState(), SparcProcess::initState(), RiscvProcess64::initState(), RiscvProcess32::initState(), ArmLinuxProcess32::initState(), Process::initState(), ArmProcess32::initState(), ArmProcess64::initState(), Sparc32Process::initState(), X86ISA::X86_64Process::initState(), Sparc64Process::initState(), X86ISA::I386Process::initState(), QueuedPrefetcher::insert(), DistIface::SyncEvent::process(), AlphaProcess::setupASNReg(), X86ISA::I82094AA::signalInterrupt(), and DistIface::toggleSync().
|
inline |
Called by pseudo_inst to track the number of work items started by this system.
Definition at line 434 of file system.hh.
References workItemsBegin.
Referenced by PseudoInst::workbegin().
|
inline |
Called by pseudo_inst to track the number of work items completed by this system.
Definition at line 444 of file system.hh.
References workItemsEnd.
Referenced by PseudoInst::workend().
|
overridevirtual |
After all objects have been created and all ports are connected, check that the system port is connected.
Reimplemented from SimObject.
Definition at line 230 of file system.cc.
References _systemPort, Port::isConnected(), SimObject::name(), and panic.
|
overridevirtual |
initState() is called on each SimObject when not restoring from a checkpoint.
This provides a hook for state initializations that are only required for a "cold start".
Load the kernel code into memory
Reimplemented from SimObject.
Definition at line 349 of file system.cc.
References ArmISA::a, DPRINTF, fatal, FullSystem, isMemAddr(), kernelEnd, kernelEntry, kernelExtras, kernelImage, kernelStart, loadAddrMask, loadAddrOffset, MaxAddr, params(), physProxy, and MemoryImage::write().
Referenced by BareMetalRiscvSystem::initState(), SparcSystem::initState(), AlphaSystem::initState(), X86System::initState(), and ArmSystem::initState().
|
inline |
Is the system in atomic mode?
There are currently two different atomic memory modes: 'atomic', which supports caches; and 'atomic_noncaching', which bypasses caches. The latter is used by hardware virtualized CPUs. SimObjects are expected to use Port::sendAtomic() and Port::recvAtomic() when accessing memory in this mode.
Definition at line 139 of file system.hh.
References ArmISA::atomic, and memoryMode.
Referenced by sc_gem5::TlmToGem5Bridge< BITWIDTH >::before_end_of_elaboration(), SMMUTranslationProcess::completeTransaction(), SMMUv3::processCommands(), SMMUv3::runProcess(), Gicv3Its::runProcess(), DmaPort::sendDma(), NonCachingSimpleCPU::verifyMemoryMode(), and AtomicSimpleCPU::verifyMemoryMode().
bool System::isMemAddr | ( | Addr | addr | ) | const |
Check if a physical address is within a range of a memory that is part of the global address map.
addr | A physical address |
Definition at line 459 of file system.cc.
References PhysicalMemory::isMemAddr(), and physmem.
Referenced by getPhysMem(), MemFootprintProbe::handleRequest(), initState(), RubyPort::MemSlavePort::isPhysMemAddress(), RubyPort::ruby_hit_callback(), NonCachingSimpleCPU::sendPacket(), and BaseTrafficGen::update().
|
inline |
Is the system in timing mode?
SimObjects are expected to use Port::sendTiming() and Port::recvTiming() when accessing memory in this mode.
Definition at line 150 of file system.hh.
References memoryMode.
Referenced by sc_gem5::TlmToGem5Bridge< BITWIDTH >::before_end_of_elaboration(), SMMUTranslationProcess::completeTransaction(), SMMUProcess::doDelay(), MinorCPU::drainResume(), DRAMCtrl::drainResume(), TrafficGen::initState(), SMMUTranslationProcess::issuePrefetch(), SMMUv3::processCommands(), SMMUTranslationProcess::resumeTransaction(), SMMUv3::runProcess(), Gicv3Its::runProcess(), DmaPort::sendDma(), X86ISA::I82094AA::signalInterrupt(), X86ISA::Walker::start(), DRAMCtrl::startup(), TimingSimpleCPU::verifyMemoryMode(), and FullO3CPU< O3CPUImpl >::verifyMemoryMode().
|
protected |
Helper function for constructing the full (sub)master name by providing the root master and the relative submaster name.
Definition at line 640 of file system.cc.
References SimObject::name().
Referenced by getMasterId(), and maxMasters().
Looks up the MasterID for a given SimObject returns an invalid MasterID (invldMasterId) if not found.
Definition at line 560 of file system.cc.
References fatal_if, ArmISA::i, ArmISA::id, Request::invldMasterId, and masters.
Referenced by QoS::PropFairPolicy::initMaster(), and QoS::Policy::pair().
MasterID System::lookupMasterId | ( | const std::string & | name | ) | const |
Looks up the MasterID for a given object name string returns an invalid MasterID (invldMasterId) if not found.
Definition at line 583 of file system.cc.
References ArmISA::i, Request::invldMasterId, masters, SimObject::name(), and stripSystemName().
|
inline |
Range used by memory-mapped m5 pseudo-ops if enabled.
Returns an invalid/empty range if disabled.
Definition at line 591 of file system.hh.
References _m5opRange.
Referenced by ArmISA::handleIprRead(), X86ISA::handleIprRead(), ArmISA::handleIprWrite(), X86ISA::handleIprWrite(), and ArmISA::TLB::TLB().
|
inline |
Called by pseudo_inst to mark the cpus actively executing work items.
Returns the total number of cpus that have executed work item begin or ends.
Definition at line 455 of file system.hh.
References X86ISA::count, ArmISA::i, and MipsISA::index.
Referenced by PseudoInst::workbegin(), and PseudoInst::workend().
|
inline |
Get the number of masters registered in the system.
Definition at line 412 of file system.hh.
References _getMasterId(), leafMasterName(), and regStats().
Referenced by BaseCache::getNextQueueEntry(), BaseCache::handleTimingReqMiss(), BaseCache::incHitCount(), BaseCache::incMissCount(), BaseCache::recvTimingResp(), BaseTags::BaseTagStats::regStats(), QoS::MemCtrl::MemCtrlStats::regStats(), AbstractMemory::MemStats::regStats(), BaseCache::CacheStats::regStats(), DRAMCtrl::DRAMStats::regStats(), BaseCache::CacheCmdStats::regStatsFromParent(), NoncoherentCache::serviceMSHRTargets(), Cache::serviceMSHRTargets(), and MemTraceProbe::startup().
Addr System::memSize | ( | ) | const |
Amount of physical memory that exists.
Definition at line 447 of file system.cc.
References physmem, and PhysicalMemory::totalSize().
Referenced by getPhysMem(), Linux::procMeminfo(), and AlphaBackdoor::startup().
|
inline |
Definition at line 206 of file system.hh.
References numRunningContexts().
Referenced by ArmISA::TLBIOp::broadcast(), MuxingKvmGic::clearBankedDistRange(), MuxingKvmGic::copyBankedDistRange(), MuxingKvmGic::copyGicState(), exitImpl(), MuxingKvmGic::fromKvmToGicV2(), Iob::generateIpi(), Gicv3CPUInterface::generateSGI(), GicV2::genSwiMask(), getrlimitFunc(), Gicv3::init(), CpuLocalTimer::init(), DistIface::SyncEvent::process(), A9SCU::read(), Gicv3Redistributor::read(), SparcISA::ISA::readFSReg(), ArmISA::ISA::readMiscReg(), Gicv3Distributor::route(), CpuLocalTimer::serialize(), setpgidFunc(), X86ISA::I82094AA::signalInterrupt(), GicV2::softInt(), AlphaBackdoor::startup(), tgkillFunc(), DistIface::toggleSync(), CpuLocalTimer::unserialize(), Gicv3Distributor::update(), GicV2::updateIntState(), GicV2::updateRunPri(), and PseudoInst::wakeCPU().
int System::numRunningContexts | ( | ) |
Return number of running (non-halted) thread contexts in system.
These threads could be Active or Suspended.
Definition at line 336 of file system.cc.
References ThreadContext::Halted, ThreadContext::Halting, and threadContexts.
Referenced by numContexts(), GicV2::readCpu(), GicV2::readDistributor(), VGic::updateIntState(), GicV2::updateIntState(), and VGic::VGic().
|
inline |
Definition at line 585 of file system.hh.
References _params.
Referenced by initState(), PseudoInst::loadsymbol(), PseudoInst::readfile(), System(), PseudoInst::workbegin(), and PseudoInst::workend().
|
static |
Definition at line 529 of file system.cc.
References ArmISA::i, SimObject::name(), and systemList.
Referenced by printSystems(), and unserializeSymtab().
ContextID System::registerThreadContext | ( | ThreadContext * | tc, |
ContextID | assigned = InvalidContextID |
||
) |
Definition at line 259 of file system.cc.
References activeCpus, ArmISA::e, fatal_if, ThreadContext::getCpuPtr(), getRemoteGDBPort(), ArmISA::id, inform, InvalidContextID, liveEvents, SimObject::name(), remoteGDB, PCEventScope::schedule(), threadContexts, and BaseCPU::waitForRemoteGDB().
Referenced by getKernelEntry(), and BaseCPU::registerThreadContexts().
|
overridevirtual |
Callback to set stat parameters.
This callback is typically used for complex stats (e.g., distributions) that need parameters in addition to a name and a description. Stat names and descriptions should typically be set from the constructor usingo from the constructor using the ADD_STAT macro.
Reimplemented from Stats::Group.
Definition at line 496 of file system.cc.
References ccprintf(), ArmISA::j, SimObject::name(), numWorkIds, Stats::Group::regStats(), and workItemStats.
Referenced by maxMasters().
|
overridevirtual |
Implements PCEventScope.
Definition at line 326 of file system.cc.
References liveEvents, and threadContexts.
void System::replaceThreadContext | ( | ThreadContext * | tc, |
ContextID | context_id | ||
) |
Definition at line 393 of file system.cc.
References ArmISA::e, liveEvents, panic, remoteGDB, PCEventScope::schedule(), and threadContexts.
Referenced by getKernelEntry(), and BaseCPU::takeOverFrom().
|
overridevirtual |
Implements PCEventScope.
Definition at line 316 of file system.cc.
References liveEvents, and threadContexts.
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Reimplemented from SimObject.
Definition at line 471 of file system.cc.
References FullSystem, kernelSymtab, pagePtr, physmem, SymbolTable::serialize(), SERIALIZE_SCALAR, Serializable::serializeSection(), and serializeSymtab().
Referenced by getKernelEntry().
|
inlineprotectedvirtual |
If needed, serialize additional symbol table entries for a specific subclass of this system.
Currently this is used by Alpha and MIPS.
os | stream to serialize to |
Reimplemented in AlphaSystem, and SparcSystem.
Definition at line 667 of file system.hh.
Referenced by serialize().
void System::setMemoryMode | ( | Enums::MemoryMode | mode | ) |
Change the memory mode of the system.
This should only be called by the Python!
mode | Mode to change to (atomic/timing/...) |
Definition at line 245 of file system.cc.
References Drained, Drainable::drainState(), memoryMode, and ArmISA::mode.
Referenced by getMemoryMode().
|
protected |
Strips off the system name from a master name.
Definition at line 550 of file system.cc.
References SimObject::name(), and startswith().
Referenced by _getMasterId(), and lookupMasterId().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Reimplemented from SimObject.
Definition at line 484 of file system.cc.
References FullSystem, kernelSymtab, pagePtr, physmem, SymbolTable::unserialize(), UNSERIALIZE_SCALAR, Serializable::unserializeSection(), and unserializeSymtab().
Referenced by getKernelEntry().
|
inlineprotectedvirtual |
If needed, unserialize additional symbol table entries for a specific subclass of this system.
cp | checkpoint to unserialize from |
section | relevant section in the checkpoint |
Reimplemented in AlphaSystem, and SparcSystem.
Definition at line 676 of file system.hh.
References printSystems().
Referenced by unserialize().
bool System::validKvmEnvironment | ( | ) | const |
Verify gem5 configuration will support KVM emulation.
Definition at line 410 of file system.cc.
References threadContexts.
Referenced by MuxingKvmGic::drainResume(), getKvmVM(), ArchTimerKvm::scheduleEvents(), and MuxingKvmGic::startup().
|
inline |
Definition at line 467 of file system.hh.
References curTick(), lastWorkItemStarted, MipsISA::p, and workItemEnd().
Referenced by PseudoInst::workbegin().
void System::workItemEnd | ( | uint32_t | tid, |
uint32_t | workid | ||
) |
Definition at line 512 of file system.cc.
References curTick(), DPRINTF, fatal, lastWorkItemStarted, numWorkIds, MipsISA::p, and workItemStats.
Referenced by PseudoInst::workend(), and workItemBegin().
|
protected |
Definition at line 325 of file system.hh.
Referenced by cacheLineSize(), and System().
|
protected |
Range for memory-mapped m5 pseudo ops.
The range will be invalid/empty if disabled.
Definition at line 577 of file system.hh.
Referenced by allocPhysPages(), and m5opRange().
|
protected |
Definition at line 571 of file system.hh.
Referenced by FreebsdArmSystem::params(), LinuxArmSystem::params(), MipsSystem::params(), RiscvSystem::params(), SparcSystem::params(), AlphaSystem::params(), LinuxAlphaSystem::params(), ArmSystem::params(), GenericArmSystem::params(), and params().
|
private |
Definition at line 103 of file system.hh.
Referenced by getPort(), getSystemPort(), and init().
|
protected |
Definition at line 330 of file system.hh.
Referenced by registerThreadContext().
FutexMap System::futexMap |
Definition at line 642 of file system.hh.
Referenced by exitFutexWake(), and futexFunc().
uint64_t System::init_param |
Definition at line 214 of file system.hh.
Referenced by PseudoInst::initParam().
ObjectFile* System::kernel |
Object pointer for the kernel code.
Definition at line 224 of file system.hh.
Referenced by ArmSystem::ArmSystem(), FreebsdArmSystem::initState(), X86System::initState(), LinuxArmSystem::initState(), System(), and ~System().
Addr System::kernelEnd |
End of kernel code.
Definition at line 234 of file system.hh.
Referenced by getKernelEnd(), initState(), System(), and AlphaISA::StackTrace::trace().
Addr System::kernelEntry |
Entry point in the kernel to start at.
Definition at line 237 of file system.hh.
Referenced by getKernelEntry(), X86System::initState(), ArmSystem::initState(), initState(), and System().
std::vector<ObjectFile *> System::kernelExtras |
Additional object files.
Definition at line 228 of file system.hh.
Referenced by initState(), and System().
MemoryImage System::kernelImage |
Definition at line 225 of file system.hh.
Referenced by initState(), and System().
Addr System::kernelStart |
Beginning of kernel code.
Definition at line 231 of file system.hh.
Referenced by getKernelStart(), initState(), System(), and AlphaISA::StackTrace::trace().
SymbolTable* System::kernelSymtab |
kernel symbol table
Definition at line 221 of file system.hh.
Referenced by addKernelFuncEvent(), PseudoInst::addsymbol(), X86ISA::StackTrace::decodePrologue(), AlphaISA::StackTrace::decodePrologue(), dumpDmesgEntry(), Linux::ThreadInfo::get_data(), FreebsdArmSystem::initState(), LinuxArmSystem::initState(), LinuxAlphaSystem::initState(), PseudoInst::loadsymbol(), AlphaISA::ProcessInfo::ProcessInfo(), X86ISA::readSymbol(), ArmISA::readSymbol(), serialize(), LinuxAlphaSystem::setDelayLoop(), LinuxAlphaSystem::setupFuncEvents(), SimpleThread::SimpleThread(), System(), AlphaISA::StackTrace::trace(), unserialize(), and ~System().
|
protected |
Definition at line 319 of file system.hh.
Referenced by getKvmVM(), and System().
Definition at line 628 of file system.hh.
Referenced by workItemBegin(), and workItemEnd().
Definition at line 102 of file system.hh.
Referenced by registerThreadContext(), remove(), replaceThreadContext(), and schedule().
Addr System::loadAddrMask |
Mask that should be anded for binary/symbol loading.
This allows one two different OS requirements for the same ISA to be handled. Some OSes are compiled for a virtual address and need to be loaded into physical memory that starts at address 0, while other bare metal tools generate images that start at address 0.
Definition at line 245 of file system.hh.
Referenced by AlphaSystem::initState(), FreebsdArmSystem::initState(), LinuxArmSystem::initState(), ArmSystem::initState(), initState(), and System().
Addr System::loadAddrOffset |
Offset that should be used for binary/symbol loading.
This further allows more flexibility than the loadAddrMask allows alone in loading kernels and similar. The loadAddrOffset is applied after the loadAddrMask.
Definition at line 252 of file system.hh.
Referenced by FreebsdArmSystem::initState(), LinuxArmSystem::initState(), ArmSystem::initState(), initState(), and System().
|
protected |
This array is a per-system list of all devices capable of issuing a memory system request and an associated string for each master id.
It's used to uniquely id any master in the system by name for things like cache statistics.
Definition at line 337 of file system.hh.
Referenced by _getMasterId(), getMasterName(), and lookupMasterId().
|
static |
Definition at line 644 of file system.hh.
Referenced by cloneFunc(), and Process::Process().
|
protected |
Definition at line 323 of file system.hh.
Referenced by bypassCaches(), getMemoryMode(), isAtomicMode(), isTimingMode(), and setMemoryMode().
const bool System::multiThread |
Definition at line 199 of file system.hh.
Referenced by ArmISA::getMPIDR(), and BaseCPU::registerThreadContexts().
|
static |
Definition at line 638 of file system.hh.
Referenced by IGbE::ethRxPkt(), and System().
|
protected |
Definition at line 329 of file system.hh.
Referenced by regStats(), workItemEnd(), and ~System().
Addr System::pagePtr |
Definition at line 212 of file system.hh.
Referenced by allocPhysPages(), freeMemSize(), serialize(), and unserialize().
|
protected |
Definition at line 321 of file system.hh.
Referenced by allocPhysPages(), freeMemSize(), getPhysMem(), LinuxArmSystem::initState(), isMemAddr(), memSize(), serialize(), and unserialize().
PortProxy System::physProxy |
Port to physical memory used for writing object files into ram at boot.
Definition at line 218 of file system.hh.
Referenced by TsunamiPChip::dmaAddr(), Gicv3Redistributor::init(), BareMetalRiscvSystem::initState(), SparcSystem::initState(), AlphaSystem::initState(), LinuxX86System::initState(), FreebsdArmSystem::initState(), X86System::initState(), LinuxArmSystem::initState(), X86ISA::X86_64Process::initState(), ArmSystem::initState(), initState(), MultiLevelPageTable< EntryTypes >::map(), SimpleDisk::read(), MultiLevelPageTable< EntryTypes >::remap(), DmaReadFifo::resumeFillFunctional(), MultiLevelPageTable< EntryTypes >::unmap(), X86System::writeOutMPTable(), and X86System::writeOutSMBiosTable().
std::set<int> System::PIDs |
Process set to track which PIDs have already been allocated.
Definition at line 647 of file system.hh.
Referenced by Process::Process().
std::vector<RedirectPath*> System::redirectPaths |
Definition at line 656 of file system.hh.
Referenced by Process::checkPathRedirect().
std::vector<BaseRemoteGDB *> System::remoteGDB |
Definition at line 564 of file system.hh.
Referenced by breakpoint(), registerThreadContext(), and replaceThreadContext().
std::list<BasicSignal> System::signalList |
Definition at line 651 of file system.hh.
Referenced by exitImpl(), pollFunc(), selectFunc(), and wait4Func().
|
static |
Definition at line 637 of file system.hh.
Referenced by IGbE::ethRxPkt(), exitImpl(), printSystems(), and System().
|
protected |
Definition at line 339 of file system.hh.
Referenced by getThermalModel().
std::vector<ThreadContext *> System::threadContexts |
Definition at line 190 of file system.hh.
Referenced by IntrControl::clear(), TsunamiCChip::clearDRIR(), MaltaCChip::clearIntr(), TsunamiCChip::clearIPI(), TsunamiCChip::clearITI(), SparcISA::TLB::doMmuRegWrite(), exitImpl(), findFreeContext(), Iob::generateIpi(), BareMetalRiscvSystem::initState(), SparcSystem::initState(), AlphaSystem::initState(), LinuxX86System::initState(), FreebsdArmSystem::initState(), X86System::initState(), LinuxArmSystem::initState(), ArmSystem::initState(), FullO3CPU< O3CPUImpl >::insertThread(), numRunningContexts(), IntrControl::post(), TsunamiCChip::postDRIR(), MaltaCChip::postIntr(), TsunamiCChip::postRTC(), SparcISA::ISA::readFSReg(), registerThreadContext(), remove(), replaceThreadContext(), TsunamiCChip::reqIPI(), schedule(), setpgidFunc(), LinuxArmSystem::startup(), tgkillFunc(), validKvmEnvironment(), and PseudoInst::wakeCPU().
Counter System::totalNumInsts |
Definition at line 627 of file system.hh.
Referenced by BaseSimpleCPU::countInst(), Minor::Execute::doInstCommitAccounting(), TimingSimpleCPU::drainResume(), drainResume(), FullO3CPU< O3CPUImpl >::instDone(), and BaseKvmCPU::kvmRun().
|
protected |
Definition at line 327 of file system.hh.
Referenced by incWorkItemsBegin().
|
protected |
Definition at line 328 of file system.hh.
Referenced by incWorkItemsEnd().
std::map<uint32_t, Stats::Histogram*> System::workItemStats |
Definition at line 629 of file system.hh.
Referenced by regStats(), workItemEnd(), and ~System().