SlideShare a Scribd company logo
1 of 4
Download to read offline
Software Development Automation with Scripting Languages                                 http://dev.emcelettronica.com/print/51795




                        Your Electronics Open Source
          (http://dev.emcelettronica.com)
          Home > Blog > allankliu's blog > Content




          Software Development Automation with
          Scripting Languages
          By allankliu
          Created 03/06/2008 - 02:46

          BLOG Microcontrollers

          The Scripting languages are deployed in many operative systems,
          either in UNIX/Linux or Windows. These languages are developed for
          general purpose process automation and web programming. But you
          can consider using them for the software development process in
          many ways. Among these languages, awk and Perl are suitable for
          automate and speed up software development for embedded
          systems, because many embedded systems only have cross tool
          chain, without powerful IDE supports for process automation. Here I
          will show you why we need them and how these tools help us.

          As a software developer, you might be involved in many trivial daily development processes, such
          as processing all source code in C files, head files, makefiles, map file, batch file and linker error
          message and all many other files in proprietary formats. Perl is similar to C, sed, shell and awk,
          and it is good at manipulating text, which is the major reason to be one of the most popular
          language in web programming. This feature makes it the good choice for text processing in your
          project.

          Perl vs. awk

          Perl is much powerful than awk with many extension modules via CPAN, an online Perl module
          inventory. But Perl is bigger than awk as well. If you only need a handy tool to complete a simple
          source file, which is demonstrated in following sample application, awk is very convenient. If you
          are planning to use the scripts to automate a big project, Perl is a better choice with more
          features.

          Benefits

          Today, more and more ICs are system ICs. That fact means every single device has hundreds or
          thousands of registers. When you, as a software developer, cut and paste all the register
          definitions from the datasheet to the source files, you will definitely find the whole process trivial,
          and it might generate many errors and takes more time to convert them into head files. Perl can
          help you to simplify this process by exporting the register tables in the PDF file to a text file, and
          then converting it into head files or other formats.

          Source Code Generator

          Assembly is very common in embedded system software. The head files for assembly and C
          source files should have same register definition in different syntax. You can use a script to
          convert definition from #define in C files/head files to equivalent assembly definition files.



1 din 4                                                                                                         03.06.2008 21:00
Software Development Automation with Scripting Languages                                 http://dev.emcelettronica.com/print/51795


          Format Conversion

          A lot of embedded system tool chain has proprietary file formats. It is possible to convert them into
          other formats with a script.

          Statistics for Project management

          It is very important and useful to have an insight of a project by displaying the statistic chart of the
          source code. These figures include line of code, comment, ROM footprint (parsed by map file)
          and other data. These files can be converted into a text database as project history.

          Port Binary Data into Project

          It is possible to convert binary application data into source code with a script. For example,
          convert a GIF file format into a C source file as embedded image data. It also works for
          embedded fonts.

          Project Porting

          To port a project to a new platform will generate a lot of errors in the beginning, because the new
          target systems might miss a lot of functions. As a result, the linker will report thousands of errors.
          It takes time to add all functions to remove the errors. With a Perl script, you can locate these
          missing functions from the linker errors, and then search the prototypes for these functions and
          add dummy function bodies for them. It is very quick to solve these linker errors. But you must
          complete the functions with real bodies by yourself.

          Project Configuration

          Since makefiles are text files as well, scripts can be used to configurate the project by updating
          rules of makefiles.If different software components are configured by these makefiles, the whole
          project can be re-configured and rebuild by this ways. The system architect should organize the
          project configuration very carefully, because the script is powerful and dangerous. It will bring
          hidden risk if the system is maintained by a not well organized script.

          Testing Automation

          Perl has many modules available on CPAN, including WIN32::SerialPort module and useful
          TCP/IP modules. A testing engineer can use this feature to test the remote system via RS232 or
          TCP/IP connection automatically and generate the test report report. And Perl can run command
          via exec() function. So even you are not using serial port, if you can access the remote device with
          Linux device file, Windows DLL or executable in command prompt which connects to your target
          hardware, you can call it in Perl. This is quite useful in testing automation, production automation.
          But it requires more knowledge in PC programming.

          Document Automation

          Perl supports Doxygen, it is very easy to generate project report with Perl script in HTML, XML
          and even Windows Word (not for all versions). You will not feel headache to synchronize the
          content of your report with your source code. The document generation could be integrated into
          your makefile as well.

          Sample Application

          This code is a part of real project from Philips Semiconductors. The register definition is written in
          C source file, but the makefile will call an awk to parse the C source, generate head files to be
          included in the C source file, and update the dependency rules in makefile. A make file can rebuild
          whole project.
          hwic.c




2 din 4                                                                                                         03.06.2008 21:00
Software Development Automation with Scripting Languages                         http://dev.emcelettronica.com/print/51795




          /*
          #I2C_MAP_BEGIN     --- begin definition of I2C-MAP
          Write registers:
          REG_CON1             0x04    0         0         0    0          ST3        ST2         ST1    ST0
          REG_CON2             0x05    0         0         0    0          SP3        SP2         SP1    SP0
          REG_CON3             0x06    SAP    ST         0     SMU   LMU          0           0           0
          #I2C_MAP_END     --- end definition of I2C-map
          */
          i2cmap.awk



          BEGIN 
          {
              open_map_file = 0
              print quot;/* Translated by AWK-script */nquot;
          }



          function print_define(string, value)
          {
              if (string != quot;0quot;)
              {
                  print quot;#define BIT_quot; string quot;tquot; value
                  print quot;#define BYTE_quot; string quot;tquot; $1
              }
          }

          #==================================
          #    Keyword #I2C_MAP_BEGIN detected
          #    Open map file
          #==================================
          #
          toupper($1) == quot;#I2C_MAP_BEGINquot; 
          {
              open_map_file = 1
          }

          #==================================
          #    Keyword #I2C_MAP_END detected
          #    Close map file
          #==================================
          toupper($1) == quot;#I2C_MAP_ENDquot; 
          {
              open_map_file = 0
          }

          #==================================
          #     Register definition detected
          #     Print register defintions
          #==================================
          (index($1,quot;REG_quot;) == 1) && (NF == 10) 
          {
              if (open_map_file == 1)
              {
                   print quot;#define quot; $1 quot;tquot; $2
                   print_define($10,quot;0x01quot;)
                   print_define($9, quot;0x02quot;)
                   print_define($8,quot;0x04quot;)
                   print_define($7,quot;0x08quot;)
                   print_define($6,quot;0x10quot;)
                   print_define($5,quot;0x20quot;)
                   print_define($4,quot;0x40quot;)
                   print_define($3,quot;0x80quot;)
                   print quot;nquot;
              }
          }

          END      
          {
                print quot;/* End translated by AWK-script */quot;
          }




3 din 4                                                                                                 03.06.2008 21:00
Software Development Automation with Scripting Languages                                http://dev.emcelettronica.com/print/51795


          makefile

          # Using awk script to generate *.h file

          %foreach X in $(MAP_INCLUDES)
          $(X): i2cmap.awk gawk.exe $[f,,$(X),c]
              %echo Generating $(X) ...
              -$(.PATH.exe)gawk -f$(.PATH.awk)i2cmap.awk $(.PATH.c)$[f,,$(X),c] > $(.PATH.h)$(X)
              -touch -f$(.PATH.c)$[f,,$(X),c] $(.PATH.h)$(X)
          %endfor

          ......

          HWIC.OBJ: HWIC.H hwic.c




          Installation

          You don't have to install these utility if you are working on UNIX/Linux. You can install Cygwin on
          Windows PC. You must enable gmake, Perl and gawk during installation.




                                                           Trademarks



          Source URL: http://dev.emcelettronica.com/software-development-automation-scripting-languages




4 din 4                                                                                                        03.06.2008 21:00

More Related Content

What's hot

Multilingual Improvements for Drupal 8
Multilingual Improvements for Drupal 8Multilingual Improvements for Drupal 8
Multilingual Improvements for Drupal 8
Acquia
 
Wenger sf xin-barton
Wenger sf xin-bartonWenger sf xin-barton
Wenger sf xin-barton
ENUG
 
Advanced driver debugging (13005399) copy
Advanced driver debugging (13005399)   copyAdvanced driver debugging (13005399)   copy
Advanced driver debugging (13005399) copy
Burlacu Sergiu
 
Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0
Quang Ngoc
 

What's hot (13)

PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
 
Php Documentor The Beauty And The Beast
Php Documentor The Beauty And The BeastPhp Documentor The Beauty And The Beast
Php Documentor The Beauty And The Beast
 
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp sessionA whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
Multilingual Improvements for Drupal 8
Multilingual Improvements for Drupal 8Multilingual Improvements for Drupal 8
Multilingual Improvements for Drupal 8
 
upload test 1
upload test 1upload test 1
upload test 1
 
Wenger sf xin-barton
Wenger sf xin-bartonWenger sf xin-barton
Wenger sf xin-barton
 
Advanced driver debugging (13005399) copy
Advanced driver debugging (13005399)   copyAdvanced driver debugging (13005399)   copy
Advanced driver debugging (13005399) copy
 
Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)
 
