This content is not included in
your SAE MOBILUS subscription, or you are not logged in.
Efficient Method for Modeling and Code Generation of Custom Functions
Technical Paper
2011-01-0055
ISSN: 0148-7191, e-ISSN: 2688-3627
Annotation ability available
Sector:
Language:
English
Abstract
Custom functions are widely used in real-time embedded automotive applications to conserve scarce processor resources. Typical examples include mathematical functions, filtering routines and lookup tables. The custom routines are very efficient and have been in production for many years [
1
]. These hand-crafted functions can be reused in new control algorithm designs being developed using Model Based Design (MBD) tools.
The next generation of vehicle control software may contain a mix of both automatically generated software and manually developed code. At Ford Motor Company, the code is automatically generated from control algorithm models that are developed using The MathWorks tool chain. Depending on the project-specific needs, the control algorithm models are automatically translated to efficient C code using either The Math Works Real-Time Workshop Embedded Coder (RTW-EC) or dSPACE TargetLink production code generators. The production software can therefore contain a mix of hand code and code that has been automatically generated from one or both code generators. It would be cost-effective to reuse the same set of custom routines for the commonly used functions.
Two different methods were proposed to model and automatically generate efficient code for lookup tables with custom data structures [
1
]. However, several limitations can be encountered while deploying them for wider user base, different code generators or custom functions with complicated input attributes. A new method is proposed that provides all the capabilities of previously proposed methods. Additionally, the model building blocks developed with the new method allow the control algorithm models to be automatically translated into production C code using either of the two code generators with minimal modifications while overcoming many of the challenges encountered while applying some of the earlier methods.
Recommended Content
Journal Article | Assembly Simulation of Riveting Process |
Technical Paper | Design for Product Quality |
Authors
Topic
Citation
Nallapa, V., Syed, F., Russell, J., Banker, A. et al., "Efficient Method for Modeling and Code Generation of Custom Functions," SAE Technical Paper 2011-01-0055, 2011, https://doi.org/10.4271/2011-01-0055.Also In
References
- Nallapa, V.R. Syed, F. Russell, J. Hoadley, D. et al. “Methods for Modeling and Code Generation for Custom Lookup Tables,” SAE Technical Paper 2010-01-0941 2010 10.4271/2010-01-0941
- Badreddine, B. Murphy, K. Nallapa, R. Syed, F. et al. “Modeling & Code Generation for Powertrain Control Monitoring,” SAE Technical Paper 2010-01-0206 2010 10.4271/2010-01-0206
- Syed, F. Nallapa, R. Grand, K. Ramaswamy, D. “Integrated Modeling Environment for Detailed Algorithm Design, Simulation and Code Generation,” SAE Technical Paper 2007-01-0274 2007 10.4271/2007-01-0274
- Syed, F. Nallapa, R. Jiang, F. Semenov, S. “Automated Migration of Legacy Functions and Algorithms to Model Based Design,” SAE Technical Paper 2008-01-0747 2008 10.4271/2008-01-0747
- Wartnaby, C.E. Bennett, S.M. Ellims, M. Raju, R.R. et al. “Auto-Generated Production Code Development for Ford/Think Fuel Cell Vehicle Programme,” SAE Technical Paper 2003-01-0863 2003 10.4271/2003-01-0863