Integration with the Target

Integration with the Target

 

In a MicroC model you can have direct access to ports, memory mapped I/O and external memory (i.e. external to the modeled feature). This can be done using Data-Items and Conditions bound to External Symbols.

This feature is normally used during code generation for H/W (i.e. hardware) properties, using the symbol mapping definition menu. The binding is done in 2 stages:

Stage 1 - Data Item/Condition tagged as bounded to external symbol, identifying “Logical” signal name.
Stage 2 - Mapping of the “Logical” signal names to “Physical” signals.

For example:

DI1 is defined as bound to PORTA.

Stage 1 - From the model via the Data Dictionary, DI1 is tagged as being bound to an external symbol, identified by the Logical signal name PORTA.
Stage 2: From the compilation profile editor, a mapping of the Logical signal name PORTA to a physical location value of 0x03 is accomplished using the data matrix tool.

Result: On this target, DI1 is now mapped to physical address 0x03.

Data-Items and Conditions might be bound in two modes:

DirectThe previous description holds.
BufferedIn buffered access mode, two additional definitions are used for the element:
Get Value Call”—A user-defined API function to receive a value
Set Value Call”—A user-defined API function to set a value

When in buffered mode, the internal value is kept. At the beginning of a step, of the correspondence TASK, (Defined in the Condition dictionary as “Its Task”) a call to the “Get Value Call” API is done to ask for the new value. The “Set Value Call” API is called whenever there is assignment to the corresponding element in the model.