CN108563439A - A kind of AADL generation Embedded System Code methods based on mid-module - Google Patents

A kind of AADL generation Embedded System Code methods based on mid-module Download PDF

Info

Publication number
CN108563439A
CN108563439A CN201810392370.2A CN201810392370A CN108563439A CN 108563439 A CN108563439 A CN 108563439A CN 201810392370 A CN201810392370 A CN 201810392370A CN 108563439 A CN108563439 A CN 108563439A
Authority
CN
China
Prior art keywords
aadl
mid
module
code
mmacg
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810392370.2A
Other languages
Chinese (zh)
Inventor
沈国华
葛晓瑜
章文炳
宛伟健
邓刘梦
黄志球
杜天保
吴德香
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Aeronautics and Astronautics
Original Assignee
Nanjing University of Aeronautics and Astronautics
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Aeronautics and Astronautics filed Critical Nanjing University of Aeronautics and Astronautics
Priority to CN201810392370.2A priority Critical patent/CN108563439A/en
Publication of CN108563439A publication Critical patent/CN108563439A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

This method is related to a kind of Embedded System Code automatic generation method, and in particular to a kind of AADL generation Embedded System Code methods based on mid-module;Include the following steps:Step 1:Using a kind of code building mid-module MMACG of Xtext technical definitions, the design of mid-module include the element structure of stratification define and single component in class method code element definition;Step 2:Mid-module stratification component carries out corresponding with AADL structures, i.e., corresponding AADL components go to mid-module MMACG components;Class method code element is expressed for the element in program in single component, and mid-module also retains the attribute information of AADL components;Step 3:For the different characteristic of embedded single task and multitask system, realize that mid-module MMACG generations meet the C code of POS IX standards according to the rule write using Xtend technologies.

Description

