Export TLM Component
Identify Generated Files
After code generation completes, go to your working folder.
There you can find the following folder: model_name_VP/
.
This folder contains the files generated for the TLM component. The
files appear under the subfolders described in the following table.
Directory Name | Files | Description |
---|---|---|
model_name | include/model_name*.h | Files relative to the behavior of the model. These files are independent of the TLM options. HDL Verifier™ provides a makefile for you to build a static library from these source files. If another TLM component is generated from the same model, these files are regenerated (if the model has not changed, the files will be identical). If you generate a second TLM version of the same model with a different tag the TLM files are added to the _VP folder with the new tag. It is possible for the _VP folder to contain multiple TLM variations of the same model all using the same behavior files. |
model_name_usertag_tlm | include/model_name_usertag_tlm.h | These files contain the TLM interface to wrap the core behavior. This file contains addresses and definitions to communicate with the component through the TLM target port using a TLM generic payload. The files are sorted in subdirectories by source and header. HDL Verifier provides a makefile for you to build a static library from these source files. |
model_name_usertag_tlm_tb | include/model_name_usertag _tlm_tb.h | These files contain the core behavior of the testbench. This file instantiates and binds the component and the testbench together. The files are sorted in subdirectories by source and header. HDL Verifier software provides a makefile for you to build an executable from these source file and the component static library. This executable requires the following:
|
model_name_usertag_tlm_doc/ | html/model_name_codegen_rpt.html | This file is the entry point of the HTML documentation. |
Create Static Library with TLM Component
Create a static library that contains the generated TLM component by following the steps described for Linux® or Windows®. Execute these steps for the operating system where you will run the TLM component.
Note
This feature requires the ASIC Testbench for HDL Verifier add-on.
Linux Users
Open a Linux console window.
Navigate to the
model_name
_VP/
model_name_usertag
_tlm/
folder.Execute the following command to start the library compilation:
make -f makefile.gnu all
If you want to obtain symbols for source code debugging, use the
all-debug
target instead ofall
.When the system finishes compiling, locate a library file named
lib
model_name_usertag
_tlm.a
in themodel_name
_VP/
model_name_usertag
_tlm/lib/
folder.
Windows Users
If you have not already, make sure that MATLAB\
or version
\bin\win32MATLAB\
has
been added to your user path.version
\bin\win64
You can choose one of the following ways to compile your project:
Compile in Visual Studio® (open the
model_name_usertag
_tlm.vcproj
project in Visual Studio and follow the application instructions for compiling your project).Compile in a console window.
Open a system console window.
Load the compilation tool chain by entering the following at the system prompt:
Win32 users:
X:\>"%VS80COMNTOOLS%\..\..\VC\vcvarsall" x86
Win64 users:
X:\>"%VS80COMNTOOLS%\..\..\VC\vcvarsall" x64
If you have a later version of Visual Studio, you may need to enter
"%VS100COMNTOOLS%..."
,"%VS90COMNTOOLS%..."
or"%VS80COMNTOOLS%..."
instead. Typeset
at the system prompt for a list of environment variables; in that list you can find the environment variable pointing to where the tool chain is installed.In the same system console, navigate to the
model_name
_VP/
model_name_usertag
_tlm/
folder.Execute the following command to start the library compilation:
X:\>nmake /f makefile.mk all
If you want to obtain symbols for source code debugging, use the
all-debug
target instead ofall
.When the system finishes compiling, locate a library file named
model_name_usertag
_tlm.lib
in themodel_name
_VP/
model_name_usertag
_tlm/lib/
folder.
Note
The temporary object files reside in the
model_name
_VP/
model_name_usertag
_tlm/obj/
folder.
Create Standalone Executable with TLM Component
You can create a standalone TLM executable in the command shell by following the steps for Linux or Windows. Execute these steps for the operating system where you will run the TLM component.
Linux Users
Open a Linux console window.
Navigate to the
model_name
_VP/
model_name_usertag
_tlm_tb/
folder.Execute the following command to start the library compilation:
make -f makefile_tb.gnu all
If you want to obtain symbols for source code debugging, use the
all-debug
target instead ofall
.Note
Executing this command also automatically builds a static library with the TLM component source files.
When the system finishes compiling, locate an executable file named
model_name_usertag
_tlm_tb.exe
in themodel_name
_VP/
model_name_usertag
_tlm_tb/
folder.
Windows Users
If you have not already, make sure that MATLAB\
or version
\bin\win32MATLAB\
has
been added to your user path.version
\bin\win64
You can choose one of the following ways to compile your project:
Compile in Visual Studio (open the
model_name_usertag
_tlm.vcproj
project in Visual Studio and follow the application instructions for compiling your project).Compile in a console window.
Open a system console window.
Load the compilation tool chain by entering the following at the system prompt:
Win32 users:
X:\>"%VS80COMNTOOLS%\..\..\VC\vcvarsall" x86
Win64 users:
X:\>"%VS80COMNTOOLS%\..\..\VC\vcvarsall" x64
If you have a later version of Visual Studio, you may need to enter
"%VS100COMNTOOLS%..."
,"%VS90COMNTOOLS%..."
or"%VS80COMNTOOL%..."
instead. Typeset
at the system prompt for a list of environment variables; in that list you can find the environment variable pointing to where the tool chain is installed.In the same system console, navigate to the
model_name
_VP/
model_name_usertag
_tlm_tb/
folder.Execute the following command to start the library compilation:
X:\>nmake /f makefile.mk all
If you want to obtain symbols for source code debugging, use the
all-debug
target instead ofall
.Note
Executing this command also automatically builds a static library with the TLM component source files.
When the system finishes compiling, locate an executable file named
model_name_usertag
_tlm_tb.exe
in themodel_name
_VP/
model_name_usertag
_tlm_tb/
folder.