EECE 276 – Embedded Systems1EECE 276Embedded SystemsSurvey: Java/RTJ, Occam2Coding standardsEECE 276 – Embedded Systems2Java LanguageO Modern, OO, platform-independent language» Platform independence through JVMO Direct support for threads and (simple) synchronization» Focus on GUI-s and web appsJVMJavaSourceCompilerBytecodePlatform-dependentPlatform-independentEECE 276 – Embedded Systems3Java LanguageO Simpler and easier to read than C++» No preprocessing» Class / module / file structure (~package)O No pointers» All objects and arrays passed by reference» Boundary checks on arrays» Automatic memory management on objects/arraysO OO: classes (only) + No standalone functionsO Interfaces: class interface specs » Only interface, no implementationEECE 276 – Embedded Systems4Java LanguageO No multiple inheritance» A class can implement multiple interfacesO Strings as built-in objectsO No automatic (type) coercion» Implicit “upcasting”, “downcasting” requires codeO Threads as built-in elements» synchronized classes» Signals (wait/signal)» Support for distributed programmingEECE 276 – Embedded Systems5Real-time JavaO Extensions to Java to address specific embedded system needs » www.rtj.orgO Memory management » Garbage-collected heap (like Java)» Short- and long-lived objects outside of heap» Memory pools» Alter GC algorithm» Access to raw memory (bytes/words @ address)» Access to physical memory (objects @ address)EECE 276 – Embedded Systems6Real-time JavaO Scheduling» Real-time threads (with or w/o heap)» Priority ordered queues for all threads waiting for resources (CPU, locks, signals)» Priority inheritance protocol by default» Fine-grain control over scheduler behaviorO Time and timers» Calculations with Time» Clock/Timer/PeriodicTimer/OneShotTimerEECE 276 – Embedded Systems7Real-time JavaO Event-driven processing: » AsyncEvent and ASyncEventHandlerAsyncEventAsyncEventHandlerAsyncEventHandlerAsyncEventHandlerfire()Subscription listRunnableentitiesEECE 276 – Embedded Systems8Real-time JavaO Summary» Features for real-time programming» Low-level abstractions for controlling real-time behavior» Similar to services provided by real-time kernels» Some literature, some applicationsEECE 276 – Embedded Systems9Occam2O Simple, high-level language with direct support for distributed systems» Direct support for processes» Process primitives: – send and receive (through port)– seq, par, and alt control structuresO Supported by the Transputer» High-performance RISC processor with 4 high-speed serial ports» HW Implementation of CSP (Hoare, 1978)O Historical significance, although some concepts live on» High-speed communication ports integrated with the processorEECE 276 – Embedded Systems10Coding standardsO Rules for writing code (such that others can read it)O Rules for» File headers» Naming conventions» Commenting conventions» Formatting conventions» Programming constructs (to be used/not
View Full Document