File FliImpl.h

Functions

void cocotb_init()
void handle_fli_callback(void *data)
class FliProcessCbHdl : public virtual GpiCbHdl

Subclassed by FliShutdownCbHdl, FliSignalCbHdl, FliSimPhaseCbHdl, FliStartupCbHdl, FliTimedCbHdl

cleanup callback

Called while unwinding after a GPI callback

We keep the process but desensitize it

NB: need a way to determine if should leave it sensitized…

int cleanup_callback() override

Public Functions

FliProcessCbHdl(GpiImplInterface *impl)

Protected Attributes

mtiProcessIdT m_proc_hdl
bool m_sensitised
class FliSignalCbHdl : public FliProcessCbHdl, public GpiValueCbHdl

cleanup callback

Called while unwinding after a GPI callback

We keep the process but desensitize it

NB: need a way to determine if should leave it sensitized…

FliSignalCbHdl(GpiImplInterface *impl, FliSignalObjHdl *sig_hdl, int edge)
int arm_callback() override

Public Functions

int cleanup_callback() override

Private Members

mtiSignalIdT m_sig_hdl
class FliSimPhaseCbHdl : public FliProcessCbHdl

Subclassed by FliNextPhaseCbHdl, FliReadOnlyCbHdl, FliReadWriteCbHdl

cleanup callback

Called while unwinding after a GPI callback

We keep the process but desensitize it

NB: need a way to determine if should leave it sensitized…

int arm_callback() override

Public Functions

FliSimPhaseCbHdl(GpiImplInterface *impl, mtiProcessPriorityT priority)

Protected Attributes

mtiProcessPriorityT m_priority
class FliReadWriteCbHdl : public FliSimPhaseCbHdl

Public Functions

FliReadWriteCbHdl(GpiImplInterface *impl)
class FliNextPhaseCbHdl : public FliSimPhaseCbHdl

Public Functions

FliNextPhaseCbHdl(GpiImplInterface *impl)
class FliReadOnlyCbHdl : public FliSimPhaseCbHdl

Public Functions

FliReadOnlyCbHdl(GpiImplInterface *impl)
class FliStartupCbHdl : public FliProcessCbHdl

cleanup callback

Called while unwinding after a GPI callback

We keep the process but desensitize it

NB: need a way to determine if should leave it sensitized…

int arm_callback() override
int run_callback() override

Public Functions

FliStartupCbHdl(GpiImplInterface *impl)
class FliShutdownCbHdl : public FliProcessCbHdl

cleanup callback

Called while unwinding after a GPI callback

We keep the process but desensitize it

NB: need a way to determine if should leave it sensitized…

int arm_callback() override
int run_callback() override

Public Functions

FliShutdownCbHdl(GpiImplInterface *impl)
class FliTimedCbHdl : public FliProcessCbHdl

cleanup callback

Called while unwinding after a GPI callback

We keep the process but desensitize it

NB: need a way to determine if should leave it sensitized…

FliTimedCbHdl(GpiImplInterface *impl, uint64_t time_ps)
int arm_callback() override
int cleanup_callback() override

Public Functions

void reset_time(uint64_t new_time)

Private Members

uint64_t m_time_ps
class FliObj

Subclassed by FliObjHdl, FliSignalObjHdl

Public Functions

FliObj(int acc_type, int acc_full_type)
~FliObj() = default
int get_acc_type()
int get_acc_full_type()

Protected Attributes

int m_acc_type
int m_acc_full_type
class FliObjHdl : public GpiObjHdl, public FliObj

Public Functions

FliObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, int acc_type, int acc_full_type)
FliObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, int acc_type, int acc_full_type, bool is_const)
int initialise(std::string &name, std::string &fq_name) override
class FliSignalObjHdl : public GpiSignalObjHdl, public FliObj

Subclassed by FliValueObjHdl

Public Functions

FliSignalObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, bool is_const, int acc_type, int acc_full_type, bool is_var)
GpiCbHdl *value_change_cb(int edge) override
int initialise(std::string &name, std::string &fq_name) override
bool is_var()

Protected Attributes

bool m_is_var
FliSignalCbHdl m_rising_cb
FliSignalCbHdl m_falling_cb
FliSignalCbHdl m_either_cb
class FliValueObjHdl : public FliSignalObjHdl

Subclassed by FliEnumObjHdl, FliIntObjHdl, FliLogicObjHdl, FliRealObjHdl, FliStringObjHdl

Public Functions

FliValueObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, bool is_const, int acc_type, int acc_full_type, bool is_var, mtiTypeIdT valType, mtiTypeKindT typeKind)
~FliValueObjHdl() override
const char *get_signal_value_binstr() override
const char *get_signal_value_str() override
double get_signal_value_real() override
long get_signal_value_long() override
int set_signal_value(long value, gpi_set_action_t action) override
int set_signal_value(double value, gpi_set_action_t action) override
int set_signal_value_str(std::string &value, gpi_set_action_t action) override
int set_signal_value_binstr(std::string &value, gpi_set_action_t action) override
void *get_sub_hdl(int index)
int initialise(std::string &name, std::string &fq_name) override
mtiTypeKindT get_fli_typekind()
mtiTypeIdT get_fli_typeid()

Protected Attributes

mtiTypeKindT m_fli_type
mtiTypeIdT m_val_type
char *m_val_buff
void **m_sub_hdls
class FliEnumObjHdl : public FliValueObjHdl

Public Functions

FliEnumObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, bool is_const, int acc_type, int acc_full_type, bool is_var, mtiTypeIdT valType, mtiTypeKindT typeKind)
const char *get_signal_value_str() override
long get_signal_value_long() override
int set_signal_value(long value, gpi_set_action_t action) override
int initialise(std::string &name, std::string &fq_name) override

