51 #include <unordered_map>
55 #include "arch/isa_traits.hh"
58 #include "config/the_isa.hh"
59 #include "enums/MemoryMode.hh"
64 #include "params/System.hh"
72 #if THE_ISA != NULL_ISA
103 {
panic(
"SystemPort does not receive timing!\n");
return false; }
105 {
panic(
"SystemPort does not expect retry!\n"); }
116 void init()
override;
166 return memoryMode == Enums::atomic_noncaching;
195 #if THE_ISA != NULL_ISA
382 i < activeCpus.end();
i++) {
403 panic(
"Base fixFuncEventAddr not implemented.\n");
419 template <
class T,
typename... Args>
421 const std::string &desc, Args... args)
425 #if THE_ISA != NULL_ISA
428 std::forward<Args>(args)...);
439 return addFuncEvent<T>(symtab, lbl, lbl);
442 template <
class T,
typename... Args>
446 T *
e(addFuncEvent<T>(symtab, lbl, std::forward<Args>(args)...));
448 panic(
"Failed to find symbol '%s'", lbl);
468 template <
class T,
typename... Args>
472 std::forward<Args>(args)...);
475 template <
class T,
typename... Args>
479 std::forward<Args>(args)...));
481 panic(
"Failed to find kernel symbol '%s'", lbl);
590 #endif // __SYSTEM_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
virtual void unserializeSymtab(CheckpointIn &cp)
If needed, unserialize additional symbol table entries for a specific subclass of this system...
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...
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)
Addr getKernelStart() const
Returns the address the kernel starts at.
MasterPort & getSystemPort()
Get a reference to the system port that can be used by non-structural simulation objects like process...
T * addKernelFuncEventOrPanic(const char *lbl, Args...args)
Enums::MemoryMode getMemoryMode() const
Get the memory mode of the system.
bool bypassCaches() const
Should caches be bypassed?
const Params * params() const
static void printSystems()
uint64_t incWorkItemsEnd()
Called by pseudo_inst to track the number of work items completed by this system. ...
Addr freeMemSize() const
Amount of physical memory that is still free.
Addr allocPhysPages(int npages)
Allocate npages contiguous unused physical pages.
void workItemEnd(uint32_t tid, uint32_t workid)
bool findAddress(const std::string &symbol, Addr &address) const
Addr getPageBytes() const
Get the page bytes for the ISA.
T * addFuncEvent(const SymbolTable *symtab, const char *lbl)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Declaration of Statistics objects.
unsigned int cacheLineSize() const
Get the cache line size of the system.
void init() override
After all objects have been created and all ports are connected, check that the system port is connec...
int numRunningContexts()
Return number of running (non-halted) thread contexts in system.
Addr kernelStart
Beginning of kernel code.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID) override
Additional function to return the Port of a memory object.
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
std::vector< GDBListener * > gdbListen
void regStats() override
Register statistics for this object.
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
PortProxy Object Declaration.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the slave port.
Tick curTick()
The current simulated tick.
Queue of events sorted in time order.
Addr loadAddrMask
Mask that should be anded for binary/symbol loading.
void drainResume() override
Resume execution after a successful drain.
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.
void recvReqRetry() override
Called by the slave port if sendTimingReq was called on this master port (causing recvTimingReq to be...
KvmVM * getKvmVM()
Get a pointer to the Kernel Virtual Machine (KVM) SimObject, if present.
std::vector< ThreadContext * > threadContexts
ThermalModel * thermalModel
Addr kernelEntry
Entry point in the kernel to start at.
std::map< uint32_t, Stats::Histogram * > workItemStats
virtual Addr fixFuncEventAddr(Addr addr)
Fix up an address used to match PCs for hooking simulator events on to target function executions...
ThreadContext * getThreadContext(ContextID tid)
The physical memory encapsulates all memories in the system and provides basic functionality for acce...
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr getKernelEnd() const
Returns the address the kernel ends at.
bool isAtomicMode() const
Is the system in atomic mode?
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
SymbolTable * kernelSymtab
kernel symbol table
MasterID maxMasters()
Get the number of masters registered in the system.
ThermalModel * getThermalModel() const
The thermal model used for this system (if any).
static const int NumArgumentRegs M5_VAR_USED
Addr memSize() const
Amount of physical memory that exists.
This object is a proxy for a structural port, to be used for debug accesses.
ObjectFile * kernel
Object pointer for the kernel code.
Addr getKernelEntry() const
Returns the address the entry point to the kernel code.
uint64_t incWorkItemsBegin()
Called by pseudo_inst to track the number of work items started by this system.
std::vector< std::string > masterIds
This array is a per-system list of all devices capable of issuing a memory system request and an asso...
virtual void serializeSymtab(CheckpointOut &os) const
If needed, serialize additional symbol table entries for a specific subclass of this system...
std::ostream CheckpointOut
static int numSystemsRunning
void workItemBegin(uint32_t tid, uint32_t workid)
Addr getPageShift() const
Get the number of bits worth of in-page address for the ISA.
Private class for the system port which is only used as a master for debug access and for non-structu...
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
T * addFuncEventOrPanic(const SymbolTable *symtab, const char *lbl, Args...args)
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
EventQueue instEventQueue
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
T * addKernelFuncEvent(const char *lbl, Args...args)
Add a function-based event to a kernel symbol.
void replaceThreadContext(ThreadContext *tc, ContextID context_id)
MasterID getMasterId(std::string req_name)
Request an id used to create a request object in the system.
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.
Addr loadAddrOffset
Offset that should be used for binary/symbol loading.
int ContextID
Globally unique thread context ID.
Addr kernelEnd
End of kernel code.
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...
bool isTimingMode() const
Is the system in timing mode?
SystemPort(const std::string &_name, MemObject *_owner)
Create a system port with a name and an owner.
Arch getArch() const
Get the architecture.
A ThermalModel is the element which ties all thermal objects together and provides the thermal solver...
void setMemoryMode(Enums::MemoryMode mode)
Change the memory mode of the system.
static std::vector< System * > systemList