SST Learning Note
Before all
Key interfaces
SST::Component
: basic class for simulation objectsSST::Event
: interactions between components or recurring events like component clock ticks- Event class can have handler with form of
void func(Event* ev)
. The handler will invoke a given member function whenever triggered. - The handler is templated with
()
operator overloaded to call the member function on the object// event.h template <typename classT, typename dataT = void> using Handler = SSTHandler<void, Event*, false, classT, dataT>; // ssthandler.h, how to pass the handler function to the event template <typename returnT, typename argT, bool createIdT, typename classT, typename dataT = void> class SSTHandler : public SSTHandlerBase<returnT, argT, createIdT> { ... /** Constructor * @param object - Pointer to Object upon which to call the handler * @param member - Member function to call as the handler * @param data - Additional argument to pass to handler */ SSTHandler(classT* const object, PtrMember member, dataT data) : SSTHandlerBase<returnT, argT, createIdT>(), object(object), member(member), data(data) {}
- An example:
// NICeventHandler(ev) will call the // proc::handle_nic_events on Event ev NICeventHandler = new Event::Handler<proc> (this, &proc::handle_nic_events); ... bool proc::handle_nic_events(Event *event) { ... }
- Can handle either type of the events
- Event class can have handler with form of
- Using the Event Handlers
- Need to register handler for link or clock
SST::Component::configureLink()
SST::Component::registerClock()
SST::Link
: communicate components by passing events- Specified in Python configuration file
Basically an SST component is comprised of the constructor and setup functions (Setup()
and Init()
) to perform any necessary setup. During these functions, handlers should be bound to the links/ports of the components to handle transcations. In addition, depend on the component, the clock event should also be handle.
Running the SST
sst [FLAGS] CONFIG_FILE
- Ex:
# in miranda/ sst -n 24 tests/randomgen.py -v
- Enabling logging
- Set the
verbose
param in the Python script - Ex: change the 0 to 1 will enable all logging statements with level <= 1
# Define the simulation components comp_cpu = sst.Component("cpu", "miranda.BaseCPU") comp_cpu.addParams({ "verbose" : 0, "printStats" : 1, })
- Set the
- Running Vanadis
- Use the basic test script
Standard Memory interface
In the core source code under interface
folder.
MMIO
Not an interface in SST, implemented with the standardmem interface? check its handlers.
Check the handle functions of standardmem
- read/write request: from other device to this
- read/write response: from this to other
- There is an example MMIO component in
memHierarchy/testcpu/standardMMIO.h
Balar
How it work
- Based on Ariel? connected to Pin, which generates trace info
- Catch the cuda calls in ariel via pin traces? and send to balar:
ariel/frontend/simple/fesimple.cc
- When building balar, do not specify the mpi compiler in the element config script