Class 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
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
Type | Name |
---|---|
std::string | name_ |
TickPri | pri_ |
Protected Static Attributes inherited from 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
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
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
Public Functions Documentation
function AttachDMem
Attach data memory to the SM.
Parameters:
dmem
Pointer to the data memory interface.
function AttachIMem
Attach instruction memory to the SM.
Parameters:
imem
Pointer to the instruction memory interface.
function BaseSM
Constructor of BaseSM .
Parameters:
name
Name of the SM.
function Process
Process a workgroup from the task dispatcher.
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.
This method is called when the SM transitions to kCompleted
or kFault
.
function cid
Get the core ID of the SM.
Returns:
Core ID.
function fault_status
Get the fault status of the SM.
Returns:
Fault status of the SM.
function mcycle
Get the cycle count (CSR mcycle) of the SM.
Returns:
Cycle count.
function minstrets
Get the instruction (CSR minstret) count of the SM.
Returns:
Instruction count.
function stat
Get the statistics group of the SM.
Returns:
Pointer to the statistics group.
function status
Get the status of the SM.
Returns:
Status of the SM.
function ~BaseSM
The documentation for this class was generated from the following file projects/simtix/include/simtix/sm.h