Embedded operating system platform related code generation method based on AADL model
Through the automatic code generation method based on the AADL model, the problem of code generation in the existing technology that rely on manual operations, easy to introduce errors and adapt to different platforms is solved, and efficient, accurate and portable code generation is achieved, suitable for aerospace, etc. Software development in key areas.
Patent Information
- Application Number
- CN202411498655.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-25
Smart Images

Figure CN119440514A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of automatic code generation, and in particular relates to a method for generating codes related to an embedded operating system platform based on an AADL model. Background Art
[0002] In recent years, with the rapid advancement of my country's aerospace field and major national engineering projects, the scale and complexity of software in key fields such as aerospace are growing exponentially. These fields have extremely high requirements for high reliability and strict execution semantics of software. At present, the software development methods in these fields are still mainly based on manual coding, but when faced with such a large and complex system, it often leads to problems such as long development time and insufficient code security. With the introduction of new concepts such as Model Based Systems Engineering (MBSE), compared with traditional software systems engineering, the concept of MBSE is more in line with the current trend of software development, and the traditional software development method is gradually being replaced by the model-based development method.
[0003] However, despite the significant advantages of AADL in system design and verification, converting AADL models into executable code on the target platform remains a challenging task. The current code generation process usually requires manual implementation and is prone to introducing errors, increasing development time and cost. In addition, the differences between different platforms further increase the complexity of code generation. To address these challenges, an automated, AADL model-based code generation method is needed that can effectively reduce manual intervention, improve the accuracy and efficiency of code generation, and ensure the portability and consistency of the generated code.
[0004] The model-based automatic code generation method of the present invention mainly includes several key steps: using AADL to model the system, obtaining and parsing the AADL model, mapping the AADL model to an intermediate platform-independent code, and then mapping the platform-independent code to the (Tianyi) embedded operating system platform code. In the system design stage, the system is first visually modeled using an AADL-based modeling tool; after the modeling is completed, the parsing tool is used to extract the necessary system architecture information from the AADL model to identify the system's components, interfaces, connection methods, and dependencies between them; in order to achieve cross-platform nature of the system, the structure and behavior in the AADL model will first be mapped to a platform-independent intermediate code, which can describe the logical functions of the system without relying on the hardware or operating system of a specific platform, such as Figure 1As shown, it can be mapped to different platforms such as JVM, seL4 or Tyche; after generating platform-independent code, the abstract components in the code are mapped to specific modules in the (Tianyi) embedded operating system, such as task scheduling, memory management, communication interface, etc.; finally, the generated code is integrated into the overall framework of the (Tianyi) embedded operating system to ensure compatibility and collaboration with other system modules. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] The technical problem to be solved by the present invention is how to provide a method for generating embedded operating system platform-related codes based on the AADL model to solve the problems that the existing code generation process relies on manual operations, is prone to human errors, and is difficult to adapt to different platforms.
[0007] (II) Technical solution
[0008] In order to solve the above technical problems, the present invention proposes a method for generating relevant codes of an embedded operating system platform based on an AADL model, the method comprising the following steps:
[0009] The first step is to traverse and parse the AADL model
[0010] Automatically traverse and obtain each component of the AADL model, including comprehensive scanning and extraction of the components, interfaces, runtime performance attributes, and inter-component connection relationships of the AADL model; through this traversal and acquisition, ensure that all key information can be correctly identified and extracted, and then conduct in-depth analysis and processing of this information; the parsing process includes identifying and classifying each component, interface, performance attribute, and inter-component connection information of the AADL model;
[0011] Step 2: Design the mapping rules from AADL model to embedded operating system code
[0012] Design a set of mapping rules from AADL models to embedded operating system code, including mapping components to modules, mapping interfaces to communication interfaces, mapping performance attributes to configuration parameters, and mapping between components to data flows or control flows. These rules define how to map the model to the corresponding modules in the embedded operating system, ensuring that the abstract concepts in the model can be accurately converted into specific implementation code.
[0013] Step 3: Automatically convert to embedded operating system platform code
[0014] Based on the above mapping rules, the components, interfaces, performance attributes and connection information between components in the AADL model are automatically converted into embedded operating system platform code. This process first converts the AADL model into an intermediate platform-independent code, and then converts the intermediate platform-independent code into the specific implementation code of the embedded operating system. Finally, the generated code can run directly on the embedded operating system platform.
[0015] (III) Beneficial effects
[0016] The present invention proposes a method for generating relevant codes for an embedded operating system platform based on an AADL model. The present invention proposes an automatic code generation technology based on an AADL model. The technology mainly has the following characteristics:
[0017] (1) By automatically converting AADL models into platform-independent code and the final (Tianyi) embedded operating system platform code, this technology significantly reduces the workload of manual coding and instead relies on automated tools to generate high-quality code, shortening the development cycle.
[0018] (2) During the automatic code generation process, the execution semantics defined in the AADL model are strictly maintained to ensure that the generated code fully complies with the design requirements of the model in terms of behavior and to ensure the reliability and security of the code in critical systems, especially in applications involving safety and security-critical areas.
[0019] (3) By first mapping the AADL model to a platform-independent intermediate code, the technology supports multiple target platforms. This design allows the same model to be mapped to different operating systems or hardware platforms, enhancing the flexibility and portability of the system. When generating platform-specific code, the system can be optimized according to the characteristics of the target platform (such as the (Tianyi) embedded operating system) to ensure optimal performance on that platform.
[0020] (4) Due to the strict execution semantics and automatic verification function of this technology, the generated code is particularly suitable for applications in fields that require high reliability and safety, such as medical equipment, avionics mission systems, etc. These fields have very low tolerance for system errors, so reliable code generation technology is crucial. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 Generate a sample diagram of the platform supporting the code chain;
[0022] Figure 2 Generate toolchain architecture diagram for code;
[0023] Figure 3 It is an AADL textual representation diagram of a port-based thread component type;
[0024] Figure 4 Modeling views for AADL software systems;
[0025] Figure 5 Generates a chain workflow diagram for the code. DETAILED DESCRIPTION
[0026] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0027] AADL has been widely used in system design and verification. It can describe the system's software and hardware components, connection relationships and non-functional properties in a standardized manner, providing strong support for performance evaluation and verification in the early design stage. However, there are still many challenges in the process of converting the AADL model into executable code on the target platform. In view of the problems that the existing code generation process relies on manual operations, is prone to human errors, and is difficult to adapt to different platforms, the present invention proposes a method for generating relevant code for an embedded operating system platform based on an AADL model. The method implements traversal acquisition and parsing of the AADL model by writing an algorithm, designs mapping rules from the AADL model to the (Tianyi) embedded operating system code, and automatically converts the components, interfaces, performance attributes and connection information between components in the model into the (Tianyi) embedded operating system platform code. This method can not only automatically generate code, reduce the complexity and uncertainty of manual writing, but also improve the reliability and platform adaptability of the code, providing a powerful tool for the development of embedded systems in the aerospace field.
[0028] The purpose of the present invention is to realize the method of model-based automatic code generation, and realize the mapping from AADL model to (Tianyi) embedded operating system platform code. The method parses the AADL model, extracts key information, and maps it to the corresponding operating system platform code to generate high-trust software. The method ensures strict execution semantics and is suitable for application development in safety and security-critical fields.
[0029] The first step is to traverse and parse the AADL model
[0030] The present invention designs and implements an algorithm for automatically traversing and acquiring various components in an AADL model. This includes comprehensive scanning and extraction of components, interfaces, runtime performance attributes, and inter-component connection relationships of the AADL model. Through this traversal acquisition, it is ensured that all key information can be correctly identified and extracted, and then the information is deeply analyzed and processed. The parsing process includes identifying and classifying various components, interfaces, performance attributes, and inter-component connection information of the AADL model. Through this process, it is ensured that all elements in the AADL model can be accurately understood and prepared for the subsequent code generation steps.
[0031] Step 2: Design the mapping rules from AADL model to (Tianyi) embedded operating system code
[0032] Based on a thorough analysis of the AADL model, the present invention designs a set of mapping rules from the AADL model to the (Tianyi) embedded operating system code, including: mapping of components to modules, mapping of interfaces to communication interfaces, mapping of performance attributes to configuration parameters, and mapping of components to data flows or control flows. These rules define how to map the model to the corresponding modules in the (Tianyi) embedded operating system, ensuring that the abstract concepts in the model can be accurately converted into specific implementation codes.
[0033] Step 3: Automatically convert to (Tianyi) embedded operating system platform code
[0034] Based on the above mapping rules, the present invention realizes the technology of automatically converting the components, interfaces, performance attributes and inter-component connection information in the AADL model into the (Tianyi) embedded operating system platform code. This process is fully automated, which not only greatly reduces the workload of manual coding, but also avoids potential errors in the manual conversion process. This process first converts the AADL model into an intermediate platform-independent code, and then converts the intermediate platform-independent code into the specific implementation code of the (Tianyi) embedded operating system. Ultimately, the generated code can run directly on the (Tianyi) embedded operating system platform, ensuring that the system's functions and performance are fully in line with the original AADL model design.
[0035] Embodiment 1:
[0036] Figure 2 The code generation toolchain architecture diagram shown in the figure shows the high-level concept of the model-based automatic code generation method. The AADL model in the figure is a simple temperature control system built from different types of components. For the automatic code generation method, the most important component type is the thread component, such as Figure 3 As shown, it corresponds to the real-time task in the real-time system. The specific implementation steps are:
[0037] The first step is to traverse, obtain and parse the AADL model
[0038] Use modeling tools to perform AADL modeling on the system to be built, such as Figure 4 Use the parsing tool to scan the AADL model file, identify and extract the components, interfaces, performance attributes and connection information between components in the model, where components include processors, threads, processes, etc., interfaces include data ports, event ports, etc., performance attributes include latency, priority, etc., and connection information between components includes data flow, control flow, etc.
[0039] The extracted model information is stored in categories and analyzed according to functions, such as the execution semantics of processing components and the communication requirements of interfaces, to ensure comprehensive coverage of all key information in the AADL model and provide complete data support for subsequent mapping. The main algorithms are as follows:
[0040] S11. Create a traverser to traverse the entire AADL model, identify and extract components, interfaces, performance attributes and connection information between components in the model;
[0041]
[0042] Among them, transformComponent() is a method in Walker, which is used to transform various attributes of model information, including: Mutexes, Semaphores, Dataports, Provides, etc. The format of each attribute involves updating from the old format or state to the new unified format, while standardizing, cleaning and enhancing to ensure that the system can correctly process and use these resources.
[0043] S12, constructing a classifier mapping, classifying and storing the extracted model information, establishing a mapping relationship between the classifier name and the model information itself, and storing it in airClassifierMap;
[0044]
[0045] The above code snippet takes the data component as an example, traverses the data components in AADL, and establishes a mapping relationship between the classifier name of the data component and the component itself, and stores it in airClassifierMap.
[0046] S13. Parsing AADL Model
[0047] In the step of parsing the AADL model, the data component is parsed separately from other parts of the model. The main reason is to deal with different concerns and requirements. The data component parsing focuses on data definition and classification, while other parts such as components and connections focus on the processing of system structure and behavior. Separate parsing helps to simplify the processing of complex models and ensure the correctness and consistency of each part of the model.
[0048] The following code segment parses the data components in the AADL model. First, it processes the data type and passes in the parameters, initializes an empty mapping to store the mapping relationship from the classifier name of the AADL data component to the corresponding AadlType object. Then it loops through all the data components in the model, processes and updates the type mapping.
[0049]
[0050]
[0051] The following code snippet parses the rest of the AADL model. First, it resets all additional file visitors and then builds the symbol table. If there is an error, it returns the built symbol table; otherwise, it processes the additional libraries in the model, initializes and fills the additional sub-clause information map, and updates this information to the symbol table together with the additional library information, and finally returns the symbol table containing all processing results.
[0052]
[0053]
[0054] Step 2: Design the mapping rules from AADL model to (Tianyi) embedded operating system code
[0055] One of the key innovations of the present invention is the design of a set of mapping rules from AADL models to (Tianyi) embedded operating system code. These rules specify how to convert abstract concepts in AADL models into specific implementation codes, including mapping components to modules, mapping interfaces to communication interfaces, mapping performance attributes to configuration parameters, and mapping between components to data flows or control flows. The code generation tool chain focuses on AADL model components, especially port-based communication between thread components and threads.
[0056] 1. Mapping components to modules
[0057] Define the mapping rules for mapping components in the AADL model to specific modules in the (Tianyi) operating system, such as task management module, device driver module, etc. For each component, a code framework is generated for the application, and the developer uses the regular development environment to supplement the generated code framework with specific application logic to complete the component implementation.
[0058] 2. Mapping of interfaces to communication interfaces
[0059] Design rules for mapping interfaces in the AADL model to communication interfaces or device interfaces in the (Tianyi) operating system. For each port, generate an API for communicating through the port, and the application code accesses the automatically generated API to communicate with other components through the component's port. For each port connection, infrastructure code is generated for the communication path between the source port and the target port to move data / events between the output port of the sending component and the input port of the receiving component.
[0060] 3. Mapping of performance attributes to configuration parameters
[0061] The performance attributes are mapped to parameter settings in the system configuration file to ensure execution efficiency on the (Tianyi) operating system. For scheduling protocol attributes, the code generation toolchain customizes the structure of the thread's computation entry point according to the scheduling protocol thread attributes specified in the AADL model.
[0062] According to the transformation rules corresponding to different parts of the AADL model, some key transformation rules are shown in Table 1. In the AADL model, the software components (processes, threads, etc.) are mapped to the (Tianyi) embedded operating system, and the task creation and start are realized by calling the tyche_task_creat() or tyche_task_start() function; the input and output ports of events or data are mapped to the (Tianyi) embedded operating system, and the event reception and sending are realized by calling the tyche_event_receive(), tyche_event_send() or tyche_message_queue_receive(), tyche_message_queue_send() functions; the attributes periodic or sporadic are mapped to the (Tianyi) embedded operating system, and the periodic tasks are managed by calling tyche_timer_create(), and sporadic events are handled by using tyche_event_trigger().
[0063] Table 1 Key transformation rules
[0064]
[0065]
[0066] Step 3: Automatically convert to (Tianyi) embedded operating system platform code
[0067] Based on the mapping rules designed in the second step, the present invention realizes the automatic conversion of AADL model to (Tianyi) embedded operating system platform code. This process first converts the AADL model into intermediate platform-independent code, and then converts the intermediate code into the specific implementation code of the (Tianyi) operating system.
[0068] 1. Intermediate code generation
[0069] First, an algorithm is designed and implemented to convert the abstract concepts in the AADL model into platform-independent intermediate codes, which are platform-independent and can be adapted to different embedded operating systems. The algorithm mainly generates an application code framework for each AADL model thread component, and communicates between ports through automatically generated APIs.
[0070] In this algorithm, the process or thread in the AADL model is converted into an object form, using the process / thread_name{} structure to clearly represent its attributes and behaviors; the notification event or data in the AADL model is converted into an API call form, specifically api.get_port_name() and api.put_port_name(), to clearly represent the data acquisition and sending operations; the periodic elements in the AADL model are converted into a function definition form, specifically deftimedTriggered(:):Unit={}, to clearly represent its triggering mechanism and time behavior; the sporadic elements in the AADL model are converted into a function definition form, specifically defhandle_port_name(:):Unit={}, to clearly represent its handling mechanism and calling method. The specific conversion relationship is shown in Table 2:
[0071] Table 2 Conversion relationship table
[0072]
[0073] Taking the fan component of the temperature control system as an example, some intermediate code segments are shown below:
[0074]
[0075] 2. Platform code generation
[0076] Compile the basic structure of the intermediate code into the specific code of the (Tianyi) operating system, and generate the execution code that can be directly run on the (Tianyi) embedded operating system platform. The main function of this part of the compilation is to statically convert the intermediate code into the standard C code that conforms to the (Tianyi) embedded operating system, including:
[0077] (1) Parse the intermediate source code and map its language structure and features into C language while maintaining the logic and structure of the original program;
[0078] (2) Process the conversion of the intermediate source code language type to the C type to ensure the consistency and correctness of the conversion process;
[0079] (3) Convert the control flow structure of the intermediate source code (such as loops, conditional judgments, etc.) into the corresponding structure of the C language;
[0080] (4) The generated C code uses static memory allocation. Since the compilation of this part of the code is quite long, only the conversion of some modules is shown.
[0081] The following is the conversion of the dowhile statement. This process is to initialize the position, save the old statement and clear the statement list, translate the main statement of the do while loop in sequence, obtain the conditional expression, and finally combine the translated statement with the old statement to form the final do while structure. This process ensures that the original logic is retained and adapted to the grammatical requirements of the target language.
[0082]
[0083]
[0084] This step ensures that the code meets the architecture and performance requirements of the (Tianyi) operating system. Taking the fan component of the temperature control system as an example, the following shows some of the specific codes of the (Tianyi) operating system:
[0085]
[0086]
[0087] The final workflow diagram of the model-based automatic code generation method is as follows: Figure 5 shown.
[0088] Embodiment 2:
[0089] The present invention provides a method for generating codes related to an embedded operating system platform based on an AADL model, which mainly comprises the following steps:
[0090] (1) Formulate the mapping rules between AADL models and (Tianyi) embedded operating system platform-related codes;
[0091] (2) Obtain the AADL model, including components, interfaces, runtime performance properties, and connections between components;
[0092] (3) Parse the AADL model to extract components, interfaces, performance attributes, and inter-component connection information;
[0093] (4) Create an application programming interface to support model checking and automatic verification;
[0094] (5) Based on the mapping rules established in (1), the components, interfaces, performance attributes and connection information between components are mapped to the (Tianyi) embedded operating system platform to generate platform-related code.
[0095] The step of obtaining the AADL model includes capturing the architecture model from the AADL.
[0096] The mapping step includes mapping the components in the AADL model to corresponding modules in the (Tianyi) embedded operating system.
[0097] The mapping step includes mapping the interface in the AADL model to the communication interface in the (Tianyi) embedded operating system.
[0098] The mapping step includes mapping the performance attributes in the AADL model to the configuration parameters in the (Tianyi) embedded operating system.
[0099] The mapping step includes mapping the connections between components in the AADL model to the data flow or control flow in the (Tianyi) embedded operating system.
[0100] Technical advantages and effects:
[0101] The present invention proposes an automatic code generation technology based on the AADL model, which has the following main features:
[0102] (1) By automatically converting AADL models into platform-independent code and the final (Tianyi) embedded operating system platform code, this technology significantly reduces the workload of manual coding and instead relies on automated tools to generate high-quality code, shortening the development cycle.
[0103] (2) During the automatic code generation process, the execution semantics defined in the AADL model are strictly maintained to ensure that the generated code fully complies with the design requirements of the model in terms of behavior and to ensure the reliability and security of the code in critical systems, especially in applications involving safety and security-critical areas.
[0104] (3) By first mapping the AADL model to a platform-independent intermediate code, the technology supports multiple target platforms. This design allows the same model to be mapped to different operating systems or hardware platforms, enhancing the flexibility and portability of the system. When generating platform-specific code, the system can be optimized according to the characteristics of the target platform (such as the (Tianyi) embedded operating system) to ensure optimal performance on that platform.
[0105] (4) Due to the strict execution semantics and automatic verification function of this technology, the generated code is particularly suitable for applications in fields that require high reliability and safety, such as medical equipment, avionics mission systems, etc. These fields have very low tolerance for system errors, so reliable code generation technology is crucial.
[0106] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for generating code related to an embedded operating system platform based on an AADL model, characterized in that: The method comprises the following steps: The first step is to traverse and parse the AADL model Automatically traverse and obtain each component of the AADL model, including comprehensive scanning and extraction of the components, interfaces, runtime performance attributes, and inter-component connection relationships of the AADL model; through this traversal and acquisition, ensure that all key information can be correctly identified and extracted, and then conduct in-depth analysis and processing of this information; the parsing process includes identifying and classifying each component, interface, performance attribute, and inter-component connection information of the AADL model; Step 2: Design the mapping rules from AADL model to embedded operating system code Design a set of mapping rules from AADL models to embedded operating system code, including mapping components to modules, mapping interfaces to communication interfaces, mapping performance attributes to configuration parameters, and mapping between components to data flows or control flows. These rules define how to map the model to the corresponding modules in the embedded operating system, ensuring that the abstract concepts in the model can be accurately converted into specific implementation code. Step 3: Automatically convert to embedded operating system platform code Based on the above mapping rules, the components, interfaces, performance attributes and connection information between components in the AADL model are automatically converted into embedded operating system platform code. This process first converts the AADL model into an intermediate platform-independent code, and then converts the intermediate platform-independent code into the specific implementation code of the embedded operating system. Finally, the generated code can run directly on the embedded operating system platform.
2. The method for generating embedded operating system platform-related codes based on the AADL model according to claim 1, characterized in that: The first step specifically includes the following steps: S11. Create a traverser to traverse the entire AADL model, identify and extract components, interfaces, performance attributes and connection information between components in the model; S12, construct a classifier mapping, classify and store the extracted model information; establish a mapping relationship between the classifier name and the model information itself, and store it in airClassifierMap; S13. Parse the AADL model and parse the data component separately from other parts of the model. The data component analysis focuses on data definition and classification, while the other parts focus on the processing of system structure and behavior.
3. The method for generating embedded operating system platform-related codes based on the AADL model as claimed in claim 2, characterized in that: In S11, the transformComponent() method in Walker is used to transform various attributes of the model information, and the format of each attribute involves updating from an old format or state to a new unified format, while standardizing, cleaning and enhancing.
4. The method for generating embedded operating system platform-related codes based on the AADL model as claimed in claim 2, characterized in that: In S13, for the data component, firstly process the data type and pass in the parameters, initialize an empty mapping for storing the mapping relationship from the classifier name of the AADL data component to the corresponding AadlType object, and then loop through all the data components in the model to process and update the type mapping.
5. The method for generating embedded operating system platform-related codes based on the AADL model as claimed in claim 2, characterized in that: In S13, for other parts, first reset all additional file visitors, and then build a symbol table; if there is an error, return the built symbol table; otherwise, process the additional libraries in the model, initialize and fill the additional sub-clause information map, and update this information together with the additional library information into the symbol table, and finally return the symbol table containing all processing results.
6. The method for generating code related to an embedded operating system platform based on an AADL model according to any one of claims 1 to 5, characterized in that: In the second step, mapping components to modules includes: defining mapping rules for mapping components in the AADL model to specific modules in the operating system, generating a code framework for each component for the application, and developers using a conventional development environment to supplement the generated code framework with specific application logic to complete component implementation.
7. The method for generating embedded operating system platform-related codes based on the AADL model as claimed in claim 6, characterized in that: In the second step, mapping the interface to the communication interface includes: designing rules for mapping the interface in the AADL model to the communication interface or device interface in the operating system; for each port, generating an API for communicating through the port, and the application code accesses the automatically generated API to communicate with other components through the port of the component; for each port connection, infrastructure code is generated for the communication path between the source port and the target port to move data / events between the output port of the sending component and the input port of the receiving component.
8. The method for generating embedded operating system platform-related codes based on the AADL model as claimed in claim 7, characterized in that: In the second step, mapping performance attributes to configuration parameters includes: mapping performance attributes to parameter settings in the system configuration file to ensure execution efficiency on the operating system; for scheduling protocol attributes, customizing the structure of the thread's computation entry point according to the scheduling protocol thread attributes specified in the AADL model.
9. The method for generating embedded operating system platform-related codes based on the AADL model as claimed in claim 8, characterized in that: According to the transformation rules corresponding to different parts of the AADL model, the key transformation rules are defined as follows: in the AADL model, the software components are mapped to the embedded operating system, and the task creation and start are implemented by calling the tyche_task_creat() or tyche_task_start() function; the input and output ports of events or data are mapped to the embedded operating system, and the event reception and sending are implemented by calling the tyche_event_receive(), tyche_event_send() or tyche_message_queue_receive(), tyche_message_queue_send() functions; the attributes periodic or sporadic are mapped to the embedded operating system, and periodic tasks are managed by calling tyche_timer_create(), and sporadic events are handled by tyche_event_trigger().
10. The method for generating embedded operating system platform-related codes based on the AADL model according to claim 9, characterized in that: The third step specifically includes two parts: intermediate code generation and platform code generation; Intermediate code generation includes: First, an algorithm is designed and implemented to convert the abstract concepts in the AADL model into platform-independent intermediate codes. The codes are platform-independent. The algorithm generates an application code framework for each AADL model thread component, and the communication between ports is carried out through the automatically generated API. In this algorithm, the process or thread in the AADL model is converted into an object form, using the process / thread_name{} structure to clearly represent its properties and behaviors; the notification event or data in the AADL model is converted into an API call form, specifically api.get_port_name() and api.put_port_name(), to clearly represent the data acquisition and sending operations; the periodic elements in the AADL model are converted into a function definition form, specifically def timedTriggered(:):Unit={} to clearly indicate its triggering mechanism and time behavior; convert the accidental elements in the AADL model into function definition form, specifically def handle_port_name(:):Unit={}, to clearly indicate its processing mechanism and calling method; Platform code generation includes: statically converting the intermediate code into standard C code that complies with the embedded operating system, including: (1) Parse the intermediate source code and map its language structure and features into C language while maintaining the logic and structure of the original program; (2) Process the conversion of the intermediate source code language type to the C type to ensure the consistency and correctness of the conversion process; (3) Convert the control flow structure of the intermediate source code into the corresponding structure of C language; (4) The generated C code uses static memory allocation.
Citation Information
Patent Citations
AADL generation embedded system code method based on middle model
CN108563439A
method for automatically converting SysML model to AADL model for safety-critical embedded system
CN109522007A
AADL model refinement method and Ada executable code automatic generation method supported by AADL model refinement method
CN110597498A
Automatic generation method for security code of integrated avionics system facing horizon operating system
CN116048518A
Cited By
Template-based AADL platform irrelevant code generation method
CN120029615A
Embedded human-computer interface code generation method based on OpenGL
CN120029620A
PEG-based AADL code-to-graph multi-level conversion method
CN120029667A