gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
LinuxAlphaSystem Class Reference

This class contains linux specific system code (Loading, Events). More...

#include <system.hh>

Inheritance diagram for LinuxAlphaSystem:
AlphaSystem System MemObject ClockedObject SimObject Clocked EventManager Serializable Drainable

Classes

struct  PrintThreadInfo
 
struct  SkipDelayLoopEvent
 

Public Types

typedef LinuxAlphaSystemParams Params
 
- Public Types inherited from AlphaSystem
typedef AlphaSystemParams Params
 
- Public Types inherited from System
typedef SystemParams Params
 
- Public Types inherited from MemObject
typedef MemObjectParams Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

Addr InitStack () const
 
Addr EmptyPGT () const
 
Addr EmptyPGE () const
 
Addr ZeroPGE () const
 
Addr StartAddr () const
 
Addr Param () const
 
Addr CommandLine () const
 
Addr InitrdStart () const
 
Addr InitrdSize () const
 
 LinuxAlphaSystem (Params *p)
 
 ~LinuxAlphaSystem ()
 
virtual void initState ()
 Initialise the system. More...
 
void setDelayLoop (ThreadContext *tc)
 
const Paramsparams () const
 
- Public Member Functions inherited from AlphaSystem
 AlphaSystem (Params *p)
 
 ~AlphaSystem ()
 
void initState () override
 Initialise the state of the system. More...
 
void serializeSymtab (CheckpointOut &cp) const override
 Serialization stuff. More...
 
void unserializeSymtab (CheckpointIn &cp) override
 If needed, unserialize additional symbol table entries for a specific subclass of this system. More...
 
void startup () override
 Override startup() to provide a path to call setupFuncEvents() More...
 
void setAlphaAccess (Addr access)
 Set the m5AlphaAccess pointer in the console. More...
 
void setIntrFreq (Tick freq)
 
- Public Member Functions inherited from System
void init () override
 After all objects have been created and all ports are connected, check that the system port is connected. More...
 
MasterPortgetSystemPort ()
 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...
 
BaseMasterPortgetMasterPort (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...
 
ThreadContextgetThreadContext (ContextID tid)
 
int numContexts ()
 
int numRunningContexts ()
 Return number of running (non-halted) thread contexts in system. More...
 
KvmVMgetKvmVM ()
 Get a pointer to the Kernel Virtual Machine (KVM) SimObject, if present. More...
 
PhysicalMemorygetPhysMem ()
 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...
 
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...
 
ThermalModelgetThermalModel () const
 The thermal model used for this system (if any). More...
 
MasterID getMasterId (std::string req_name)
 Request an id used to create a request object in the system. More...
 
std::string getMasterName (MasterID master_id)
 Get the name of an object for a given request id. More...
 
MasterID maxMasters ()
 Get the number of masters registered in the system. More...
 
void regStats () override
 Register statistics for this object. 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)
 
bool breakpoint ()
 
 System (Params *p)
 
 ~System ()
 
void initState () override
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
const Paramsparams () const
 
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)
 
- Public Member Functions inherited from MemObject
const Paramsparams () const
 
 MemObject (const Params *params)
 
virtual BaseSlavePortgetSlavePort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a slave port with a given name and index. More...
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () const
 
Enums::PwrState pwrState () const
 
std::string pwrStateName () const
 
std::vector< double > pwrStateWeights () const
 Returns the percentage residency for each power state. More...
 
void computeStats ()
 Record stats values like state residency by computing the time difference from previous update. More...
 
void pwrState (Enums::PwrState)
 
- Public Member Functions inherited from SimObject
const Paramsparams () 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 resetStats ()
 Reset statistics associated with this object. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. 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...
 
- Public Member Functions inherited from EventManager
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
EventQueueeventQueue () 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)
 
- Public Member Functions inherited from Serializable
 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)
 
- Public Member Functions inherited from Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 
- Public Member Functions inherited from Clocked
void updateClockPeriod () const
 Update the tick to the current tick. More...
 
Tick clockEdge (Cycles cycles=Cycles(0)) const
 Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More...
 
Cycles curCycle () const
 Determine the current cycle, corresponding to a tick aligned to a clock edge. More...
 
Tick nextCycle () const
 Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More...
 
uint64_t frequency () const
 
Tick clockPeriod () const
 
double voltage () const
 
Cycles ticksToCycles (Tick t) const
 
Tick cyclesToTicks (Cycles c) const
 

Static Public Attributes

static const int CommandLineSize = 256
 
- Static Public Attributes inherited from System
static std::vector< System * > systemList
 
static int numSystemsRunning = 0
 
static const int maxPID = 32768
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 

Protected Member Functions

virtual void setupFuncEvents ()
 Setup all the function events. More...
 
- Protected Member Functions inherited from AlphaSystem
const Paramsparams () const
 
template<class T >
T * addPalFuncEvent (const char *lbl)
 Add a function-based event to PALcode. More...
 
template<class T >
T * addConsoleFuncEvent (const char *lbl)
 Add a function-based event to the console code. More...
 
Addr fixFuncEventAddr (Addr addr) override
 This function fixes up addresses that are used to match PCs for hooking simulator events on to target function executions. More...
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Member Functions inherited from Clocked
 Clocked (ClockDomain &clk_domain)
 Create a clocked object and set the clock domain based on the parameters. More...
 
 Clocked (Clocked &)=delete
 
Clockedoperator= (Clocked &)=delete
 
virtual ~Clocked ()
 Virtual destructor due to inheritance. More...
 
void resetClock () const
 Reset the object's clock using the current global tick value. More...
 

Private Attributes

Addr KernelStart
 Addresses defining where the kernel bootloader places various elements. More...
 
BreakPCEventkernelPanicEvent
 Event to halt the simulator if the kernel calls panic() More...
 
SkipFuncEventskipCacheProbeEvent
 Event to skip determine_cpu_caches() because we don't support the IPRs that the code can access to figure out cache sizes. More...
 
SkipFuncEventskipIdeDelay50msEvent
 PC based event to skip the ide_delay_50ms() call. More...
 
Linux::DebugPrintkEventdebugPrintkEvent
 PC based event to skip the dprink() call and emulate its functionality. More...
 
SkipDelayLoopEventskipDelayLoopEvent
 Skip calculate_delay_loop() rather than waiting for this to be calculated. More...
 
PrintThreadInfoprintThreadEvent
 Event to print information about thread switches if the trace flag Thread is set. More...
 
IdleStartEventidleStartEvent
 Grab the PCBB of the idle process when it starts. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from System
static void printSystems ()
 
- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
- Static Public Member Functions inherited from Serializable
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 inherited from AlphaSystem
SymbolTableconsoleSymtab
 console symbol table More...
 
SymbolTablepalSymtab
 pal symbol table More...
 
ObjectFileconsole
 Object pointer for the console code. More...
 
ObjectFilepal
 Object pointer for the PAL code. More...
 
BreakPCEventconsolePanicEvent
 Event to halt the simulator if the console calls panic() More...
 
- Public Attributes inherited from System
std::vector< ThreadContext * > threadContexts
 
int _numContexts
 
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...
 
SymbolTablekernelSymtab
 kernel symbol table More...
 
ObjectFilekernel
 Object pointer for the kernel code. 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
 
std::vector< GDBListener * > gdbListen
 
Counter totalNumInsts
 
EventQueue instEventQueue
 
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< BasicSignalsignalList
 
- Protected Attributes inherited from AlphaSystem
Tick intrFreq
 
FSTranslatingPortProxy virtProxy
 Proxy used to copy arguments directly into kernel memory. More...
 
- Protected Attributes inherited from System
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< std::string > masterIds
 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...
 
ThermalModelthermalModel
 
Params_params
 
- Protected Attributes inherited from ClockedObject
Enums::PwrState _currPwrState
 To keep track of the current power state. More...
 
Tick prvEvalTick
 
Stats::Scalar numPwrStateTransitions
 
Stats::Distribution pwrStateClkGateDist
 
Stats::Vector pwrStateResidencyTicks
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

This class contains linux specific system code (Loading, Events).

It points to objects that are the system binaries to load and patches them appropriately to work in simulator.

Definition at line 51 of file system.hh.

Member Typedef Documentation

typedef LinuxAlphaSystemParams LinuxAlphaSystem::Params

Definition at line 136 of file system.hh.

Constructor & Destructor Documentation

LinuxAlphaSystem::LinuxAlphaSystem ( Params p)

Definition at line 64 of file system.cc.

LinuxAlphaSystem::~LinuxAlphaSystem ( )

Member Function Documentation

Addr LinuxAlphaSystem::CommandLine ( ) const
inline

Definition at line 82 of file system.hh.

References Param().

Referenced by initState().

Addr LinuxAlphaSystem::EmptyPGE ( ) const
inline

Definition at line 77 of file system.hh.

References KernelStart.

Addr LinuxAlphaSystem::EmptyPGT ( ) const
inline

Definition at line 76 of file system.hh.

References KernelStart.

Addr LinuxAlphaSystem::InitrdSize ( ) const
inline

Definition at line 84 of file system.hh.

References Param().

Addr LinuxAlphaSystem::InitrdStart ( ) const
inline

Definition at line 83 of file system.hh.

References Param().

Addr LinuxAlphaSystem::InitStack ( ) const
inline

Definition at line 75 of file system.hh.

References KernelStart.

void LinuxAlphaSystem::initState ( )
virtual

Initialise the system.

