Professional Documents
Culture Documents
1
Content Outline / アウトライン
1. Design Specification
* Remote Control Car Overview
* Detail design specification (Flow Chart? / STD? /STM?)
* What is EHSTM? (Extended Hierarchy STM)
2. ZIPC Simulation
* What is the benefits of ZIPC Simulation?
* Software Prototyping with Design Specification?
3. ZIPC Code Generation
* What is the benefits of ZIPC Code Generation?
* How ZIPC doing Code Generation from STM?
4. ZIPC Emulation
* What’s a relationship of STM & Binary?
* State Transition-Oriented Debugging
5. Conclusion
2
1.Design 1.1) Remote Control Car
Specification Overview
*** Let’s think together about embedded software
design in our Remote Control Car
System hardware block diagram
R C LED LCD
IR Steering
e o
module Motor
m n
M32C83
o t
MCU
t r Motor Drive
OAKS32 Board
e o Driver Motor
l Car
UART
USB PC
CATS IF Board
3
1.Design 1.1) Remote Control Car
Specification Overview
*** Remote Control Command Specification
電源 Buttons Functions
電源 SystemON/OFF
1 setForward
1 2 3
3 setSpeedUp
4 5 6 5 setStop
7 setBackward
7 8 9
9 setSpeedDown
10 11 12 10 turnLeft
11 setCenter
+ +
12 turnRight
-
-
4
1.Design 1.1) Remote Control Car
Specification Overview
*** Use Case Diagram of System Requirement
What should be
the next design
diagram for the
detail design?
• Flow Chart ?
• STD ?
• STM ?
5
1.Design 1.2) Steering Motor Control
Specification Specification
a.) Basic Design
Steering Motor Degree Level
Turn
Turn Left Degree Turn Right Degree
Left4 Left1 Center Right1 Right4
Left3 Left2 Right2 Right3
(Max) (Min) (Min) (Max)
Buttons Functions
10 turnLeft Flow Chart? / STD? / STM?
11 setCenter What would be the best design
specification for this
12 turnRight steering motor control ?
6
1.Design 1.2) Steering Motor Control
Specification Specification
b.) Design Limitation of Flow Chart
Turn
Turn Left Degree Turn Right Degree
Left4 Left1 Center Right1 Right4
Left3 Left2 Right2 Right3
(Max) (Min) (Min) (Max)
7
1.Design 1.2) Steering Motor Control
Specification Specification
c.) Design Limitation of STD
(State Transition Diagram)
Turn
Turn Left Degree Turn Right Degree
Left4 Left1 Center Right1 Right4
Left3 Left2 Right2 Right3
(Max) (Min) (Min) (Max)
*** It is good for overall design view. But, the
Buttons Functions
10 turnLeft design coverage is so difficult to notice. It is
difficult to comparing among a lot of
11 setCenter
connecting lines. trnR trnR trnR
12 turnRight
R1 R2 R3 R4
trnR
trnL trnL trnL
setC setC setC trnL,
trnL Center setC setC setC setC
trnR trnR trnL
trnR,
L4 L3 L2 L1 setC
trnLR trnR trnR 8
1.Design 1.2) Steering Motor Control
Specification Specification
d.) Design Advantage of STM
9
1.Design 1.3) Drive Motor Control
Specification Specification
a.) Basic Design
Drive Motor Speed Level
Backward Speed Forward Speed
B4 B1 Stop F1 F4
B3 B2 F2 F3
(Max) (Min) (Min) (Max)
Motor
Drive Motor Control Functions
Driver
Buttons Functions
1 setForward Drive
STD? / STM?
3 setSpeedUp Motor
What would be the best design
5 setStop specification for this
7 setBackward drive motor control ?
9 setSpeedDow
10
1.Design 1.3) Drive Motor Control
Specification Specification
b.) Design Limitation of STD
(State Transition Diagram)
Backward Speed Forward Speed
B4 B1 Stop F1 F4
B3 B2 F2 F3
(Max) (Min) (Min) (Max)
12
1.Design 1.3) Drive Motor Control
Specification Specification
c.) Design Advantage of STM
*** Doing STM design can help us doing requirement analysis.
Software debugging could be done since design phase.
14
1.Design 1.4) Tool for the Design
Specification Analysis
15
1.Design 1.4) Tool for the Design
Specification Analysis
*** Using STM Design is to clarify
the Design Specification
Drive Motor Control STM
16
1. Design 1.5) Tool for the Design
Specification Specification
*** Using STM Design is suite for the Design Specification
of Embedded Software
18
1.Design 1.6) What is EHSTM?
Specification (Extended Hierarchy STM)
*** Using the Hierarchy STM prevents an increase in the
area of STM cells
ZEH_0 MainControl ZEH_0.2 DriveMotorControl
ZEH_0.3 SteeringMotorControl
21
2. ZIPC 2.1) What is the benefits of
Simulation ZIPC Simulation?
*** Usual practices in Software Development
(Traditional)
(Design omissions)
Revised Design
(Design omissions)
更改設計)
更改設計)
(更改設計
(Design omissions)
22
Image source: http://en.wikipedia.org/wiki/Image:V-model.JPG
1. ZIPC 2.1) What is the benefits of
Simulation ZIPC Simulation?
*** Actively verifies the design specification before coding
(Using ZIPC) • Verification can start from
the moment the design
(Design omissions) specification is created
EH imu
• Reduces code-level
&S
ST
debugging man-hours
Re
M lation
(Design omissions)
vis
De
ed
design stage
改設
sig
D esi
n
計)
gn
(Design omissions)
Software Prototyping by
Design Spec.(EHSTM)
23
Image source: http://en.wikipedia.org/wiki/Image:V-model.JPG
2. ZIPC 2.2) How to do
Simulation Software Prototyping?
*** Software Module Design of Remote Control Car
(Sub-functions of Main Control)
Main Control
System
Initialization
System
Steering Motor Drive Motor Display API
functions
IR Command
setting
Steering Motor Drive Motor
API functions API functions
IR API
functions
IR_Cmd
Setting STM
Main Control STM
25
3. ZIPC Code 3.1) What is the benefits of
Generation ZIPC Code Generation?
*** Human errors of Coding Phase
(Traditional)
UM
LD
es
ign
(Re
-Pr
26
)
man-hours
M
De
sig
n
Design Spec.(EHSTM)
Automated
Code Generation
27
Image source: http://en.wikipedia.org/wiki/Image:V-model.JPG
3. ZIPC Code 3.1) What is the benefits of
Generation ZIPC Code Generation?
*** ZIPC doing Code Generation from
Design Specificaion (EHSTM)
(Hardware Independence)
(Human Language)
Hardware
Abstraction EHSTM
Design
by ZIPC +
Automated
Others
ZIPC Sheet
Code Generation
(Hardware Dependence)
ANSI C
(*.c, *.h) (C Language)
API Func,
Device Driver
(*.c, *.h)
+ Implementation
on target platform
28
3. ZIPC Code 3.1) What is the benefits of
Generation ZIPC Code Generation?
*** Design Porting wizard for any 8-bit or larger target
platform even various makers
(Hardware Independence)
(Human Language)
Hardware
Abstraction EHSTM
Design
by ZIPC +
Automated
Replacement
Others
Design
DesignSheet
Sheet
Code Generation
for A
(C Language)
(*.c, *.h)
API Func,
for A
(*.c, *.h)
+ Implementation Hardware of
on target platform Platform A
29
3. ZIPC Code 3.1) What is the benefits of
Generation ZIPC Code Generation?
*** Design Porting wizard for any 8-bit or larger target
platform even various makers
(Hardware Independence)
We can use same
(Human Language)
Hardware STM design in any
Abstraction different platform
EHSTM
Design
by ZIPC +
Automated
Others
Replacement
DesignSheet
Sheet
Code Generation
Design
for B
(Hardware Dependence) Gen.Code
for B
(Platform B)
(C Language)
(*.c, *.h)
API Func,
for B
(*.c, *.h)
+ Implementation Hardware of
on target platform Platform B
30
3. ZIPC Code 3.1) What is the benefits of
Generation ZIPC Code Generation?
*** Software Module Design of Remote Control Car
(Sub-functions of Main Control)
Main Control
System
Initialization
System
Steering Motor Drive Motor Display API
functions
IR Command
setting
Steering Motor Drive Motor
API functions API functions
IR API
functions
}
else if (PressBtnBuff == STOP_BUTT)
{
34
3. ZIPC Code 3.3) What is the Text
Replacement Design Sheet?
Generation
*** Translate Human Lang. & Link to Hardware API functions
STM (Human Lang.) Generated C code (C Lang.)
/*****************************************
MainTask MainControl( level : 0 )
State : 1 Event : 0 Action function
*****************************************/
static void ZMainTask_m0e0s1( void )
{
{
AppDispMsg.DispName=LCD_SystemOff;
AppDispMsg.Option=0;
AppDispSpeed.DispName=SPEED_STOP;
AppDispSpeed.Option=0;
Display_Message(AppDispMsg.DispName,
Display_Speed(AppDispSpeed.DispName,
};
35
3. ZIPC Code 3.4) How ZIPC doing Code
Generation Generation from STM?
1. Initialization Function
2. Call Function
(event analysis function)
3. Action Function
System
Steering Motor Drive Motor Display API
functions
IR Command
setting
Steering Motor Drive Motor
API functions API functions
IR API
functions
Signal
Sync Signal (1 , 0 )
Data 16 bit( Overflow Reset
Type
38
3. ZIPC Code 3.5) Tool for the Program
Generation Coding
*** STD of IR API functions
Convert
? ?
?
?
Some Action that we can not considered when it was STD will be show up when
It’s converted into STM.
41
3. ZIPC Code 3.5) Tool for the Program
Generation Coding
*** STM of IR API functions
After considered, We fill the right action into the empty cell
42
3. ZIPC Code 3.5) Tool for the Program
Generation Coding
*** Code Optimization by STM
Adjust
Can be Merge
And actions on Sync and Reading state are giving the same result.
So, We can merge Sync and Reading state in to just one state.
43
3. ZIPC Code 3.5) Tool for the Program
Generation Coding
*** Code Optimization by STM
Optimize
For Complete Read Event, This one always activate on the 16th bit of data.
So, We turn this event to the condition in the action fields of data reading.
44
3. ZIPC Code 3.5) Tool for the Program
Generation Coding
*** Code Optimization by STM
Priority High
Priority Low
After that. Just arranged events by it’s priority and push coding into STM.
45
3. ZIPC Code 3.5) Tool for the Program
Generation Coding
*** Code generation of IR API functions
Increase_Reset_Counter Clear_Overflow_Flag Keep_Timer_Value Clear_Reset_Counter
Replace Replace
By using ZIPC, Designer can insert the program activities and processes by human
language into a structural area of STMs then the program will be generated with
a structural coding. Moreover, the designed STM is also good to show the overall
view of a program to get an easy understanding for another designers. 46
3. ZIPC Code 3.5) Tool for the Program
Generation Coding
*** Manual Coding using Flow chart is not easy to understand and
implement because there are a lot of branch conditions.
Flow chart of Manual Coding STM in ZIPC
47
3. ZIPC Code 3.5) Tool for the Program
Generation Coding
ZIPC
Emulator
CPU
Debugger
Target
CPU
Our project
using this one 50
4. ZIPC 4.3) What’s a relationship of
Emulation STM & Binary?
*** When compiling the ZIPC generated code to Binary.
1. Generating an 2. Generating a 3. Download to
emulation load module Target CPU
source code (Binary) (M32C83)
#ifndef __ZIPC_NOTEMU__
unsigned short zemu_eventno[4]; zemu_eventno[4]
unsigned short zemu_actionno[4]; zemu_actionno[4]
unsigned short zemu_stateno[4];
zemu_stateno[4]
#endif
(*.c, *.h) (*.x30)
zemu_eventno[0]=0;
zemu_actionno[0]=0;
zemu_stateno[0]=1;
;zemu_eventno[0] = 0;
MOV.W:Z #0,043CH
;zemu_actionno[0] = 0;
MOV.W:Z #0,0444H Event No.0
;zemu_stateno[0] = 1; Action No.0
MOV.W:Z #0001H,044CH State No.1
Make it Easy
to Identify
bugs
53
Image source: http://en.wikipedia.org/wiki/Image:V-model.JPG
5. Conclusion 5.1) Development Flow
of our Remote Con. Car
ZIPC
ZIPC Emulator
Generator
EHSTM EHSTM
(Emulation)
Editor
ZIPC EHSTM
Simulator (Design Spec.)
54
5. Conclusion 5.2) What is the benefits for
using ZIPC?
1. Benefits at Design Phase
• Using EHSTM can do the exhaustive design specification
rather than the Flow Chart or STD, preventing mistakes
and omissions
2. Benefits at Simulation Phase
• Verification can start from the moment at the design
specification is being created and before coding.
• Reduces design omissions at the design stage
3. Benefits at Generation Phase
• Uniform format of the code. The documentation and code
always be matching
• Design Porting wizard for any target CPUs & various makers
4. Benefits at Emulation Phase
• Using the Design Spec. (EHSTM) to do state transition-
oriented which is better than code oriented debugging 55
Please be enjoying with
our emulation demonstration …
以上、
以上、よろしくお願
よろしくお願いします
56