Private Members

char **m_value_enum
mtiInt32T m_num_enum
class FliLogicObjHdl : public FliValueObjHdl

Public Functions

FliLogicObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, bool is_const, int acc_type, int acc_full_type, bool is_var, mtiTypeIdT valType, mtiTypeKindT typeKind)
~FliLogicObjHdl() override
const char *get_signal_value_binstr() override
int set_signal_value(long value, gpi_set_action_t action) override
int set_signal_value_binstr(std::string &value, gpi_set_action_t action) override
int initialise(std::string &name, std::string &fq_name) override

Private Members

char *m_mti_buff
char **m_value_enum
mtiInt32T m_num_enum
std::map<char, mtiInt32T> m_enum_map
class FliIntObjHdl : public FliValueObjHdl

Public Functions

FliIntObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, bool is_const, int acc_type, int acc_full_type, bool is_var, mtiTypeIdT valType, mtiTypeKindT typeKind)
const char *get_signal_value_binstr() override
long get_signal_value_long() override
int set_signal_value(long value, gpi_set_action_t action) override
int initialise(std::string &name, std::string &fq_name) override
class FliRealObjHdl : public FliValueObjHdl

Public Functions

FliRealObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, bool is_const, int acc_type, int acc_full_type, bool is_var, mtiTypeIdT valType, mtiTypeKindT typeKind)
~FliRealObjHdl() override
double get_signal_value_real() override
int set_signal_value(double value, gpi_set_action_t action) override
int initialise(std::string &name, std::string &fq_name) override

Private Members

double *m_mti_buff
class FliStringObjHdl : public FliValueObjHdl

Public Functions

FliStringObjHdl(GpiImplInterface *impl, void *hdl, gpi_objtype_t objtype, bool is_const, int acc_type, int acc_full_type, bool is_var, mtiTypeIdT valType, mtiTypeKindT typeKind)
~FliStringObjHdl() override
const char *get_signal_value_str() override
int set_signal_value_str(std::string &value, gpi_set_action_t action) override
int initialise(std::string &name, std::string &fq_name) override

Private Members

char *m_mti_buff
class FliTimerCache

Find the root handle

Find the root handle using an optional name

Get a handle to the root simulator object. This is usually the toplevel.

If no name is provided, we return the first root instance.

If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL

FliTimedCbHdl *get_timer(uint64_t time_ps)
void put_timer(FliTimedCbHdl*)

Public Functions

FliTimerCache(FliImpl *impl)

Private Members

std::queue<FliTimedCbHdl*> free_list
FliImpl *impl
class FliIterator : public GpiIterator

Find the root handle

Find the root handle using an optional name

Get a handle to the root simulator object. This is usually the toplevel.

If no name is provided, we return the first root instance.

If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL

GpiIteratorMapping<int, OneToMany> iterate_over
FliIterator(GpiImplInterface *impl, GpiObjHdl *hdl)
Status next_handle(std::string &name, GpiObjHdl **hdl, void **raw_hdl) override
void populate_handle_list(OneToMany childType)

Public Types

enum OneToMany

Values:

enumerator OTM_END = 0
enumerator OTM_CONSTANTS
enumerator OTM_SIGNALS
enumerator OTM_REGIONS
enumerator OTM_SIGNAL_SUB_ELEMENTS
enumerator OTM_VARIABLE_SUB_ELEMENTS

Private Members

std::vector<OneToMany> *selected
std::vector<OneToMany>::iterator one2many
std::vector<void*> m_vars
std::vector<void*> m_sigs
std::vector<void*> m_regs
std::vector<void*> *m_currentHandles
std::vector<void*>::iterator m_iterator
class FliImpl : public GpiImplInterface

Native Check Create

Determine whether a simulation object is native to FLI and create a handle if it is

GpiObjHdl *native_check_create(std::string &name, GpiObjHdl *parent) override
GpiObjHdl *native_check_create(int32_t index, GpiObjHdl *parent) override
const char *reason_to_string(int reason) override

Get current simulation time

Get current simulation time

NB units depend on the simulation configuration

void get_sim_time(uint32_t *high, uint32_t *low) override
void get_sim_precision(int32_t *precision) override
const char *get_simulator_product() override
const char *get_simulator_version() override

Find the root handle

Find the root handle using an optional name

Get a handle to the root simulator object. This is usually the toplevel.

If no name is provided, we return the first root instance.

If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL

GpiObjHdl *get_root_handle(const char *name) override
GpiIterator *iterate_handle(GpiObjHdl *obj_hdl, gpi_iterator_sel_t type) override
GpiCbHdl *register_timed_callback(uint64_t time_ps) override
GpiCbHdl *register_readonly_callback() override
GpiCbHdl *register_nexttime_callback() override
GpiCbHdl *register_readwrite_callback() override
int deregister_callback(GpiCbHdl *obj_hdl) override

Public Functions

FliImpl(const std::string &name)
void sim_end() override
GpiObjHdl *native_check_create(void *raw_hdl, GpiObjHdl *paret) override
GpiObjHdl *create_gpi_obj_from_handle(void *hdl, std::string &name, std::string &fq_name, int accType, int accFullType)

Public Members

FliTimerCache cache

Private Functions

bool isValueConst(int kind)
bool isValueLogic(mtiTypeIdT type)
bool isValueChar(mtiTypeIdT type)
bool isValueBoolean(mtiTypeIdT type)
bool isTypeValue(int type)
bool isTypeSignal(int type, int full_type)

Private Members

FliReadOnlyCbHdl m_readonly_cbhdl
FliNextPhaseCbHdl m_nexttime_cbhdl
FliReadWriteCbHdl m_readwrite_cbhdl