The symbol swapper_pg_dir marks the beginning of the kernel and the location of bootloader passed arguments

Since we aren't using a bootloader, we have to copy the kernel arguments directly into the kernel's memory.

find the address of the est_cycle_freq variable and insert it so we don't through the lengthly process of trying to calculated it by using the PIT, RTC, etc.

EV5 only supports 127 ASNs so we are going to tell the kernel that the paritiuclar EV6 we have only supports 127 asns.

Todo:
At some point we should change ev5.hh and the palcode to support 255 ASNs.

Reimplemented from SimObject.

Definition at line 70 of file system.cc.

References addr, CommandLine(), SymbolTable::findAddress(), SimClock::Frequency, LittleEndianGuest::htog(), AlphaSystem::initState(), KernelStart, System::kernelSymtab, panic, params(), AlphaSystem::virtProxy, PortProxy::write(), and FSTranslatingPortProxy::writeBlob().

Addr LinuxAlphaSystem::Param ( ) const
inline

Definition at line 81 of file system.hh.

References ZeroPGE().

Referenced by CommandLine(), InitrdSize(), and InitrdStart().

const Params* LinuxAlphaSystem::params ( ) const
inline

Definition at line 147 of file system.hh.

References System::_params.

Referenced by initState().

void LinuxAlphaSystem::setDelayLoop ( ThreadContext tc)
void LinuxAlphaSystem::setupFuncEvents ( )
protectedvirtual

Setup all the function events.

Must be done after init() for Alpha since fixFuncEvent() requires a function port

Any time ide_delay_50ms, calibarte_delay or determine_cpu_caches is called just skip the function. Currently determine_cpu_caches only is used put information in proc, however if that changes in the future we will have to fill in the cache size variables appropriately.

Reimplemented from AlphaSystem.

Definition at line 120 of file system.cc.

References addr, debugPrintkEvent, SymbolTable::findAddress(), idleStartEvent, kernelPanicEvent, System::kernelSymtab, printThreadEvent, AlphaSystem::setupFuncEvents(), skipCacheProbeEvent, skipDelayLoopEvent, and skipIdeDelay50msEvent.

Addr LinuxAlphaSystem::StartAddr ( ) const
inline

Definition at line 79 of file system.hh.

References KernelStart.

Addr LinuxAlphaSystem::ZeroPGE ( ) const
inline

Definition at line 78 of file system.hh.

References KernelStart.

Referenced by Param().

Member Data Documentation

const int LinuxAlphaSystem::CommandLineSize = 256
static

Definition at line 85 of file system.hh.

Linux::DebugPrintkEvent* LinuxAlphaSystem::debugPrintkEvent
private

PC based event to skip the dprink() call and emulate its functionality.

Definition at line 112 of file system.hh.

Referenced by setupFuncEvents(), and ~LinuxAlphaSystem().

IdleStartEvent* LinuxAlphaSystem::idleStartEvent
private

Grab the PCBB of the idle process when it starts.

Definition at line 127 of file system.hh.

Referenced by setupFuncEvents(), and ~LinuxAlphaSystem().

BreakPCEvent* LinuxAlphaSystem::kernelPanicEvent
private

Event to halt the simulator if the kernel calls panic()

Definition at line 90 of file system.hh.

Referenced by setupFuncEvents(), and ~LinuxAlphaSystem().

Addr LinuxAlphaSystem::KernelStart
private

Addresses defining where the kernel bootloader places various elements.

Details found in include/asm-alpha/system.h

Definition at line 72 of file system.hh.

Referenced by EmptyPGE(), EmptyPGT(), InitStack(), initState(), StartAddr(), and ZeroPGE().

PrintThreadInfo* LinuxAlphaSystem::printThreadEvent
private

Event to print information about thread switches if the trace flag Thread is set.

Definition at line 124 of file system.hh.

Referenced by setupFuncEvents(), and ~LinuxAlphaSystem().

SkipFuncEvent* LinuxAlphaSystem::skipCacheProbeEvent
private

Event to skip determine_cpu_caches() because we don't support the IPRs that the code can access to figure out cache sizes.

Definition at line 103 of file system.hh.

Referenced by setupFuncEvents(), and ~LinuxAlphaSystem().

SkipDelayLoopEvent* LinuxAlphaSystem::skipDelayLoopEvent
private

Skip calculate_delay_loop() rather than waiting for this to be calculated.

Definition at line 118 of file system.hh.

Referenced by setupFuncEvents(), and ~LinuxAlphaSystem().

SkipFuncEvent* LinuxAlphaSystem::skipIdeDelay50msEvent
private

PC based event to skip the ide_delay_50ms() call.

Definition at line 106 of file system.hh.

Referenced by setupFuncEvents(), and ~LinuxAlphaSystem().


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:13 for gem5 by doxygen 1.8.6