A kind of AADL generation Embedded System Code methods based on mid-module
Technical field
This method is related to a kind of Embedded System Code automatic generation method, and in particular to a kind of based on mid-module AADL generates Embedded System Code method.
Background technology
Embedded system was a kind of computer system designed to meet specific area demand, from 50 years last century Generation, which rises, to be applied in field of aerospace to applying at present in all trades and professions.Embedded System Design development ability also becomes one The measurement standard of the industrialization of the country, information-based ability.Traditional embedded system development mode is in order in design phase raising system Safety reliability, generally require to write a large amount of technical design document, be evaluated by expertise, recycle test The method of use-case tests the system of completion, modifies again to system if there is safety issue.It is this traditional embedding Occur among embedded system development approach and growing embedded software scale and security of system reliability Contradiction.Especially in safety-critical field, thrashing will bring massive losses, therefore be designed into realization each from system Step will consider safety problem, even if paying larger time, human cost.And Mode-driven architecture (Model- Driven Development, abbreviation MDD) as it is a kind of by model carry out system early-time analysis and verification method, by The extensive concern of R&D Professional.
In Embedded System Modeling field, AADL predecessor MetaH is real by being under the jurisdiction of the Honeywell technologies of U.S. Department of Defense A kind of architecture description language that room was proposed in 1991 is tested, the system of the systems such as aviation electronics, flight control is used primarily for Structure describes and analysis.In academia and industrial quarters on the basis of years of researches on MetaH are with application, 2001, the U.S. Automobile engineering association proposes a new aviation electronics architecture description language standard, i.e. Avionics based on MetaH Architecture Description Language.2004, SAE combined CMU (Carnegie Mellon again University), Honeywell has issued AADL1.0 versions jointly, is officially named Architecture Analysis& Design Language.Also do not stopping to update up to now when AADL standards, the AADL of latest edition is publication in 2017 AADLv2.3.Safety-Critical System is a kind of System, and AADL can be fine by three kinds of offer software architecture, runtime environment and hardware architecture modeling concepts Ground adapts to complex embedded system modeling.Wherein software architecture can be collectively referred to as system of systems knot with hardware architecture Structure, which depict static structure of the system in terms of software and hardware.AADL utilizes component distribution, synchronous/asynchronous communication, tune Degree, mode conversion etc. model concept to describe dynamic behaviour and the runtime environment of system.In AADL standards, thread, son Program component, which is minimum execution and scheduling unit, the outside function interface of the two, to be described in AADL, but in it The specific process performing in portion can not obtain in the AADL of standard.Therefore AADL Behavior Annex, i.e. behavior attachment, are carried Go out so that the concrete behavior of thread and subprogram component is described in detail.
In embedded system field, there is a variety of operation platforms and programming language, and there is also some to be directed to AADL at present The tool of code building has ocarina, Stood etc..But there is several disadvantages for these platforms:These tools are mostly foreign countries Product, Some tools can collect high expense, and the code that Open-Source Tools generate cannot be satisfied the life of most domestic system code At requirement;Since code building work has the characteristics of certain specificity, purpose, i.e., presently, there are a variety of embedded systems Platform uses different types of programming language, or even there is a variety of embedded system platforms in the same unit, therefore difficult Can directly generate or provide simultaneously a kind of fast and convenient secondary developing platform there are one unified platform and can produce A variety of embedded codes;Presently, there are code building platform there is no a kind of mechanism can facilitate secondary development, lead to some Code Generator is i.e. enabled to meet for 90% the needs of, but because secondary development can not be carried out, and can not use.Therefore it develops A kind of Embedded System Code generation method based on mid-module is that have problem to be solved always.
Invention content
The purpose of the present invention is to provide a kind of, and the AADL based on mid-module generates Embedded System Code method.
To achieve the above object, the present invention provides the following technical solutions:A kind of AADL generation insertions based on mid-module Formula system code method, includes the following steps:
Step 1:Using a kind of code building mid-module MMACG of Xtext technical definitions, the design of mid-module includes The element structure of stratification define and single component in class method code element definition;
Step 2:Mid-module stratification component carries out corresponding with AADL structures, i.e., corresponding AADL components go to intermediate die Type MMACG components;Class method code element is expressed for the element in program in single component, and mid-module is also protected Stay the attribute information of AADL components;AADL is write using java language and goes to the crossover tool of mid-module, and provides conversion rule Then, the tool that AADL generates mid-module traverses the component information and AADL of AADL using the tool of the AADL in Osate Behavior attachment, behavior model go to MMACG models, convert the automatic machine for including in behavior attachment to the class in MMACG models Program code elements;
Step 3:For the different characteristic of embedded single task and multitask system, using Xtend technologies according to writing Rule realize that mid-module MMACG generates the C code for meeting POSIX standard
Preferably, the AADL behaviors attachment is further refining to AADL models, it is detailed description AADL components The model of internal act.
Preferably, the attribute information for retaining AADL components refers to mainly being stored in using key-value forms In the properties attributes of MMACG components.
Preferably, mid-module will also retain the attribute information of AADL components
Preferably, MMACG models include " System ", " Process ", " Thread " and " Subprogram " component.
Compared with prior art, beneficial effects of the present invention are as follows:A mid-module is defined using Xtext.It is intermediate Model includes mainly two parts:Component with hierarchical structure and the class hierarchy element included in component.Intermediate die Component in type can carry out corresponding with AADL components, i.e., corresponding AADL components are gone to the component of mid-module MMACG.
AADL to mid-module MMACG has been formulated to transformation rule, AADL has been write using Java language and has gone to intermediate die The crossover tool of type, and give detailed transformation rule.The tool that AADL generates mid-module is mainly utilized in Osate AADL traverse relevant tool-class, traverse the component information and behavior attachment of AADL.AADL behavior attachmentes are to AADL moulds Type is further refined, and is the model that AADL component inside behaviors are described in detail.
It has formulated mid-module MMACG and has generated object code rule, according to the rule write, realized using Xtend intermediate Model M MACG generates the C code for meeting POSIX standard.Since mid-module belongs to Platform Independent Model, and C code is usually Platform is relevant.Although must also write a code conversion rule, mid-module life again for different target system code It is relatively easy at system code, and Xtend is suitble to write transformation rule again.During MMACG generates system and executes code, Corresponding platform relevant information will be added.Using MMACG as the middle transition model of AADL to system code, can reduce The difficulty of AADL code buildings.
Description of the drawings
Fig. 1 defines for MMACG hierarchical structures of the present invention.
Fig. 2 is the hierarchical structure of mid-module of the present invention.
Fig. 3 is the grammer of expression formula part of the present invention, mainly gives assignment statement part grammar.
Fig. 4 is the grammer of conditional expression of the present invention and operation expression.
Fig. 5 is thread member transform rule.
Fig. 6 is process transformation rule.
Fig. 7 is types of variables transformation rule.
Fig. 8 is port operator transformation rule.
Fig. 9 is mid-module member transform rule.
Figure 10 is port operation function transformation rule.
Figure 11 is device port transformation rule process schematic.
Figure 12 is single system code structure schematic diagram.
Figure 13 is that single system mid-module generates code conversion rule.
Figure 14 is single system port operation transformation rule.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
A kind of AADL generation Embedded System Code methods based on mid-module, include the following steps:
Step 1:Using a kind of code building mid-module MMACG of Xtext technical definitions, the design of mid-module includes The element structure of stratification define and single component in class method code element definition;
Step 2:Mid-module stratification component carries out corresponding with AADL structures, i.e., corresponding AADL components go to intermediate die Type MMACG components;Class method code element is expressed for the element in program in single component, and mid-module is also protected Stay the attribute information of AADL components;AADL is write using java language and goes to the crossover tool of mid-module, and provides conversion rule Then, the tool that AADL generates mid-module traverses the component information and AADL of AADL using the tool of the AADL in Osate Behavior attachment, behavior model go to MMACG models, convert the automatic machine for including in behavior attachment to the class in MMACG models Program code elements;
Step 3:For the different characteristic of embedded single task and multitask system, using Xtend technologies according to writing Rule realize that mid-module MMACG generates the C code for meeting POSIX standard
The AADL behaviors attachment is further refining to AADL models, is detailed description AADL component inside behaviors Model.
The attribute information for retaining AADL components refers to mainly being stored in MMACG components using key-value forms In properties attributes.
Mid-module will also retain the attribute information of AADL components.
MMACG models include " System ", " Process ", " Thread " and " Subprogram " component.
Mid-module MMACG grammers
The grammer of mid-module is defined using Xtext.Fig. 1 has gone out the definition of MMACG hierarchical structures.In proposed by the present invention Between model, there is the hierarchical structure of similar AADL.There is both sides advantage in such structure, turn AADL first, facilitating To mid-module, because there is hierarchical relationships between each components of AADL, can be corresponded with mid-module;Second is that protecting After staying hierarchy information, the autgmentability that kinds of platform code is generated by model is also just remained.
Mid-module can be divided into two parts, and first part is the component for having stratification.Mid-module have with Under several components:System、Process、Thread、Subprogram.Although AADL can be to the software and hardware of embedded system Component part is modeled, but the code ultimately generated is to belong to software section.Therefore mid-module only expresses software portion Point component, there is no the component for expressing hardware components, to hardware access can all by code to the access of interface come Expression.When mid-module generates code, because by software code sentence has been wholly converted into the access of system hardware, The complexity for generating multi-platform code can also be reduced in this way.Meanwhile the System components in mid-module can include another A System, because in reality system, what complicated system was often made of multiple subsystems, even in subsystem still It can continue to be divided into multiple sub- subsystems.But a Process component cannot include then another Process component, this It is by resource that in general computer system, although a process is divided into parent process subprocess, but is possessed between process Often independent, therefore in mid-module, Process components are not present inclusion relation, Thread components, Subprogram components are also to be designed with that in mind.Each component must also be gathered around also there are one title, When mid-module generates code for producing code file name, function name etc..The structure of mid-module is as shown in Figure 2.
Another part of mid-module is then used for modeling program statement.In AADL, all kinds of components are such as System, Process, Thread etc. are the architecture modelings to real system.In order to be built to single component behavior Mould can then use the behavior attachment (AADL Behavior Annex) of AADL to be modeled.The jump of behavior attachment adoption status It moves to be modeled to the behavior of system, a transition guarded by original state, the condition of transition, dbjective state, behavior act These elements form.This condition transition used by behavior attachment is an abstract expression to system mode, although It is very concise, but general procedure language is procedure-oriented or object-oriented, and the program word towards state is not present Speech, thus can not directly subordinate act attachment translate program code.Therefore representation program sentence is added in mid-module Model, the model can easily generate various program codes.The part mid-module mainly has:Indicate various program statements 's:if_cmd、while_cmd、for_cmd、 switch_Cmd、do_cmd、break_cmd、continue_cmd、return_ cmd、 expression_stmt.These orders correspond to respectively If sentences in general procedure language, While Do statements, For Do statements, Switch case statements, DoWhile Do statements, variable assignments sentence, Break sentences, Continue languages Sentence, return statement, expression statement.These models represent the basic sentence that nearly all program design language calls the turn.
Fig. 3 gives the grammer about expression formula part, mainly gives assignment statement part grammar, condition judgment sentence Concrete syntax will be given later.Assignment statement, condition judgment sentence in general programming language belong to the part.Asignment statement Sentence is main by the way of " lvalue=expression formula ", while supporting ' * ' and ' & ', and reference reconciliation can be expressed in mid-module Reference also supports array access, structure member variable to access, accesses three kinds of forms by pointer, can be to most of language Assignment statement expressed.For assignment operator, other than offer "=" number, additionally provide from increase (+=), subtract certainly (- =), from except (/=), from remainder (%=), move to left certainly (<<=), move to right certainly (>>=), from and (&=), from exclusive or (^=), From or (|=) symbol.
Fig. 4 gives the grammer of conditional expression and operation expression.Control of the mid-module in addition to program can be expressed Logic, moreover it is possible to express arithmetical operation and logical expression.This is because in the behavior attachment of AADL, defends and contain in formula condition Simple arithmetical operation and logical expression, and acting after the completion of transition between states also contain the arithmetic fortune to AADL variables It calculates.
AADL models go to MMACG models
Due to by whole AADL elements all go to MMACG model workloads it is excessive and be not necessarily to, the present invention choose The component of a system, process component, thread component, subprogram component, data members, six big component of element of installation are as generation intermediate die The target member of type.AADL models will be told about successively go to the transformation rule of MMACG models below.
AADL only states two systems realization, but three system structures are but generated in corresponding mid-module Part.This is because in AADL, " title can be used in subcomponents:This mode of element type element type title " Sub- component is declared, indicates the example for generating corresponding types as sub- component, therefore is also required to generate in corresponding mid-module corresponding Element.
In AADL, properties is used for expressing the functionality and nonfunctional space of component.Consider for autgmentability, The form of key-value is utilized to preserve the attribute and attribute value of component herein.The Dispatch_Protocol of thread with Period attributes execute that model is also closely related, and being remained in subsequent conversion part will use with it, but no matter the category Whether property can be used to, and will all be switched to key-value forms is saved in mid-module, this allows for mid-module The attribute value of component will be used when can generate certain analysis models.
It is many aspects such as the distribution for being related to component, communication that AADL, which executes model, for describing runtime environment.Such as Thread can periodically be distributed, also can by the arrival of data and time, the behaviors such as calling of subprogram and be scheduled, concrete behavior It is described by the behavior attachment of thread.Thread is divided into the period by the specified distribution attribute of Dispatch_Protocol attributes (Periodic), aperiodic (Aperiodic) and accidental (Sporadic) etc..Herein, mainly realize process, thread, Three highest member transforms of frequency of use of subprogram are to mid-module.
Since the statement of data components is in the packet action scope of AADL, programs of the declarative statement in the component of a system In element, rather than in subprogram.For an empty Data component, acquiescence is stated in the form of struct.Scheming In 8, it can be noted that three subprogram are generated altogether, because subprogram cannot be by as an independent running unit It is scheduled, although stating the different subprogram of two titles of mul1 and mul2, state a function, while It needs to generate mid-module subprogram to sub- function declaration, facilitates later programmed language generation function declaration.
Thread component in AADL can model concurrently executing for task, and most common is exactly in operating system Thread.Thread in an operating system, generally creates API by system thread and is created, need to transmit function (or Function pointer) as thread execution code.Fig. 5 gives a process and realizes that component and a thread realize component, thread Realize the sub- component that component is realized as process.Meanwhile also with " identifier in process realizes component:Thread thread components The form of type " states two threads.As shown in figure 5, a thread realizes that component will generate one of mid-module Subprogram components, if with " identifier:The sub- component of thread of thread threads element type " form statement, then second The sub- component of thread will not regenerate specific programs sentences, but generate " parent " attribute, show first in fact The copy of the sub- component of thread shares identical code.
Thread can periodically be assigned, and can also be assigned by the behaviors such as calling of the arrival of data and time, subprogram, specifically Behavior is described by the behavior attachment of thread.Thread assigns attribute by the way that Dispatch_Protocol attributes are specified, is divided into week Phase (Periodic), aperiodic (Aperiodic) and accidental (Sporadic) etc..The conversion rule of this few class thread are presented below Then.
The thread order of the type will terminate after having executed one time, if defining Action_Entrypoint, table Show the subprogram executed when thread initializes, then starting to generate corresponding calling inside thread programs The sentence of subprogram, when generating, it is also noted that conversion of the full name of component to function name.Finalize_ Entrypoint indicates the subprogram executed when thread terminates, as Active_Entrypoint create-rules, only It is but ending of the generated statement position inside programs.If not defining the two attributes, phase need not be generated The code answered.The create-rule of the two attributes is also the same rule in other kinds of thread, is not listed.
The assignment of accidental thread is triggered by port.In accidental thread, period values must be stated, and it represents two Minimum interval between secondary successfully assignment.Therefore when executing calculation code every time, time counter has to be larger than Time specified period, after the completion of execution, time counter is reset.It is also to be noted that if stating Compute_ Entrypoint, then before being calculated every time, it is necessary to the subprogram for calling Compute_Entrypoint specified.
Periodical thread refers to fixing the thread of code of one section of period execution.Using modulus operator, work as the time After counter passes through a cycle, it will be cleared, reach periodic purpose.In the AADL statements of periodical thread, Also period must be stated.In being usually embedded formula system, the required period is all the multiple that CPU executes the period, otherwise will Think that AADL modellings are wrong.
Timed thread is executed after Period attribute specified times, therefore in the beginning clock synchronization of programs Between counter judged, if having exceeded the Period specified times is exited after having executed code using break, Otherwise it will sink into endless loop.
Fig. 6 gives process transformation rule.In AADL, process can also state subroutine call, create-rule with The rule of call subroutine is consistent in subprogram.Process is as the unit that can be called in model is executed, although regardless of the period Property, the types such as sporadic, but can be realized by stating that a thread be used as its sub- component.Generally speaking, process is converted Rule is fairly simple, all introduction in front.
Due in AADL, component and the attribute included in component only describe frame and the portion of whole system Adhering to separately property, can not describe concrete behavior and the change procedure of component, therefore introduce behavior attachment for describing the component of a system Concrete behavior.Behavior attachment describes the behavior of component by the form of automatic machine, mainly have variables, states, Transtions three parts form.
In behavior attachment, the variable defined by variables sentences will give birth on the heads programs of counterpart member At variable declarations.Specific types of variables create-rule is shown in Fig. 7.
The present invention realizes automatic machine using while cycle cooperations switch:An integer variable state, table are stated first Show the state being presently in, state transition is realized by changing the value of state;It states each state variable, coordinates switch languages Sentence selects the code block performed by current state.
In behavior attachment, time expired, data arrival etc. can triggering state migration.It is expired for the time, due to In mid-module, in terms of the time, being judged the time by the way that time counter is arranged.Although there are one for this method Fixed limitation is not suitable for the embedded system very strict to time requirement, such as guided missile system, but is suitble to most of embedding The time precision requirement of embedded system.If judged from a certain moment a, be judged as through b after a period of time it is expired, then From moment a, setting time counter be 0, calculate pass through time interval b, time counter will increased value c, if the time After counter is more than c, then it is assumed that expired events have occurred.
In addition to time-out meeting triggering state migration, it is also the migration of triggering port that port, which receives data,.Simultaneously in behavior attachment Action can also be defined toward operations such as port transmission datas.These are referred to as port operator for the functional symbol of port. Fig. 8 gives these port operator to the transformation rule of mid-module, and wherein first row is port operator in behavior attachment In expression way, secondary series is the meaning of these operators, and third row are representation method of the operator in mid-module.
When port, in_port has data, state machine moves to sf from state st, and data are taken out from in_port It is assigned to variable tmp.
MMACG models go to object code
At present in built-in field, embedded system is generally divided into single task system and multitask system.Single task system Be generally implemented on one chip microcomputer, using one piece be integrated with central processing unit, memory, counter, it is various input it is defeated The IC chip of outgoing interface.The high-level programming language that some microcontrollers also support some built-in at present, such as BASIC, C language Speech etc..There is no operating systems for this kind of embedded system, can only execute single-threading program.With the development of the times, this single Business embedded system can not meet the industry-specific demand in portion.In the 1990s, there is real-time multi-task operating system (Real-Time Operation System, abbreviation RTOS), and it is increasingly becoming mainstream.Again due to commercial real-time embedded System price is expensive, some civilian industries have developed the embedded system using Linux as kernel successively in order to reduce cost System.Such as the Android operation system of Google companies exploitation is a kind of embedded Linux system.Due in embedded neck It in domain, both has use value, at present still in being widely used, therefore the present invention has carried out mid-module going to this respectively In two kinds of systems.Both transformation rules will be described respectively below:
A. transformation rule of the mid-module to multitask system
Mid-module remains AADL hierarchical informations, and in code level, it needs through file, file, function definition Etc. embodying this hierarchical information.Some programmings with package definition are needed, it is also necessary to generate packet name, such as Ada language. In Fig. 9, mainly give mid-module to operation C language multi-task embedded operation system transformation rule.
Connection elements in mid-module do not participate in directly converting with property elements, because Connection and property elements as retain AADL elements between relationship and attribute, can participate in code building this During a, but there is no direct objects to indicate property and connection elements in code.
Mid-module programs is the expression to program statement, and grammer is also very close to program statement.It is right The conversion of programs is broadly divided into following several transformation rules:Declarative statement conversion, command statement conversion, expression formula conversion.
Port operation semanteme is indicated by the form of call function.In being usually embedded formula system, the end between process Mouth, which connects, belongs to interprocess communication scope, and communication belongs to thread communication scope between thread between the difference in only same process. It is realized in the form of message queue and is communicated between port herein, reason is that communicating the queue included between port is very suitable for using The form of message queue is realized.
Since in AADL, there are two types of forms altogether for port variable, and one is single variables, and another kind is using port The form of queue.For single variable, the transformation rule for generating code is that PRIO is preferential when message queue sends, receives Grade, is generally set to 0.Since section ports operation is to be directed to queue, such as next_value, get_count, therefore monotropic It does not support to use these operators in amount port.Message queue function mq_send and mq_receive will return to size_t, It indicates the number of characters for being successfully transmitted or receiving, after calling the two functions every time, should check immediately returning to number, If failure, acquiescence uses and prints error message, and logs off.
Mid-module is provided by the way of function instead of the expression way for port operation in behavior attachment, Figure 10 Transformation rules of these port operation functions to multitask system code.Port is to connect software component and hardware component, Express the meaning of software and hardware communication.In systems in practice, simple software and hardware communication is read by hardware interface, interface is arranged For low level either high level or read, the voltage levels of setting analog port are completed, the communication of complicated software and hardware then needs It to be driven by driver, driver also tends to provide programming interface to complete the driving of equipment.
Due to the complexity that hardware device accesses, AADL difficult to use is modeled, therefore also needs to manually refine. Before conversion, it is necessary to find the corresponding equipment in port, entire generating process such as Figure 11 by connecting definition in mid-module It is shown.
B. transformation rule of the mid-module to single task system
Single task system can regard as only there are one thread loops execute system.Such system is often built-in advanced The SCM system of language.There is no operating systems concept, the code structures such as process to be often divided into initialization in single task system And loop code, as shown in figure 12.
For single task system, AADL is generally modeled using single thread.It, can but in certain embedded systems It is cooperated using polylith micro-chip processor, is communicated using Hard link line between each SCM system jointly, each monolithic It can not be communicated by being similar to method as message queue between machine.In such a system, it is still desirable to using more A system is modeled, and such modeling pattern will be closely similar with multisystem modeling pattern, but its generation method is not The same.In addition, engineer can get used to multithreading to be modeled, be conducive in this way to being directed to such system In model level clearly dividing system structure, but the design of more thread and real system and do not meet.It is asked for this Topic, this paper presents a kind of conversion thinkings:Mid-module retains the Schema information that original AADL contains, and is given birth to when for single task system When at code, then change the original semantemes of thread, transformation rule is as shown in Figure 13.
Because in single task system, interprocess communication is not present, therefore port communication between all processes is all used The mode of I/O input and output is realized.All port are defined as shaping in the present invention, represent stitch number.Port operation turns It changes regular as shown in figure 14.
It although an embodiment of the present invention has been shown and described, for the ordinary skill in the art, can be with Understanding without departing from the principles and spirit of the present invention can carry out these embodiments a variety of variations, modification, replace And modification, the scope of the present invention is defined by the appended.

