Outport affect to the CPU usage

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Outport affect to the CPU usage

跳至解决方案
560 次查看
aslan_eyyup
Contributor II

For the simscape battery SOC estimation example, when using the outport for SOC monitoring in the PIL block with MPC5775E, the CPU usage is ~0.153%. But When I terminate it and don't monitor the SOC, CPU usage from PIL block becomes ~0.000208%. In this case I am not sure if the algorithm works without outport but I am wondering about your comments. Thanks.

aslan_eyyup_0-1678287848465.png

aslan_eyyup_1-1678287884771.png

 

 

标记 (3)
0 项奖励
1 解答
499 次查看
stefancinipeanu
NXP Employee
NXP Employee

Hi @aslan_eyyup 

The reason why CPU usage drops from 0.15% to 0.002% is because Simulink Coder optimizes the generated code. In this matter, when in PIL mode, if you terminate the model inside the PIL subsystem, the code corresponding to your model will not be generated and so the CPU has nothing to execute.

In the attached picture, you can see the differences between PIL subsystem generated code when using the output port and when using the terminator. When using the terminator, the code for the SOC Kalman Filter is not generated due to Simulink optimizations.

stefancinipeanu_0-1679565990600.png

Hope this helps!

Regards,

Stefan.

 

在原帖中查看解决方案

0 项奖励
2 回复数
500 次查看
stefancinipeanu
NXP Employee
NXP Employee

Hi @aslan_eyyup 

The reason why CPU usage drops from 0.15% to 0.002% is because Simulink Coder optimizes the generated code. In this matter, when in PIL mode, if you terminate the model inside the PIL subsystem, the code corresponding to your model will not be generated and so the CPU has nothing to execute.

In the attached picture, you can see the differences between PIL subsystem generated code when using the output port and when using the terminator. When using the terminator, the code for the SOC Kalman Filter is not generated due to Simulink optimizations.

stefancinipeanu_0-1679565990600.png

Hope this helps!

Regards,

Stefan.

 

0 项奖励
486 次查看
aslan_eyyup
Contributor II

Thank you for the detailed explanation, this information will help to me. 

Best wishes. 

0 项奖励