SDL Based Auto Code Generation: A Multi Beneficial Approach

Download Report

Transcript SDL Based Auto Code Generation: A Multi Beneficial Approach

Motorola India Electronics Ltd..
SDL Based Auto Code Generation: A
Multi Beneficial Approach
Bhaskar Rao.G
Software Engineering Group,
Motorola India Electronics Ltd.
Banglore, India - 560 042.
email: [email protected].
SAM-2000
1
28/JUNE/2000
Motorola India Electronics Ltd..
Agenda
• Introduction to SDL and Benefits ( 3 min.)
• Experiences and Results (17 min.)
– Pilot Project
– GPRS Layer Study
– Problems and Solutions
• Challenges Remaining (3 min.)
• Conclusions (2 min.)
SAM-2000
2
28/JUNE/2000
Motorola India Electronics Ltd..
SAM-2000
3
28/JUNE/2000
Motorola India Electronics Ltd..
SDL, Is it only Auto Code Generation?
• Methodology
• Integrated Methods and Tools for
Software Development
– Requirements - MSC
– SAD - State
–
–
–
Charts/UML/SDL
Coding - SDL, C, C++, Java <AUTO CODE >
Unit and Integration Testing - Simulation & Validation
System Testing - TTCN/SDL
SAM-2000
4
28/JUNE/2000
Motorola India Electronics Ltd..
Auto Code Generation from SDL
SDL
Code
SDL
Code
Manual C Code + env
SDT Auto
Code Tool
H2SDL
C
Headers
C Compiler
Run Time Library
Executable
Simulation, Validation, UNIX, NT, pSOS, VxWorks etc..
SAM-2000
5
Gen. code
28/JUNE/2000
Motorola India Electronics Ltd..
SDL Usage Perspectives
• Design Language
• Implementation Methodology
– Infrastructure
– Handsets?
• Test Development Language
– Strong data features
– Better tool support compared to TTCN tools
SAM-2000
6
28/JUNE/2000
Motorola India Electronics Ltd..
Range of Benefits Observed
•
•
•
•
•
Cycle Time Improvement: 1.2 to 2X
Productivity: 1.2 to 2X
Effort Reduction: 1.2 to 2X
Quality: 2 to 5X
Performance: PROBLEMS NOT NOTICED
SAM-2000
7
28/JUNE/2000
Motorola India Electronics Ltd..
SAM-2000
8
28/JUNE/2000
Motorola India Electronics Ltd..
Pilot Project Architecture
Application Interface
Network Management Layer
Transport Layer
Sessions Layer
Network Layer
Driver Interface
SAM-2000
9
28/JUNE/2000
Motorola India Electronics Ltd..
Pilot Project
• EIA 709.1 Control Network Protocol
• Network Management Layer
– Provides services to the application
– Uses either Transport layer or Session layer
• Session Layer
– Provides session services
• Transport layer
– Acknowledged/Un-acknowledged repeat data transfer
• Network layer
– Interacts with the driver
• Driver
– send and receive messages
SAM-2000
10
28/JUNE/2000
Motorola India Electronics Ltd..
SDL Architecture
Application
Interface
Network
Management
Process
Controller
Controller
Transmit side
(SL, TL)
Controller
Network
Layer
Driver
Interface
SAM-2000
11
28/JUNE/2000
Receive
Side (SL,
TL)
Motorola India Electronics Ltd..
Features of the Architecture
• Layer independent architecture
• Adaptable to any changes
• Cadvanced Code Generator (Telelogic
Tau)
• < 1 year project
SAM-2000
12
28/JUNE/2000
Motorola India Electronics Ltd..
Pilot Results
Attribute
Cycle time
No of Errors
Object Code
Effort
Performance
Estimated
Value
1
1
1
1
SAM-2000
13
Actual
Value
1.44X
2.82X
2.62X
1.3X
Met the
requirem
ent
28/JUNE/2000
Motorola India Electronics Ltd..
Observations ….
• Simulation based testing has been proved
very effective
–
–
–
–
Less than average of the organization
Script language
Real Time Simulation
Traces
• Automatic support of targeting for
Windows, pSOS etc.
• Significantly impacted customer
satisfaction
SAM-2000
14
28/JUNE/2000
Motorola India Electronics Ltd..
Problems ...
• Code Size??????
– 3X
• System Testing
– Interpreted the AUTO CODE
– Less productive
SAM-2000
15
28/JUNE/2000
Motorola India Electronics Ltd..
Reasons for Code Bloat
• Architecture
– Too Modular
– Layer independent
• Tool translation of SDL support functions
–
–
–
–
Assignment, Equality etc.
StructVari := StructVar2
if(StructVari = StructVar2)
Overhead is ~400 bytes per structure
• Translation of Header files to C code
– Hdr.h >>> GenHdr.c
SAM-2000
16
28/JUNE/2000
Motorola India Electronics Ltd..
Optimization Results on one layer
Version Type X factor with
Manual Code
Before
2.97X
Optimization
After
1.34X
Optimization
SAM-2000
17
28/JUNE/2000
Motorola India Electronics Ltd..
Optimization Features
• C code mix is increased to 65%
• Pointers are used
• Negative impact on Productivity and
Quality
– Effort increased to locate the error
SAM-2000
18
28/JUNE/2000
Motorola India Electronics Ltd..
Plans After Pilot
• Used in Infrastructure projects
– Results are encouraging
– Code size is not CRITICAL
• Handsets?????
SAM-2000
19
28/JUNE/2000
Motorola India Electronics Ltd..
Further study
• Try new tools
– Cmicro Code generator
– Proprietary generator
• Optimize with the help of the vendors
– Excellent help
SAM-2000
20
28/JUNE/2000
Motorola India Electronics Ltd..
Optimization Results (UNIX)
Size
KB
in Manu Cadvanc Cmicro
al
ed
X factor
Xfactor
Before
Optimiza
tion
1.93X
1.5X
1X
After
Optimiza
tion
1.34X
0.96X
SAM-2000
21
28/JUNE/2000
Motorola India Electronics Ltd..
Optimization Results (UNIX) [contd..]
Case1
Case 2
CAdvanced Cmicro
29.5
11.6
55
23.2
Case 3 (NO Opt)
Case 4(Opt)
181
126
SAM-2000
22
140.5
90
28/JUNE/2000
Motorola India Electronics Ltd..
Auto Code Generation from SDL (Optimization)
SDL
Code
SDL
Code
H2SDL
C
Headers
SDT Auto
Code Tool
SCRIPTS
Gen. code
C Compiler
(Optimiza
tion)
Run Time Library
Executable
Simulation, Validation, UNIX, NT, pSOS, VxWorks etc..
SAM-2000
23
Manual C Code + env
28/JUNE/2000
Motorola India Electronics Ltd..
Optimization of Code
• Data Types defined only in SDL
• NON OO
• Minimize C Code Integration
– Through common types between SDL and C (Octet = Unsigned
Char)
• Scripts
– Script to convert C constants to SDL macros
– Script to convert STRUCTURES to ADTs
• Compilation Switches for Optimization
– XNOUSEOFREAL,
XNOUSEOFOBJECTIDENTIFIER etc.
SAM-2000
24
28/JUNE/2000
Motorola India Electronics Ltd..
Size of Utility Functions
• Default Functions
Size: 16 Type: FUNC yDef_zF_MyStruct1
Size: 16 Type: FUNC yDef_zG_MyStruct5
• Equal Functions
Size: 192 Type: FUNC yEq_zF_MyStruct1
Size: 192 Type: FUNC yEq_zG_MyStruct5
• Make Functions
Size: 152 Type: FUNC yMake_zF_MyStruct1
Size: 152 Type: FUNC yMake_zG_MyStruct5
SAM-2000
25
28/JUNE/2000
Motorola India Electronics Ltd..
After Optimization
newtype MyStruct1 struct
a1, a2, a3, a4, a5 Integer;
/*#ADT(E(H) D(H) K(H) H)
#TYPE
#define yDef_#(MyStruct1)(yVar)
#define yMake_#(MyStruct1)(yVar1, yVar2)
#define yEq_#(MyStruct1) (E1, E2)*/
endnewtype;
SAM-2000
26
28/JUNE/2000
Motorola India Electronics Ltd..
Size analysis command
• Usage
$> nm -f <exec_file_name>
• Displays Type, Size etc. of all symbols
NOTYPE
no type was specified
OBJECT
a data object such as an array or variable in
bytes
FUNC
SECTION
FILE
a function or other executable code in bytes
a section symbol
name of the source file.
SAM-2000
27
28/JUNE/2000
Motorola India Electronics Ltd..
SAM-2000
28
28/JUNE/2000
Motorola India Electronics Ltd..
No Wider Acceptance??
• Not Part of Curriculum
– Industry has to invest
• Technical
– Performance and Code Size issues
– Debugging the generated code (off site and onsite)
– Performance, Code Size VS READABILITY of SDL
• Customer Related
– Cost of the tools
– Lack of familiarity and Expertise
– Risk of failure
SAM-2000
29
28/JUNE/2000
Motorola India Electronics Ltd..
100% Real time Software
Development with SDL
Methodology
SAM-2000
30
28/JUNE/2000
Motorola India Electronics Ltd..
• Effective Algorithms for mapping SDL
code to implementation language
• Effective Approaches to handle on-site
testing
SAM-2000
31
28/JUNE/2000
Motorola India Electronics Ltd..
• SDL is a Methodology but only tool for
auto code
• Positive impact on Cycle Time, Quality
and Productivity
• Code Size Overheads could be brought
down with a few restrictions in SDL
• Needs improvement for 100% usage
SAM-2000
32
28/JUNE/2000
Motorola India Electronics Ltd..
• Questions????
SAM-2000
33
28/JUNE/2000
Motorola India Electronics Ltd..
Bhaskar Rao.G
Motorola India Electronics Ltd.,
SE Group,
Banglore, India- 560 042
[email protected]
SAM-2000
34
28/JUNE/2000