Everything multilingual in Drupal 8
Everything multilingual in Drupal 8Everything multilingual in Drupal 8
Everything multilingual in Drupal 8
 
C
CC
C
 
Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0
 

Viewers also liked

Multimedia Presentation
Multimedia PresentationMultimedia Presentation
Multimedia Presentation
Rajesh R. Nair
 
MOTION CAPTURE TECHNOLOGY
MOTION CAPTURE TECHNOLOGYMOTION CAPTURE TECHNOLOGY
MOTION CAPTURE TECHNOLOGY
Shaik Tanveer
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technology
Anvesh Ranga
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technology
Anvesh Ranga
 

Viewers also liked (17)

Sjb Presentation
Sjb PresentationSjb Presentation
Sjb Presentation
 
7 Exciting Uses of 3D Animation Today
7 Exciting Uses of 3D Animation Today7 Exciting Uses of 3D Animation Today
7 Exciting Uses of 3D Animation Today
 
Automatic 3D facial expression recognition
Automatic 3D facial expression recognitionAutomatic 3D facial expression recognition
Automatic 3D facial expression recognition
 
CODE Interactive
CODE InteractiveCODE Interactive
CODE Interactive
 
What's Animation and its uses?
What's Animation and its uses?What's Animation and its uses?
What's Animation and its uses?
 
