page 1 ajacs and hip/automotive antonio kung - trialog copyright (c) 2002 j consortium ®, inc. all...

34
........ ........ .... ......... ...... Page 1 AJACS and HIP/Automotive Antonio Kung - Trialog Copyright (c) 2002 J Consortium ® , Inc. All Rights Reserved J Consortium is a registered trademark in the United States. Java TM is a trademark of Sun Microsystems in the United States and other countries.

Upload: ethan-small

Post on 31-Dec-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

....................

......

......

.....

Page 1

AJACS and HIP/Automotive

Antonio Kung - Trialog

Copyright (c) 2002 J Consortium®, Inc. All Rights Reserved

J Consortium is a registered trademark in the United States.JavaTM is a trademark of Sun Microsystems in the United States and other countries.

... ............................................

Page 2

Content

AJACS rationale Technical approach and related issues HIP/Automotive working group

... ............................................

Page 3

The AJACS Project

Applying Java to Automotive Control Systems Web site : www.ajacs.org Consortium

– Trialog– PSA (Peugeot-Citroën)– CRF (Centro Riserche Fiat )– Mecel (technology centre of Delphi)– University of Karslruhe

....................

......

......

.....

Page 4

AJACS Rationale

... ............................................

Page 5

The Trend Today

More global applications– Multiplexing– Connectivity

... ............................................

Page 6

Two Worlds

Infotainment : navigation, Internet, telecom...– AMIC initiative (www.ami-c.com) on Java-based technology

Control bus : powertrain, ABS, engine control...– OSEK/VDX initiative (www.osek-vdx.org) on RTOS and

multiplexing– TTP or Flexray initiatives for fault-tolerance (Drive-by-wire)– LIN Local Interconnect Network initiative

AJACS targets the second world

... ............................................

Page 7

Specification of USER Functions

Cruise ControlUser Function

Display SpeedUser Function

MeasureSpeed

ReadBrake Pedal

Displayvalue

ReadCC-buttons

EngineControl

CruiseControl

Data flow:Vehicle speed

System input:wheel sensor System output:

Speedometer

Sub-function:Engine control

... ............................................

Page 8

Allocation to “ECUs”

ABS Instrument Cluster

Powertrain

Cruise ControlUser Function

Display SpeedUser Function

MeasureSpeed

ReadBrake Pedal

Displayvalue

ReadCC-buttons

EngineControl

CruiseControl

... ............................................

Page 9

General Requirements

Car manufacturers – To have more control on the specification of user functions– To protect trade secrets– To reduce integration cost– To reduce bills of material

For the OEMs– To reduce development cost through “generic platforms”

... ............................................

Page 10

Engineering Requirements

Subfunctions must be independent and relocatable

This implies– standard communication interfaces– software development methodologies that supports easy

customisation and reuse of software components

Java can help meeting all these requirements !

... ............................................

Page 11

Technical Constraints

Typical ECU configurations– Single Chip– 256Kb ROM or Flash– 8Kb to 16Kb RAM

Typical runtime constraints– ~100µs response time for some conditions– Predictability– Overall CPU load from system software < 10%

Closed world– every thing is static

... ............................................

Page 12

AJACS Objectives

Specification, Development, Demonstration of– An open technology– Based on Java– For deeply embedded automotive control systems

Industrial viewpoint– Benefit from OO in terms of structuring, reusability, dependability– WORA attributes to some extent, robustness attributes– Support the same kind of real-time constraints which non Java

based ECUs are managing today. – Single chip approach - Small footprint

....................

......

......

.....

Page 13

Technical Approach. Related Issues

... ............................................

Page 14

Run-time Architecture

Architecture of the target software– Application Java classes

use the HIPA API

Note : Multithreadone-to-one mapping– 1 java thread = 1 OSEK

Task OSEK runtime

HIPA APIs

implementationAJACS

runtime

C standard libraries

Application

Language core

HIPA APIs

... ............................................

Page 15

Generation Approach

Native code approach– Compiler generates low-level, assembler-like C

Approach :– Front-end : Jikes Java front-end from IBM– Java source code translated into AJACS-Abstract Syntax Tree– AJACS-AST translated into C code

... ............................................

Page 16

Specific Technical Constraints

