Using lax_codegen with enable dynamic memory allocation

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

Using lax_codegen with enable dynamic memory allocation

跳至解决方案
860 次查看
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 解答
823 次查看
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 项奖励
回复
3 回复数
805 次查看
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 项奖励
回复
35 次查看
paulvlase
NXP Employee
NXP Employee

Hello @OPSofiane ,

 

We have released a new version of MBDT for LAX toolbox, now renamed to MBDT for RADAR v1.0.0, at the end of 2024. You can find the release announcement here: NXP Model-Based Design Toolbox for RADAR - version 1.0.0 - NXP Community

Based on your encountered problem we have included an example that multiplies large matrices, found in LAX_Examples\basic\multiplication\mul_large_matrix folder, and which also showcases how to transfer chunks of matrices via DMA.

It's been a while since our lost message, but if you are still interested in using our toolbox, please download the latest version of MBDT for RADAR toolbox and check our mul_large_matrix example.

 

Regards,

Paul

0 项奖励
回复
824 次查看
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 项奖励
回复