Claims (5)

1. a kind of AADL based on mid-module generates Embedded System Code method, include the following steps:
Step 1:Using a kind of code building mid-module MMACG of Xtext technical definitions, the design of mid-module includes level The element structure of change define and single component in class method code element definition;
Step 2:Mid-module stratification component carries out corresponding with AADL structures, i.e., corresponding AADL components go to mid-module MMACG components;Class method code element is expressed for the element in program in single component, and mid-module also retains The attribute information of AADL components;AADL is write using java language and goes to the crossover tool of mid-module, and provides transformation rule, AADL generates the tool of mid-module using the tool of the AADL in Osate, traverses component information and the AADL behaviors of AADL Attachment, behavior model go to MMACG models, convert the automatic machine for including in behavior attachment to the class method in MMACG models Code element;
Step 3:For the different characteristic of embedded single task and multitask system, using Xtend technologies according to the rule write Realize that mid-module MMACG generates the C code for meeting POSIX standard.
2. the AADL according to claim 1 based on mid-module generates Embedded System Code method, it is characterised in that: The AADL behaviors attachment is further refining to AADL models, is the model that AADL component inside behaviors are described in detail.
3. the AADL according to claim 1 based on mid-module generates Embedded System Code method, it is characterised in that: The attribute information for retaining AADL components refers to mainly being stored in MMACG components using key-value forms In properties attributes.
4. the AADL according to claim 1 based on mid-module generates Embedded System Code method, it is characterised in that: Mid-module will also retain the attribute information of AADL components.
5. the AADL according to claim 1 based on mid-module generates Embedded System Code method, it is characterised in that: MMACG models include " System ", " Process ", " Thread " and " Subprogram " component.
CN201810392370.2A 2018-04-27 2018-04-27 A kind of AADL generation Embedded System Code methods based on mid-module Pending CN108563439A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810392370.2A CN108563439A (en) 2018-04-27 2018-04-27 A kind of AADL generation Embedded System Code methods based on mid-module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810392370.2A CN108563439A (en) 2018-04-27 2018-04-27 A kind of AADL generation Embedded System Code methods based on mid-module

