User guide
System Generator for DSP User Guide www.xilinx.com 325
UG640 (v 12.2) July 23, 2010
Black Box Configuration M-Function
• Port descriptions;
• Generics required by the module;
• Clocking and sample rates;
• Files associated with the module;
• Whether the module has any combinational paths.
The name of the configuration M-function associated with a black box is specified as a
parameter in the black box parameters dialog box (parity_block_config.m in the
example shown below).
Configuration M-functions use an object-based interface to specify black box information.
This interface defines two objects, SysgenBlockDescriptor and SysgenPortDescriptor.
When System Generator invokes a configuration M-function, it passes the function a block
descriptor:
function sample_block_config(this_block)
A SysgenBlockDescriptor object provides methods for specifying information about the
black box. Ports on a block descriptor are defined separately using port descriptors.
Language Selection
The black box can import VHDL and Verilog modules. SysgenBlockDescriptor provides a
method, setTopLevelLanguage, that tells the black box what type of module you are
importing. This method should be invoked once in the configuration M-function. The
following code shows how to select between the VHDL and Verilog languages.
VHDL Module:
this_block.setTopLevelLanguage('VHDL');
Verilog Module:
this_block.setTopLevelLanguage('Verilog');
Note: The Configuration Wizard automatically selects the appropriate language when it generates
a configuration M-function.
Specifying the Top-Level Entity
You must tell the black box the name of the top-level entity that is associated with it.
SysgenBlockDescriptor provides a method, setEntityName, which allows you to specify
the name of the top-level entity.
Note:
Use lower case text to specify the entity name.
For example, the following code specifies a top-level entity named foo.