migrating embedded systems from assembler to c using the fermat transformation system

21
Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Upload: jason

Post on 29-Jan-2016

25 views

Category:

Documents


2 download

DESCRIPTION

Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System. Pigs from Sausages?. Extracting the logic and business rules from evolved legacy systems Automatically migrate them to a new High Level Language Re-host them. Why bother?. Increased Speed/Capacity - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Migrating Embedded Systems from Assembler to C Using the Fermat

Transformation System

Page 2: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Pigs from Sausages?

• Extracting the logic and business rules from evolved legacy systems

• Automatically migrate them to a new High Level Language

• Re-host them

Page 3: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Why bother?

• Increased Speed/Capacity• Better Price/Performance• Larger, more complex systems• Cost per function point:

– Assembler: £48.00– PL/1: £39.00– C: £21.00

• Pressure to Migrate to HLL

Page 4: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Case Study – Tenovis Gmbh & Co.

• Specialists in Convergent Networking

• 200,000 Clients• 6000 Employees• Revenues over 950

million euros

Page 5: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Tenovis Challenge

• Private Branch eXchange (PBX) system• Four Hardware Platforms• Installed in 18 countries• 800,000 lines of C• 544,000 lines of 186 assembler in 318

source files• Problems:

– Backlog of enhancements– Availability and functionality of the processor

Page 6: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

SML’s Challenge

• To migrate the assembler to high-level structured, maintainable C code suitable for porting to more modern processor and also suitable for implementing the backlog of enhancements.

• The migrated code should meet the coding standards used within the existing C code.

Page 7: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

FermaT Transformation System

• Nearly 20 years research and development (> 120 man years)

• Core technology research @ Oxford and Durham University

• Migration projects to validate this research funded by IBM, CAA & DTI

• Used extensively in Y2K projects• FermaT Workbench• Transformation System

Page 8: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Fermat Architecture

Page 9: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

What is WSL

• Wide Spectrum Language– From low-level constructs to high-level

abstract specifications– Unique transform capability

• Fermat product set is implemented in MetaWSL

• WSL is now in the Public Domain under a GUL licence

Page 10: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Case Study – Phase 1

• Migration of a single 3,000 line source file– Develop a 186 to WSL parser– Modify the existing WSL to C parser– Implement 186-specific WSL

transformations

Page 11: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Case Study – Phase 2

• Mini Call Control– Self contained subsystem– 67,000 lines of assembler – 41 source files

Page 12: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Phase 2 - Requirements

• Use existing C header files where available• Use of the “function parameter table”• Translate selected subroutines directly to HLL

code• Translate bitfield operations into C record fields• Eliminate stack usage where possible• Detect jump tables and generate appropriate

switch statements• Generate switch statements instead of nested if

statements• Can ignore segment addressing for this

application

Page 13: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Phase 2 - Process

• 5 iterations of the Mini Call Control

• Customer feedback on each iteration

• Update the parsers or transformations

• Regenerate the C code automatically

• Final iteration C code was compiled installed and tested

Page 14: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Final Migration

• 2.6Ghz PC with 512Mb of RAM• All 318 source files processed in 1.5 hours• 1,436,031 transformations:

– 4,500 transformations per source file– 275 transformations per second

• Largest source file was 8,348 lines– 73,393 transformations– 370 seconds CPU time– 42Mb RAM

• 506,672 lines of C code plus 37,047 lines of header files generated

Page 15: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Results

• At least 6 bugs were discovered in the system via the migration process

• “Hey, this really looks like C!”

• Test environment: “soft switch” between C and Assembler Versions on a PC linked to the hardware.

Page 16: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Cost Savings

• Estimate for Manual translation: 67 man months• Actual customer effort for automated translation:

• SML’s actual effort 52 man days• Less than 10% of manual effort• Larger systems will achieve even greater savings

Page 17: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Advantages of Automated Reengineering

• Scalability• Rapid turnaround of the subsystem• Customisability• Low resource requirements• Low Impact on ongoing development• Enables porting to different hardware

and/or software platform• Removes dependence on limited resources

Page 18: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Conclusion

• Assembler to C using the FermaT Migration System and Workbench is a practical solution to the high costs and skills shortage in assembler maintenance and to the problem of migrating legacy assembler systems to a more modern platform.

Page 19: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

The future for Fermat

• Currently assembler to C and COBOL

• Pascal to C

• Assembler/Pascal to C

• Output to Java

• Joint 3 year research project with DeMontfort University to extend the use of WSL and Fermat

Page 20: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Further Resources

www.artechhouse.com

Page 21: Migrating Embedded Systems from Assembler to C Using the Fermat Transformation System

Further Resources

• The Fermat Transformation System is available under GNU GPL (General Public Licence)

• www.dur.ac.uk/~dcs0mpw/fermat.html

• www.cse.dmu.ac.uk/~mward/fermat.html