Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Safety Critical Java implementation on HVM af Hans Søndergaard, ViaUC


Published on

Oplægget blev holdt ved et seminar i InfinIT-interessegruppen højniveau sprog til indlejrede systemer den 8. februar 2012.
Læs mere om interessegruppen på

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Safety Critical Java implementation on HVM af Hans Søndergaard, ViaUC

  1. 1. Safety Critical Java implementation on HVM • SCJ program • Mission Concept • H dl Handlers • Memory Model • Scheduling • ImplementationInfinit Højniveausprog, 8 February 2012Hans Søndergaard 1
  2. 2. SCJ program gA SCJ program is organized as• Missions Mi iEach mission is composed of• Schedulable objects i e handlers objects, i.e.Handlers are• Periodic (SCJ Level 0)• Periodic and Aperiodic (Level 1)Memory Model y• Immortal Memory, Mission Memory, Private Memory• No heap and no Garbage CollectionScheduling is• Cyclic executive (Level 0)• Fixed i it Fi d priority preemptive (L ti (Level 1) l 2
  3. 3. The Mission Concept p 3
  4. 4. HandlersExample: A periodic event handler implementationpublic class MyPeriodicEvh extends PeriodicEventHandler{ p protected MyPeriodicEvh (PriorityParameters priority, y ( y p y, PeriodicParameters periodic, long memSize) // size of private mem { super(priority, periodic, new StorageParameters(memSize, null)); } public void handleAsyncEvent() { // the logic to be executed every period for (int i = 0; i < n; i++) { Integer obj = new Integer (i); } }} 4
  5. 5. Memory ModelMemory Model of Level 1; - scheduling is Fixed Priority Preemptive Scheduling 5
  6. 6. Schedulig (Level 0):Cyclic Executive 6
  7. 7. Scheduling (Level 1):Fixed Priority Preemptive 7
  8. 8. Implementation of SCJ using HVM• Mission concept (finished)• Memory model (finished)• Level 0 (finished) – PeriodicEventHandler – Cyclic Executive Scheduling• Level 1 (not finished) – Fixed Priority Preemptive Scheduling – Periodic- (Yes), AperiodicEventHandler 8
  9. 9. Example: MemoryArea.executeInArea/** * Executes logic in this memory area, with no cleanup and pointer reset * at the end. * @param logic The Runnable object whose run() method shall be e ecuted. @pa a og c e u ab e ose u () et od s a executed. */public void executeInArea (Runnable logic){ MemoryArea outerArea = currentArea; currentArea = this; VMFct.pushNativeAllocScope(allocPoint); VMFct pushNativeAllocScope(allocPoint); // call of HVM C function C-function; // Java VMFct.popNativeAllocScope(); // call of HVM C-function currentArea = outerArea;} 9
  10. 10. PlatformsNow – x86 with Linux / Cygwin on WindowsLater this year – AVR ATMega2560 – CR16c from National – NECv850 10