Motion Capture Technology
Motion Capture TechnologyMotion Capture Technology
Motion Capture Technology
 
Introduction to motion capture
Introduction to motion captureIntroduction to motion capture
Introduction to motion capture
 
Multimedia Presentation
Multimedia PresentationMultimedia Presentation
Multimedia Presentation
 
MOTION CAPTURE TECHNOLOGY
MOTION CAPTURE TECHNOLOGYMOTION CAPTURE TECHNOLOGY
MOTION CAPTURE TECHNOLOGY
 
Motion Capture
Motion CaptureMotion Capture
Motion Capture
 
Introduction to 3D Animation
Introduction to 3D AnimationIntroduction to 3D Animation
Introduction to 3D Animation
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technology
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technology
 
3d internet
3d internet3d internet
3d internet
 
3d internet
3d internet3d internet
3d internet
 
3D Animation
3D Animation3D Animation
3D Animation
 
ANIMATION PPT
ANIMATION PPTANIMATION PPT
ANIMATION PPT
 

Similar to Software Development Automation With Scripting Languages

Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
LiquidHub
 
OpenERP Technical Memento V0.7.3
OpenERP Technical Memento V0.7.3OpenERP Technical Memento V0.7.3
OpenERP Technical Memento V0.7.3
Borni DHIFI
 
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program DevelopmenKostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Konstantin Sorokin
 
Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02
Wei Sun
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
Esha Yadav
 