Support of C legacy code– OSEK-Based applications– Drivers (e.g. CAN drivers)

Support current programming practices– OSEK culture– Everything is static

Using Java for system programming– accessing physical memory/registers– bit manipulation– no physical memory rep spec– no typedef

... ............................................

Page 17

AJACS Development chain

File edition

JavaFiles

Config.Files

Front-End

Back-end : code generator

Optimization

HIPAAPIs

runtimelibraries

Usual compilation chain : (C compiler, linker, transfer software,...)

Verification

Target

externallibraries

Generatednative code

Generatedconfigdata

Load image

Debuginfo

Nativelibrary Native

library

Javafiles

Intermediate representation

Intermediate representation

OptimizationoptionsProgramming

modelfeatures

Debugger

Support fordebug

... ............................................

Page 18

Java Run-time Issues 1

C/Native Interface– Very simple implementation (e.g. direct name matching,

parameters can be only primitive types ...)

Exception management– Currently implemented : backward propagation from Callee to

Caller.

Debugging– Will rely on usual C debugging solution + instrumentation of the

generated code to retrieve original Java source code.

... ............................................

Page 19

Java Run-Time Issues 2

Supporting Core classes– directly managed by the compiler

Class initialization– performed at compile-time

Concurrency– threads are mapped directly by underlying OSEK– Java synchronization means not yet implemented

Object ROMization– first step : the user explicitly specifies objects to be ROMized– further investigation : automatic ROMization by code analysis

... ............................................

Page 20

AJACS Status

Requirements Specification and Architecture

– HIPA 0.3 Draft– AJACS architecture

Reference Implementation - Jan 2002– Run-time on top of OSEK/VDX– Code generator– ECU platform

Evaluation - June 2002– PSA : body control application– CRF : dashboard application

....................

......

......

.....

Page 21

HIP/AutomotiveWorking Group

... ............................................

Page 22

What is HIP/Automotive

High Integrity Profile– HIP requirements– Static tasking model from Real-time core

High Integrity Profile /Automotive– HIP requirements– Static tasking model from OSEK

... ............................................

Page 23

Main orientations of HIP/A

Native code compilation expected– not imposed

Execution of complete applications Static configuration

– all system entities are defined prior to generation– Specific language for configuration purpose

Support for OSEK legacy

... ............................................

Page 24

Current Status

Draft 0.3 Harmonisation work with HIP has been started

– a work document has been released in order to identify the common requirements with HIP

... ............................................

Page 25

Harmonization in picture

HIP 0.2

HIPA 0.3

HIP 1.0High integrityrequirements

High integrityrequirements

HIPA 1.0

Static task modelderived from OSEK

Other automotiverequirements

Annex:Static task modelderived from Core

....................

......

......

.....

Page 26

Implementation Aspects

... ............................................

Page 27

Class Diagram

... ............................................

Page 28

Java: Task 1 structure

public class Task1 extends StaticTask {

...

public void work() {EventManager.setEvent (Task2, Event2);

...

}

}HIPA service

... ............................................

Page 29

HIPA: EventManager Class Implementation

public class EventManager {

public static void setEvent (int task_id,byte mask) /*throws BadIdentifier, BadTaskDef, BadTaskState*/ {

...

EventManager.nativeSetEvent(task_id,mask);

}

} Native interface call

Exception management will be implemented

in the next version of the compiler

... ............................................

Page 30

C native interface

public native void nativeSetEvent(int task_id, byte mask) of EventManager class is implemented as:

void _EventManager_nativeSetEvent_void_int_byte (char* this,int task_id,byte mask) {

Status=SetEvent(task_id,mask);

}

OSEK service

... ............................................

Page 31

CompilationCore class

HIPA class

C compilation

Application class

... ............................................

Page 32

Execution

Execution on targetenvironmentGeneration of a binary file with

the usual compilation chain

Download of thebinary file on target

1

2

3

... ............................................

Page 33

Technology Availability

Two packages to be available for evaluation PC evaluation

– Compiler– Minimal run-time

68336 evaluation kit– Compiler– AJACS run-time– HIPA run-time– OSEK/VDX– 68336 board with CAN interfaces

....................

......

......

.....

Page 34

Thank You