Battling state machine complexity IAR visualSTATE - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Battling state machine complexity IAR visualSTATE

Description:

Battling state machine complexity 'Any fool can write code that ... Battling state machine complexity. 32-bit ARM/Cortex architecture bring great opportunities ... – PowerPoint PPT presentation

Number of Views:70
Avg rating:3.0/5.0
Slides: 31
Provided by: thomass88
Category:

less

Transcript and Presenter's Notes

Title: Battling state machine complexity IAR visualSTATE


1
Battling state machine complexityIAR visualSTATE
  • Thomas Sporrong
  • Field Application Engineer
  • fae_at_iar.se
  • www.iar.com

2
Battling state machine complexity
  • Any fool can write code that a computer can
    understand.
  • Good programmers write code that humans can
    understand

3
Battling state machine complexity
  • 32-bit ARM/Cortex architecture bring great
    opportunities
  • New tools and methodologies needed?
  • This session will cover one aspect of application
    the program logic implemented as state machines

4
Microcontroller projects code size
5
Software development
Effort
Complexity
old method
new method
6
IAR visualSTATE can help
  • Design of program logic
  • Simulation Formal Verification of program logic
  • Debugging program logic
  • Maintenance of design

7
Battling state machine complexity
  • C-code
  • Switch (state) case STOP if (event
    S_new_target T_Floor gt Floor) then state UP
    break
  • case UP if (entry) then entry
    0A_drive_up()if (event S_stop)thenentry
    1 state STOPbreakcase DOWN ...

8
Battling state machine complexity
State machine
  • C-code
  • Switch (state) case STOP if (event
    S_new_target T_Floor gt Floor) then state UP
    break
  • case UP if (entry) then entry
    0A_drive_up()if (event S_stop)thenentry
    1 state STOPbreakcase DOWN ...

9
Complex?
29 states
10
Complex?
7 states
29 states
Number of transitions is a more critical factor
for complexity
11
From design to code
12
Design to code?
  • Hand coding state machines
  • As complexity increases, how do I ensure that I
    capture the complete design in code?
  • How do I restructure the code if I discover
    errors in the design?
  • Do I even have a complete design before I code?

13
From design to code!
  • Automatic code generation
  • Do I even have a complete design before I code?
  • How do I restructure the code if I discover
    errors in the design?
  • No problem regenerate the code from the updated
    design!
  • As complexity increases, how do I ensure that I
    capture the complete design in code?
  • No problem The code is a full representation of
    the design!
  • Design and code is always in sync

14
From design to code
15
Simulation Validation on design model
16
No dead ends? No contradictions?
17
Spot a difference?
18
Know for sure!
Full verification requires restrictions to the
modeling language
19
Design Simulation Verification
20
Design maintenance
  • Documentation up to date?
  • How do I verify that my changes does not
    introduce contradictions/dead ends?
  • Person who did the original design might have
    left the company...

21
Design maintenance
  • Documentation up to date?
  • How do I verify that my changes does not
    introduce contradictions/dead ends?
  • Person who did the original design might have
    left the company...
  • Feedback from our customers
  • Using IAR visualSTATE is a key advantage when
    it comes to maintenance

22
Design maintenance
23
IAR visualSTATE
Automatic C or C code-generation
API
Complete Target Application
Middleware
Automatic document generation
State machine design Formal verification Simulatio
n Prototyping
Device Drivers
ARM/Cortex HW
24
Model debugging on hardware?
25
Model debugging on hardware!
Events and actions
Breakpoints
Full design model feedback
26
Model debugging on hardware
27
The full circle
  • Code generation from design model
  • Avoid stupid coding mistakes
  • Simulation/Validation on design model
  • Find errors early
  • Formal model checking on design model
  • Find dead-locks before they bite you
  • Model debugging on target hardware
  • Find remaining issues faster

28
More ARM/Cortex info at www.iar.com
29
More ARM/Cortex info atwww.SevensAndNines.com
30
Thank you!
  • Thomas Sporrong
  • Field Application Engineer
  • fae_at_iar.se
  • www.iar.com
Write a Comment
User Comments (0)
About PowerShow.com