Similar to Software Development Automation With Scripting Languages (20)

TestUpload
TestUploadTestUpload
TestUpload
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
 
(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language
 
C Language
C LanguageC Language
C Language
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)
 
Srgoc dotnet_new
Srgoc dotnet_newSrgoc dotnet_new
Srgoc dotnet_new
 
Caerusone
CaerusoneCaerusone
Caerusone
 
OpenERP Technical Memento V0.7.3
OpenERP Technical Memento V0.7.3OpenERP Technical Memento V0.7.3
OpenERP Technical Memento V0.7.3
 
Makefile
MakefileMakefile
Makefile
 
Easy native wrappers with SWIG
Easy native wrappers with SWIGEasy native wrappers with SWIG
Easy native wrappers with SWIG
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible research
 
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program DevelopmenKostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
 
Visual studio
Visual studioVisual studio
Visual studio
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API Documentation
 
Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perl
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
 

More from Ionela

openPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetopenPicus Proto Nest Datasheet
openPicus Proto Nest Datasheet
Ionela
 
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Windows phone 7 è l’ultima occasione di microsoft   2010-10-18Windows phone 7 è l’ultima occasione di microsoft   2010-10-18
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Ionela
 
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Ionela
 
Utente premium 2010-10-17
Utente premium   2010-10-17Utente premium   2010-10-17
Utente premium 2010-10-17
Ionela
 
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Unity sostituisce gnome su ubuntu 11.04   2010-11-01Unity sostituisce gnome su ubuntu 11.04   2010-11-01
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Ionela
 
Una retina artificiale per ridare la vista 2010-11-10
Una retina artificiale per ridare la vista   2010-11-10Una retina artificiale per ridare la vista   2010-11-10
Una retina artificiale per ridare la vista 2010-11-10
Ionela
 
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Ionela
 
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ionela
 
Ubuntu passa a wayland 2010-11-08
Ubuntu passa a wayland   2010-11-08Ubuntu passa a wayland   2010-11-08
Ubuntu passa a wayland 2010-11-08
Ionela
 
Touchatag un'applicazione di internet delle cose 2010-11-10
Touchatag  un'applicazione di internet delle cose   2010-11-10Touchatag  un'applicazione di internet delle cose   2010-11-10
Touchatag un'applicazione di internet delle cose 2010-11-10
Ionela
 
Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05
Ionela
 
Thread o processo quale usare - 2010-11-02
Thread o processo  quale usare  - 2010-11-02Thread o processo  quale usare  - 2010-11-02
Thread o processo quale usare - 2010-11-02
Ionela
 
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Ionela
 
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Ionela
 
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Ionela
 

More from Ionela (20)

IoT with OpenPicus Flyport
IoT with OpenPicus FlyportIoT with OpenPicus Flyport
IoT with OpenPicus Flyport
 
Flyport wifi webserver configuration page
Flyport wifi webserver configuration pageFlyport wifi webserver configuration page
Flyport wifi webserver configuration page
 
openPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetopenPicus Proto Nest Datasheet
openPicus Proto Nest Datasheet
 
How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with
 
Openpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud servicesOpenpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud services
 
Flyport openPicus datasheet
Flyport openPicus datasheetFlyport openPicus datasheet
Flyport openPicus datasheet
 
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Windows phone 7 è l’ultima occasione di microsoft   2010-10-18Windows phone 7 è l’ultima occasione di microsoft   2010-10-18
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
 
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
 
Utente premium 2010-10-17
Utente premium   2010-10-17Utente premium   2010-10-17
Utente premium 2010-10-17
 
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Unity sostituisce gnome su ubuntu 11.04   2010-11-01Unity sostituisce gnome su ubuntu 11.04   2010-11-01
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
 
