Matlab/SIMULINK profile

The code for this mapper resides in simulink_B_mapper.py. It follows the synchronous API paradigm (see section 3.1). In plain terms, this means that access to this kind of subsystems is offered via two functions: one that initializes the subsystem, readying it for use, and a second one that executes it: the "cycle" function, which reads the input parameters, acts upon them and (possibly) populates output parameters.

The way the Real-Time Workshop (RTW) code generator operates makes this task easier than other tools: for one, both initiliazation and execution functions are already there, called SubsystemName_initialize and SubsystemName_step. For another, input and output parameters are easily accessible as global variables, named SubsystemName_Y and SubsystemName_U respectively.

The mapper therefore has a clear task: to use the appropriate recursive mapping rules when assigning data into and outof the RTW-generated data structures. The source/target data structures can again be either the Semantix ASN1SCC or the OSS/Nokalva generated data structures. When using Native encodings, just as with ObjectGeode, we use memory dumps of the ASN1SCC data structures, since they are self-contained (pointerless).

Code generated by RTW is very close to the one humans would actually write, and this applies to the data structures as well. The recursive descent into the ASN.1 AST doesn't need to address any special needs for temporary types or anything else: the mapping is very straightforward for RTW code: in around 60 lines we have a complete mapper - and this applies for all directions: OSS to Simulink, Simulink to ASN1SCC, etc (see classes FromOSStoSimulink, FromSimulinkToASN1SCC, etc).