Outport affect to the CPU usage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Outport affect to the CPU usage

Jump to solution
541 Views
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

 

 

Tags (3)
0 Kudos
1 Solution
480 Views
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.

 

View solution in original post

0 Kudos
2 Replies
481 Views
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 Kudos
467 Views
aslan_eyyup
Contributor II

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

Best wishes. 

0 Kudos