T-50 Avionics Embedded Software Development Using Java
T-50 Avionics Embedded Software Development Using Java
Overview
The Flagship Project
Core Software
Why Java?
C/C++ Experience in Other Projects
Pointer Problems
Points to Ponder
Korea Aerospace Industries Proprietary Information 2
Verification
Test Bench Development Test Bench Development
-- System Integration Laboratory System Integration Laboratory -- Software Development Station Software Development Station
Core Software
Software (OFP) developed from scratch with enhanced capabilities compared to initial T-50 OFPs
6 independent 5x7 MFD pages (3 for each seat) Embedded Training functions
Aerial Gunnary Target Simulation
Core Software
Central to Systems integration & mission operations
Aircraft & Weapon Specific Characteristics Pilot Interface
Control Commands
Mission/Flight Information
Avionic Systems
Korea Aerospace Industries Proprietary Information 5
Why Java?
Avionics Needs
Safety (DO-178) Long lifecycle support
An Empirical Study of Programming Language Trends, IEEE Software, 2005
30 Percent of respondents 25 C 20 15 10 5 0 C++ C++ Ada Java 1993 1998 Year 2003 Ada Java
Language Trends
F-16: Jovial F-22: Ada F-35: C++ T-50: C/C++
C 2008
Evolution of Java
2002
2005
Year
2008
2011
Exception handling: assert was used instead for debugging Pointers: cannot live without but usually the culprit of most of the troubles Many other dos and donts
Lessons learned from prior projects including T-50 went into KUH
Coding guidelines became Coding Standards Peer review prerequisites are enforced with automated tools
LDRA coding rule checking and PolySpace static verification
KUH: Korea Utility Helicopter RAII: Resource Acquisition is Initialization
Pointer Problems
Problems such as an example shown below would easily be identified by a static analysis tool
An example of one of the problems
extract_data outputs an address of a data block to MESSAGE_DATA sidd_write_link uses MESSAGE_DATA to transmit the data block
// doubleTrouble.c typedef void* Data_Pointer_Type; Data_Pointer_Type MESSAGE_DATA; Would read better if named: MESSAGE_DATA_PTR
void extract_data(Data_Pointer_Type* MSG_DATA_PTR,...); void write_link(Data_List_Type* DATA_LIST,...); Should be a reference: &MESSAGE_DATA : : Should not dereference: (MESSAGE_DATA)
Pros
C/C++ like syntax : easier transition to the new language No pointers, No header files Safer and more secure
Cons
Garbage Collection Big Slow JamaicaVM caught our attention so it was evaluated
OOTiA: Object Oriented Technology in Aviation RTSJ: Real-time Specification for Java
Real-time Java
JSR-1 RTSJ adds features that are immune to GC
Memory models and regions that are not subject to GC Real-time threads that are not preemptible by GC
GC: Garbage Collection JSR: Java Specification Request RTSJ: Real-time Specification for Java
10
Real-time Java
JamaicaVM from aicas
Implements Work-Based GC which runs when and where memory allocation occurs Also implements RTSJ but having deterministic GC enables real-time programming easier
11
Language Selection
Performance Evaluation
Test program
Existing in-house tool written in C was converted to Java The tool was a weapon delivery accuracy analysis software based on actual ballistics algorithm
Target Environment
OS: VxWorks 5.5.1, BSP 1.2/1.10 CPU: SBS CK5 MPC 7447A 999MHz RAM: 512MB
Some optimizations were done with profiling and adjusting compile options to get the best possible results
BSP: Board Support Package
12
Language Selection
Results
C Speed (msec) File Size 1.43 157KB Java 2.8 4MB Java is 1.98 times slower Java includes JVM which is 3~4MB depending on packages
Conclusion
Target CPU speed (1.6 GHz) and large memory size (1 GB) were thought to be sufficient enough to run Java applications
Development
Development Environment
Models containing code are put under configuration control
Requirements : DOORS Version Control : PVCS Rhapsody Eclipse JamaicaVM EMMA / CodeCover VeriFlux STE & SIL Ground Test / Flight Test
GUI : GL Studio - evaluated but not integrated with the process, yet
SIL: System Integration Laboratory STE: Software Test Equipment
14
OFP Layers
JVMs platform independence enables modular development
Success story : One day integration of JVM and HUD OFP
JVM provided portability
T-50 Java Applications (OFP) FC HUD MFDS IUFC KAI Works JNI Real-time JVM Device Drivers OS* * OS : VxWorks, NEOS, Windows
CDU: Control & Display Unit JNI: Java Native Interface KUH: Korea Utility Helicopter OXF: Object Execution Framework SMM: System Mission Management
KAI API
OpenGL SC
Device Drivers
OpenGL
* OS : VxWorks, Windows
JOGL: Java OpenGL PFD: Primary Flight Display JVM: Java Virtual Machine SC: Safety Critical
15
Initially, it took almost 40msec for a FC OFP rate group to complete which was double the time limit
One of the reasons was data I/O utilizing JNI, especially MIL-STD-1553 due to its tight coupling with the OFP The other reasons were compile options
Optimizations
Took a few months to optimize
Compile/build options including
Tradeoff between profiled interpreter code vs compiled code Static binding for virtual calls (no dynamic class loading), etc.
JNI
Reducing the number of JNI calls Reducing run-time creation of temporary data buffers
Overall efforts brought down the speed to within 20msec, and the size from over 80MB to 50MB and then to 30MB in case of FC OFP
Korea Aerospace Industries Proprietary Information 17
Points to Ponder
JNI
With some care, it is a nice solution for hardware interfaces Alternatives may be considered e.g. CORBA, XML
But are they DO-178 compliant?
But within the same rules, Java eases much of a burden off the programmer
Enables spending more time on design, or having a longer coffee break LSP: Liskov Substitution Principle
Korea Aerospace Industries Proprietary Information 18
Points to Ponder
DO-178C and supplement documents are due by the end of 2011
After 7 years of preparation since OOTiA handbook in 2004 Will enable the use of real-time Java Technology with deterministic garbage collection in critical avionics software
Java is a good language of choice for safety-critical, hard real-time embedded software development
DO-178C: Safety Considerations in Airborne Systems and Equipment Certification OOTiA: Object Oriented Technology in Aviation TOPCASED: The Open-Source Toolkit for Critical Systems
19
Thank you
Bang, Keugyeol Principal Research Engineer Avionics Advanced R&D Team [email protected] 010-9048-0828 20
Acronyms
Air-BEST API ARINC BSP CDU FAA FC GC HUD IUFC JNI JOGL JSR JVM KAI KIDA KUH KMC LSP MFDS
Air-borne Embedded System and Technologies Application Program Interface Aeronautical Radio Incorporated Board Support Package Control and Display Unit Federal Aviation Administration Fire Control Garbage Collection Head Up Display Integrated Up Front Controls Java Native Interface Java OpenGL Java Specification Request Java Virtual Machine Korea Aerospace Industries, Ltd. Korea Institute for Defense Analysis Korea Utility Helicopter Korea Mission Computer Liskov Substitution Principle Multi-function Display Set
MIL-STD MPSS OFP OOTiA OpenCL OpenGL OS OXF PDR PFD RAII RTOS RTSJ SC SIL SMC SMM SMS STE UFC
Military Standard Mission Planning and Support System Operational Flight Program Object Oriented Technology in Aviation, FAA Open Computing Language Open Graphics Library Operating System Object Execution Framework Preliminary Design Review Primary Flight Display Resource Acquisition Is Initialization Real-time Operating System Real-time Specification for Java Safety Critical System Integration Laboratory Stores Management Computer System Mission Management Stores Management System Software Test Equipment Up-front Controls
21