C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
simics::StepEvent< T > Class Template Reference

Not commonly used for device model. Step-based event type. More...

#include <event.h>

Inheritance diagram for simics::StepEvent< T >:
simics::Event simics::StepEventInterface simics::EventInterface

Public Member Functions

bool posted (void *match_data=nullptr) const override
 Returns true if the event is in the queue, and false otherwise.
 
void remove (void *match_data=nullptr) const override
 Removes all events of this type with matching data from the queue.
 
void post (pc_step_t steps, void *data=nullptr) override
 Posts the event on the associated queue of the device.
 
pc_step_t next (void *match_data=nullptr) const override
 Returns the steps to the next occurrence of the event in the queue (relative to the current time)
 
 Event (ConfObject *obj, event_class_t *ev)
 
 Event (ConfObject *obj, const std::string &name)
 
- Public Member Functions inherited from simics::Event
 Event (ConfObject *obj, event_class_t *ev)
 
 Event (ConfObject *obj, const std::string &name)
 
void destroy (void *data) override
 Called when the event is removed from the queue without being called.
 
attr_value_t get_value (void *data) override
 Called to convert the event data into a value that can be saved in a configuration.
 
void * set_value (attr_value_t value) override
 Called to convert a configuration value into event data.
 
char * describe (void *data) const override
 Called to generate a human-readable description of the event to be used in the print-event-queue command.
 
 operator event_class_t * () const
 
- Public Member Functions inherited from simics::EventInterface
virtual ~EventInterface ()=default
 
virtual void callback (void *data)=0
 Called when the event expires.
 
virtual void destroy (void *data)=0
 Called when the event is removed from the queue without being called.
 
virtual attr_value_t get_value (void *data)=0
 Called to convert the event data into a value that can be saved in a configuration.
 
virtual void * set_value (attr_value_t value)=0
 Called to convert a configuration value into event data.
 
virtual char * describe (void *data) const =0
 Called to generate a human-readable description of the event to be used in the print-event-queue command.
 
- Public Member Functions inherited from simics::StepEventInterface
virtual ~StepEventInterface ()=default
 
virtual void remove (void *match_data) const =0
 Removes all events of this type with matching data from the queue.
 
virtual bool posted (void *match_data) const =0
 Returns true if the event is in the queue, and false otherwise.
 
virtual pc_step_t next (void *match_data) const =0
 Returns the steps to the next occurrence of the event in the queue (relative to the current time)
 
virtual void post (pc_step_t steps, void *data)=0
 Posts the event on the associated queue of the device.
 

Protected Attributes

T * dev_ {device_ptr<T>()}
 
- Protected Attributes inherited from simics::Event
ConfObjectobj_ {nullptr}
 
event_class_t * ev_ {nullptr}
 
conf_object_t * clock_ {nullptr}
 clock_ cannot be initialized here by SIM_object_clock, since attribute queue is not set yet
 

Additional Inherited Members

- Protected Member Functions inherited from simics::Event
template<typename T >
T * device_ptr () const
 
const char * name () const
 
- Static Protected Member Functions inherited from simics::Event
static int pointer_eq (void *data, void *match_data)
 

Detailed Description

template<typename T = ConfObject>
class simics::StepEvent< T >

Not commonly used for device model. Step-based event type.

Member Function Documentation

◆ Event() [1/2]

template<typename T = ConfObject>
simics::Event::Event ( ConfObject obj,
const std::string &  name 
)
Parameters
nameis the name of the event class registered

◆ Event() [2/2]

template<typename T = ConfObject>
simics::Event::Event ( ConfObject obj,
event_class_t *  ev 
)
Parameters
objshould be an instance of the same class the event is registered on
evshould be pointed to the registered Simics event class (e.g., SIM_register_event)

◆ next()

template<typename T = ConfObject>
pc_step_t simics::StepEvent< T >::next ( void *  match_data = nullptr) const
inlineoverridevirtual

Returns the steps to the next occurrence of the event in the queue (relative to the current time)

Implements simics::StepEventInterface.

◆ post()

template<typename T = ConfObject>
void simics::StepEvent< T >::post ( pc_step_t  steps,
void *  data = nullptr 
)
inlineoverridevirtual

Posts the event on the associated queue of the device.

clock_ is initialized when event is posted

Implements simics::StepEventInterface.

◆ posted()

template<typename T = ConfObject>
bool simics::StepEvent< T >::posted ( void *  match_data = nullptr) const
inlineoverridevirtual

Returns true if the event is in the queue, and false otherwise.

Implements simics::StepEventInterface.

◆ remove()

template<typename T = ConfObject>
void simics::StepEvent< T >::remove ( void *  match_data = nullptr) const
inlineoverridevirtual

Removes all events of this type with matching data from the queue.

Implements simics::StepEventInterface.

Member Data Documentation

◆ dev_

template<typename T = ConfObject>
T* simics::StepEvent< T >::dev_ {device_ptr<T>()}
protected

The documentation for this class was generated from the following file: