UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 17857

3.1 System Generator for DSP - How do I add VHDL packages from other libraries when using HDL Co-Sim?

Description

Keywords: SysGen, System Generator, MATLAB, HDL, Co-Sim, simulation, libraries, packages

Urgency: Standard

General Description:
How do I add VHDL packages from other libraries when using HDL Co-Sim?

Solution

- To implement a VHDL Black Box with packages from other libraries with Project Navigator, please see (Xilinx Answer 17858).

- To simulate a VHDL Black Box with packages from other libraries in ModelSim, you must add the libraries to your design by creating a custom ModelSim DO script that will create the libraries and compile the packages into the libraries.

To create the DO script:

1. Create your black box using the black box procedures from the SysGen help.

2. Create a customer ModelSim DO file (e.g., my_lib.do).

3. Modify the ModelSim DO file to add your new library and compile the VHDL packages you want in the library.
For example:
vlib my_lib
vcom -93 flop.vhd -work my_lib
vcom -93 reg_8_bit.vhd -work my_lib

4. Ensure that you call the libraries from within your VHDL module. (For more information on VHDL syntax, please see a VHDL training book.)
For example:
library my_lib;
use my_lib.flop.all;
use my_lib.reg_8_bit.all;

5. Modify the "blackbox_config.m" script to include the ModelSim DO file and the VHDL package files in the designated location in the _config.m script.
For example:
this_block.addFile('my_lib.do');
this_block.addFile('flop.vhd'); % This is a VHDL package file.
this_block.addFile('reg_8_bit.vhd'); % This is a VHDL package file.
this_block.addFile('my_top.vhd'); % This is the original file used to define the black box.

6. Add the ModelSim Simulation token to the MDL file and modify it to use the custom ModelSim DO that you created.
a) Double-click on the ModelSim token.
b) Check the "Add Customer Script" box.
c) Add your custom ModelSim DO file to in the "Script to Run Before Starting Compilation:" box (e.g., my_lib.do).
AR# 17857
Date Created 08/22/2003
Last Updated 06/24/2004
Status Archive
Type General Article