ebook img

alma mater studiorum universit`a degli studi di bologna towards PDF

109 Pages·2012·1.5 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview alma mater studiorum universit`a degli studi di bologna towards

ALMA MATER STUDIORUM ` UNIVERSITA DEGLI STUDI DI BOLOGNA Seconda Facolta` di Ingegneria Corso di Laurea Magistrale in Ingegneria Informatica TOWARDS MODEL DRIVEN SOFTWARE DEVELOPMENT FOR ARDUINO PLATFORMS: A DSL AND AUTOMATIC CODE GENERATION Elaborata nel corso di: Ingegneria dei Sistemi Software LM Tesi di Laurea di: Relatore: MIRCO BORDONI Prof. ANTONIO NATALI Co-Relatore: Prof ALESSANDRO RICCI ANNO ACCADEMICO 2011-2012 SESSIONE I KEYWORDS Model Driven Software Development Arduino Meta-Modeling Domain Specific Languages Software Factory Contents Introduction ix 1 Introduction to Model Driven Software Development 1 1.1 Models and Meta-Models in Software Engineering . . . 2 1.2 Model Driven Development . . . . . . . . . . . . . . . 3 1.3 Model-Driven Architecture . . . . . . . . . . . . . . . . 6 1.4 From Standard to Domain Specific Modeling Language 8 1.5 Ecore and EMF . . . . . . . . . . . . . . . . . . . . . . 9 1.6 Domain Specific Languages . . . . . . . . . . . . . . . 11 1.7 XText and XTend2 Brief Introduction . . . . . . . . . 12 2 Embedded Systems 15 2.1 Main Features . . . . . . . . . . . . . . . . . . . . . . . 15 2.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.2.1 Software Tools . . . . . . . . . . . . . . . . . . 18 2.2.2 Programming Languages . . . . . . . . . . . . . 18 2.2.3 Embedded Software Architectures . . . . . . . . 21 2.2.4 Wiring . . . . . . . . . . . . . . . . . . . . . . . 22 3 Introduction to Arduino 23 3.1 Arduino Software Introduction . . . . . . . . . . . . . . 24 3.2 IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.3 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.4 Arduino Hardware Introduction . . . . . . . . . . . . . 28 4 Arduino DSL and Semantic Mapping 31 4.1 A First Domotic System . . . . . . . . . . . . . . . . . 32 4.2 Basic Arduino Meta-Model . . . . . . . . . . . . . . . . 36 v 4.3 DSL Syntactic Definition . . . . . . . . . . . . . . . . . 37 4.3.1 Structure . . . . . . . . . . . . . . . . . . . . . 38 4.3.2 Behaviour . . . . . . . . . . . . . . . . . . . . . 40 4.3.3 Interaction . . . . . . . . . . . . . . . . . . . . . 43 4.4 Semantic Mapping . . . . . . . . . . . . . . . . . . . . 44 4.4.1 Structure . . . . . . . . . . . . . . . . . . . . . 44 4.4.2 Behaviour . . . . . . . . . . . . . . . . . . . . . 50 4.5 Domotic Example Model . . . . . . . . . . . . . . . . . 52 5 Towards a System perspective 55 5.1 Provided Supports . . . . . . . . . . . . . . . . . . . . 57 5.2 Structure of the System . . . . . . . . . . . . . . . . . 57 5.3 Messages . . . . . . . . . . . . . . . . . . . . . . . . . . 58 5.4 High Level Operation . . . . . . . . . . . . . . . . . . . 59 5.5 Semantic Mapping of System Perspective Concepts . . 62 5.5.1 TCP Support . . . . . . . . . . . . . . . . . . . 62 5.5.2 Server . . . . . . . . . . . . . . . . . . . . . . . 63 5.5.3 Client . . . . . . . . . . . . . . . . . . . . . . . 65 5.6 UDP Support . . . . . . . . . . . . . . . . . . . . . . . 66 5.7 Serial Support . . . . . . . . . . . . . . . . . . . . . . . 66 5.8 Communication Params Mapping . . . . . . . . . . . . 67 5.9 Message Exchange . . . . . . . . . . . . . . . . . . . . 67 5.10 TCP Mapping . . . . . . . . . . . . . . . . . . . . . . . 69 5.11 Serial Mapping . . . . . . . . . . . . . . . . . . . . . . 71 5.12 Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 6 Code Generators Overview 73 6.1 Generators Access Point . . . . . . . . . . . . . . . . . 73 6.2 MainArduinoGenerator Behaviour . . . . . . . . . . . . 74 6.2.1 MainStructureGenerator . . . . . . . . . . . . . 75 6.2.2 BasicLibrariesGenerator . . . . . . . . . . . . . 76 6.2.3 HandlerGenerator . . . . . . . . . . . . . . . . . 76 6.2.4 TaskGenerator . . . . . . . . . . . . . . . . . . 76 6.2.5 CommunicationGenerator . . . . . . . . . . . . 77 6.3 Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 vi 7 A Case Study with Multiple Arduino Platforms 81 7.1 User Requirements . . . . . . . . . . . . . . . . . . . . 81 7.2 Brief Requirements Analysis . . . . . . . . . . . . . . . 83 7.3 Hardware Setup . . . . . . . . . . . . . . . . . . . . . . 84 7.4 Domotic1 Model . . . . . . . . . . . . . . . . . . . . . 86 7.5 Domotic2 Model . . . . . . . . . . . . . . . . . . . . . 92 8 Conclusions And Future Development 97 8.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . 97 8.2 Future Development . . . . . . . . . . . . . . . . . . . 98 vii viii Introduction The aim of this thesis is the production of a Meta-Model to character- ize the main concepts introduced by a particular family of Embedded Systems, named Arduino. The Meta-Model will be defined trying to capture all the concepts introduced by these kinds of Systems. The reference platform will be Arduino because it is a widely used platform to easily realize hardware systems. Arduino provides a successful combination of good quality, low complexity and low price. In fact, with an Arduino board and some sensors or actuators everyone can create its own embedded system. The production of a Meta-Model will lead to the implementation of a Software Factory to enhance fast prototyping and fast implemen- tation of Arduino systems, through automatic code generation. The Meta-Model will be expressed through an EBNF that formally defines a Domain Specific Language. The framework used to define the DSL is XText. Such DSL has then been mapped on the proper Arduino code through automatic code generation. This aims at providing a programming language to write models, instance of the defined meta- model, that will be mapped automatically on an Arduino program. The thesis goes in this direction because Meta-Modeling and DSLs areoneofthemaintrendsofSoftwareEngineeringofthelastfewyears and they are gradually changing the way a Software is conceived and produced, speeding up its development. Once a Meta-Model of an Embedded System is defined, the level of Abstraction has been raised trying to define some of the concepts that characterizeaSystemofdifferententities,regardlessfromtheirnature. All the newly introduced concepts will describe the System Structure and the Interaction with the other components of the System, seen ix from each entity viewpoint. The thesis is composed by eight chapters describing in order: what Model Driven Software Development means, an introduction on Em- bedded Systems, a brief description of Arduino, the defined Meta- Model for an Arduino platform, the definition of the Meta-Model re- lated to the System perspective, a brief overview of implemented code generators, a Use Case and conclusions. x

Description:
Univesal Serial Bus (USB). - Network: like Ethernet, XBee etc. - Multimedia Storage: like SD, Flash etc. - Fieldbuses: like CANBUS, PROFIBUS etc. - Discrete IO.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.