Skip to content

Class simtix::AtomicSM

ClassList > simtix > AtomicSM

Inherits the following classes: simtix::BaseSM

Classes

Type Name
class Impl

Public Types inherited from simtix::BaseSM

See simtix::BaseSM

Type Name
enum uint8_t Status

Public Functions

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

Public Functions inherited from simtix::BaseSM

See simtix::BaseSM

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

Type Name
std::unique_ptr< Impl > impl_

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

Type Name
virtual bool HasPendingTasks () override
Check if the AtomicSM has pending tasks.
virtual void Tick () override
Perform AtomicSM operation cycle.

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.

Public Functions Documentation

function AtomicSM

Constructor of AtomicSM .

explicit simtix::AtomicSM::AtomicSM (
    const std::string & name,
    uint32_t cid,
    const ArchParam & p=kDefaultArchParam
) 

Parameters:

  • name Name of the SM.
  • cid Core ID of the SM.
  • p Architecture parameters from param.h.

function AttachDMem

Attach data memory to the SM.

virtual void simtix::AtomicSM::AttachDMem (
    mem::MemoryInterface * dmem
) override

Parameters:

  • dmem Pointer to the data memory interface.

Implements simtix::BaseSM::AttachDMem


function AttachIMem

Attach instruction memory to the SM.

virtual void simtix::AtomicSM::AttachIMem (
    mem::MemoryInterface * imem
) override

Parameters:

  • imem Pointer to the instruction memory interface.

Implements simtix::BaseSM::AttachIMem


function Process

Process a workgroup from the task dispatcher.

virtual int simtix::AtomicSM::Process (
    const opencl::WorkGroup & wg
) override

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

Implements simtix::BaseSM::Process


function Reset

Reset the SM to its initial state.

virtual void simtix::AtomicSM::Reset () override

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

Implements simtix::BaseSM::Reset


function cid

Get the core ID of the SM.

virtual uint32_t simtix::AtomicSM::cid () override const

Returns:

Core ID.

Implements simtix::BaseSM::cid


function fault_status

Get the fault status of the SM.

virtual FaultStatus simtix::AtomicSM::fault_status () override const

Returns:

Fault status of the SM.

Implements simtix::BaseSM::fault_status


function mcycle

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

virtual uint64_t simtix::AtomicSM::mcycle () override const

Returns:

Cycle count.

Implements simtix::BaseSM::mcycle


function minstrets

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

virtual const std::vector< uint64_t > & simtix::AtomicSM::minstrets () override const

Returns:

Instruction count.

Implements simtix::BaseSM::minstrets


function stat

Get the statistics group of the SM.

virtual const std::shared_ptr< stat::Group > simtix::AtomicSM::stat () override const

Returns:

Pointer to the statistics group.

Implements simtix::BaseSM::stat


function status

Get the status of the SM.

virtual Status simtix::AtomicSM::status () override const

Returns:

Status of the SM.

Implements simtix::BaseSM::status


function ~AtomicSM

simtix::AtomicSM::~AtomicSM () 

Protected Attributes Documentation

variable impl_

std::unique_ptr<Impl> simtix::AtomicSM::impl_;

Protected Functions Documentation

function HasPendingTasks

Check if the AtomicSM has pending tasks.

virtual bool simtix::AtomicSM::HasPendingTasks () override

Returns:

True if there are pending tasks, false otherwise.

Implements simtix::sim::Clocked::HasPendingTasks


function Tick

Perform AtomicSM operation cycle.

virtual void simtix::AtomicSM::Tick () override

Implements simtix::sim::Clocked::Tick



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