simulink generate C code using target "systemverilog_dpi_grt.tlc" problem
6 views (last 30 days)
Show older comments
my simulink bulid name is sim_test
when generate code using target "systemverilog_dpi_grt.tlc" meet following problem
Specified export DPI_sim_test_output is not defined
Specified export DPI_sim_test_reset is not defined
Specified export DPI_sim_test_update is not defined
Missing exports. Aborting gmake: ***
[C:/Users/user/DOCUME~1/MATLAB/Examples/R2022b/sdadc/SIM_TE~3/sim_test_win64.dll] Error 1
log message as follow :
### Writing header file sim_test_private.h ### Writing header file rtmodel.h ### TLC code generation complete (took 1.462s). ### Starting SystemVerilog DPI Component Generation
Existing traceability information was replaced for file 'sim_test.h'.
Component:Simulink | Category:Model warning
### Creating HTML report file index.html### Saving binary information cache. ### Generating DPI H Wrapper sim_test_dpi.h### Generating DPI C Wrapper sim_test_dpi.c### Generating SystemVerilog module package sim_test_dpi_pkg.sv### Generating SystemVerilog module sim_test_dpi.sv### Generating makefiles for: sim_test_dpi ### Invoking make to build the DPI Shared Library ### Using toolchain: LCC-win64 v2.4.1 | gmake (64-bit Windows) ### 'C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build\sim_test.mk' is up to date ### Building 'sim_test_win64': "D:\01_tools\matlab\bin\win64\gmake" -f sim_test.mk all C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build>set MATLAB=D:\01_tools\matlab C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build>cd . C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build>if "all" == "" ("D:\01_tools\matlab\bin\win64\gmake" -f sim_test.mk all ) else ("D:\01_tools\matlab\bin\win64\gmake" -f sim_test.mk all ) "D:/01_tools/matlab/sys/lcc64/lcc64/bin/lcc64" -c -w -noregistrylookup -nodeclspec -ID:/01_tools/matlab/sys/lcc64/lcc64/include64 -g -DRT -DUSE_RTMODEL -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=1 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=1 -DINTEGER_CODE=0 -DMT=0 -DRT_MALLOC -DTID01EQ=0 -DMODEL=sim_test -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/user/Documents/MATLAB/Examples/R2022b/sdadc -IC:/Users/user/Documents/MATLAB/Examples/R2022b/sdadc/sim_test_build -ID:/01_tools/matlab/extern/include -ID:/01_tools/matlab/simulink/include -ID:/01_tools/matlab/rtw/c/src -Fo"rt_i32zcfcn.obj" "C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build\rt_i32zcfcn.c" "D:/01_tools/matlab/sys/lcc64/lcc64/bin/lcc64" -c -w -noregistrylookup -nodeclspec -ID:/01_tools/matlab/sys/lcc64/lcc64/include64 -g -DRT -DUSE_RTMODEL -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=1 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=1 -DINTEGER_CODE=0 -DMT=0 -DRT_MALLOC -DTID01EQ=0 -DMODEL=sim_test -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/user/Documents/MATLAB/Examples/R2022b/sdadc -IC:/Users/user/Documents/MATLAB/Examples/R2022b/sdadc/sim_test_build -ID:/01_tools/matlab/extern/include -ID:/01_tools/matlab/simulink/include -ID:/01_tools/matlab/rtw/c/src -Fo"sim_test.obj" "C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build\sim_test.c" "D:/01_tools/matlab/sys/lcc64/lcc64/bin/lcc64" -c -w -noregistrylookup -nodeclspec -ID:/01_tools/matlab/sys/lcc64/lcc64/include64 -g -DRT -DUSE_RTMODEL -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=1 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=1 -DINTEGER_CODE=0 -DMT=0 -DRT_MALLOC -DTID01EQ=0 -DMODEL=sim_test -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/user/Documents/MATLAB/Examples/R2022b/sdadc -IC:/Users/user/Documents/MATLAB/Examples/R2022b/sdadc/sim_test_build -ID:/01_tools/matlab/extern/include -ID:/01_tools/matlab/simulink/include -ID:/01_tools/matlab/rtw/c/src -Fo"sim_test_capi.obj" "C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build\sim_test_capi.c" "D:/01_tools/matlab/sys/lcc64/lcc64/bin/lcc64" -c -w -noregistrylookup -nodeclspec -ID:/01_tools/matlab/sys/lcc64/lcc64/include64 -g -DRT -DUSE_RTMODEL -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=1 -DONESTEPFCN=0 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=1 -DINTEGER_CODE=0 -DMT=0 -DRT_MALLOC -DTID01EQ=0 -DMODEL=sim_test -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/user/Documents/MATLAB/Examples/R2022b/sdadc -IC:/Users/user/Documents/MATLAB/Examples/R2022b/sdadc/sim_test_build -ID:/01_tools/matlab/extern/include -ID:/01_tools/matlab/simulink/include -ID:/01_tools/matlab/rtw/c/src -Fo"sim_test_dpi.obj" "C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build\sim_test_dpi.c" "### Creating shared library "C:/Users/user/DOCUME~1/MATLAB/Examples/R2022b/sdadc/SIM_TE~3/sim_test_win64.dll" ..." "D:/01_tools/matlab/sys/lcc64/lcc64/bin/lcclnk64" -dll -entry LibMain -s -LD:/01_tools/matlab/sys/lcc64/lcc64/lib64 sim_test.def -o C:/Users/user/DOCUME~1/MATLAB/Examples/R2022b/sdadc/SIM_TE~3/sim_test_win64.dll @sim_test.rsp Specified export DPI_sim_test_output is not defined Specified export DPI_sim_test_reset is not defined Specified export DPI_sim_test_update is not defined Missing exports. Aborting gmake: *** [C:/Users/user/DOCUME~1/MATLAB/Examples/R2022b/sdadc/SIM_TE~3/sim_test_win64.dll] Error 1 C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build>echo The make command returned an error of 2 The make command returned an error of 2 C:\Users\user\Documents\MATLAB\Examples\R2022b\sdadc\sim_test_build>exit /B 1 . ### Build procedure for model: 'sim_test' aborted due to an error.
Build Summary
Top model targets built: Model Action Rebuild Reason ==================================================================== sim_test Failed Code generation information file does not exist. 0 of 1 models built (0 models already up to date) Build duration: 0h 0m 7.6644s
Error(s) encountered while building "sim_test_win64"
Component:Simulink | Category:Block diagram error
0 Comments
Answers (1)
Vandit
on 6 Apr 2023
The error message you received suggests that there are missing DPI (Direct Programming Interface) exports in your Simulink model. To resolve this issue, you will need to define these exports in your Simulink model using the steps defined below:
1)On your Simulink model, go to “Model Configuration Parameters” dialog box by clicking "Simulation" in the menu bar and selecting "Model Configuration Parameters".
2)In the "Model Configuration Parameters" dialog box, select the "Code Generation" tab.
3)Under the “Code Generation section” click on the “Custom Code” tab.
4)In the “Custom Code” tab, locate the "DPI Function Declarations" section and define the missing exports.
You can learn more about DPI Component Generation with Simulink using the following link:
0 Comments
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!