Publications (1)

Publication Number Publication Date
CN108563439A true CN108563439A (en) 2018-09-21

Family

ID=63537075

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810392370.2A Pending CN108563439A (en) 2018-04-27 2018-04-27 A kind of AADL generation Embedded System Code methods based on mid-module

Country Status (1)

Country Link
CN (1) CN108563439A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110308932A (en) * 2019-06-03 2019-10-08 南京航空航天大学 A kind of reverse reconstructing method of AADL behaviour model based on source code
CN110597498A (en) * 2019-03-04 2019-12-20 南京航空航天大学 AADL model refinement method and Ada executable code automatic generation method supported by same
CN111510483A (en) * 2020-04-09 2020-08-07 眸芯科技(上海)有限公司 Configuration synchronization system between different network domains in chip test and application
CN113791776A (en) * 2021-08-03 2021-12-14 中国电子科技集团公司第三十研究所 Method, system, device and storage medium for verifying concurrency capable of bidirectional conversion

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520925A (en) * 2011-11-18 2012-06-27 北京航空航天大学 AADL2TASM (Architecture Analysis and Design Language-to-Timed Abstract State Machine) model transformation method
CN103049602A (en) * 2012-12-13 2013-04-17 南京大学 Method for transforming AADL (Architecture Analysis and Design Language) component to interface automata model based on model driven engineering
US20140019943A1 (en) * 2012-07-10 2014-01-16 Honeywell International Inc. Systems and methods for verifying expression folding
CN103793458A (en) * 2013-11-01 2014-05-14 西北工业大学 Method for nondestructively converting AADL (architecture analysis and design language) into XML (extensible markup language)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520925A (en) * 2011-11-18 2012-06-27 北京航空航天大学 AADL2TASM (Architecture Analysis and Design Language-to-Timed Abstract State Machine) model transformation method
US20140019943A1 (en) * 2012-07-10 2014-01-16 Honeywell International Inc. Systems and methods for verifying expression folding
CN103049602A (en) * 2012-12-13 2013-04-17 南京大学 Method for transforming AADL (Architecture Analysis and Design Language) component to interface automata model based on model driven engineering
CN103793458A (en) * 2013-11-01 2014-05-14 西北工业大学 Method for nondestructively converting AADL (architecture analysis and design language) into XML (extensible markup language)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110597498A (en) * 2019-03-04 2019-12-20 南京航空航天大学 AADL model refinement method and Ada executable code automatic generation method supported by same
CN110308932A (en) * 2019-06-03 2019-10-08 南京航空航天大学 A kind of reverse reconstructing method of AADL behaviour model based on source code
CN110308932B (en) * 2019-06-03 2021-06-15 南京航空航天大学 AADL (architecture analysis and design language) functional behavior model reverse reconstruction method based on source code
CN111510483A (en) * 2020-04-09 2020-08-07 眸芯科技(上海)有限公司 Configuration synchronization system between different network domains in chip test and application
CN113791776A (en) * 2021-08-03 2021-12-14 中国电子科技集团公司第三十研究所 Method, system, device and storage medium for verifying concurrency capable of bidirectional conversion

Similar Documents

Publication Publication Date Title
US10019339B2 (en) Sequentially constructive model of computation
Liu et al. PERTS: A prototyping environment for real-time systems
CN108563439A (en) A kind of AADL generation Embedded System Code methods based on mid-module
Traulsen et al. A SystemC/TLM semantics in Promela and its possible applications
Pasaje et al. MAST real-time view: A graphic UML tool for modeling object-oriented real-time systems
Foughali et al. Formal verification of complex robotic systems on resource-constrained platforms
CN102722601B (en) Implementation method of formal semantic integration framework for model transformation of numerical control system
Raju et al. A prototyping environment for specifying, executing and checking communicating real‐time state machines
Vyatkin et al. Modeling of IEC 61499 function blocks–a clue to their verification
Brandt et al. Embedding polychrony into synchrony
Hähnle et al. HATS abstract behavioral specification: The architectural view
Scheler et al. The Real‐Time Systems Compiler: migrating event‐triggered systems to time‐triggered systems
Dietrich et al. Back to the roots: implementing the RTOS as a specialized state machine
Lu et al. A UML profile to model safety-critical embedded real-time control systems
Lindlar et al. A code generation tool for embedded automotive systems based on finite state machines
da Fontoura et al. Timing assurance of avionic reconfiguration schemes using formal analysis
Hagge et al. Applying the handler-based execution model to IEC 61499 basic and composite function blocks
Mader et al. Data Consistency Testing in Automotive Multi-Core Applications-towards systematic requirement elicitation
Hsiung et al. Vertaf: an object-oriented application framework for embedded real-time systems
Dotti et al. Verifying object-based graph grammars: An assume-guarantee approach
Peiler Priority-based compilation of SCCharts
Mkaouar A formal approach for real-time systems engineering
Fort Programing adaptive real-time systems
Qiu et al. Research on Real-Time Software Development Approach.
Dietrich Interaction-aware analysis and optimization of real-time application and operating system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180921