摘要
基于模型的开发(Model Based Development,MBD)在现代汽车电控领域有着广泛的应用。MATLAB/Simulink软件作为策略开发和自动代码生成工具也得到了广泛的应用。发动机电子控制单元(ECU)开发时间比较早,已经积累了许多可靠性高的C源代码,在转入基于模型的开发后不可能遗弃这些资源,所以对新旧模式的整合就十分有必要。传统手写查表函数和内存管理函数可靠性高且形成产品规模,所以基于Embedded Coder开发相应的数据管理系统与之相匹配:将原有的数据类型定义移植到MATLAB环境下;创建查表模块库代替Simulink中的Lookup Table模块使之生成代码后能够调用原有的查表函数。结果证明所开发的数据管理系统能够很好地与传统手写代码相匹配,而传统的经验也有助于加快基于模型的开发速度。
Model based development( MBD) has been used in modern automotive electronic control field widely. As a strategy devel-opment and automatic code generation tool, MATLAB/Simulink software has also been used widely. Engine electronic control unit( ECU) development has a long history, and a lot of reliable C source code has been accumulated. We couldn ′ t abandon these resources while in the model-based development, so the integration of old and new mode is necessary. Since the traditional hand-written look-up table functions and memory management functions have high reliability and a product level, this article develops the corresponding data management system to match it based on the Embedded Coder. The original data type definition has been imported in to the MATLAB environment. Instead of Lookup Table module in Simulink, a new lookup module library has been cre-ated which can generate code to call the original hand-written lookup table function. The result shows that the developed data management system can match the traditional hand-written code well, and the traditional experience also helps to speed up the model based development.
引文
[1]DILLABER E,KENDRICK L,JIN W,et al.Pragmatic strategies for adopting modelbased design for embedded applications[J].SAE Technical Paper,2010,2010-01-0935.
[2]HODGE G,YE J,STUART W.Multi-target modeling for embedded software development for automotive applications[J].SAE Technical Paper,2004,2004-01-0269.
[3]The Math Works Inc.Embedded Coder reference[Z].2015.
[4]ERKKINEN T.Fixed-point ECU development with model-based design[J].SAE Technical Paper,2008,2008-01-0744.
[5]REDDY V,NADARAJAH S,BEALS G.Tips for fixed-point modeling and code generation for simulink[EB/OL].[2017-10 -23].http://cn.mathworks.com/matlabcentral/fileexchange/7197-tips-for-fixed-point-modeling-and-code-generation-for-simulink-6.