Using lax_codegen with enable dynamic memory allocation

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

Using lax_codegen with enable dynamic memory allocation

跳至解决方案
511 次查看
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 项奖励
回复
1 解答
474 次查看
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 项奖励
回复
2 回复数
456 次查看
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 项奖励
回复
475 次查看
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 项奖励
回复