Una retina artificiale per ridare la vista 2010-11-10
Una retina artificiale per ridare la vista   2010-11-10Una retina artificiale per ridare la vista   2010-11-10
Una retina artificiale per ridare la vista 2010-11-10
 
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
 
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
 
Ubuntu passa a wayland 2010-11-08
Ubuntu passa a wayland   2010-11-08Ubuntu passa a wayland   2010-11-08
Ubuntu passa a wayland 2010-11-08
 
Touchatag un'applicazione di internet delle cose 2010-11-10
Touchatag  un'applicazione di internet delle cose   2010-11-10Touchatag  un'applicazione di internet delle cose   2010-11-10
Touchatag un'applicazione di internet delle cose 2010-11-10
 
Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05
 
Thread o processo quale usare - 2010-11-02
Thread o processo  quale usare  - 2010-11-02Thread o processo  quale usare  - 2010-11-02
Thread o processo quale usare - 2010-11-02
 
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
 
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
 
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

Software Development Automation With Scripting Languages

  • 1. Software Development Automation with Scripting Languages http://dev.emcelettronica.com/print/51795 Your Electronics Open Source (http://dev.emcelettronica.com) Home > Blog > allankliu's blog > Content Software Development Automation with Scripting Languages By allankliu Created 03/06/2008 - 02:46 BLOG Microcontrollers The Scripting languages are deployed in many operative systems, either in UNIX/Linux or Windows. These languages are developed for general purpose process automation and web programming. But you can consider using them for the software development process in many ways. Among these languages, awk and Perl are suitable for automate and speed up software development for embedded systems, because many embedded systems only have cross tool chain, without powerful IDE supports for process automation. Here I will show you why we need them and how these tools help us. As a software developer, you might be involved in many trivial daily development processes, such as processing all source code in C files, head files, makefiles, map file, batch file and linker error message and all many other files in proprietary formats. Perl is similar to C, sed, shell and awk, and it is good at manipulating text, which is the major reason to be one of the most popular language in web programming. This feature makes it the good choice for text processing in your project. Perl vs. awk Perl is much powerful than awk with many extension modules via CPAN, an online Perl module inventory. But Perl is bigger than awk as well. If you only need a handy tool to complete a simple source file, which is demonstrated in following sample application, awk is very convenient. If you are planning to use the scripts to automate a big project, Perl is a better choice with more features. Benefits Today, more and more ICs are system ICs. That fact means every single device has hundreds or thousands of registers. When you, as a software developer, cut and paste all the register definitions from the datasheet to the source files, you will definitely find the whole process trivial, and it might generate many errors and takes more time to convert them into head files. Perl can help you to simplify this process by exporting the register tables in the PDF file to a text file, and then converting it into head files or other formats. Source Code Generator Assembly is very common in embedded system software. The head files for assembly and C source files should have same register definition in different syntax. You can use a script to convert definition from #define in C files/head files to equivalent assembly definition files. 1 din 4 03.06.2008 21:00
  • 2. Software Development Automation with Scripting Languages http://dev.emcelettronica.com/print/51795 Format Conversion A lot of embedded system tool chain has proprietary file formats. It is possible to convert them into other formats with a script. Statistics for Project management It is very important and useful to have an insight of a project by displaying the statistic chart of the source code. These figures include line of code, comment, ROM footprint (parsed by map file) and other data. These files can be converted into a text database as project history. Port Binary Data into Project It is possible to convert binary application data into source code with a script. For example, convert a GIF file format into a C source file as embedded image data. It also works for embedded fonts. Project Porting To port a project to a new platform will generate a lot of errors in the beginning, because the new target systems might miss a lot of functions. As a result, the linker will report thousands of errors. It takes time to add all functions to remove the errors. With a Perl script, you can locate these missing functions from the linker errors, and then search the prototypes for these functions and add dummy function bodies for them. It is very quick to solve these linker errors. But you must complete the functions with real bodies by yourself. Project Configuration Since makefiles are text files as well, scripts can be used to configurate the project by updating rules of makefiles.If different software components are configured by these makefiles, the whole project can be re-configured and rebuild by this ways. The system architect should organize the project configuration very carefully, because the script is powerful and dangerous. It will bring hidden risk if the system is maintained by a not well organized script. Testing Automation Perl has many modules available on CPAN, including WIN32::SerialPort module and useful TCP/IP modules. A testing engineer can use this feature to test the remote system via RS232 or TCP/IP connection automatically and generate the test report report. And Perl can run command via exec() function. So even you are not using serial port, if you can access the remote device with Linux device file, Windows DLL or executable in command prompt which connects to your target hardware, you can call it in Perl. This is quite useful in testing automation, production automation. But it requires more knowledge in PC programming. Document Automation Perl supports Doxygen, it is very easy to generate project report with Perl script in HTML, XML and even Windows Word (not for all versions). You will not feel headache to synchronize the content of your report with your source code. The document generation could be integrated into your makefile as well. Sample Application This code is a part of real project from Philips Semiconductors. The register definition is written in C source file, but the makefile will call an awk to parse the C source, generate head files to be included in the C source file, and update the dependency rules in makefile. A make file can rebuild whole project. hwic.c 2 din 4 03.06.2008 21:00
  • 3. Software Development Automation with Scripting Languages http://dev.emcelettronica.com/print/51795 /* #I2C_MAP_BEGIN --- begin definition of I2C-MAP Write registers: REG_CON1 0x04 0 0 0 0 ST3 ST2 ST1 ST0 REG_CON2 0x05 0 0 0 0 SP3 SP2 SP1 SP0 REG_CON3 0x06 SAP ST 0 SMU LMU 0 0 0 #I2C_MAP_END --- end definition of I2C-map */ i2cmap.awk BEGIN { open_map_file = 0 print quot;/* Translated by AWK-script */nquot; } function print_define(string, value) { if (string != quot;0quot;) { print quot;#define BIT_quot; string quot;tquot; value print quot;#define BYTE_quot; string quot;tquot; $1 } } #================================== # Keyword #I2C_MAP_BEGIN detected # Open map file #================================== # toupper($1) == quot;#I2C_MAP_BEGINquot; { open_map_file = 1 } #================================== # Keyword #I2C_MAP_END detected # Close map file #================================== toupper($1) == quot;#I2C_MAP_ENDquot; { open_map_file = 0 } #================================== # Register definition detected # Print register defintions #================================== (index($1,quot;REG_quot;) == 1) && (NF == 10) { if (open_map_file == 1) { print quot;#define quot; $1 quot;tquot; $2 print_define($10,quot;0x01quot;) print_define($9, quot;0x02quot;) print_define($8,quot;0x04quot;) print_define($7,quot;0x08quot;) print_define($6,quot;0x10quot;) print_define($5,quot;0x20quot;) print_define($4,quot;0x40quot;) print_define($3,quot;0x80quot;) print quot;nquot; } } END { print quot;/* End translated by AWK-script */quot; } 3 din 4 03.06.2008 21:00
  • 4. Software Development Automation with Scripting Languages http://dev.emcelettronica.com/print/51795 makefile # Using awk script to generate *.h file %foreach X in $(MAP_INCLUDES) $(X): i2cmap.awk gawk.exe $[f,,$(X),c] %echo Generating $(X) ... -$(.PATH.exe)gawk -f$(.PATH.awk)i2cmap.awk $(.PATH.c)$[f,,$(X),c] > $(.PATH.h)$(X) -touch -f$(.PATH.c)$[f,,$(X),c] $(.PATH.h)$(X) %endfor ...... HWIC.OBJ: HWIC.H hwic.c Installation You don't have to install these utility if you are working on UNIX/Linux. You can install Cygwin on Windows PC. You must enable gmake, Perl and gawk during installation. Trademarks Source URL: http://dev.emcelettronica.com/software-development-automation-scripting-languages 4 din 4 03.06.2008 21:00