Define types and variables in e, then call C routines, passing all needed information through parameters.
Do not use fields where the enum type is declared implicitly in the field declaration. The enum value names will not be accessible on the C side.
Do not save an e instance pointer in C. The garbage collection mechanism will destroy the pointed instance. Use a field under sys instead.
Struct instances created by the appropriate macros should NOT be freed (de-allocated) in C. Such struct instances will be de-allocated automatically by Specman Elite when they are no longer needed. You should not attempt to de-allocate them manually.
Complex structs can be packed into a list of bytes or bits before they are passed to C. This can eliminate the need in C to access multiple fields. For example, this can be useful when oneis computing a Cyclic Redundancy Code (CRC) in C code on blocks of data.
The following features are not supported in Specman Elite.
Long integers are not supported by the C interface.
Lists with keys are not supported by the C interface.
TCMs cannot be implemented by C routines.
Subtypes (when inheritance, for example, small packet) cannot be used as type specifiers. Struct instances of subtypes can be passed and used as regular types' instances.