Mitsugu Inoue
Engineer

Limitations of traditional software development methods

  • Software becomes huge and changes in development method

Automotive software becomes huge day by day, traditional software development cannot support it. For example, engine control, fine control which support fuel economy improvement and exhaust gas regulations are required higher performance and higher efficiency year by year. To realize it, code size is increasing accelerated. Attention is focused on Model Based Development Instead of traditional software development because it is necessary to reduce development man-power, increase reuse and development accuracy.

  • Model Based Development

Model Based Development is mathematically model the development target, repeats simulating the model, it is a method to make a control and system. It is spreading rapidly in automotive development software.
In Model Based Development, it is possible to immediately verify the designed model, it is possible to prevent development backtracking which was an issue.

In Model Based Development, simulate the model which is modeled the control and plant. Simulating the model is called Model in the Loop Simulation (MILS). At the beginning of design, it is possible to verify system by MILS.

Image
Inoue_blog_fig_1

In verifying this model, confirm that the results of the simulation using the code which is generated from the model and the result of simulating the model are same, confirm the generated code is correct. This test is called Back-to-Back test.

Execute the generated code on the processor such as MCU, co-simulate between the model and processor, it is possible to verify the algorism. Co-simulation by plant model and processor is called Processor in the Loop Simulation (PILS).

Image
Inoue_blog_fig_2

How to execute the code which is generated by model on the processor easily?

Even if introduce the Model Based Development, generate the code from the made model, do the Back-to-Back test, manual work takes a lot of time to build the code, execute it on the MCU, set the debugger and co-simulate. And even if construct the environment, it is not easy to confirm the behavior and analyze the performance.

Embedded Target for RH850 Multicore can generate the code which is possible to run on the MCU by communicating with Embedded Coder ® released by Mathworks, build the code and download it to debugger, connect the model and debugger, it is possible to do PILS by co-simulate.

  • What is the Embedded Target for RH850 Multicore?

It is the development tool to construct the environment to do PILS at the RH850. Embedded Target for RH850 Multicore has below functions, it is possible to construct the environment automatically.

-    Automatic generation for RH850 project file for Renesas Integrated Development Environment CS+(*1).
-    Code generation from Simulink ® model by Embedded Coder.
-    Adding source code file to CS+ project file.
-    Setting build tool
-    Setting debug tool
-    Executing debug tool
-    Connecting Simulink and debug tool (supporting Cycle accurate simulator(*2) or evaluation board)


After connecting Simulink and debugger, it is possible to do PILS with MCU by Simulink simulating. Confirm the result of PILS and result of MILS are same on Back-to-Back test.

*1 https://www.renesas.com/cs+
*2 https://www.renesas.com/rh850-cycle-accurate-sim

  • Single core PILS and analysis block performance 

Embedded Target for RH850 Multicore can analyze the performance of subsystem block unit in the model by using cycle accurate simulator or evaluation board. It is a unique function of Embedded Target for RH850 that other companies do not have.
At first, convert the model for analysis performance of block. Select the measurement target block with the dedicated GUI, them convert the model.

Image
Inoue_blog_fig_3

Generate the code from converted the model for analysis performance of block. It is possible to analysis performance of block by doing PILS. It is possible to confirm the result of each block performance by graph visually

Image
Inoue_blog_fig_4

This explanation is for Single core but latest almost RH850 is multicore therefore software also needs to support multicore.
In case of using multicore, if software which is executed on single core not changed to execute it, performance does not improve because behavior is same as single core. To improve the performance by executing multicore efficiently, it is necessary to parallel the software. Parallelization is described in next chapter.

How to execute the code which was generated from the model easily on multicore MCU?

To execute the software on multicore, it is necessary to parallel the software for multicore can execute software at same time. After parallelized the software, it is necessary to add the synchronous processing for multicore to be able to execute it the correct order, it is necessary to add the exclusion control for multicore to not access the common resources at the same time. It is very difficult to parallel the software with these in mind.
Expected performance may not be got because over head of synchronous processing and exclusion control are large although execute the software which was paralleled with difficulty.
On Embedded Target for RH850 Multicore, by parallelizing the model and generating the code from the paralleled model it is possible to generate the code which can execute on multicore.

  • Parallel the model for multicore

It is possible to get the execution time of block by result of analysis performance of block. Consider the core allocation of the block base on the information.
Core allocation is assigning the core each block with the dedicated GUI, then convert the model.
By this allocation, it is possible to convert model for multicore.

Image
Inoue_blog_fig_5

Allocating green and blue blocks to the different cores

  • Back-to-Back test by multicore PILS

It is possible to do PILS with multicore MCU by generated code. It is possible to do Back-to-Back test by comparing the result of PILS and result of MILS.

  • Analysis performance of multicore and validation optimized multicore parallelization

It is possible to analysis performance of block on multicore same as on single core. It is possible to confirm the result of each block performance by graph visually.

To be short the total execution time compare with the above figure result, repeat considering the validation by multicore PILS, consider the optimized multicore allocation. 

Image
Inoue_blog_fig_6

Explain the Model Based Development which supports both single core and multicore. Renesas Electronics continues maintenance the Model Based Development Environment.

Embedded Target for RH850 Multicore + Multirate, a higher-end version of Embedded Target for RH850 Multicore support the model which has some control rate (It is called Multi rate model at Model Based Development). Please visit Embedded Target for RH850 Multicore page (here) for more detail and also the supporting multi rate.
 

Log in or register to post comments