User guide

System Generator for DSP User Guide www.xilinx.com 403
UG640 (v 12.2) July 23, 2010
Creating Compilation Targets
1. The name of the compilation target as it should appear in the Compilation field of the
System Generator parameters dialog box;
2. The name of the MATLAB function it should invoke to find out more information (e.g.,
System Generator dialog box parameters, which post-generation function to use, if
any) about the target.
The following code shows how to define three compilation targets named Standalone
Bitstream, iMPACT, and ChipScope™ Pro Analyzer:
function s = xltarget
s = {};
target_1.('name') = 'Standalone Bitstream';
target_1.('target_info') = 'xltools_target';
target_2.('name') = 'iMPACT';
target_2.('target_info') = 'xltools_target';
target_3.('name') = 'ChipScope Pro Analyzer';
target_3.('target_info') = 'xltools_target';
s = {target_1, target_2, target_3};
The name field in the code shown above specifies the name of the compilation target, as it
should appear in the Compilation field of the System Generator dialog box:
target_1.('name') = 'Standalone Bitstream';
The target_info field tells System Generator the target info function it should call to find
out more information about the target. This function can have any name provided it is
saved in the same directory as the corresponding xltarget.m file, or it is saved somewhere
in the MATLAB path.
target_1.('target_info') = 'xltools_target';
Note: An example xltarget function is included in the examples/comp_targets directory of your
System Generator install tree. You can modify this function to define your own bitstream-related
compilation targets.
Target Info Functions
A target info function (specified by the target_info field in the code above) is responsible
for two things:
It defines the available and default settings for the target in the System Generator
block dialog box;
It specifies the functions System Generator should call before and after the standard
code generation process.
Note:
An example target info function, xltools_target.m, is included in the
examples/comp_targets directory of your System Generator install tree.
One such function that is particularly useful to compilation targets is the post-generation
function. A post-generation function is run after standard code generation. The code below
shows how a post-generation function is specified in a target info function:
settings.('postgeneration_fcn') = 'xltools_postgeneration';
Post-generation Functions
One way to extend System Generator compilation is by defining a new variety of
compilation that specifies a post-generation function. A post-generation function is a
MATLAB function that tells System Generator how to process the HDL and netlist files
once they are generated. This function is run after System Generator finishes the normal
code generation steps involved with HDL Netlist compilation (i.e., producing an HDL