Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
Præsentation af IAR visualSTATE
Lars [email protected]
Agenda
• Lidt historie samt firma præsentation
• visualSTATE• Grundlæggende visualSTATE opbygning• Designeren og UML• Formel verifikation • Test / Validering samt prototyping• Kodegenerering og RealLink• Dokumentation
• Kunderne og deres applikationer
• Næste visualSTATE release
• Demo af visualSTATE
Lidt historie samt firma præsentation
visualSTATE and IAR A/S History
1985 1987 1989 1991 1993 1995 1997 1999 2001
University
B&O R&D
B&O Technology
Beologic A/S
Baan
IAR
Today
IAR Systems World wide
• San Francisco• San José• Boston• Munich• London• Uppsala• Jonkoping• Aarhus• Tokyo
SalesApp. Dev. Services
R&D
App. Dev. ServicesR&D
Sales SalesApp. Dev. Services
SalesR&D
VisionTo radically improve the softwaredevelopment process for embeddedapplication development. We are creating new leading edge embedded solutions that drastically shorten the entire development process while still achieving more efficientresults.
FromFrom ideaidea toto targettarget!!
visualSTATEprogramming tool for Design, Prototyping, Code
Generation, Test & Documentation
Different ArchitecturesDifferent Architectures.. OneOne Solution.Solution.The IAR Solution is now available for more than 30 chiparchitectures!
8-bit 16-bit
32-bit
Intel
Atmel
MotorolaNEC
NationalSemiconductor
Hitachi
ToshibaZilog
Sharp
Samsung
Texas Instruments
OKI
ITT
Microchip Technologies
Mitsubishi
DSP
Embedded Workbenchdevelopment toolkit based on C/C++ compilers
The IAR Embedded Workbench
A complete development suite for embedded development:
• Project management functionality
• Editors for source code and binary files
• ANSI C & Embedded C++ compilers
• Assembler
• Linker & librarian
• Debugger (Simulator, Emulator & ROM-monitor)
IAR MakeAppautomatic code generators for device drivers
BlueTooth
StarterKitMakeApp for BlueTooth
PreQual
Other Products / Services
• Consultant services– Project startup– Project preview– project development
• Training– Product training– Technology training (C++, EC++, UML, BT, etc)
• Technical Support Services• Application development Services
Hvad er vigtigt for embeddedesystemer?
Krav til embeddede systemer
• Tidskrav– Eksekverings-tid / Real-time – Deterministisk
• Ressource forbrug / Kodestørrelse– RAM– ROM
• Kvalitet / pålidelighed
Grundlæggende visualSTATE opbygning
High-levelAnalysis &
Design Tool
strictly formal
Analysis
Design
Verification
Coding
Integration
UMLSDL
SAInformal analysis
Incomplete design
Manualcoding
Trial & Error
Traditional Development IAR baseddevelopment
Typical CASE-tool baseddevelopment
Informalmethod
Manualcoding
Manual coding
IARIARvisualSTATE
MakeApp
EmbeddedWorkbench
From idea to target
From Design To Final Tested Code in an Easy Way
IAR visualSTATE notations
• State machines designed in IAR visualSTATE can be designed using two notations :
– S/E notation based on the Mealy notation
– UML notation for Statecharts• Hierarchy• Concurrency• Memory in state machines
S1
S2
S3
E1 / A2A3
E1!S4/A2A3
E1 / A1
SE_RESET
Hvad er en tilstandsmaskine ?• En maskine/system med en tilstands-orienteret dynamisk opførsel
• Et dynamisk system, der reagerer på påvirkninger afhængig af tidog tilstand
Et tilstandsdiagram beskriver• ”Livs-forløbet” af et system
• Hvordan systemet reagerer på påvirkninger i alle situationer
Eksempler• Mobiltelefoner
• Automater (kaffe, slik, cigaretter, Dankort, ...)
• Operatør-paneler
• Symaskiner
• Reguleringer (varme, lys, fugtighed, ...)
De centrale elementer i tilstandsmaskiner er :• Events
• States
• Actions
Events• Hændelser, der påvirker tilstandsmaskinen
• Har i princippet ingen tidsmæssig udstrækning (forekommer momentant og asynkront)
States• Beskriver systemets tilstand mellem to events
• Har tidsmæssig udstrækning
Actions• Beskriver systemets påvirkning på omgivelserne
• Har i princippet ingen tidsmæssig udstrækning (udføres momentant og uden afbrydelser)
TraditionelTraditionel implementationimplementation af tilstandsmaskineraf tilstandsmaskiner
• Manuel kodning med switch-case
• Manuel kodning med tabeller
• Manuel kodning med tilstandsklasser
• Arv og polymorfe operationer (C++/Java)
switch ( current_state ) {
case ALARM :
if ( event == ALARM_KVITTERING ) {
StopAlarm();
current_state = INGEN_ALARM;
}
break;
case ...
:
}
Hvordan håndterer viHvordan håndterer vihierarki,hierarki,
concurrencyconcurrencyogog
synkroniseringersynkroniseringerved manuel kodningved manuel kodning
??
Rule notation
• CSV = current state vector• NSV = next state vector• AV = action vector
• Each state machine is always in one and only one state
• State changes (transitions) are triggered by one and only one event
event CSV : NSV AV
visualSTATE Fundamentals
visualSTATEenigne
Device Driverconvert inputs
to events
Real Life
x=port(0); port(1) = 1;
Real Life
Device Driverconvert actions
to outputs
Events Action functions
Event Queue
• Mathematical proof of correct code through binary arrays with unique interpretation
• Kernel functionality verified in millions of applications since 1987
Modeling
Well definedset of mathematical
operations
Run-time
Technological concept
State analysis
Patented
Patented
Hvad kan visualSTATE?
Fejl hvis Event1 og state1 og state2
A
C
B
D
Event1() /
Event2() /
Event5() /
Event6() / Event3() /
Event4() /
Design vha.grafisk
programmering
Prototype påbaggrund af
designA
C
B
D
Event1() /
Event2() /
Event5() /
Event6() / Event3() /
Event4() /
Event1Event3Event7Event4
...
Manueltest
Automatisktest
Kodegenerering DokumentationA
C
B
D
Event1() /
Event2() /
Event5() /
Event6() / Event3() /
Event4() /
{if (SEM.CSV [4] == 0x05)SEM.WSV [3] = 0x0F;
....}
A
C
B
D
Event1() /
Event2() /
Event5() /
Event6() / Event3() /
Event4() /
This TV set has beendeveloped for a
Motorola platform...
Designer / UML
Hvad er UML
• UML, Unified Modeling Language• UML er en metode / notation der prøver at samle
nogle af de forskellige objekt orienterede metoder.
• OMG godkendte UML som standard i 1997.• 3 modeller
– Kravmodeller (USE-case diagram og sekvensdiagram)– Strukturer (klassediagrammer)– Opførsel (tilstandsdiagrammer)
Hvorfor UML
• Veldefineret objekt model• Uafhængig af implementerings sprog • Mulighed for genbrug• Samme platform uafhængig af type applikation • Bred vifte af værktøjer• Bred vifte af litteratur, træning og
konsulentydelser • Efterhånden udbredt på undervisnings
institutioner
Designing a stereo...
Either the tape recorder or the radio or the CDplayer is active...
Events are added...
Transition
Event
A new hierarchical level is introduced
Substate
Superstate
The states STOPPED, PLAYING and RECORDINGare only active when state TAPE is active
Concurrency is introduced
State PLAYING or state STOPPEDand
state CD or state NO_CD are active
Composite state
Concurrent substate
Actions are added
Action
Entry and Exit actions
Entry action
Exit action
Entry actions are activated each time a state in enteredExit actions are activated each time a state is left
Initial statesInitialstate
Initial states are used to initialize the statecharts and as defaultstates in superstates
History states
History state
History states are used to apply “memory” to the statecharts
Variables
Variable
Signals
Signal
Signals can be used to send a “message” to another state machine
Internal transitions
Internaltransition
An internal transition does not cause any state change
InIn thethe realreal worldworld......
• Events could be interrupts, a button press,timeouts, reset...
• States represents whatever the product is doingright now...
• Actions could control valves, displays, a CAN bus...
• Variables could be used to represent temperatures, counters, flags...
• Each state machine is always in one and only one state
• State changes (transitions) are triggered by one and only oneevent / event group / signal
• Upon receipt of a trigger, all state combinations are “frozen” until all transitions have been handled,and all variables are double buffered (if necessary)
Summary - UML and visualSTATE, Rules :
Summary - UML and visualSTATE, Transition :
A BEV(p) · S1 · [(x < 7) || (y > 10)]
[z = MAX] · A2(x, y) · S4 · ^SIG
/
Condition side
Action side
Trigger State condition
Guard
expression
Assignment Action
functionForce state
Signal
Design / metodeDesign / metode”De 6 trin” :
1. Identificér events og actions
2. Identificér states
3. Gruppér efter hierarki
4. Gruppér efter concurrency
5. Tilføj transitioner
6. Tilføj synkroniseringer
Trin 1 : Identificér events og actions
Events er omgivelsernes påvirkning på systemet= input til tilstandsmaskinenEvents er eksterne hændelser
Signaler er interne hændelser fra systemet selv
Actions er systemets påvirkning på omgivelserne= output fra tilstandsmaskinenActions er systemets reaktion på de eksterne påvirkninger
Trin 2 : Identificér states
States identificeres udfra kravspecifikation samt viden om problem-domænet.
• Døren kan være åben eller lukket
• Døren kan være låst eller ulåst
• Switchen kan være i en af de tre positioner
• Lyset kan tændt eller slukket
Trin 3 : Gruppér efter hierarkiUndersøg hvilke states, der i sig selv har dynamisk opførsel, samt om visse tilstande kun vil optræde i bestemte situationer
Med denne gruppering modelleres, at døren ikke kan være åben eller lukket, når den er låst.
Modellen indkapsler muligheden for at åbne en dør –kun muligt, når døren er ulåst
Trin 4 : Gruppér efter concurrency
Undersøg hvilke tilstande, der kan være aktive på samme tid
Opdel i flere parallelle aktive tilstandsmaskiner
Det skal være muligt at åbne, lukke og låse dørensamtidigt med at switchen ændres ogsamtidigt med at lyset skifter
Trin 5 : Tilføj transitioner
Identificér hvilke tilstandsskift og udførelse af actions, der skal foregå, når events forekommer
Beskriv scenarier (sekvenser af påvirkninger) og tilføj transitioner, der understøtter disse
Bemærk, at der er indført yderligere hierarki af design hensyn –én transition til hver ”switch-position”
Trin 6 : Tilføj synkroniseringerIdentificér hvilke transitioner, der er betingede og tilføj evt. yderligere transitioner
Identificér hvilke transitioner, der har brug for at sende ”interne beskeder”
Når døren åbnes mens switchen er i ”sensitive”,så skal lyset tændes........ etc.
IAR visualSTATE Designer• Graphical overview
of system behavior• Hierarchical state
systems• Multiple and inter-
related state machines
• Parallel threads of control
• UML Statecharts• State Transition
Diagrams
Formel verifikation
� Interrelationships between state-machines are checked
� All combinations are checked
S11
S13
S12
KEY1
KEY1
S14
KEY2[S21 && S22]
S21
S22
IAR visualSTATE TestingDynamic Formal Verification
KEY3
Conflicting Transition
Dead end
UnreachableTransition
Verificator settings
• Exhaustive computation• 7 different checks
• Use of elements• Reachable transitions• Conflicting transitions• Activation of elements• State dead end• Local dead end• System dead end
• Forward / Backward mode• Backward = no dead-end • check
Test / Validering samtprototyping
• Simulation• Sending events• Monitoring
• Current States• Active events• Guards• Triggered actions• Timers• Variables• Signals
AA AB
AD AC
E1() /
E2() /
E3() /
E4() / E3() /
IAR visualSTATE TestingManual validation
• Record test sequences• Static analysis, use of
• Events• Actions• Signals• Internal & External-
variables• Dynamic analysis
• Test coverage analysis• Non-activated elements• Most frequently used
IAR visualSTATE TestingLog & Animation
Prototyping
• You can build a model that looks and behave like your final product
• You can get feedback from marketing, sales and customers and therefore make corrections in a much earlier state in your development process and therefore save money.
• It will help you increase the awareness and knowledge of your product before it is launched
• With visualSTATE your final product will behave in a way 100% identical to that of your prototype.
Why prototyping
Prototyping with Altia FacePlate
Altia integration to visualSTATE
Other Prototype possibilities
• Visual C / C++– App note 10743: Prototyping in Visual C++ with IAR
visualSTATE
• Borland C++ builder– IAR DK can provide you with an example.
• Visual Basic– App note 45079: Prototyping in Visual Basic with
visualSTATE expert DLL.
• Delphi– App note 45079: Prototyping in Visual Basic with
visualSTATE expert DLL.
Kodegenerering og RealLink
IAR visualSTATE Code generation
• Features– Automatic Code Generation based on the design – Generation of very compact code for 8/16/32-bit
microprocessors – integrates with any ANSI-C Compiler
– Integrates with any RTOS
• Advantages– SW-consistency between design and actual code
is guaranteed – Avoid manual coding, spaghetti coding and
reverse engineering
Design + Test + Prototyping
Automaticcode-
generation
Real-Link Hardware
^ RTOSDevice Drivers
vAPI*
Application Com
plete Target Application
Flexible realization in any target
8-/16-/32-bit*) Foot print: 600 bytes to 2K
Model
Host
Wire
Target
Connectivity via Real-Link
*) Foot print: ~1K (RS232 interface)
Real-Link Agent*Real-Link Server
TCP/IP Direct
Validator
Application
Model
Documentation
IAR visualSTATE Documentation
• Features– Automatic generation of
design/test/code documentation
– Customized generation of documents
• Advantages– 100% consistent with current
implementation– Customized
documentation/manual – Up-to-date documentation
One genericOne genericproductproduct
for a varietyfor a varietyof industriesof industries
Our customers
• Automotive• Telecom • Medical• Electronics • Aerospace & Defense• Financial• Industrial machinery• Industrial instruments • Consulting & Education• Multimedia & Entertainment
Case Stories
• Husqvarna Viking, MMI for sewing machine • Grundfos Group, Pumps• Bang & Olufsen, TV, video and stereo • Danfoss A/S, MMI for flow meters • P.I.V. Eldutronik, frequency controller• Spark Holland, laboratory equipment • Wittenborg A/S, Vending machines
http://www.iar.com/Products/vS/References
Other Customers
• Canon Inc.• LG Electronics • Digianswer A/S• DE-VI A/S• DEIF A/S• Migatronic A/S• FBI laboratory
• KONE Corporation• Lego Systems A/S• Novo Nordisk A/S• Scanvægt International A/S• Siemens Elema AB• Siemens AG• Terma Elektronic A/S
Next visualSTATE release
• Hierarchical Coder• C++ wrapper• Verification of guard and assignments• Trace generation w/ Validator integration• New UML modeling constructs • Team work (+VCS)• New Navigator• Graphical breakpoints and transitions• General bug fixing, performance and stability
improvements
Future: More UML support ???
Questions