Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Model-Based Design for Embedded Systems- P9:The unparalleled flexibility of computation has been a key driver and feature bonanza in the development of a wide range of products across a broad and diverse spectrum of applications such as in the automotive aerospace, health care, consumer electronics, etc. | 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. 8.5.1 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 8.6a 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 8.6 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 .