User guide

404 www.xilinx.com System Generator for DSP User Guide
UG640 (v 12.2) July 23, 2010
Chapter 5: System Generator Compilation Types
description of the design, running CORE Generator™, etc). For example, a hardware co-
simulation target defines a post-generation function that in turn runs the tools necessary to
produce hardware that can be used in the Simulink simulation loop.
Note:
Two post-generation functions xlBitstreamPostGeneration.m and
xltools_postgeneration.m, are included in the examples/comp_targets directory of your
System Generator install tree.
xlBitstreamPostGeneration.m
This example post-generation function compiles your model into a configuration bitstream
that is appropriate for the settings (e.g., FPGA part, clock frequency, clock pin location)
given in the System Generator dialog box of your design.
It then uses an XFLOW-based flow to invoke the Xilinx tools necessary to produce an
FPGA configuration bitstream.
It is possible to configure the tools and configurations for each tool invoked by XFLOW.
For more information on how to do this, refer to the topic in this example entitled Using
XFLOW
xltools_postgeneration.m
Sometimes you may want to run tools that configure and run the FPGA after a
configuration bitstream has been generated (e.g., iMPACT, ChipScope™ Pro Analyzer).
The xltools_postgeneration function first calls the xlBitstreamGeneration function to
generate the bitstream. It then invokes the appropriate tool (or tools) depending on the
compilation target that is selected.
For example, you may want a compilation target that invokes iMPACT after the bitstream
is generated. This can be done as follows (assuming iMPACT is in your system path):
if (strcmp(params.compilation, 'iMPACT'))
dos('impact');
end;
The first line checks the name of the compilation target. The second line sets up a DOS
command that invokes iMPACT. ChipScope Pro Analyzer can be invoked similarly to the
code above:
if (strcmp(params.compilation, 'ChipScope Pro Analyzer'))
xlCallChipScopeAnalyzer;
end;
Note: xlCallChipScopeAnalyzer is a MATLAB function provided by System Generator to invoke
ChipScope.
Configuring and Installing the Compilation Target
Listed below are the steps necessary to configure and install new bitstream compilation
targets.
1. Copy the xltarget.m, xltools_postgeneration.m, and xltools_target.m
files from examples/comp_targets into a temporary directory.
2. Change the permissions of the above files so they can be modified.
3. Add the desired compilation targets (e.g., iMPACT, ChipScope Analyzer Pro) to the
xltarget.m file.
4. Add the desired tool invocations to the xltools_postgeneration.m file.