23
Embedded Systems Development Selecting a language for a real-time embedded system

Embedded Systems Development Selecting a language for a real-time embedded system

  • View
    220

  • Download
    3

Embed Size (px)

Citation preview

Embedded Systems Development

Selecting a language for a real-time embedded system

Embedded Systems

• In order to select a language for real-time embedded system we need to ask two questions– What languages are available?– What do we want from these languages?

Embedded Systems

• There are four criteria that we can adopt for language selection– Essential features– Primary features– Secondary features– Perfomance

Embedded Systems

• Essential features– Assembley language MC interface– Absolute addressing– Access/control of H/W– Bit manipulation– Interrupt handling– Pointers– Specification for time delays– Processor extensions

Embedded Systems

• The primary features are:– Well defined language standard– Well defined behaviour– Strong data typing/ Rigorous control structures– Modular structure - seperate compilation – Exception handling– Tasking facilities– RTOS/RTEX interfaces– Maths library well defined

Embedded Systems

• The secondary features are:– Good syntax and layout– Multitasking - language and rt support– Interfaces to other HLLs– Safety critical subset/features– Comprehensive libraries– Object Orientated programming constructs

Embedded Systems

• The performance features are:– Setting task deadlines– Evaluation of code execution times– Deterministic code– Selection of scheduling strategies– Timing analysis mechanism

Embedded SystemsAda

• Modularity• separate compilation• tasking• exception handling• reliable• readable• portable

• large language• complex• weak tasking model• no safety critical • no OOP (Ada95)

Embedded SystemsC

• highly efficient• easy to learn• powerful• widely available• lots of tools/GUIs

• difficult to read• portability problems• no OOP interface• undefined behaviour• weak type checking

Embedded SystemsC++

• builds on C• Object orientated• good type checking• portable• HLL interfaces

• difficult to read• memory leakage• library incompatibility

Embedded SystemsModula2

• Modular construction• Systems programming• Concurrency• interrupt handling• portable

• not widely used• few compilers• no OOP

Embedded SystemsOberon/Oberon2

• Modular• Concurrency• interrupt handling• Systems programming• OOP Support

• not widely used• no standard• limited OOP model

Embedded Systems

• Assembly language and MC interface– Ada - standard library package or pragma– C - embedded with asm or function call– C++ - similar to C– Modula2 - no defined standard facilties– Oberon-2 - highly systems dependant

Embedded Systems

• Absolute addressing– Ada - type ADDRESS in SYSTEM package– C - uses pointers– C++ - as with C or library interfaces– Modula2 - SYSTEM library – Oberon-2 - as with Modula2

Embedded Systems

• Well defined language standard?– Ada - Yes– C - Yes but compiler differences exist– C++ - still evolving– Modula2 - Yes but few around– Oberon-2 - informal standard

Embedded Systems

• Well defined behaviour?– Ada - yes few differences– C - No large discrepancies– C++ - No better than C– Modula2 - yes rigorous– Oberon-2 - evolving but strict

Embedded Systems

• Strong type checking?– Ada - yes very strong– C - very weak use of pointers– C++ - better than C but pointer problems– Modula2 - strongly typed– Oberon-2 - strongly type OOP features?

Embedded Systems

• Rigorous control structures?– Ada - yes but has goto– C - care needed with switch, for and jumps– C++ - similar to C– Modula2 - yes but has EXIT/RETURN– Oberon-2 similar to Modula2

Embedded Systems

• Modular structure/ seperate compilation?– Ada - Yes built into language– C - Yes, pointer problems– C++ - no explicitly modular - can have class– Modula2 - Yes, implemantation & definition– Oberon-2 - similar to Modula2, implementation

Embedded Systems

• Exception handling– Ada - standard for language & user defined– C - no standard use jumps– C++ - version 3.0 support it– Modula2 - no standard - some support– Oberon-2 - no standard

Embedded Systems

• Tasking?– Ada - yes built in– C - no can be implemented with pointers– C++ no can be implemented– Modula2 - yes using PROC– Oberon-2 - can be implemented

Embedded Systems

• Syntax and layout– Ada - Good highly readable– C - well specificed syntax but bad overall– C++ - even worse than C– Modula2 - highly readable EBNF/VDM– Oberon-2 - very readable EBNF

Embedded Systems

• Multitasking rt support– Ada - integral part of language– C - not supported– C++ - not supported libraries?– Modula2 - implemented using coroutines– Oberon-2 - optional library feature