Model-Based Design for Embedded Systems- P26: This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. | 216 Model-Based Design for Embedded Systems the necessary information needed for each translation step. Based on the task-dependency information that tells how to connect the tasks the translator determines the number of intertask communication channels. Based on the period and deadline information of tasks the run-time system is synthesized. With the memory map information of each processor the translator defines the shared variables in the shared region. To support a new target architecture in the proposed workflow we have to add translation rules of the generic API to the translator make a target-specific-OpenMP-translator for data parallel tasks and apply the generation rule of task scheduling codes tailored for the target OS. Each step of CIC translator will be explained in this section. Generic API Translation Since the CIC task code uses generic APIs for target-independent specification the translation of generic APIs to target-dependent APIs is needed. If the target processor has an OS installed generic APIs are translated into OS APIs otherwise they are translated into communication APIs that are defined by directly accessing the hardware devices. We implement the OS API library and communication API library both optimized for each target architecture. For most generic APIs API translation is achieved by simple redefinition of the API function. Figure shows an example where the translator replaces MQ_RECEIVE API with a read_port function for a target processor with pthread support. The read_port function is defined using Generic API MQ_RECEIVE port_id buf size 1. int read_port int channel_id unsigned char buf int len 2. . 3. pthread_mutex_lock channel_mutex 4. . 5. memcpy buf channel- start len 6. . 7. pthread_mutex_unlock channel_mutex 8. a b FIGURE Examples of generic API translation a MQ_RECEIVE operation b READ operation. Retargetable Embedded Software Design Methodology 217 pthread APIs and the memcpy C library function. However some .