General principle of operation:
- FMU defines a typedef containing bypass variables (i.e. those variables which will see a performance increase).
- FMU defines/set/calculates the VRef of bypassed variables to the offset of those variables in the "bypass" typedef.
- FMU allocates an instance of the "bypass" typdef and assigns to a pointer variable.
- Legacy Get/Set operates against the "bypass" instance using the VRef: pointer + offset.
- FMU defines a variable which gives the "bypass" pointer (i.e. using uint64).
- Importer requests the "bypass" pointer and accesses variables directly using the VRef of those variables: pointer + offset.
- Alternative (to 6):
- FMU exports (optionally) a known symbol representing the bypass pointer.
- The importer attempts to locate that symbol, the presence of which indicates that bypass-mode is supported.
Noteworthy items:
- FMU may define variables in blocks according to type, allowing importer to use vectorization when accessing variables.
- Ownership of variable memory belongs with FMU.
- Existing constraints for Get/Set interface applies; during do_step() model only access, otherwise only importer access (and so on).
- Pointer variables may need to be references (void**) so that they can be reallocated. Annotations should indicate that, as well as associating a variable that indicates the size of that allocated resource (if required, for instance, a dynamic resizing buffer).
General principle of operation:
Noteworthy items: