Rebuilding a part of the model only

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

Rebuilding a part of the model only

316 Views
Ahmed_Abd_El-Hafez
Contributor III

Hello NXP team,

When I modify some points in the Model [Model based design for using FOC to control a PMSM for example] and build it to download on the target board, is it necessary to rebuild  the whole model or there is a capability of rebuilding the modified blocks or subsystem only and include it in the last generated code to reduce the code generation time? if there is, how? 

Thank you in advance

Best Regards

Ahmed 

0 Kudos
Reply
3 Replies

270 Views
brianmckay
Contributor III

Hi Ahmed,

Disclaimer: I'm not an expert on the details of code generation; so for deep questions you can contact MathWorks Tech Support.

A couple points:
1) MathWorks Code generation is great for embedded systems and deployment. 1000's of customers do this every day. The phone in your pocket, the satellite it connects to in orbit, the rocket that put the satellite there, and car or train you rode in today; all of them likely are running MathWorks generated code. The Mars Rover (still running around on Mars) is running MathWorks generated code in an embedded system.

2) You are looking for code generation speed up. Here's an article on this topic: Increase Code Generation Speed

3) One of the methods is to use incremental builds. This is what I was referring to above. When enabled, the code generator looks at your model, see what has changed, and only rebuilds what it needs to. However in the case where you are connecting to NXP hardware, the changes you make may force a larger code rebuild because numerous things have changed in the model (that you may not be able to see directly). There are ways to shortcut and force faster code generation - but for every shortcut, you might also be reducing the performance of the code. Personally, I'd just let the code generation do what it needs to do and have  a coffee/tea if it takes a few minutes. If it is a massive issue - open up a help ticket with MathWorks - there might be ways to restructure your model to make code generation more efficient

Cheers,

-Brian

 

294 Views
brianmckay
Contributor III

Hi Ahmed,

This is often controlled by the MathWorks code generation. The MathWorks coder tools look at the model and determines what has changed and needs to be generated new. In an embedded system we are trying to generate lean code for performance and memory footprint reasons, so the changes may force a substantial amount of the model to generate fresh code - this is always safer, but as you note, slower.

Cheers,

-Brian

281 Views
Ahmed_Abd_El-Hafez
Contributor III

Hi Brian,

Thank you for fast replaying.

You mean that this option is available in Mathworks Code generation but it is not safer in embedded system or it is not available? please clarify this point and how can I do this where it is available?

Thanks

Ahmed

0 Kudos
Reply