I am unable to compile and execute SystemC code generated from a Simulink model
Show older comments
I am following the stepos given in this example, https://www.mathworks.com/help/hdlverifier/ug/untimed-systemc-tlm-simulation.html
The code generation is successfull but when I click on "Verify TLM Component" in the Configuration Parameter window inside the TLM Testbench panel I get the following error,
### Starting component verification
### Checking available compiler.
### Building testbench and TLM component.
C:\Users\advaitthakre\Documents\SystemC\DualFilter_VP\DualFilter_uttb_tlm_tb>set "VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\"
C:\Users\advaitthakre\Documents\SystemC\DualFilter_VP\DualFilter_uttb_tlm_tb>set "VSCMD_START_DIR=C:\Users\advaitthakre\Documents\SystemC\DualFilter_VP\DualFilter_uttb_tlm_tb"
C:\Users\advaitthakre\Documents\SystemC\DualFilter_VP\DualFilter_uttb_tlm_tb>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\\..\..\VC\Auxiliary\Build\vcvarsall" x64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.58
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall] Environment initialized for: 'x64'
Microsoft (R) Program Maintenance Utility Version 14.16.27051.0
Copyright (C) Microsoft Corporation. All rights reserved.
nmake.exe /nologo /f makefile.mk all-am OPT_CXXFLAGS="/O2 /MT /D _NDEBUG" OPT_LDFLAGS=""
cd ..\DualFilter_uttb_tlm && nmake.exe /nologo /f makefile.mk all-am
cd ..\DualFilter && nmake.exe /nologo /f makefile.mk all-am
cl.exe /c /O2 /MT /D _NDEBUG /Fd".\obj\DualFilter_uttb_tlm.pdb" /D "RT" /D "USE_RTMODEL" /D "WIN64" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE" /I ".\include" /I "..\DualFilter\include" /I "..\DualFilter\utils" /I "" /I "" /D SC_INCLUDE_DYNAMIC_PROCESSES /nologo /FD /EHsc /W3 /TP /wd4244 /wd4267 /vmg /Foobj\DualFilter_uttb_tlm.obj src\DualFilter_uttb_tlm.cpp
cl : Command line error D8004 : '/I' requires an argument
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
10 Comments
Walter Roberson
on 15 Nov 2023
those two /I "" appear to be a problem.
Advait Thakre
on 15 Nov 2023
Edited: Advait Thakre
on 15 Nov 2023
Walter Roberson
on 15 Nov 2023
I would suspect that you have left two configuration fields empty but that the makefile is blindly putting in those two empty values instead of just leaving that part out.
Advait Thakre
on 15 Nov 2023
Advait Thakre
on 15 Nov 2023
Walter Roberson
on 15 Nov 2023
C:\Users\advaitthakre\Downloads\systemc-2.3.1\systemc-2.3.1\src\systemc.h(118): error C2039: 'gets': is not a member of 'std'
std::gets was deprecated in C++11 and removed in C++14
Advait Thakre
on 15 Nov 2023
Walter Roberson
on 15 Nov 2023
I do not know? The only thing I notice is that between ..\DualFilter\lib\DualFilter.lib and libmat.lib there is a "" and possibly that is being treated as an empty name with default extension .obj
Jerome Chevalier
on 22 Nov 2023
Edited: Jerome Chevalier
on 22 Nov 2023
Based on the compilation log, the environment variables pointing to your SystemC library installation are missing
cl.exe /c /O2 /MT /D _NDEBUG /Fd".\obj\DualFilter_uttb_tlm.pdb" /D "RT" /D "USE_RTMODEL" /D "WIN64" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE" /I ".\include" /I "..\DualFilter\include" /I "..\DualFilter\utils" /I "" /I "" /D SC_INCLUDE_DYNAMIC_PROCESSES /nologo /FD /EHsc /W3 /TP /wd4244 /wd4267 /vmg /Foobj\DualFilter_uttb_tlm.obj src\DualFilter_uttb_tlm.cpp
cl : Command line error D8004 : '/I' requires an argument
You must download and compile the SystemC library and define the following variables in your system (or enter the values directly in the 'TLM Compilation' dialog):
- SYSTEMC_INC_PATH and TLM_INC_PATH to provide the path to the systemC and tlm .h include files
- SYSTEMC_LIB_NAME and SYSTEMC_LIB_PATH to provide the name and location of the systemC .lib static library file.
see the following link for more information: https://www.mathworks.com/help/hdlverifier/ug/select-tlm-compilation-options.html?searchHighlight=systemc%20lib&s_tid=srchtitle_support_results_2_systemc%20lib
Jerome Chevalier
on 22 Nov 2023
Based on the linker log, SYSTEMC_LIB_NAME environment variable is missing
link.exe obj\mw_support_tb.obj obj\DualFilter_uttb_tlm_tb.obj obj\DualFilter_uttb_tlm_tb_main.obj /LIBPATH:"C:\Users\advaitthakre\Downloads\systemc-2.3.4\src" /LIBPATH:"C:\Program Files\MATLAB\R2023b\extern\lib\win64\microsoft" /nologo /INCREMENTAL /SUBSYSTEM:CONSOLE /MACHINE:X64 ..\DualFilter_uttb_tlm\lib\DualFilter_uttb_tlm.lib ..\DualFilter\lib\DualFilter.lib "" libmat.lib libmx.lib libeng.lib /PDB:".\obj\DualFilter_uttb_tlm_tb.pdb" /out:DualFilter_uttb_tlm_tb.exe
Answers (2)
Marc Erickson
on 15 Nov 2023
Edited: Walter Roberson
on 15 Nov 2023
You appear to have a missing the specification of the systemc library and so it is showing up as an empty string in the linker line:
..\DualFilter\lib\DualFilter.lib "" libmat.lib
Please read through:
Here is a successful link command for a design named "Subsystem".
link.exe \
obj\mw_support_tb.obj obj\Subsystem_tlm_tb.obj obj\Subsystem_tlm_tb_main.obj \
/LIBPATH:"F:/tools/SystemC/systemc-2.3.1/lib/win64" /LIBPATH:"O:\27\matlab\extern\lib\win64\microsoft" \
/nologo /INCREMENTAL /SUBSYSTEM:CONSOLE /MACHINE:X64 \
..\Subsystem_tlm\lib\Subsystem_tlm.lib ..\Subsystem\lib\Subsystem.lib \
"systemc-vs-15.0.lib" \
libmat.lib libmx.lib libeng.lib \
/PDB:".\obj\Subsystem_tlm_tb.pdb" /out:Subsystem_tlm_tb.exe
If you continue to have issues, you can file a tech support request and we can look further.
Jerome Chevalier
on 22 Nov 2023
Edited: Jerome Chevalier
on 22 Nov 2023
0 votes
Based on the compilation log, the environment variables pointing to your SystemC library installation are missing
cl.exe /c /O2 /MT /D _NDEBUG /Fd".\obj\DualFilter_uttb_tlm.pdb" /D "RT" /D "USE_RTMODEL" /D "WIN64" /D "_LIB" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE" /I ".\include" /I "..\DualFilter\include" /I "..\DualFilter\utils" /I "" /I "" /D SC_INCLUDE_DYNAMIC_PROCESSES /nologo /FD /EHsc /W3 /TP /wd4244 /wd4267 /vmg /Foobj\DualFilter_uttb_tlm.obj src\DualFilter_uttb_tlm.cpp
cl : Command line error D8004 : '/I' requires an argument
You must download and compile the SystemC library and define the following variables in your system (or enter the values directly in the 'TLM Compilation' dialog):
- SYSTEMC_INC_PATH and TLM_INC_PATH to provide the path to the systemC and tlm .h include files
- SYSTEMC_LIB_NAME and SYSTEMC_LIB_PATH to provide the name and location of the systemC .lib static library file.
see the following link for more information: https://www.mathworks.com/help/hdlverifier/ug/select-tlm-compilation-options.html?searchHighlight=systemc%20lib&s_tid=srchtitle_support_results_2_systemc%20lib
Categories
Find more on Transaction Level Model Generation 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!