Using lax_codegen with enable dynamic memory allocation

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

Using lax_codegen with enable dynamic memory allocation

Jump to solution
147 Views
OPSofiane
Contributor II

Hello to the mbd community

I am currently exploring the NXP_MBDToolbox_LAX. The code generated by lax_codegen is based on static allocation. I'd like to manage large vectors, how do I enable dynamic memory allocation with LAX_CODEGEN?

Thank you in advance.

Best regards,

OPSofiane

0 Kudos
1 Solution
110 Views
paulvlase
NXP Employee
NXP Employee

Hello @OPSofiane ,

 

All vectors/matrices in the LAX graph are statically allocated. It would be difficult, maybe impossible, to implement dynamic allocation from the MATLAB code. Could you tell as the approximate size of your vectors?

If your algorithm allows you can execute multiple times the LAX graph on chunks of your vectors. Another option, not supported in our toolbox but it is in the Radar SDK, is to use DMA inside the LAX graph to transfer chunks of matrices/vector and process them. Check my answer also to your previous question posted here:https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/SER45-LAX-memory/m-p/1878230#M9150

 

Regards,

Paul

View solution in original post

0 Kudos
2 Replies
92 Views
OPSofiane
Contributor II

Hello @paul,

Here is an example of multiplication of two matrices: A(9216x600) and B(600 X1024). the block matrix multiplication can be a solution however I need to reduce the time transfere to and from Lax. Regarding DMA, I need an example to understand and follow its application.

Best regards,

@OPSofiane

0 Kudos
111 Views
paulvlase
NXP Employee
NXP Employee

Hello @OPSofiane ,

 

All vectors/matrices in the LAX graph are statically allocated. It would be difficult, maybe impossible, to implement dynamic allocation from the MATLAB code. Could you tell as the approximate size of your vectors?

If your algorithm allows you can execute multiple times the LAX graph on chunks of your vectors. Another option, not supported in our toolbox but it is in the Radar SDK, is to use DMA inside the LAX graph to transfer chunks of matrices/vector and process them. Check my answer also to your previous question posted here:https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/SER45-LAX-memory/m-p/1878230#M9150

 

Regards,

Paul

0 Kudos