Public Types | Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Friends

SST::Component Class Reference

Main component object for the simulation. More...

#include <component.h>

Inheritance diagram for SST::Component:
Bit_bucket Bus Cpu Cpu Cpu Cpu Cpu DRAMSimTrace Dummy event_test Ghost_pattern mem Nicmodel PHXSimC PHXSimC processor resil RtrIF schedule SS_router SST::IntrospectedComponent SST::RtrIF sstdisksim sstdisksim_tracereader tester trig_cpu Xbar XbarShell XbarV2

Public Types

typedef std::map< std::string,
std::string > 
Params_t

Public Member Functions

 Component (ComponentId_t id)
 Constructor.
ComponentId_t getId () const
 Returns unique component ID.
virtual int Setup ()
 Called after all components have been constructed, but before simulation time has begun.
virtual int Finish ()
 Called after simulation completes, but before objects are destroyed.
virtual bool Status ()
LinkconfigureLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL)
LinkconfigureLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL)
LinkconfigureLink (std::string name, Event::HandlerBase *handler=NULL)
LinkconfigureSelfLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL)
LinkconfigureSelfLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL)
LinkconfigureSelfLink (std::string name, Event::HandlerBase *handler=NULL)
TimeConverterregisterClock (std::string freq, Clock::HandlerBase *handler, bool regAll=true)
 Registers a clock for this component.
void unregisterClock (TimeConverter *tc, Clock::HandlerBase *handler)
TimeConverterregisterTimeBase (std::string base, bool regAll=true)
 Registers a default time base for the component and optionally sets the the component's links to that timebase.
SimTime_t getCurrentSimTime (TimeConverter *tc)
 return the time since the simulation began in units specified by the parameter.
SimTime_t getCurrentSimTime ()
 return the time since the simulation began in the default timebase
SimTime_t getCurrentSimTime (std::string base)
 return the time since the simulation began in timebase specified
SimTime_t getCurrentSimTimeNano ()
 Utility function to return the time since the simulation began in nanoseconds.
SimTime_t getCurrentSimTimeMicro ()
 Utility function to return the time since the simulation began in microseconds.
SimTime_t getCurrentSimTimeMilli ()
 Utility function to return the time since the simulation began in milliseconds.
bool registerExit ()
 Register that the simulation should not end until this component says it is OK to.
bool unregisterExit ()
 Indicate permission for the simulation to end.

Data Fields

std::string type
 Component's type, set by the factory when the object is created.

Protected Member Functions

void setDefaultTimeBase (TimeConverter *tc)
 Manually set the default detaulTimeBase.
LinkselfLink (std::string name, Event::HandlerBase *handler=NULL)

Protected Attributes

TimeConverterdefaultTimeBase
 Timebase used if no other timebase is specified for calls like Component::getCurrentSimTime().

Friends

class boost::serialization::access

Detailed Description

Main component object for the simulation.

All models inherit from this.


Constructor & Destructor Documentation

SST::Component::Component ( ComponentId_t  id  ) 

Constructor.

Generally only called by the factory class.

Parameters:
id Unique component ID

Member Function Documentation

virtual int SST::Component::Finish (  )  [inline, virtual]

Called after simulation completes, but before objects are destroyed.

A good place to print out statistics.

Reimplemented in Cpu, Cpu_data, Cpu_power, Cpu_PowerAndData, Cpu_router_power, DRAMSimC, event_test, Cpu, PHXSimC, PHXSimC, trig_cpu, trig_nic, Routermodel, SST::RtrIF, SS_router, RtrIF, sstdisksim, and sstdisksim_tracereader.

SimTime_t SST::Component::getCurrentSimTime ( std::string  base  ) 

return the time since the simulation began in timebase specified

Parameters:
base Timebase frequency in SI Units
SimTime_t SST::Component::getCurrentSimTime ( TimeConverter tc  ) 

return the time since the simulation began in units specified by the parameter.

Parameters:
tc TimeConverter specificing the units
TimeConverter * SST::Component::registerClock ( std::string  freq,
Clock::HandlerBase handler,
bool  regAll = true 
)

Registers a clock for this component.

Parameters:
freq Frequency for the clock in SI units
handler Pointer to Clock::HandlerBase which is to be invoked at the specified interval
regAll Should this clock perioud be used as the default time base for all of the links connected to this component
bool SST::Component::registerExit (  ) 

Register that the simulation should not end until this component says it is OK to.

Calling this function (generally done in Component::Setup()) increments a global counter. Calls to Component::unregisterExit() decrement the counter. The simulation cannot end unless this counter reaches zero, or the simulation time limit is reached. This counter is synchonized periodically with the other nodes.

See also:
Component::unregisterExit()
TimeConverter * SST::Component::registerTimeBase ( std::string  base,
bool  regAll = true 
)

Registers a default time base for the component and optionally sets the the component's links to that timebase.

Useful for components which do not have a clock, but would like a default timebase. base Frequency for the clock in SI units regAll Should this clock perioud be used as the default time base for all of the links connected to this component

virtual int SST::Component::Setup (  )  [inline, virtual]

Called after all components have been constructed, but before simulation time has begun.

Reimplemented in Cpu, Cpu_data, Cpu_power, Cpu_PowerAndData, Cpu_router_power, event_test, Cpu, trig_cpu, trig_nic, Routermodel, sstdisksim, and sstdisksim_tracereader.

bool SST::Component::unregisterExit (  ) 

Indicate permission for the simulation to end.

This function is the mirror of Component::registerExit(). It decrements the global counter, which, upon reaching zero, indicates that the simulation can terminate.

See also:
Component::registerExit()

Referenced by sstdisksim_tracereader::Setup().


Field Documentation

Timebase used if no other timebase is specified for calls like Component::getCurrentSimTime().

Often set by Component::registerClock() function

Referenced by getCurrentSimTime(), SST::IntrospectedComponent::getFreq(), and setDefaultTimeBase().

std::string SST::Component::type

Component's type, set by the factory when the object is created.

It is identical to the configuration string used to create the component. I.e. the XML "<component id="aFoo"><foo>..." would set component::type to "foo"


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