1 SAM-2000 28/JUNE/2000 Motorola India E lectronics 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].
Feb 02, 2016
1 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
SDL Based Auto Code Generation: A Multi Beneficial
Approach
Bhaskar Rao.GSoftware Engineering Group,Motorola India Electronics Ltd.Banglore, India - 560 042.email: [email protected].
2 SAM-2000 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.)
3 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
4 SAM-2000 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
5 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Auto Code Generation from SDL
SDT Auto Code Tool Gen. code C Compiler
Manual C Code + env
Run Time Library
SDL Code
Simulation, Validation, UNIX, NT, pSOS, VxWorks etc..C
Headers
SDL Code
H2SDL Executable
6 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
SDL Usage PerspectivesSDL Usage Perspectives
• Design Language• Implementation Methodology
– Infrastructure – Handsets?
• Test Development Language– Strong data features– Better tool support compared to TTCN tools
7 SAM-2000 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
8 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
9 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Pilot Project Architecture
Network Management Layer
Transport Layer Sessions Layer
Network Layer
Driver Interface
Application Interface
10 SAM-2000 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
11 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
SDL Architecture
Network Management Process
Transmit side (SL, TL)
Receive Side (SL, TL)
Network Layer
Driver Interface
Application Interface
Controller
ControllerController
12 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Features of the Architecture
• Layer independent architecture• Adaptable to any changes• Cadvanced Code Generator
(Telelogic Tau)• < 1 year project
13 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Attribute Estimated Value
Actual Value
Cycle time 1 1.44XNo of Errors 1 2.82XObject Code 1 2.62XEffort 1 1.3XPerformance Met the
requirement
Pilot Results
14 SAM-2000 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
15 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Problems ...
• Code Size??????– 3X
• System Testing– Interpreted the AUTO CODE– Less productive
16 SAM-2000 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
17 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Version Type X factor withManual Code
BeforeOptimization
2.97X
AfterOptimization
1.34X
Optimization Results on one layer
18 SAM-2000 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
19 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Plans After Pilot
• Used in Infrastructure projects– Results are encouraging– Code size is not CRITICAL
• Handsets?????
20 SAM-2000 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
21 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Optimization Results (UNIX)
Size inKB
Manual
CadvancedXfactor
CmicroX factor
BeforeOptimization
- 1.93X 1.5X
AfterOptimization
1X 1.34X 0.96X
22 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Optimization Results (UNIX)
[contd..]
CAdvanced CmicroCase1 29.5 11.6Case 2 55 23.2
Case 3 (NO Opt) 181 140.5Case 4(Opt) 126 90
23 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..Auto Code Generation from SDL
(Optimization)
SDT Auto Code Tool
Gen. code C Compiler
Manual C Code + env
Run Time Library
SDL Code
Simulation, Validation, UNIX, NT, pSOS, VxWorks etc..C
Headers
SDL Code
H2SDL Executable
SCRIPTS
(Optimization)
24 SAM-2000 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.
25 SAM-2000 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
26 SAM-2000 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;
27 SAM-2000 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 a function or other executable code in bytes
SECTION a section symbol
FILE name of the source file.
28 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
29 SAM-2000 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
30 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
100% Real time Software Development with SDL
Methodology
31 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
• Effective Algorithms for mapping SDL code to implementation language
• Effective Approaches to handle on-site testing
32 SAM-2000 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
33 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
• Questions????
34 SAM-2000 28/JUNE/2000
Motorola India Electronics Ltd..
Bhaskar Rao.GMotorola India Electronics Ltd.,SE Group,Banglore, India- 560 042