290 likes | 603 Views
Cyber Physical Systems Lab Ramtin Raji Kermani. Giotto. A tool-supported design methodology for developing hard real-time applications. Embedded Software Development. One of the fastest growing topics of the computer industry
E N D
Cyber Physical Systems Lab Ramtin Raji Kermani Giotto A tool-supported design methodology for developing hard real-time applications
Embedded Software Development • One of the fastest growing topics of the computer industry • Electronics, Medical implants, Cruise control, Flight autopilot etc. • Communicate with physical world (Environment) • Control a system (Robot movement, control an electronic gadget) • Correctness: Time + Value • We need more sophisticated tools for this • Using Real-time OS: VxWorks, LynxOS, Windows CE, etc OR bare-iron
Control Software development • Using Legacy programming languages: C, C++, Ada • Using Engineering software: Matlab, Simulink, LabVIEW • Real-time Java • Design process: • Modeling • Simulation • Analysis and verification • Code generation for a specific platform • Traditional methods are usually platform dependent
The Giotto Project at CHESS • The Giotto project started as a part of CHESS research group (Center for Hybrid and Embedded Software Systems) at the University of California Berkeley • The research is considered inactive in UC Berkeley but still a research topic at ETH Zurich Institute of Technology • supported by the Air Force Office of Scientific Research, by the California MICRO program, by DARPA, by the National Science Foundation, and by Wind River Systems
What is Giotto? • Giotto is a tool-supported programming methodology for designing embedded control systems with periodic, possibly concurrent, task execution nature. • The tools include • A time-triggered programming language • A compiler • A run-time environment (including multiple virtual machines). • Based on LET (Logical Execution Time) assumption • The goal is to raise the level of abstraction while keeping the programs unambiguous • Suitable for designing distributed platforms
What is Giotto? • Separation of timing and functionality • Separation of platform-dependent and platform-independent constraints • A Giotto program: • Functionality Code (C, Oberon, etc) • Giotto Timing code (Giotto Code) • For a sequence of time-triggered sensor readings we have a deterministic time-triggered sequence of actuator updates
What is Giotto? Modes • A Giotto program is composed of “modes” • Each mode is consist of a specific set of “task” • Switching between modes ( if condition true)
What is Giotto? Tasks • Tasks carry the code for functionality program • Each application is composed of a series of tasks • Written in any Programming language (C, C++, Ada, Oberon, etc) • Compiled independent of the Giotto program • Finally compiled tasks are linked with the Giotto program • Giotto program is responsible for anaging the execution of tasks • Giotto Program is "Glue code" • Each task has an Execution Frequency in each mode
What is Giotto? Logical Execution Time • Logical Execution Time of tasks vs. Physical Execution of tasks • platform independent • Deterministic code
What is Giotto? Ports • Communication between different tasks, sensors and actuators are done via “ports” • A shared memory location Drivers • Communication between tasks, sensors and actuators is performed by drivers
What is Giotto? Mode Switches • Switching between modes when a condition is held true • Re-arrangement of task set
Giotto Compiler • Giotto compiler is responsible for compiling the giotto program with respect to the specifications of a target hardware/software • Compilation process guarantees the preservation of timing and functionality on the platform or rejects the program • The compiled Giotto code is executed on multiple virtual machines. The result of the compilation is “E-Code” which is executed on a virtual machine called “E-Machine” • For scheduling purposes, the E-machine may pass the tasks to the scheduler of the operating system OR alternatively pass it to the S-Machine which interprets the S-Code
Giotto Annotations • Using “Giotto Annotations” which convey the platform specific specification and constraints, we can guide the compiler in order to faster and better schedule tasks and assign appropriate resources to each task. • Annotation Types: • Giotto-P => Resources • Giotto-PM => esource assignments to tasks • Giotto-PMC (Giotto-PMS) => Communication and Scheduling
gTranslator: Simulink/Giotto model translator • A “Component Library” is developed for Mathworks Simulink • To create functionality codes using standard block based programs in simulink • Translates the Giotto syntactic models into available semantic simulink blocks without modifying the non-Giotto functionality code • Harnesses the code generation capabilities of simulink
Giotto Demo • Giotto simulator is a demo software based on Java which is developed by Giotto research group to demonstrate the capabilities of Giotto framework
Giotto Program Structure • structure of a sample Giotto program provided in Giotto website • C-like syntax • A Giotto code is composed of • Comments, • Sensor declarations, • Actuator declarations, • Output port declaration, • Task declaration, • Actuator driver declaration, • Input driver declaration, • Mode switch driver declarations, • mode declarations • Comments using // and /*....*/
Giotto Program Structure • Sensor declaration: sensor real_port positionX uses GetPosX; real_port positionY uses GetPosY; real_port angle uses GetPosA; Syntax: [SensorType] [SensorName] uses [Driver]
Giotto Program Structure • Actuator declaration: actuator real_port rightJet uses PutRightJet; real_port leftJet uses PutLeftJet; Syntax: [ActuatorType] [ActuatorName] uses [Driver]
Giotto Program Structure • Output port declarations output real_port turn := real_zero; real_port thrust := real_zero; real_port errorX := real_zero; Syntax: [OutputType] [PortName] < := InitialValue >
Giotto Program Structure • Task Declaration task turnToTargetTask(real_port eX, real_port eY, real_port eA, real_port eA2) output (turn, thrust) state () {schedule TurnToTarget(eX, eY, eA, eA2, turn, thrust)} • Actuator Driver Declaration driver leftMotor(turn, thrust) output (real_port left) { if constant_true() then ComputeLeftJetPower(turn, thrust, left)}
Giotto Program Structure • Input Driver declaration driver getPos (positionX, positionY, angle, targetX, targetY, targetAngle)output (real_port posX, real_port posY, real_port posA, real_port tgtX, real_port tgtY, real_port tgtA) { if constant_true() then copy_real_port6(positionX, positionY, angle, targetX, targetY, targetAngle, posX, posY, posA, tgtX, tgtY, tgtA)} • Mode switch driver declaration driver goForward(errorX, errorY, errorAngle, targetDirection) output () { if GoForward(errorX, errorY, errorAngle, targetDirection) then dummy()}
Giotto Program Structure • Mode declarations mode rotate() period 200 { actfreq 1 do leftJet(leftMotor); actfreq 1 do rightJet(rightMotor); exitfreq 1 do point(goPoint); exitfreq 1 do idle(goIdle); exitfreq 1 do forward(goForward); taskfreq 2 do errorTask(getPos); taskfreq 1 do turnTowardsTargetTask(getErr);}
Giotto: Success Stories • Model helicopter control system • Mind-Storm Lego Robots -Swarm Multi-Robot system • Electronic Throttle Control
Projects Inspired by Giotto • xGiotto • The Timed Definition Language: TDL • Hierarchical Timing Language: HTL
Conclusion • Giotto is a powerful methodology for development of software for hard real-time embedded control systems with a periodic nature. The Giotto program itself plays the role of a coordinator to synchronize, schedule and coordinate the execution of a series of tasks in a structured manner. • Tools are still not mature enough • Concept is so powerful that many projects are initiated based on Giotto