using a dpigen with a mexfile inside it

7 ビュー (過去 30 日間)
nadav
nadav 2025 年 1 月 1 日
コメント済み: nadav 2025 年 1 月 5 日
hi
i am trying to generate a dpi-c with the matlab dpigen.
inside my code i have a matlab interface that he came from vivado model c. for simulation the ip code of an fft.
when i am trying to create the dpi, i am getting the following error:
Function call resolved to MEX file 'C:\CMODEL_FFT\xfft_v9_1_bitacc_mex.mexw64'. Only MATLAB files are
supported for code generation. Consider using coder.extrinsic to declare MEX function as extrinsic.
how can i create the dpi with this mex file inside the matlab code?
or how can i over come this error?

回答 (1 件)

praguna manvi
praguna manvi 2025 年 1 月 2 日
Hi @nadav,
I see that you are looking to include external C/C++ function calls compiled as a MEX file for standalone code generation using "dpigen". To include these calls in code generation, you can consider using "coder.ceval", which calls the C/C++ function specified in "functionName" from the generated code. For more information, refer to:
To understand more about when code generation is unsupported with "coder.extrinsic", refer to this useful discussion thread:
Hope this helps!
  1 件のコメント
nadav
nadav 2025 年 1 月 5 日
thank you for your help.
when i try to use the coder.ceval, the ouput of the c file is a struct that i dont know how to approach the field inside.
meaning out.overflow for example does not work with the dpigen?
i know the fields of the struct, but i can't access them after calling coder.ceval.
can you please help and tell me if you know how can i get the field in the struct?

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by