Me3D: A Model-driven Methodology                Model-          Expediting Embedded Device              Driver Development...
Device driver context    Considerable time & effort for the SW development in a    typical MPSoC project    o Device drive...
Outline      Device driver context      Device driver overview      Related work      Device driver generation environment...
Outlineo     Device driver context      Device driver overviewo     Related worko     Device driver generation environment...
Device driver interaction in low-level SW                             low-    Device driver: a low-level component in the ...
Device driver role    Implements an interface to the kernel for an underlying    device         Requires kernel services, ...
Device driver complexity    Device driver entry points                                               static inline uint32_...
Outlineo     Device driver contexto     Device driver overview      Related worko     Device driver generation environment...
Device driver synthesis methodologies            Tool for synthesizing                         Device driver synthesis    ...
Device driver generation methodology    Device driver generation based on the RTL test bench of    an IP (Polytechnic U. o...
Other related work    Device interface languages: offer some constructs to    describe device interface    o Laddie: gener...
Outlineo     Device driver contexto     Device driver overviewo     Related work      Device driver generation environment...
Device driver generation environmentSpecification of device driver generation     Objective: to help device driver develop...
Device driver generation environmentMethodology and inputs     Abstract view of the Me3D methodology                      ...
Device driver generation environmentInputs     Device features model     o Captures a sequence of       interactions with ...
Device driver generation environmentInputs (cont.)     Libraries     o HAL library: low-level       HW access primitives  ...
Device driver generation environmentDevice driver generation (step by step)     Step 1: Parsing & inline     functions gen...
Device driver generation environmentDevice driver generation (step by step)     Step 3: Driver source & Makefile     gener...
Outlineo     Device driver contexto     Device driver overviewo     Related worko     Device driver generation environment...
Evaluation    Evaluation points    1. Feasibility of describing device features & in-kernel I/F    2.                     ...
EvaluationCase study and inputs     Case study: MCI device driver for the ATMEL D940 MPSoC     o MCI device and its neighb...
EvaluationInputs     MCI device features model: in DFDL, which has some     constructs tailored for modeling device featur...
EvaluationConversion     Conversion step 1:            Conversion step 2:     Macros & inline functions     MCI device fea...
EvaluationConversion (cont.)     Conversion step 3.1: Synthesize EFSM & derive driver     functionalities     Conversion s...
EvaluationConversion results       Source lines of code, binary sizes of the native &       generated MCI drivers w/o and ...
Outlineo     Device driver contexto     Device driver overviewo     Related worko     Device driver generation environment...
Conclusion and future work    Conclusion    o Advanced device driver generation environment            Inputs: specificati...
Thank you         for your attention!        Me3D: A Model-driven Methodology Expediting                Model driven      ...
Upcoming SlideShare
Loading in …5
×

Me3D: A Model-driven Methodology Expediting Embedded Device Driver Development

877 views
823 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
877
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Me3D: A Model-driven Methodology Expediting Embedded Device Driver Development

  1. 1. Me3D: A Model-driven Methodology Model- Expediting Embedded Device Driver Development Hui Chen, Guillaume Godet-Bar, Frédéric Rousseau, Frédéric Pétrot TIMA Laboratory (CNRS – Grenoble INP – UJF) - France {FirstName.LastName}@imag.fr 22nd IEEE International Symposium on Rapid System Prototyping27/05/2011
  2. 2. Device driver context Considerable time & effort for the SW development in a typical MPSoC project o Device driver development: a serious bottleneck Interdisciplinary knowledge required Laborious to write • 19.6 person-years of effort in developing device drivers for the LH7A404 SoC Unreliable • 85% of unexpected Windows stops caused by device drivers A new methodology to address reliability for device driver generationTIMA Laboratory RSP 2011 2
  3. 3. Outline Device driver context Device driver overview Related work Device driver generation environment D i d i ti i t Evaluation Conclusion and future workTIMA Laboratory RSP 2011 3
  4. 4. Outlineo Device driver context Device driver overviewo Related worko Device driver generation environment D i d i ti i to Evaluationo Conclusion and future workTIMA Laboratory RSP 2011 4
  5. 5. Device driver interaction in low-level SW low- Device driver: a low-level component in the OS, which allows upper-level SW to interact with the device Device/hardware device: a specific HW resource for a dedicated task APPLICATION Interactions: APPLICATION PROGRMMING INTERFACE a) Kernel LIBRARIES b) b) User KERNEL DRIVER OS a) DRIVER DRIVER c) c) Libraries L d) d) HAL (Hardware HAL INTERFACE abstraction HARDWARE ABSTRACTION LAYER layer) I/F HARDWARETIMA Laboratory RSP 2011 5
  6. 6. Device driver role Implements an interface to the kernel for an underlying device Requires kernel services, and often also offers services to other kernel components Provides a l P id lower-level communication channel t th l l i ti h l to the device Acts as a translator from the kernel to the HW interfaceTIMA Laboratory RSP 2011 6
  7. 7. Device driver complexity Device driver entry points static inline uint32_t registerA_bitfieldX_rd() {return_type entry_a_name(…) { return <read primitive> (IO_BASE  … 1 4 + REGISTER_A_OFFSET) & REGISTER A OFFSET) & <kernel memory allocation> BIT_FIELD_X_MASK;} 5 … 2 access_hardware(…); access_hardware(…); void access_hardware(…) { 6 … registerB_bitfieldY_wr($VAL); i B bi fi ldY ($VAL)} … $VAL2 = registerA_bitfieldX_rd();return_type entry_b_name(…) { } 3 … strcpy(…); 7 1 Kernel‐driver interface 5 Platform‐related … 2 Kernel service 6 Device‐related <create MMC card> … 3 De ice feat res Device‐features 7 C library related C library‐related 8} 4 HAL‐related 8 Device class‐related Various and interrelated sources of information Device driver generation is intrinsically complexTIMA Laboratory RSP 2011 7
  8. 8. Outlineo Device driver contexto Device driver overview Related worko Device driver generation environment D i d i ti i to Evaluationo Conclusion and future workTIMA Laboratory RSP 2011 8
  9. 9. Device driver synthesis methodologies Tool for synthesizing Device driver synthesis embedded device drivers with Termite (NICTA / (Princeton U ) U.) U. U of New South Wales) cation Core Device vice Gen specificationspecific Dev Virtual .c Core functions (.c) Device-class environment Termite specification Device uration Target Mapper environment OS driver iver ( (library etc.) y ) specificationconfigu Dri .c Device driver TIMA Laboratory RSP 2011 9
  10. 10. Device driver generation methodology Device driver generation based on the RTL test bench of an IP (Polytechnic U. of Turin & U. of Verona) Device Test bench cardinality (RTL) CPU model Device driver .c generation I/O memory Device specification driversTIMA Laboratory RSP 2011 10
  11. 11. Other related work Device interface languages: offer some constructs to describe device interface o Laddie: generates register access functions o NDL: a new way to write the device drivers, but not for legacy ones Hardware specification languages: able to describe some parts of electronic components & designs o UML MARTE: widely used o IP-XACT: IEEE standard describes … IP XACT: standard, structural information about HW devices & designs some contents, e.g., a register mapTIMA Laboratory RSP 2011 11
  12. 12. Outlineo Device driver contexto Device driver overviewo Related work Device driver generation environment D i d i ti i to Evaluationo Conclusion and future workTIMA Laboratory RSP 2011 12
  13. 13. Device driver generation environmentSpecification of device driver generation Objective: to help device driver development p Inputs o Hardware specifications o Device features model o In-kernel interface specification o Libraries o Driver configuration parameters Output: device driver in C Validation by execution TIMA Laboratory RSP 2011 13
  14. 14. Device driver generation environmentMethodology and inputs Abstract view of the Me3D methodology Hardware Device Features In-Kernel Interface Specifications Model Specification Driver Configuration Device Driver Generation Libraries Parameters P t Is used by Validation Device driver Produces HW specifications (e.g., in IP-XACT, UML MARTE) o D i specification(s) Device ifi i ( ) o Platform specification Processor (e.g., byte ordering) ( g, y g) Device instantiations, I/O offsets, … TIMA Laboratory RSP 2011 14
  15. 15. Device driver generation environmentInputs Device features model o Captures a sequence of interactions with the HW o A set of predefined device features: init, read, etc. In-kernel interface specification p o Contains mainly kernel data structures (if any) to be used, software events, & transitions o S f Software events: messages f from/to the kernel / h k l o Transitions: define the drivers desired reactions to requests TIMA Laboratory RSP 2011 15
  16. 16. Device driver generation environmentInputs (cont.) Libraries o HAL library: low-level HW access primitives o Basic library: an Basic Library StrCpy = (Newlib) “strcpy” + “…” abstract layer for usual y Lib X Lib X data manipulation Lib Y StrCpy = (uClibc) “strcpy” + “…” methods Lib Z StrCpy = “dna_strcpy” + “…” Driver configuration parameters o D i driver development: d i i Device d i d l t decision-making processes ki o High-level configuration parameters: to efficiently & effectively explore the device driver design space TIMA Laboratory RSP 2011 16
  17. 17. Device driver generation environmentDevice driver generation (step by step) Step 1: Parsing & inline functions generation Step 2: Device features generation TIMA Laboratory RSP 2011 17
  18. 18. Device driver generation environmentDevice driver generation (step by step) Step 3: Driver source & Makefile generation TIMA Laboratory RSP 2011 18
  19. 19. Outlineo Device driver contexto Device driver overviewo Related worko Device driver generation environment D i d i ti i t Evaluationo Conclusion and future workTIMA Laboratory RSP 2011 19
  20. 20. Evaluation Evaluation points 1. Feasibility of describing device features & in-kernel I/F 2. Hardware Device Features In-Kernel Interface Specifications Model Specification Driver Configuration Parameters ? Device Driver Generation Libraries Device driver o To evaluate point 1: specified HW devices & platform in IP-XACT, in-kernel interfaces with in-house IISL, device features with DFDL o To evaluate point 2: manual conversion according to the proposed methodologyTIMA Laboratory RSP 2011 20
  21. 21. EvaluationCase study and inputs Case study: MCI device driver for the ATMEL D940 MPSoC o MCI device and its neighborhood: Hardware specifications o Device specifications for MCI PMC & PIO MCI, PMC, o Platform specification: only necessary parts modeled TIMA Laboratory RSP 2011 21
  22. 22. EvaluationInputs MCI device features model: in DFDL, which has some constructs tailored for modeling device features In-kernel interface specification: with our in-house language IISL o In-kernel interfaces for the MCI driver In kernel Driver configuration parameters: synchronization mechanism, … TIMA Laboratory RSP 2011 22
  23. 23. EvaluationConversion Conversion step 1: Conversion step 2: Macros & inline functions MCI device features generation generation TIMA Laboratory RSP 2011 23
  24. 24. EvaluationConversion (cont.) Conversion step 3.1: Synthesize EFSM & derive driver functionalities Conversion step 3 2 G C i t 3.2: Generate M k fil t Makefile TIMA Laboratory RSP 2011 24
  25. 25. EvaluationConversion results Source lines of code, binary sizes of the native & generated MCI drivers w/o and w/ Me3D Efforts for MCI driver development w/o and w/ Me3D Person‐days P d Device features model 30 3200 In‐kernel interface specification 3000 20 Platform specification 2800 10 2600 Device specifications 2400 0 2200 w/o Me3D w/ Me3D SLOC TIMA Laboratory RSP 2011 25
  26. 26. Outlineo Device driver contexto Device driver overviewo Related worko Device driver generation environment D i d i ti i to Evaluation Conclusion and future workTIMA Laboratory RSP 2011 26
  27. 27. Conclusion and future work Conclusion o Advanced device driver generation environment Inputs: specifications/model (hardware, device features, in- kernel interface), libraries, & driver configuration parameters Output: C file of the device driver Validation by execution Future work o Evaluate the methodology on several OSes o Introduce an intermediate format for driver generation & validation ld o Develop a tool for fully automatic device driver generation o Verify device drivers by symbolic execution (in cooperation with NICTA)TIMA Laboratory RSP 2011 27
  28. 28. Thank you for your attention! Me3D: A Model-driven Methodology Expediting Model driven Embedded Device Driver Development Hui Ch H i Chen, G ill Guillaume Godet-Bar, F édé i R G d B Frédéric Rousseau, F édé i Pé Frédéric Pétrot TIMA Laboratory (CNRS – Grenoble INP – UJF) - France 22nd IEEE International Symposium on Rapid System Prototyping27/05/2011

×