User guide

System Generator for DSP User Guide www.xilinx.com 365
UG640 (v 12.2) July 23, 2010
Black Box Examples
Advanced Black Box Example Using ModelSim
The following topics are discussed in this example:
How to design a black box with a dynamic port interface;
How to configure a black box using mask parameters;
How to assign generic values based on input port data types;
Saving black box blocks in Simulink libraries for later reuse;
How to specify custom scripts for ModelSim HDL co-simulation.
This example also shows a way to view signals coming from a black box. In Simulink,
waveforms are typically viewed with a scope. The Simulink scope block serves this
purpose and the System Generator WaveScope block is available in versions 8.1 and later.
The waveform viewer in the ModelSim simulator may also be used to view waveforms. In
this example, a black box is configured as a specialized ModelSim waveform scope for
Xilinx fixed-point signals. When a model that uses the black box scope is simulated, the
signals that drive the black box are displayed in ModelSim.
The files for this example are contained in the directory
<ISE_Design_Suite_tree>/sysgen/examples/black_box/example5.
The files contained in this directory are:
black_box_ex5.mdl: A Simulink model containing a black box scope.
scope_lib.mdl: A Simulink library containing the black box waveform viewer.
scope_config.m: The configuration M-function for the black box waveform viewer.
scope1.vhd, scope2.vhd, scope3.vhd, scope4.vhd: Black box VHDL for the
signal scope that accept one, two three, and four input signals, respectively.
waveform.do – A script that instructs ModelSim how to display signals during
simulation.