Skip to content

Class simtix::BaseSM

ClassList > simtix > BaseSM

Base class for all Streaming Multiprocessor (SM) implementations. More...

  • #include <sm.h>

Inherits the following classes: simtix::sim::Clocked

Inherited by the following classes: simtix::AtomicSM, simtix::pipelined::PipelinedSM

Classes

Type Name
struct FaultStatus

Public Types

Type Name
enum uint8_t Status

Public Functions

Type Name
virtual void AttachDMem (mem::MemoryInterface * dmem) = 0
Attach data memory to the SM.
virtual void AttachIMem (mem::MemoryInterface * imem) = 0
Attach instruction memory to the SM.
BaseSM (const std::string & name)
Constructor of BaseSM .
virtual int Process (const opencl::WorkGroup & wg) = 0
Process a workgroup from the task dispatcher.
virtual void Reset () = 0
Reset the SM to its initial state.
virtual uint32_t cid () const = 0
Get the core ID of the SM.
virtual FaultStatus fault_status () const = 0
Get the fault status of the SM.
virtual uint64_t mcycle () const = 0
Get the cycle count (CSR mcycle) of the SM.
virtual const std::vector< uint64_t > & minstrets () const = 0
Get the instruction (CSR minstret) count of the SM.
virtual const std::shared_ptr< stat::Group > stat () const = 0
Get the statistics group of the SM.
virtual Status status () const = 0
Get the status of the SM.
virtual ~BaseSM () = default

Public Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
Clocked (const std::string & name, TickPri pri=kDefaultPri)
Constructor for clocled.
const std::string & name () const
Get the name of the clocked object.
virtual ~Clocked ()

Protected Attributes inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
std::string name_
TickPri pri_

Protected Static Attributes inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
bool busy_ = true
std::map< TickPri, std::vector< Clocked * > > clocked_objs_map_
uint64_t cur_tick_ = 0

Protected Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
virtual bool HasPendingTasks () = 0
Checks if any registered clocked objects have pending tasks at the current tick.
virtual void Tick () = 0
Global tick function that advances the simulation by one cycle.

Protected Static Functions inherited from simtix::sim::Clocked

See simtix::sim::Clocked

Type Name
void Register (Clocked * c)
Register a clocked object to participate in tick-driven simulation.
void Unregister (Clocked * c)
Unregister a clocked object from tick-driven simulation.

Detailed Description

The BaseSM class provides the foundation for all SM implementations. It handles the dispatch, execution, and error notification of workgroups. It also provides methods for interacting with memory and Control and Status Registers (CSRs), and manages synchronization and scheduling of warps. The class includes mechanisms for handling faults and synchronization barriers and inherits from <sim::Clocked> to account for clock cycles.

Public Types Documentation

enum Status

enum simtix::BaseSM::Status {
    kIdle = 0,
    kRunning,
    kCompleted,
    kFault
};

Public Functions Documentation

function AttachDMem

Attach data memory to the SM.

virtual void simtix::BaseSM::AttachDMem (
    mem::MemoryInterface * dmem
) = 0

Parameters:

  • dmem Pointer to the data memory interface.

function AttachIMem

Attach instruction memory to the SM.

virtual void simtix::BaseSM::AttachIMem (
    mem::MemoryInterface * imem
) = 0

Parameters:

  • imem Pointer to the instruction memory interface.

function BaseSM

Constructor of BaseSM .

inline explicit simtix::BaseSM::BaseSM (
    const std::string & name
) 

Parameters:

  • name Name of the SM.

function Process

Process a workgroup from the task dispatcher.

virtual int simtix::BaseSM::Process (
    const opencl::WorkGroup & wg
) = 0

Parameters:

  • wg Workgroup to process.

Returns:

0 if successful, -1 if failed.

Accept a work-group from task dispatcher and initialize all the threads. Implementation should override this method and determine how a work-group


function Reset

Reset the SM to its initial state.

virtual void simtix::BaseSM::Reset () = 0

This method is called when the SM transitions to kCompleted or kFault.


function cid

Get the core ID of the SM.

virtual uint32_t simtix::BaseSM::cid () const = 0

Returns:

Core ID.


function fault_status

Get the fault status of the SM.

virtual FaultStatus simtix::BaseSM::fault_status () const = 0

Returns:

Fault status of the SM.


function mcycle

Get the cycle count (CSR mcycle) of the SM.

virtual uint64_t simtix::BaseSM::mcycle () const = 0

Returns:

Cycle count.


function minstrets

Get the instruction (CSR minstret) count of the SM.

virtual const std::vector< uint64_t > & simtix::BaseSM::minstrets () const = 0

Returns:

Instruction count.


function stat

Get the statistics group of the SM.

virtual const std::shared_ptr< stat::Group > simtix::BaseSM::stat () const = 0

Returns:

Pointer to the statistics group.


function status

Get the status of the SM.

virtual Status simtix::BaseSM::status () const = 0

Returns:

Status of the SM.


function ~BaseSM

virtual simtix::BaseSM::~BaseSM () = default


The documentation for this class was generated from the following file projects/simtix/include/simtix/sm.h