Class simtix::BaseSMImpl
ClassList > simtix > BaseSMImpl
Base class for the Streaming Multiprocessor (SM) implementation. More...
#include <base.h>
Inherited by the following classes: simtix::AtomicSMImpl, simtix::pipelined::PipelinedSMImpl
Classes
Type | Name |
---|---|
struct | Stat |
struct | WorkGroupStat |
Public Functions
Type | Name |
---|---|
virtual void | AttachDMem (MemoryInterface * dmem) Connect data memory interface. |
virtual void | AttachIMem (MemoryInterface * imem) Connect instruction memory interface. |
BaseSMImpl (const std::string & name, uint32_t cid, const ArchParam & p=kDefaultArchParam) Constructor for BaseSMImpl . |
|
virtual int | NotifyBarrier (uint32_t wid, uint8_t bid, uint8_t wc) Notify the SM of a barrier instruction. |
virtual void | NotifyCtrlFlowChange (uint32_t wid, bool is_diverged, uint64_t wpc, uint64_t sswpc) = 0 Notify the SM of a control flow change. |
virtual void | NotifyException (uint32_t wid, uint64_t mcause, uint64_t mepc, uint64_t mtval) Notify the SM of an exception. |
virtual int | Process (const opencl::WorkGroup & wg) Process a work-group and initialize all threads. |
int32_t | ReadCSR (uint16_t addr, uint64_t * data) Read a Control and Status Register (CSR). |
virtual void | Reset () Reset the SM to its initial state. |
virtual void | ResetStat () Reset and create a new stat for a workgroup. |
virtual BaseArbitrator * | arbitrator () = 0 |
virtual BaseLoadStoreUnit * | lsu () = 0 |
uint32_t | marchid () const |
uint64_t | mcycle () const |
const std::vector< uint64_t > & | minstrets () |
uint32_t | mvendorid () const |
const std::string | name () const |
uint32_t | num_active_warps () const |
uint32_t | num_warps () const |
uint32_t | num_warps_per_warpgroup () const |
void | set_mcycle (uint64_t cycle) |
virtual std::shared_ptr< Stat > | stat () = 0 |
const std::vector< std::unique_ptr< Warp > > & | warps () const |
virtual WorkGroupStat * | wg_stat () = 0 |
uint32_t | xclgoffx () const |
uint32_t | xclgoffy () const |
uint32_t | xclgoffz () const |
uint32_t | xclgsx () const |
uint32_t | xclgsy () const |
uint32_t | xclgsz () const |
uint32_t | xclsx () const |
uint32_t | xclsy () const |
uint32_t | xclsz () const |
uint32_t | xclwx () const |
uint32_t | xclwy () const |
uint32_t | xclwz () const |
uint32_t | xdim () const |
uint64_t | xkernelarg () const |
uint64_t | xkernelpc () const |
uint64_t | xmhartidbase () const |
virtual | ~BaseSMImpl () |
Protected Attributes
Type | Name |
---|---|
std::vector< Barrier > | barriers_ |
uint32_t | cid_ |
MemoryInterface * | dmem_port_ = nullptr |
BaseSM::FaultStatus | fault_status_ = {0, 0, 0, 0} |
MemoryInterface * | imem_port_ = nullptr |
uint32_t | marchid_ = 0 |
uint64_t | mcycle_ = 0 |
std::vector< uint64_t > | minstrets_ |
uint32_t | mvendorid_ = 0 |
const std::string | name_ |
uint32_t | num_active_warps_ = 0 |
const uint32_t | num_threads_per_warp_ |
const uint32_t | num_warps_ |
uint32_t | num_warps_per_warpgroup_ = 1 |
std::unique_ptr< WarpSched > | scheduler_ |
BaseSM::Status | status_ |
std::vector< Warp * > | valid_leader_warps_ |
std::vector< std::unique_ptr< Warp > > | warps_ |
Barrier | wg_completion_barrier_ |
uint32_t | wg_serial_id_ = 0 |
uint32_t | xclgoffx_ = 0 |
uint32_t | xclgoffy_ = 0 |
uint32_t | xclgoffz_ = 0 |
uint32_t | xclgsx_ = 0 |
uint32_t | xclgsy_ = 0 |
uint32_t | xclgsz_ = 0 |
uint32_t | xclsx_ = 0 |
uint32_t | xclsy_ = 0 |
uint32_t | xclsz_ = 0 |
uint32_t | xclwx_ = 0 |
uint32_t | xclwy_ = 0 |
uint32_t | xclwz_ = 0 |
uint32_t | xdim_ = 0 |
uint64_t | xkernelarg_ = 0 |
uint64_t | xkernelpc_ = 0 |
uint64_t | xmhartidbase_ = 0 |
Protected Functions
Type | Name |
---|---|
bool | BarrierCompleted (const Barrier & b) const |
virtual bool | IsBusy () |
virtual void | Tick () Advance pipeline by one cycle. |
Detailed Description
This class provides the core functionality for managing warps, memory interfaces, and synchronization mechanisms within a Streaming Multiprocessor (SM).
Public Functions Documentation
function AttachDMem
Connect data memory interface.
Parameters:
dmem
Pointer to the data memory interface.
function AttachIMem
Connect instruction memory interface.
Parameters:
imem
Pointer to the instruction memory interface.
function BaseSMImpl
Constructor for BaseSMImpl .
explicit simtix::BaseSMImpl::BaseSMImpl (
const std::string & name,
uint32_t cid,
const ArchParam & p=kDefaultArchParam
)
Parameters:
name
The name of the SM instance.cid
Core ID.p
Architecture parameters from param.h.
function NotifyBarrier
Notify the SM of a barrier instruction.
Parameters:
Returns:
0 if successful, -1 if failed.
This method should be called when a warp reaches a barrier instruction.
function NotifyCtrlFlowChange
Notify the SM of a control flow change.
virtual void simtix::BaseSMImpl::NotifyCtrlFlowChange (
uint32_t wid,
bool is_diverged,
uint64_t wpc,
uint64_t sswpc
) = 0
Parameters:
This method should be called when a warp encounters a control flow change.
function NotifyException
Notify the SM of an exception.
virtual void simtix::BaseSMImpl::NotifyException (
uint32_t wid,
uint64_t mcause,
uint64_t mepc,
uint64_t mtval
)
Parameters:
wid
Warp ID.mcause
Machine cause register value.mepc
Machine exception PC.mtval
Machine trap value.
This method should be called when a warp generates an exception.
function Process
Process a work-group and initialize all threads.
Parameters:
wg
The work-group to process.
Returns:
0 if successful, -1 if failed.
This method accepts a work-group from the task dispatcher and initializes all threads. The implementation should override this method to determine how a work-group is dispatched.
function ReadCSR
Read a Control and Status Register (CSR).
Parameters:
addr
Address of the CSR.data
Pointer to store the read value.
Returns:
0 if successful, -1 if the CSR is undefined.
function Reset
Reset the SM to its initial state.
This method is called when the SM transitions to the kCompleted
or kFault
state. It resets the execution environment.
function ResetStat
Reset and create a new stat for a workgroup.
function arbitrator
function lsu
function marchid
function mcycle
function minstrets
function mvendorid
function name
function num_active_warps
function num_warps
function num_warps_per_warpgroup
function set_mcycle
function stat
function warps
function wg_stat
function xclgoffx
function xclgoffy
function xclgoffz
function xclgsx
function xclgsy
function xclgsz
function xclsx
function xclsy
function xclsz
function xclwx
function xclwy
function xclwz
function xdim
function xkernelarg
function xkernelpc
function xmhartidbase
function ~BaseSMImpl
Protected Attributes Documentation
variable barriers_
variable cid_
variable dmem_port_
variable fault_status_
variable imem_port_
variable marchid_
variable mcycle_
variable minstrets_
variable mvendorid_
variable name_
variable num_active_warps_
variable num_threads_per_warp_
variable num_warps_
variable num_warps_per_warpgroup_
variable scheduler_
variable status_
variable valid_leader_warps_
variable warps_
variable wg_completion_barrier_
variable wg_serial_id_
variable xclgoffx_
variable xclgoffy_
variable xclgoffz_
variable xclgsx_
variable xclgsy_
variable xclgsz_
variable xclsx_
variable xclsy_
variable xclsz_
variable xclwx_
variable xclwy_
variable xclwz_
variable xdim_
variable xkernelarg_
variable xkernelpc_
variable xmhartidbase_
Protected Functions Documentation
function BarrierCompleted
function IsBusy
function Tick
Advance pipeline by one cycle.
The documentation for this class was generated from the following file projects/simtix/src/simtix/sm/base.h