Commit 6276fc84 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Generate access to internal state in shared libs

parent 8f63fd0f
......@@ -190,6 +190,19 @@ def _process(process, simu=False, **kwargs):
process_level_decl.append('function get_state return chars_ptr;')
process_level_decl.append('pragma export(C, get_state, "{}_state");'
# Functions to get gobal variables (length and value)
for var_name, (var_type, _) in process.variables.viewitems():
process_level_decl.append("function l_{name}_size return integer "
"is (l_{name}'Size) with Export, "
"Convention => C, "
'Link_Name => "{name}_size";'
process_level_decl.append("function l_{name}_value return {sort} "
"is (l_{name}) with Export, "
"Convention => C, "
'Link_Name => "{name}_value";'
# Add the declaration of the runTransition procedure
process_level_decl.append('procedure runTransition(Id: Integer);')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment