4.2.2.4 Instruction Class Identifiers

An individual instruction class has the following identifiers unique in various scopes.

The following tuples containing instruction class identifiers are unique in various scopes of a multinode model.

Tuple or IdentifierScope of Uniqueness
<instruction meta-class name, binary instruction class parameters>instruction class set
<instruction class set name, binary instruction class parameters>instruction meta-class
instruction class nameinstruction class set
instruction class indexinstruction class set

An instruction class index identifies an individual instruction class or instruction class sequence. The function qsmm_reg_instr_class_seq (see Instruction Class Sequences) returns an instruction class index for an instruction class sequence after registering it in an instruction class set. If an output signal of an instruction emitting engine is an instruction class index identifying an instruction class sequence, emitting the output signal corresponds to emitting a sequence of assembler instructions with the same effect as emitting individual assembler instructions comprising the sequence. A list of signal identifiers encoding an action choice state of the environment state identification engine includes the output signal as the index of the last emitted instruction sequence.

The following function retrieves the name of an instruction meta-class from its event handler function. The function might be useful when multiple instruction meta-classes share the same event handler function.

Function: int qsmm_get_mehcall_instr_meta_class (qsmm_mehcall_t mehcall, const char **instr_meta_class_name_pp)

This function retrieves the name of an instruction meta-class associated with an event sent to an instruction meta-class event handler, where mehcall is an argument of the event handler passing information about the event. If instr_meta_class_name_pp is not NULL, the function sets *instr_meta_class_name_pp to the name of the instruction meta-class.

On success, the function returns a non-negative value. If the context of calling the function is not the event handler of an instruction meta-class, the function returns negative error code QSMM_ERR_UNTIMELY.

The function qsmm_reg_instr_class_v2 registers an individual instruction class as belonging to an instruction class set. Use the function described below to get the name of the instruction class set when processing an event by the event handler of instruction meta-class of the instruction class. You can also use this function to get the name of the instruction class set when processing an event by the event handler of the instruction class set.

Function: int qsmm_get_mehcall_instr_class_set (qsmm_mehcall_t mehcall, const char **instr_class_set_name_pp)

This function retrieves the name of an instruction class set associated with an event sent to the event handler of an instruction meta-class or the instruction class set, where mehcall is an argument of that event handler passing information about the event. If instr_class_set_name_pp is not NULL, the function sets *instr_class_set_name_pp to the name of the instruction class set.

If the event handler of an instruction meta-class calls this function while processing an event QSMM_EVT_INSTR_CLASS_INIT, QSMM_EVT_INSTR_CLASS_DONE, or QSMM_EVT_ACTIVATE, the function retrieves the name of an instruction class set containing an individual instruction class associated with the event and derived from the instruction meta-class. If the event handler of an instruction class set calls this function, it retrieves the name of the instruction class set.

On success, the function returns a non-negative value. If the context of calling the function is not the event handler of an instruction meta-class on processing an event QSMM_EVT_INSTR_CLASS_INIT, QSMM_EVT_INSTR_CLASS_DONE, or QSMM_EVT_ACTIVATE and not the event handler of an instruction class set, the function returns negative error code QSMM_ERR_UNTIMELY.