XST User Guide
XST User Guide
XPLA3/-II and
XC9500
/XL/XV families, and generates an NGC file ready for the CPLD fitter.
The general flow of XST for CPLD synthesis is the following:
1. HDL synthesis of VHDL or Verilog designs
2. Macro inference
3. Module optimization
4. NGC file generation
Global CPLD Synthesis Options
This section describes supported CPLD families and lists the XST options related only to
CPLD synthesis that can be set from the Process Properties dialog box in Project Navigator.
Supported Families
XST suppports five families for CPLD synthesis:
CoolRunner XPLA3
CoolRunner -II
XC9500
XC9500XL
XC9500XV
recommends running the multi-level optimization of the CPLD fitter with different values
for the pterms options, starting with 20 and finishing with 50 with a step of 5. Statistically
the value 30 gives the best results for frequency.
Fitting Large Design
If a design does not fit in the selected device, exceeding the number of device macrocells or
device P-Term capacity, you must select an area optimization for XST. Statistically, the best
area results are obtained with the following options:
Optimization effort: 1/Normal or 2/High
Optimization Goal: Area
Default values for other options
Another option that you can try is "wysiwyg yes". This option may be useful when the
design cannot be simplified by the optimization process and the complexity (in number of
P-Terms) is near the device capacity. It may be that the optimization process, trying to
reduce the number of levels, creates larger equations, therefore increasing the number of
P-Terms and so preventing the design from fitting. By validating this option, the number of
P-Terms is not increased, and the design fitting may be successful.
XST User Guide www.xilinx.com 273
9.1i
R
Chapter 5
Design Constraints
This chapter describes constraints supported for use with XST. It explains which attributes
and properties can be used with FPGA devices, CPLD devices, VHDL, and Verilog. This
chapter contains the following sections:
Alphabetized List of Xilinx Constraints
About Constraints
Setting Global Constraints and Options
VHDL Attribute Syntax
Verilog Attribute Syntax
XST Constraint File (XCF)
General Constraints
HDL Constraints
FPGA Constraints (Non-Timing)
CPLD Constraints (Non-Timing)
Timing Constraints
Constraints Summary
Implementation Constraints
Third Party Constraints
Constraints Precedence
Alphabetized List of Xilinx Constraints
This chapter contains information on the following constraints:
Add I/O Buffers
Asynchronous to Synchronous
Automatic BRAM Packing
Automatic FSM Extraction
Box Type
BRAM Utilization Ratio
BUFGCE
Bus Delimiter
Bus Delimiter
Case Implementation Style
274 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Case
Clock Enable
Clock Signal
Convert Tristates to Logic
Cores Search Directories
Cross Clock Analysis
Data Gate
Decoder Extraction
DSP Utilization Ratio
Enumerated Encoding (VHDL)
Equivalent Register Removal
FSM Encoding Algorithm
FSM Style
Full Case (Verilog)
Generate RTL Schematic
Generics
Global Timing Constraints Support
Handling by XST
HDL Library Mapping File (.INI File)
Hierarchy Separator
Hierarchy Separator
Incremental Synthesis
IOSTANDARD
Keep Hierarchy
Keep
Library Search Order
LOC
Logical Shifter Extraction
Macro Preserve
Map Entity on a Single LUT
Map Logic on BRAM
Max Fanout
Move First Stage
Move Last Stage
Multiplier Style
Mux Extraction
Mux Style
No Reduce
Number of Global Clock Buffers
Number of Regional Clock Buffers
XST User Guide www.xilinx.com 275
9.1i
Alphabetized List of Xilinx Constraints
R
Optimization Effort
Optimization Goal
Optimize Instantiated Primitives
Pack I/O Registers Into IOBs
Parallel Case (Verilog)
Power Reduction
Priority Encoder Extraction
RAM Extraction
RAM Style
Register Balancing
Register Duplication
Register Power Up
Resource Sharing
Resynthesize
RLOC
ROM Extraction
ROM Style
Safe Implementation
Safe Recovery State
Shift Register Extraction
Signal Encoding
Slice Packing
Slice Utilization Ratio Delta
Slice Utilization Ratio
Synthesis Constraint File
Translate Off/Translate On (Verilog/VHDL)
Use Carry Chain
Use Clock Enable
Use DSP48
Use Synchronous Reset
Use Synchronous Set
Use Synthesis Constraints File
USELOWSKEWLINES
Verilog 2001
Verilog Include Directories (Verilog Only)
Verilog Macros (DEFINE)
Work Directory
Write Timing Constraints
WYSIWYG
XCF Timing Constraint Support
276 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
XOR Collapsing
XOR Preserve
XST Timing Options
XST-Specific Non-Timing Options
About Constraints
Constraints are essential to help you meet your design goals or obtain the best
implementation of your circuit. Constraints are available in XST to control various aspects
of the synthesis process itself, as well as placement and routing. Synthesis algorithms and
heuristics have been tuned to automatically provide optimal results in most situations. In
some cases, however, synthesis may fail to initially achieve optimal results; some of the
available constraints allow you to explore different synthesis alternatives to meet your
specific needs.
The following mechanisms are available to specify constraints.
Options provide global control on most synthesis aspects. They can be set either from
within the Process Properties dialog box in Project Navigator or by setting options of
the run command from the command line.
VHDL attributes can be directly inserted into the VHDL code and attached to
individual elements of the design to control both synthesis, and placement and
routing.
Constraints can be added as Verilog meta comments in the Verilog code.
Constraints can be specified in a separate constraint file.
Typically, global synthesis settings are defined within the Process Properties dialog box in
Project Navigator or with command line arguments, while VHDL attributes or Verilog
meta comments can be inserted in your source code to specify different choices for
individual parts of the design. Note that the local specification of a constraint overrides its
global setting. Similarly, if a constraint is set both on a node (or an instance) and on the
enclosing design unit, the former takes precedence for the considered node (or instance).
Setting Global Constraints and Options
This section explains how to set global constraints and options from the Process Properties
dialog box in Project Navigator.
For a description of each constraint that applies generally that is, to FPGA devices,
CPLD devices, VHDL, and Verilog see the Xilinx
Constraints Guide.
Except for the Value fields with check boxes, there is a pull-down arrow or browse button
in each Value field. However, you cannot see the arrow until you click in the Value field.
Synthesis Options
To specify the HDL synthesis options from Project Navigator:
1. Select a source file from the Source file window.
2. Right-click Synthesize - XST in the Process window.
3. Select Properties.
4. In the Process Properties dialog box, click the Synthesis Options tab.
XST User Guide www.xilinx.com 277
9.1i
Setting Global Constraints and Options
R
5. Depending on the device family you have selected (FPGA or CPLD), one of two dialog
boxes displays.
The following synthesis options can be selected from the dialog boxes.
Optimization Goal
Optimization Effort
Use Synthesis Constraints File
Synthesis Constraint File
Library Search Order
Keep Hierarchy*
Global Optimization Goal
Generate RTL Schematic
Cores Search Directories*
Write Timing Constraints
Cross Clock Analysis*
Hierarchy Separator*
Bus Delimiter*
Slice Utilization Ratio*
Case*
Work Directory*
HDL Library Mapping File (.INI File)*
Verilog 2001
Verilog Include Directories (Verilog Only)*
Custom Compile File List*
Other XST Command Line Options*
* To view these options, go to the Property Display Level drop down menu at the bottom
of the window, and select Advanced.
HDL Options
With the Process Properties dialog box displayed for the Synthesize - XST process, select
the HDL Options tab.
FPGA Devices
The following HDL Options can be set for FPGA devices from the HDL Options tab of the
Process Properties dialog box:
FSM Encoding Algorithm
Safe Implementation
Case Implementation Style
FSM Style*
RAM Extraction
RAM Style
ROM Extraction
278 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
ROM Style
Mux Extraction
Mux Style
Decoder Extraction
Priority Encoder Extraction
Shift Register Extraction
Logical Shifter Extraction
XOR Collapsing
Resource Sharing
Multiplier Style **
Use DSP48**
* To view this option, go to the Property Display Level drop down menu at the bottom of
the window, and select Advanced.
** When working with Virtex-4 devices, Use DSP48 replaces Multiplier Style in this
dialog box. For Virtex-5, this option is called Use DSP Block.
CPLD Devices
The following HDL Options can be set for CPLD devices from the HDL Options tab of the
Process Properties dialog box:
FSM Encoding Algorithm
Safe Implementation
Case Implementation Style
Mux Extraction
Resource Sharing
Xilinx Specific Options
To display the options, select the Xilinx Specific Options tab from the Process Properties
dialog box for the Synthesize - XST process.
FPGA Devices
Following are the Xilinx Specific Options for FPGA devices:
Add I/O Buffers
Max Fanout
Number of Global Clock Buffers*
Number of Regional Clock Buffers*
Register Duplication
Equivalent Register Removal
Register Balancing
Move First Stage
Move Last Stage
Convert Tristates to Logic**
XST User Guide www.xilinx.com 279
9.1i
Setting Global Constraints and Options
R
Use Clock Enable
Use Synchronous Set
Use Synchronous Reset
Optimize Instantiated Primitives
* To view these options, go the Property Display Level drop down menu at the bottom of
the window, and click Advanced.
** Convert Tristate to Logic only appears when working with devices with internal tristate
resources.
CPLD Devices
Following are the Xilinx Specific Options for CPLD devices:
Add I/O Buffers
Equivalent Register Removal
Clock Enable
Macro Preserve
XOR Preserve
WYSIWYG
Other XST Command Line Options
Any XST command line option can be set via the Other XST Command Line Options
property in the Process Properties dialog box. This is an advanced property. Use the syntax
described in Chapter 10, Command Line Mode. Separate multiple options with a space.
While the Other XST Command Line Options property is intended for XST options not
listed in the Process Properties dialog box, if an option already listed as a dialog box
property is entered, precedence is given to the option entered here. Illegal or unrecognized
options cause XST to stop processing and generate a message like the following:
ERROR:Xst:1363 - Option "verilog2002" is not available for command
run.
Custom Compile File List
By using the Custom Compile File List property, you can change the order in which source
files are processed by XST. With this property, you select a user-defined compile list file
that XST uses to determine the order in which it processes libraries and design files.
Otherwise, XST uses an automatically generated list.
This user-defined file must list all design files and their libraries in the order in which they
are to be compiled, from top to bottom. Type each file/library pair on its own line, with a
semicolon separating the library from the file. The format is as follows:
library_name;file_name
[library_name;file_name]
...
280 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Following is an example:
work;stopwatch.vhd
work;statmach.vhd
...
This property is not connected to the Custom Compile File List property in the Simulation
Properties dialog box, which means that a different compile list file is used for synthesis
than for simulation.
VHDL Attribute Syntax
You can describe constraints with VHDL attributes in the VHDL code. Before it can be
used, an attribute must be declared with the following syntax.
attribute AttributeName : Type ;
Example
attribute RLOC : string ;
The attribute type defines the type of the attribute value. The only allowed type for XST is
string. An attribute can be declared in an entity or architecture. If declared in the entity, it
is visible both in the entity and the architecture body. If the attribute is declared in the
architecture, it cannot be used in the entity declaration. Once declared a VHDL attribute
can be specified as follows:
attribute AttributeName of ObjectList : ObjectType is AttributeValue ;
Example
attribute RLOC of u123 : label is R11C1.S0 ;
attribute bufg of my_signal : signal is sr;
The object list is a comma separated list of identifiers. Accepted object types are entity,
component, label, signal, variable and type.
Verilog Attribute Syntax
This section discusses Verilog Attribute Syntax.
Verilog-2001 Attributes
XST supports Verilog-2001 attribute statements. Attributes are comments that are used to
pass specific information to software tools such as synthesis tools. Verilog-2001 attributes
can be specified anywhere for operators or signals within module declarations and
instantiations. Other attribute declarations may be supported by the compiler, but are
ignored by XST.
Attributes can be used to:
Set constraints on individual objects (for example, module, instance, net)
Set FULL_CASE and PARALLEL_CASE synthesis directives
XST User Guide www.xilinx.com 281
9.1i
Verilog Attribute Syntax
R
Syntax
Attributes must be bounded by the characters (* and *), and are written using the
following syntax:
(* attribute_name = attribute_value *)
where
The attribute must precede the signal, module or instance declaration it refers to.
The attribute_value must be a string; no integer or scalar values are allowed.
The attribute_value must be between quotes.
The default value is 1. (* attribute_name *) is the same as
(* attribute_name = "1" *).
Example One
(* clock_buffer = "IBUFG" *) input CLK;
Example Two
(* INIT = "0000" *) reg [3:0] d_out;
Example Three
always@(current_state or reset)
begin (* parallel_case *) (* full_case *)
case (current_state)
...
Example Four
(* mult_style = "pipe_lut" *) MULT my_mult (a, b, c);
Limitations
Verilog-2001 attributes are not supported for the following:
Signal declarations
Statements
Port connections
Expression operators
Verilog Meta Comments
Constraints can also be specified in Verilog code using meta comments. The Verilog-2001
format is the preferred syntax, but the meta comment style is still supported. Use the
following syntax:
// synthesis attribute AttributeName [of] ObjectName [is]
AttributeValue
Example
// synthesis attribute RLOC of u123 is R11C1.S0
// synthesis attribute HU_SET u1 MY_SET
// synthesis attribute bufg of my_clock is "clk"
282 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
The parallel_case, full_case, translate_on, and translate_off directives
follow a different syntax. For more information, see Verilog Attributes and Meta
Comments in Chapter 7.
XST Constraint File (XCF)
XST constraints can be specified in a file called the Xilinx Constraint File (XCF). The XCF
must have an extension of .xcf. You can specify the constraint file in ISE, by going to the
Synthesis - XST Process Properties, clicking the Synthesis Options tab, enabling the Use
Synthesis Constraints File option by clicking the check box, clicking the value field for the
Synthesis Constraints File option, and typing the constraint file name. You can also
browse for an existing file to use by clicking the box to the right of the value field. Also, to
quickly enable/disable the use of a constraint file by XST, you can check or uncheck the
Use Synthesis Constraint File option in this same menu. By selecting this option, you
invoke the iuc command line switch.
To specify the constraint file in command line mode, use the uc switch with the run
command. See Chapter 10, Command Line Mode for details on the run command and
running XST from the command line.
XCF Syntax and Utilization
The XCF syntax enables you to specify a specific constraint for the entire device (globally)
or for specific modules in your design. The XCF syntax is basically the same as the UCF
syntax for applying constraints to nets or instances, but with an extension to the syntax to
allow constraints to be applied to specific levels of hierarchy. You can use the keyword
MODEL to define the entity or module that the constraint is applied to. If a constraint is
applied to an entity or module, the constraint is applied to each instance of the entity or
module.
In general, you should define constraints within the ISE process properties dialog box (or
the XST run script, if running on the command line), then use the XCF file to specify
exceptions to these general constraints. The constraints specified in the XCF file are applied
ONLY to the module listed, and not to any submodules below it.
To apply a constraint to the entire entity or module use the following syntax:
MODEL entityname constraintname = constraintvalue;
Examples
MODEL top mux_extract = false;
MODEL my_design max_fanout = 256;
If the entity my_design is instantiated several times in the design, the max_fanout=256
constraint is applied to each instance of my_design.
To apply constraints to specific instances or signals within an entity or module, use the
INST or NET keywords. XST does not support constraints which are applied to VHDL
variables.
BEGIN MODEL entityname
INST instancename constraintname = constraintvalue ;
NET signalname constraintname = constraintvalue ;
END;
XST User Guide www.xilinx.com 283
9.1i
General Constraints
R
Examples
BEGIN MODEL crc32
INST stopwatch opt_mode = area ;
INST U2 ram_style = block ;
NET myclock clock_buffer = true ;
NET data_in iob = true ;
END;
See Constraints Summary for the complete list of synthesis constraints that you can
apply for XST.
Native vs. Non-Native UCF Constraints Syntax
From a UCF syntax point of view, all constraints supported by XST can be divided into two
groups: native UCF constraints, and non-native UCF constraints. Only Timing and Area
Group constraints use native UCF syntax.
For all non-native UCF constraints, use the MODEL or BEGIN MODEL... END; constructs.
This is true for pure XST constraints such as FSM_EXTRACT or RAM_STYLE, as well as
for implementation non-timing constraints, such as RLOC or KEEP.
For native UCF constraints, such as PERIOD, OFFSET, TNM_NET, TIMEGRP, TIG, and
FROM-TO, use native UCF syntax, which includes the use of wildcards and hierarchical
names. Do not use these constraints inside the BEGIN MODEL... END construct, otherwise
XST issues an error.
Caution! If you specify timing constraints in the XCF file, Xilinx strongly suggests that you use
'/' character as a hierarchy separator instead of '_'. For more information on its usage, see
Hierarchy Separator.
Limitations
XCF syntax has the following limitations.
Nested model statements are not supported in the current release.
Instance or signal names listed between the BEGIN MODEL statement and the END
statement are only the ones visible inside the entity. Hierarchical instance or signal
names are not supported.
Wildcards in instance and signal names are not supported, except in timing
constraints.
Not all native UCF constraints are supported in the current release. For more
information, see the Xilinx Constraints Guide.
General Constraints
This section lists various constraints that you can use with XST. These constraints apply to
FPGA devices, CPLD devices, VHDL, and Verilog. You can set some of these options under
the Synthesis Options tab of the Process Properties dialog box in Project Navigator. See
Constraints Summary for a complete list of constraints supported by XST.
Add I/O Buffers
Add I/O Buffers (iobuf) enables or disables I/O buffer insertion. XST automatically
inserts Input/Output Buffers into the design. You can manually instantiate I/O Buffers for
some or all the I/Os, and XST will insert I/O Buffers only for the remaining I/Os. If you do
284 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
not want XST to insert any I/O Buffers, set this option to no. This option is useful to
synthesize a part of a design to be instantiated later on.
IOBUF enables or disables I/O buffer insertion. Allowed values are yes, no. By default,
buffer insertion is enabled (yes).
When the yes value is selected, IBUF and OBUF primitives are generated. IBUF/OBUF
primitives are connected to I/O ports of the top-level module. When XST is called to
synthesize an internal module that will be instantiated later in a larger design, you must
select the no option. If I/O buffers are added to a design, this design cannot be used as a
submodule of another design.
Add I/O Buffers Architecture Support
The following table shows whether the constraint may be used with that device.
Add I/O Buffers Applicable Elements
Applies globally
Add I/O Buffers Propagation Rules
Applies to design primary IOs
Add I/O Buffers Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
XST User Guide www.xilinx.com 285
9.1i
General Constraints
R
XST Command Line Syntax Examples
Define globally with the iobuf command line option of the run command. Following is
the basic syntax:
-iobuf {yes|no|true|false|soft}
The default is yes.
Project Navigator Syntax Example
Define globally with the Add I/O Buffers option of the Xilinx Specific Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Box Type
BOX_TYPE is a synthesis constraint. It currently takes three possible values: primitive,
black_box, and user_black_box, which instruct XST not to synthesize the behavior of
a module. The black_box value is equivalent to primitive and will eventually become
obsolete.
The main difference between the primitive (black_box) and user_black_box is that
if the user_black_box value is specified, XST reports inference of a black box in the LOG
file, but does not do this if primitive is specified.
If box_type is applied to at least a single instance of a block of a design, then box_type
is propagated to all other instances of the entire design. This feature was implemented for
Verilog and XCF only in order to have a VHDL-like support, where box_type can be
applied to a component.
BOX_TYPE Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
286 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
BOX_TYPE Applicable Elements
Applies to the following design elements:
VHDL
component, entity
Verilog
module, instance
XCF
model, instance
BOX_TYPE Propagation Rules
Applies to the design element to which it is attached
BOX_TYPE Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using BOX_TYPE, declare it with the following syntax:
attribute box_type: string;
After declaring BOX_TYPE, specify the VHDL constraint as follows:
attribute box_type of {component_name|entity_name}: {component|entity}
is {primitive|black_box|user_black_box};
Verilog Syntax Example
Place this attribute immediately before the black box instantiation:
(* box_type = "{primitive|black_box|user_black_box}" *)
XCF Syntax Examples
Example One
MODEL entity_name box_type={primitive|black_box|user_black_box};
Example Two
BEGIN MODEL entity_name
INST instance_name
box_type={primitive|black_box|user_black_box};
END;
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
XST User Guide www.xilinx.com 287
9.1i
General Constraints
R
Bus Delimiter
The Bus Delimiter (bus_delimiter) command line option defines the format used to
write the signal vectors in the result netlist. The available possibilities are <>, [], {}, (). The
default is <>.
Bus Delimiter Architecture Support
The Bus Delimiter (bus_delimiter) command line option is architecture independent.
Bus Delimiter Applicable Elements
Applies to syntax
Bus Delimiter Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the bus_delimiter command line option of the run command.
Following is the basic syntax:
-bus_delimiter {<>|[]|{}|()}
The default is <>.
Project Navigator Syntax Example
Define globally with the Bus Delimiter option of the Synthesis Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Case
The Case command line option (case) determines if instance and net names are written
in the final netlist using all lower or upper case letters or if the case is maintained from the
source. Note that the case can be maintained for either Verilog or VHDL synthesis flow.
Case Architecture Support
The Case command line option (case) is architecture independent.
Case Applicable Elements
Applies to syntax
Case Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
288 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
XST Command Line Syntax Example
Define globally with the case command line option of the run command. Following is
the basic syntax:
-case {upper|lower|maintain}
The default is maintain.
Project Navigator Syntax Example
Define globally with the Case option of the Synthesis Options tab of the Process Properties
dialog box in Project Navigator. With a design selected in the Sources window, right-click
Synthesize in the Processes window to access the Process Properties dialog box.
Case Implementation Style
The Case Implementation Style (vlgcase) command line option instructs XST how to
interpret Verilog Case statements. It has three possible values: full, parallel and
full-parallel.
If the option is not specified, then XST implements the exact behavior of the case
statements.
If full is used, XST assumes that the case statements are complete and avoids latch
creation.
If parallel is used, XST assumes that the branches cannot occur in parallel and does
not use a priority encoder.
If full-parallel is used, XST assumes that the case statements are complete and
that the branches cannot occur in parallel, therefore saving latches and priority
encoders.
For more information, see Multiplexers in Chapter 2 and Full Case (Verilog) and
Parallel Case (Verilog) in this chapter.
Case Implementation Style Architecture Support
Case Implementation Style is architecture independent and valid for Verilog designs only.
Case Implementation Style Applicable Elements
Applies globally
Case Implementation Style Propagation Rules
Not applicable
Case Implementation Style Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the vlgcase command line option of the run command.
-vlgcase {full|parallel|full-parallel}
By default, there is no value.
XST User Guide www.xilinx.com 289
9.1i
General Constraints
R
Project Navigator Syntax Example
Define globally with the Case Implementation Style option of the HDL Options tab of the
Process Properties dialog box in Project Navigator. Allowed values are Full, Parallel, and
Full-Parallel. By default, the value is blank. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Verilog Macros (DEFINE)
The Verilog Macros (DEFINE) command line option allows you to define (or redefine)
Verilog macros. This allows you to easily modify the design configuration without any
HDL source modifications, such as for IP core generation and testing flows. If the defined
macro is not used in the design, no message is given.
DEFINE Architecture Support
The Verilog Macros (DEFINE) command line option is architecture independent.
DEFINE Applicable Elements
Applies to the entire design
DEFINE Propagation Rules
Not applicable
DEFINE Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define this option globally with the -define command line option of the run command.
Following is the basic syntax:
-define {name[=value] name[=value] }
where
name is a macro name
value is a macro text
The default value is an empty definition: -define {}
Notes
Values for macros are not mandatory.
Place the values inside curly braces. Separate the values with spaces.
Macro text can be specified between quotation mark (") characters, or without them. If
the macro text contains spaces, you must use quotation mark (") characters.
Example
-define {macro1=Xilinx macro2=Xilinx Virtex4}
290 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Project Navigator Syntax Example
Define globally with the Verilog Macros option of the Synthesis Option tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog box.
Caution! Omit curly braces when specifying values in Project Navigator.
Example
macro1=Xilinx macro2=Xilinx Virtex4
Duplication Suffix
The Duplication Suffix (duplication_suffix) command line option controls how
XST names replicated flip-flops. By default, when XST replicates a flip-flop, it creates a
name for the new flip-flop by taking the name of the original flip-flop and adding "_n" to
the end of it, where n is an index number. For example, if the original flip-flop name is
my_ff, and this flip-flop was replicated three times, XST generates flip-flops with the
following names: my_ff_1, my_ff_2 and my_ff_3.
Using the Duplication Suffix command line option, you can specify a text string to append
to the end of the default name. You can use the %d escape character to specify where in the
name the index number appears. For example, for the flip-flop named my_ff, if you
specify _dupreg_%d with the Duplication Suffix option, XST generates the following
names: my_ff_dupreg_1, my_ff_dupreg_2, and my_ff_dupreg_3. The %d
escape character can be placed anywhere in the suffix definition. For example, if the
Duplication Suffix value is specified as _dup_%d_reg, XST generates the following
names: my_ff_dup_1_reg, my_ff_dup_2_reg and my_ff_dup_3_reg.
Duplication Suffix Architecture Support
The Duplication Suffix command line option is architecture independent.
Duplication Suffix Applicable Elements
Applies to files
Duplication Suffix Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the duplication_suffix command line option of the run
command. Following is the basic syntax:
-duplication_suffix string%dstring
The default is _%d.
Project Navigator Syntax Example
The Duplication Suffix option does not appear in the Process Properties dialog box.
Define globally with the Other option of the Synthesis Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
XST User Guide www.xilinx.com 291
9.1i
General Constraints
R
box. Specify the option of the Other XST Command Line Options menu item. See the XST
Command Line example for coding details.
Full Case (Verilog)
The Full Case (FULL_CASE) directive is used to indicate that all possible selector values
have been expressed in a case, casex or casez statement. The directive prevents XST
from creating additional hardware for those conditions not expressed. See Multiplexers
in Chapter 2 for more information.
Full Case Architecture Support
The Full Case directive is architecture independent and valid for Verilog designs only.
Full Case Applicable Elements
Applies to case statements in Verilog meta comments
Full Case Propagation Rules
Not applicable
Full Case Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Verilog Syntax Examples
The Verilog 2001 syntax is as follows:
(* full_case *)
Since the directive does not contain a target reference, the attribute immediately precedes
the selector.
Example
(* full_case *)
casex select
4'b1xxx: res = data1;
4'bx1xx: res = data2;
4'bxx1x: res = data3;
4'bxxx1: res = data4;
endcase
The directive is also available as a meta comment in the Verilog code. The syntax differs
from the standard meta comment syntax as shown in the following:
// synthesis full_case
Since the directive does not contain a target reference, the meta comment immediately
follows the selector.
292 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Example
casex select // synthesis full_case
4'b1xxx: res = data1;
4'bx1xx: res = data2;
4'bxx1x: res = data3;
4'bxxx1: res = data4;
endcase
XST Command Line Syntax Example
Define globally with the vlgcase command line option of the run command using the
full or full-parallel options. Following is the basic syntax:
-vlgcase {full|parallel|full-parallel}
Project Navigator Syntax Example
For Verilog files only, define globally in the Synthesis Options tab of the Process Properties
dialog box in Project Navigator. With a Verilog design selected in the Sources window,
right-click Synthesize in the Processes window to access the Synthesis Options tab of the
Process Properties dialog box in Project Navigator. For Case Implementation Style, select
Full as a Value.
Generate RTL Schematic
The Generate RTL Schematic (rtlview) command line option enables XST to generate a
netlist file, representing an RTL structure of the design. This netlist can be viewed by the
RTL and Technology Viewers. This option has three possible values: yes, no and only.
When the only value is specified, XST stops the synthesis process just after the RTL view
is generated. The file containing the RTL view has an NGR file extension.
Generate RTL Schematic Architecture Support
The Generate RTL Schematic (rtlview) command line option is architecture
independent.
Generate RTL Schematic Applicable Elements
Applies to files
Generate RTL Schematic Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the rtlview command line option of the run command. Following
is the basic syntax:
-rtlview {yes|no|only}
From the command line, the default is no.
Project Navigator Syntax Example
Define globally with the Generate RTL Schematic option of the Synthesis Options tab of
the Process Properties dialog box in Project Navigator. The default is yes. With a design
XST User Guide www.xilinx.com 293
9.1i
General Constraints
R
selected in the Sources window, right-click Synthesize in the Processes window to access
the Process Properties dialog box.
Generics
The Generics (GENERICS) command line option allows you to to redefine generics
(VHDL) or parameters (Verilog) values defined in the top-level design block. This allows
you to easily modify the design configuration without any HDL source modifications,
such as for IP core generation and testing flows. If the defined value does not correspond
to the data type defined in the VHDL or Verilog code, then XST tries to detect the situation
and issues a warning message, ignoring the command line definition.
In some situations, XST may fail to detect a type mismatch. In that case, XST attempts to
apply this value by adopting it to the type defined in the VHDL or Verilog file without any
warning message. Be sure that the value you specified corresponds to the type defined in
the VHDL or Verilog code. If a defined generic or parameter name does not exist in the
design, no message is given, and the definition is ignored.
GENERICS Architecture Support
The Generics (GENERICS) command line option is architecture independent.
GENERICS Applicable Elements
Applies to the entire design
GENERICS Propagation Rules
Not applicable
GENERICS Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define this option globally with the -generics command line option of the run
command. Following is the basic syntax:
-generics {name=value name=value }
where
name
is the name of a generic or parameter of the top level design block, and
value
is the value of a generic or parameter of the top level design block.
The default value is an empty definition.
-generics {}
294 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Notes
Place the values inside curly braces. Separate the values with spaces.
XST can accept as values only constants of scalar types. Composite data types (arrays
or records) are supported only in the following situations: string, std_logic_vector,
std_ulogic_vector, signed, unsigned, bit_vector.
There must be no space characters between the prefix and the corresponding value.
Example
-generics {company=Xilinx width=5 init_vector=b100101}
Project Navigator Syntax Example
Define globally with the Generics, Parameters option of the Synthesis Option tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Caution! Omit curly braces when specifying values in Project Navigator.
Example
company=Xilinx width=5 init_vector=b100101
Hierarchy Separator
The Hierarchy Separator (hierarchy_separator) command line option defines the
hierarchy separator character that is used in name generation when the design hierarchy is
flattened.
There are two supported characters, '_' and '/'. The default is '/' for newly created projects.
If a design contains a sub-block with instance INST1, and this sub-block contains a net,
called TMP_NET, then the hierarchy is flattened and the hierarchy separator character is
'_'. The name of TMP_NET becomes INST1_TMP_NET. If the hierarchy separator character
is '/', then the name of the net will be 'INST1/TMP_NET'. Using '/' as a hierarchy
separator is very useful in the design debugging process because this separator makes it
much easier to identify a name if it is hierarchical.
Hierarchy Separator Architecture Support
The Hierarchy Separator command line option is architecture independent.
Hierarchy Separator Applicable Elements
Applies to files
Hierarchy Separator Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST User Guide www.xilinx.com 295
9.1i
General Constraints
R
XST Command Line Syntax Example
Define globally with the hierarchy_separator command line option of the run
command. Following is the basic syntax:
-hierarchy_separator {_|/}
The default is '/' for newly created projects.
Project Navigator Syntax Example
Define globally with the Hierarchy Separator option of the Synthesis Options tab of the
Process Properties dialog box in Project Navigator. The default is '/'. With a design selected
in the Sources window, right-click Synthesize in the Processes window to access the
Process Properties dialog box.
IOSTANDARD
Use the IOSTANDARD constraint to assign an I/O standard to an I/O primitive. For more
information, see IOSTANDARD in the Xilinx Constraints Guide.
Keep
KEEP is an advanced mapping constraint. When a design is mapped, some nets may be
absorbed into logic blocks. When a net is absorbed into a block, it can no longer be seen in
the physical design database. This may happen, for example, if the components connected
to each side of a net are mapped into the same logic block. The net may then be absorbed
into the block containing the components. KEEP prevents this from happening.
KEEP preserves the existence of the signal in the final netlist, but not its structure. For
example, if your design has a 2-bit multiplexer selector and you attach KEEP to it, then this
signal will be preserved in the final netlist. But the multiplexer could be automatically
reencoded by XST using one-hot encoding. As a consequence, this signal in the final netlist
will be four bits wide instead of the original two. To preserve the structure of the signal, in
addition to KEEP you must also use ENUM_ENCODING. See Enumerated Encoding
(VHDL) for more information.
For more information, see KEEP in the Xilinx Constraints Guide.
Keep Hierarchy
Keep Hierarchy (KEEP_HIERARCHY) is a synthesis and implementation constraint. If
hierarchy is maintained during Synthesis, the Implementation tools will use this constraint
to preserve the hierarchy throughout the implementation process and allow a simulation
netlist to be created with the desired hierarchy.
XST can flatten the design to get better results by optimizing entity or module boundaries.
You can set KEEP_HIERARCHY to true so that the generated netlist is hierarchical and
respects the hierarchy and interface of any entity or module of your design.
This option is related to the hierarchical blocks (VHDL entities, Verilog modules) specified
in the HDL design and does not concern the macros inferred by the HDL synthesizer.
Three values are available for this option:
true: allows the preservation of the design hierarchy, as described in the HDL
project. If this value is applied to synthesis, it will also be propagated to
implementation.
296 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
false: hierarchical blocks are merged in the top level module.
soft: allows the preservation of the design hierarchy in synthesis, but the
KEEP_HIERARCHY constraint is not propagated to implementation.
For CPLD devices, the default is true. For FPGA devices, the default is false.
In general, an HDL design is a collection of hierarchical blocks, and preserving the
hierarchy gives the advantage of fast processing because the optimization is done on
separate pieces of reduced complexity. Nevertheless, very often, merging the hierarchy
blocks improves the fitting results (fewer PTerms and device macrocells, better frequency)
because the optimization processes (collapsing, factorization) are applied globally on the
entire logic.
In the following figure, if KEEP_HIERARCHY is set to the entity or module I2, the
hierarchy of I2 will be in the final netlist, but its contents I4, I5 will be flattened inside I2.
Also I1, I3, I6, I7 will be flattened.
Figure 5-1: KEEP_HIERARCHY EXAMPLE
Keep Hierarchy Architecture Support
The following table shows whether the constraint may be used with that device.
X9542
I0 I0
I2 KEEP HIERARCHY YES I2
I1 I3
I7 I6
I5 I4
Design View Netlist View
NGC FILE 1 (I0)
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
XST User Guide www.xilinx.com 297
9.1i
General Constraints
R
Keep Hierarchy Applicable Elements
Applies to logical blocks, including blocks of hierarchy or symbols
Keep Hierarchy Propagation Rules
Applies to the entity or module to which it is attached
Keep Hierarchy Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Schematic Syntax Example
Attach to the entity or module symbol.
Attribute Name
KEEP_HIERARCHY
Attribute Values
YES, NO
VHDL Syntax Example
Before using KEEP_HIERARCHY, declare it with the following syntax:
attribute keep_hierarchy : string;
After declaring KEEP_HIERARCHY, specify the VHDL constraint as follows:
attribute keep_hierarchy of architecture_name: architecture is
"{yes|no|true|false|soft}";
The default is no for FPGA devices and yes for CPLD devices.
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* keep_hierarchy = "{yes|no|true|false|soft}" *)
XCF Syntax Example
MODEL entity_name keep_hierarchy={yes|no|true|false|soft};
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
298 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
XST Command Line Syntax Example
Define globally with the -keep_hierarchy command line option of the run command.
Following is the basic syntax:
-keep_hierarchy {yes|no|soft}
The default is no for FPGA devices and yes for CPLD devices.
For more information, see Chapter 10, Command Line Mode.
Project Navigator Syntax Example
Define globally with the Keep Hierarchy option of the Synthesis Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Library Search Order
The Library Search Order (lso) command line option is related to the use of mixed
language (VHDL or Verilog) projects support. It allows you to specify the order in which
various library files are used.
It can be invoked by specifying the file containing the search order in the value field to the
right of Library Search option of the Synthesis Options tab of the Process Properties
dialog box in Project Navigator, or with the lso command line option.
Library Search Order Architecture Support
The Library Search Order command line option is architecture independent.
Library Search Order Applicable Elements
Applies to files
Library Search Order Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the lso command line option of the run command. Following is the
basic syntax:
-lso file_name.lso
There is no default file name. If not specified XST uses the default search order. For more
information, see the Library Search Order File in Chapter 8.
Project Navigator Syntax Example
Define globally with the Library Search option of the Synthesis Options tab of the Process
Properties dialog box in Project Navigator. For more information, see Library Search
Order File in Chapter 8. With a design selected in the Sources window, right-click
Synthesize in the Processes window to access the Process Properties dialog box.
XST User Guide www.xilinx.com 299
9.1i
General Constraints
R
LOC
The LOC constraint defines where a design element can be placed within an FPGA or
CPLD device. For more information, see LOC in the Xilinx Constraints Guide.
Optimization Effort
The Optimization Effort (OPT_LEVEL) constraint defines the synthesis optimization effort
level. Allowed values are 1 (normal optimization) and 2 (higher optimization). The default
optimization effort level is 1 (Normal).
1 (Normal)
Very fast processing, especially for hierarchical designs. This is the default mode and
suggested for use with a majority number of designs.
2 (Higher Optimization)
Time consuming processingsometimes with better results in the number of
slices/macrocells or maximum frequency.
In speed optimization mode, Xilinx strongly suggests using 1 (Normal) optimization effort
for the majority of designs. Selecting optimization level 2 usually results in increased
synthesis run times, and does not always bring optimization gain.
Optimization Effort Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
300 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Optimization Effort Applicable Elements
Applies globally, or to an entity or module
Optimization Effort Propagation Rules
Applies to the entity or module to which it is attached
Optimization Effort Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using OPT_LEVEL, declare it with the following syntax:
attribute opt_level: string;
After declaring OPT_LEVEL, specify the VHDL constraint as follows:
attribute opt_level of entity_name: entity is {1|2};
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* opt_level = "{1|2}" *)
XCF Syntax Example
MODEL entity_name opt_level={1|2};
XST Command Line Syntax Example
Define OPT_LEVEL globally with the opt_level command line option. Following is the
basic syntax:
-opt_level {1|2}
The default is 1.
Project Navigator Syntax Example
Define globally with the Optimization Effort option of the Synthesis Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Optimization Goal
The Optimization Goal (OPT_MODE) constraint defines the synthesis optimization
strategy. Available strategies are speed and area. By default, XST optimizations are speed-
oriented.
speed
Priority is to reduce the number of logic levels and therefore to increase frequency.
area
Priority is to reduce the total amount of logic used for design implementation and
therefore improve design fitting.
XST User Guide www.xilinx.com 301
9.1i
General Constraints
R
Optimization Goal Architecture Support
The following table shows whether the constraint may be used with that device.
Optimization Goal Applicable Elements
Applies globally, or to an entity or module
Optimization Goal Propagation Rules
Applies to the entity or module to which it is attached
Optimization Goal Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using OPT_MODE, declare it with the following syntax:
attribute opt_mode: string;
After declaring OPT_MODE, specify the VHDL constraint as follows:
attribute opt_mode of entity_name: entity is {speed|area};
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
302 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* opt_mode = "{speed|area}" *)
XCF Syntax Example
MODEL entity_name opt_mode={speed|area};
XST Command Line Syntax Example
Define globally with the opt_mode command line option of the run command.
Following is the basic syntax:
-opt_mode {area|speed}
The default is speed.
Project Navigator Syntax Example
Define globally with the Optimization Goal option of the Synthesis Options tab of the
Process Properties dialog box in Project Navigator. The default is speed. With a design
selected in the Sources window, right-click Synthesize in the Processes window to access
the Process Properties dialog box.
Parallel Case (Verilog)
The PARALLEL_CASE directive is used to force a case statement to be synthesized as a
parallel multiplexer and prevents the case statement from being transformed into a
prioritized if/elsif cascade. See Multiplexers in Chapter 2 of this guide.
Parallel Case (Verilog) Architecture Support
The PARALLEL_CASE directive is architecture independent and valid for Verilog designs
only.
Parallel Case (Verilog) Applicable Elements
Applies to case statements in Verilog meta comments only
Parallel Case (Verilog) Propagation Rules
Not applicable
Parallel Case (Verilog) Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Verilog Syntax Examples
The Verilog 2001 syntax is as follows:
(* parallel_case *)
XST User Guide www.xilinx.com 303
9.1i
General Constraints
R
Since the directive does not contain a target reference, the attribute immediately precedes
the selector.
(* parallel_case *)
casex select
4'b1xxx: res = data1;
4'bx1xx: res = data2;
4'bxx1x: res = data3;
4'bxxx1: res = data4;
endcase
The directive is also available as a meta comment in the Verilog code. The syntax differs
from the standard meta comment syntax as shown in the following:
// synthesis parallel_case
Since the directive does not contain a target reference, the meta comment immediately
follows the selector.
casex select // synthesis parallel_case
4'b1xxx: res = data1;
4'bx1xx: res = data2;
4'bxx1x: res = data3;
4'bxxx1: res = data4;
endcase
XST Command Line Syntax Example
Define globally with the -vlgcase command line option of the run command using the
parallel or full-parallel options. Following is the basic syntax:
-vlgcase {full|parallel|full-parallel}
RLOC
The RLOC constraint is a basic mapping and placement constraint. This constraint groups
logic elements into discrete sets and allows you to define the location of any element
within the set relative to other elements in the set, regardless of eventual placement in the
overall design. For more information, see RLOC in the Xilinx Constraints Guide.
Synthesis Constraint File
The Synthesis Constraint File (uc) command line option specifies a synthesis constraint
file for XST to use. The XCF must have an extension of .xcf. If the extension is not .xcf,
XST will error out and stop processing. For more information, see XST Constraint File
(XCF).
Synthesis Constraint File Architecture Support
The Synthesis Constraint File (-uc) command line option is architecture independent.
Synthesis Constraint File Applicable Elements
Applies to files
Synthesis Constraint File Propagation Rules
Not applicable
304 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Synthesis Constraint File Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Specify a file name with the uc command line option of the run command. Following is
the basic syntax:
uc filename
Project Navigator Syntax Example
Define globally with the Use Synthesis Constraints File option of the Synthesis Options
tab of the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Translate Off/Translate On (Verilog/VHDL)
The Translate Off (TRANSLATE_OFF) and Translate On (TRANSLATE_ON) directives can
be used to instruct XST to ignore portions of your VHDL or Verilog code that are not
relevant for synthesis; for example, simulation code. The TRANSLATE_OFF directive
marks the beginning of the section to be ignored, and the TRANSLATE_ON directive
instructs XST to resume synthesis from that point.
TRANSLATE_OFF and TRANSLATE_ON are also Synplicity and Synopsys constraints
that are supported by XST in Verilog. Automatic conversion is also available in VHDL and
Verilog.
TRANSLATE_ON/TRANSLATE_OFF can be used with the following words:
synthesis
synopsys
pragma
Translate Off/Translate On Architecture Support
TRANSLATE_OFF and TRANSLATE_ON directives are architecture independent.
Translate Off/Translate On Applicable Elements
Applies locally
Translate Off/Translate On Propagation Rules
Instructs the synthesis tool to enable or disable portions of code
Translate Off/Translate On Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST User Guide www.xilinx.com 305
9.1i
General Constraints
R
VHDL Syntax Example
In the VHDL code, write the directives as follows:
-- synthesis translate_off
...code not synthesized...
-- synthesis translate_on
Verilog Syntax Example
The directives are available as VHDL or Verilog meta comments. The Verilog syntax differs
from the standard meta comment syntax presented earlier in this chapter, as shown below.
// synthesis translate_off
...code not synthesized...
// synthesis translate_on
Use Synthesis Constraints File
The Use Synthesis Constraints File (iuc) command line option allows you to ignore the
constraint file during synthesis.
Use Synthesis Constraints File Architecture Support
The Use Synthesis Constraints File command line option is architecture independent.
Use Synthesis Constraints File Applicable Elements
Applies to files
Use Synthesis Constraints File Propagation Rules
Not applicable
Use Synthesis Constraints File Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the -iuc command line option of the run command. Following is the
basic syntax:
-iuc {yes|no}
The default is no.
Project Navigator Syntax Example
Define globally with the Use Synthesis Constraints File option of the Synthesis Options
tab of the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Verilog Include Directories (Verilog Only)
Use the Verilog Include Directories option (vlgincdir) to enter discrete paths to your
Verilog Include Directories.
306 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Include Directories Architecture Support
The Use Synthesis Constraints File command line option is architecture independent.
Verilog Include Directories Applicable Elements
Applies to directories
Verilog Include Directories Propagation Rules
Not applicable
Verilog Include Directories Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the vlgincdir command line option of the run command.
Allowed values are names of directories. For more information, see Names with Spaces
in Chapter 10.
-vlgincdir {directory_path [directory_path]}
There is no default.
Project Navigator Syntax Example
Define globally with the Verilog Include Directories option of the Synthesis Options tab
of the Process Properties dialog box in Project Navigator. Allowed values are names of
directories. There is no default.
You must have Property Display Level set to Advanced in the Processes tab of the
Preferences dialog box (Edit > Preferences) to display the Verilog Search Paths option.
With a design selected in the Sources window, right-click Synthesize in the Processes
window to access the Process Properties dialog box.
Verilog 2001
The Verilog 2001(verilog2001) command line option enables or disables interpreted
Verilog source code as the Verilog 2001 standard. By default Verilog source code is
interpreted as the Verilog 2001 standard.
Verilog 2001 Architecture Support
The Verilog 2001 command line option is architecture independent.
Verilog 2001 Applicable Elements
Applies to syntax
Verilog 2001 Propagation Rules
Not applicable
XST User Guide www.xilinx.com 307
9.1i
General Constraints
R
Verilog 2001 Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the verilog2001 command line option of the run command.
Following is the basic syntax:
-verilog2001 {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Verilog 2001 option of the Synthesis Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
HDL Library Mapping File (.INI File)
Use the HDL Library Mapping File command (xsthdpini) to define the library
mapping.
There is a library mapping file and two associated parameters: XSTHDPINI and
XSTHDPDIR. The library mapping file contains the library name and the directory in
which this library is compiled. XST maintains two library mapping files:
The pre-installed file, which is installed during the Xilinx software installation
The user file, which you may define for your own projects
The pre-installed (default) INI file is named xhdp.ini, and is located
in %XILINX%\vhdl\xst. These files contain information about the locations of the
standard VHDL and UNISIM libraries. These should not be modified, but the syntax can
be used for user library mapping. This file appears as follows:
-- Default lib mapping for XST
std=$XILINX/vhdl/xst/std
ieee=$XILINX/vhdl/xst/unisim
unisim=$XILINX/vhdl/xst/unisim
aim=$XILINX/vhdl/xst/aim
pls=$XILINX/vhdl/xst/pls
You can use this file format to define where each of your own libraries must be placed. By
default, all compiled VHDL flies will be stored in the xst sub-directory of the ISE project
directory. You can place your custom INI file anywhere on a disk by using one of the
following methods:
Select the VHDL INI File option of the Synthesis Options tab of the Synthesis process
properties in Project Navigator
Set up the xsthdpini parameter, using the following command in
stand-alone mode:
set -xsthdpini file_name
308 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
You can give this library mapping file any name you wish, but it is best to keep the .ini
classification. The format is:
library_name=path_to_compiled_directory
Note: Use "--" for comments.
Sample text for my.ini:
work1=H:\Users\conf\my_lib\work1
work2=C:\mylib\work2
HDL Library Mapping File Architecture Support
The HDL Library Mapping File command is architecture independent.
HDL Library Mapping File Applicable Elements
Applies to files
HDL Library Mapping File Propagation Rules
Not applicable
HDL Library Mapping File Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the set -xsthdpini command line option before running the run
command. Following is the basic syntax:
set -xsthdpini file_name
The command can accept a single file only.
Project Navigator Syntax Example
Define globally with the VHDL INI File option of the Synthesis Options tab of the Process
Properties dialog box in Project Navigator.
You must have Property Display Level set to Advanced in the Processes tab of the
Preferences dialog box (Edit > Preferences) to display the VHDL INI File option.
With a design selected in the Sources window, right-click Synthesize in the Processes
window to access the Process Properties dialog box.
Work Directory
The Work Directory (xsthdpdir) parameter defines the location in which VHDL-
compiled files must be placed if the location is not defined by library mapping files. You
can access this switch by using one of the following methods:
Selecting the VHDL Working Directory menu in the "Synthesis Options" tab of the
Synthesis process properties in Project Navigator
Using the following command in stand-alone mode:
set -xsthdpdir directory
XST User Guide www.xilinx.com 309
9.1i
General Constraints
R
Work Directory Example
Suppose three different users are working on the same project. They must share one
standard, pre-compiled library, shlib. This library contains specific macro blocks for their
project. Each user also maintains a local work library, but User 3 places it outside the
project directory (for example, in c:\temp). Users 1 and 2 will share another library
("lib12") between them, but not with User 3. The settings required for the three users are as
follows:
User One
Mapping file:
schlib=z:\sharedlibs\shlib
lib12=z:\userlibs\lib12
User Two
Mapping file:
schlib=z:\sharedlibs\shlib
lib12=z:\userlibs\lib12
User Three
Mapping file:
schlib=z:\sharedlibs\shlib
User Three will also set:
XSTHDPDIR = c:\temp
Work Directory Architecture Support
The Work Directory command is architecture independent.
Work Directory Applicable Elements
Applies to directories
Work Directory Propagation Rules
Not applicable
Work Directory Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define this parameter globally with the set xsthdpdir command line option before
running the run command. Following is the basic syntax:
set -xsthdpdir directory
The command can accept a single path only. You must specify the directory you want to
use. There is no default.
310 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Project Navigator Syntax Example
Define globally with the VHDL Work Directory option of the Synthesis Options tab of the
Process Properties dialog box in Project Navigator.
You must have Property Display Level set to Advanced in the Processes tab of the
Preferences dialog box (Edit > Preferences) to display the option.
With a design selected in the Sources window, right-click Synthesize in the Processes
window to access the Process Properties dialog box.
HDL Constraints
This section describes encoding and extraction constraints. Most of the constraints can be
set globally in the HDL Options tab of the Process Properties dialog box in Project
Navigator. The only constraints that cannot be set in this dialog box are Enumerated
Encoding, Signal Encoding, and Recovery State. The constraints described in this section
apply to FPGA devices, CPLD devices, VHDL, and Verilog.
In many cases, a particular constraint can be applied globally to an entire entity or model,
or alternatively, it can be applied locally to individual signals, nets or instances. See
Table 5-3 and Table 5-4 for valid constraint targets.
Automatic FSM Extraction
The Automatic FSM Extraction (FSM_EXTRACT) constraint enables or disables finite state
machine extraction and specific synthesis optimizations. This option must be enabled in
order to set values for the FSM Encoding Algorithm and FSM Flip-Flop Type.
XST User Guide www.xilinx.com 311
9.1i
HDL Constraints
R
Automatic FSM Extraction Architecture Support
The following table shows whether the constraint may be used with that device.
Automatic FSM Extraction Applicable Elements
Applies globally, or to a VHDL entity, Verilog module, or signal
Automatic FSM Extraction Propagation Rules
Applies to the entity, module, or signal to which it is attached
Automatic FSM Extraction Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using FSM_EXTRACT, declare it with the following syntax:
attribute fsm_extract: string;
After declaring FSM_EXTRACT, specify the VHDL constraint as follows:
attribute fsm_extract of {entity_name|signal_name}: {entity|signal} is
"{yes|no}";
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
312 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* fsm_extract = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name fsm_extract={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name fsm_extract={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the fsm_extract command line option of the run command.
Following is the basic syntax:
-fsm_extract {yes|no}
The default is yes.
Project Navigator Syntax Example
In Project Navigator, Automatic FSM Extraction is controlled by the FSM Encoding
Algorithm menu under the HDL Options tab of the Process Properties dialog box in
Project Navigator. The FSM Encoding Algorithm menu controls both the Automatic FSM
Extraction (fsm_extract) option and the FSM Encoding (-fsm_encoding) option.
These options are set as follows:
If the FSM Encoding Algorithm menu is set to None, and fsm_extract is set to no
and fsm_encoding has no influence on the synthesis.
In all other cases, fsm_extract is set to yes and fsm_encoding is set to the
value selected in the menu. See FSM Encoding Algorithm for more information
about fsm_encoding.
With a design selected in the Sources window, right-click Synthesize in the Processes
window to access the HDL Options tab of the Process Properties dialog box in Project
Navigator.
Enumerated Encoding (VHDL)
The Enumerated Encoding (ENUM_ENCODING) constraint can be used to apply a
specific encoding to a VHDL enumerated type. The constraint value is a string containing
space-separated binary codes. You can only specify ENUM_ENCODING as a VHDL
constraint on the considered enumerated type.
When describing a finite state machine using an enumerated type for the state register, you
may specify a particular encoding scheme with ENUM_ENCODING. In order for this
encoding to be actually used by XST, you must also set FSM_ENCODING to user for the
considered state register.
XST User Guide www.xilinx.com 313
9.1i
HDL Constraints
R
Enumerated Encoding Architecture Support
The following table shows whether the constraint may be used with that device.
Enumerated Encoding Applicable Elements
Applies to a type or signal
Because ENUM_ENCODING must preserve the external design interface, XST ignores the
ENUM_ENCODING constraint when it is used on a port.
Enumerated Encoding Propagation Rules
Applies to the type or signal to which it is attached
Enumerated Encoding Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
314 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
VHDL Syntax Example
You can specify ENUM_ENCODING as a VHDL constraint on the considered enumerated
type, as shown in the example below.
...
architecture behavior of example is
type statetype is (ST0, ST1, ST2, ST3);
attribute enum_encoding of statetype : type is "001 010 100 111";
signal state1 : statetype;
signal state2 : statetype;
begin
...
XCF Syntax Example
BEGIN MODEL entity_name
NET signal_name enum_encoding=string;
END;
Equivalent Register Removal
The Equivalent Register Removal (EQUIVALENT_REGISTER_REMOVAL) constraint
enables or disables removal of equivalent registers, described at the RTL Level. By default
XST does not remove equivalent flip-flops if they are instantiated from a Xilinx primitive
library. Flip-flop optimization includes the removal of equivalent flip-flops for FPGA and
CPLD devices and flip-flops with constant inputs for CPLD devices. This processing
increases the fitting success as a result of the logic simplification implied by the flip-flops
elimination. Two values are available (true and false are available in XCF as well):
yes (check box is checked)
Flip-flop optimization is allowed. This is the default.
no (check box is not checked)
Flip-flop optimization is inhibited.
The flip-flop optimization algorithm is time consuming. When fast processing is desired,
use no.
Equivalent Register Removal Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
XST User Guide www.xilinx.com 315
9.1i
HDL Constraints
R
Equivalent Register Removal Applicable Elements
Applies globally, or to an entity, module, or signal
Equivalent Register Removal Propagation Rules
Removes equivalent flip-flops and flip-flops with constant inputs
Equivalent Register Removal Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using EQUIVALENT_REGISTER_REMOVAL, declare it with the following syntax:
attribute equivalent_register_removal: string;
After declaring EQUIVALENT_REGISTER_REMOVAL, specify the VHDL constraint as
follows:
attribute equivalent_register_removal of {entity_name|signal_name}:
{signal|entity} is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* equivalent_register_removal = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name equivalent_register_removal={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name equivalent_register_removal={yes|no|true|false};
END;
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
316 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
XST Command Line Syntax Example
Define globally with the equivalent_register_removal command line option of
the run command. Following is the basic syntax:
-equivalent_register_removal {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Equivalent Register Removal option of the Xilinx Specific
Option tab of the Process Properties dialog box in Project Navigator. The default is yes
(check box is checked). With a design selected in the Sources window, right-click
Synthesize in the Processes window to access the Process Properties dialog box.
FSM Encoding Algorithm
The FSM Encoding Algorithm (FSM_ENCODING) constraint selects the finite state
machine coding technique to use. The Automatic FSM Extraction option must be enabled
in order to select a value for the FSM Encoding Algorithm. Available property values are
auto, one-hot, compact, sequential, gray, johnson, speed1, and user. FSM_ENCODING
defaults to auto, meaning that the best coding technique is automatically selected for each
individual state machine.
FSM Encoding Algorithm Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
XST User Guide www.xilinx.com 317
9.1i
HDL Constraints
R
FSM Encoding Algorithm Applicable Elements
Applies globally, or to a VHDL entity, Verilog module, or signal
FSM Encoding Algorithm Propagation Rules
Applies to the entity, module, or signal to which it is attached
FSM Encoding Algorithm Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using FSM_ENCODING, declare it with the following syntax:
attribute fsm_encoding: string;
After declaring FSM_ENCODING, specify the VHDL constraint as follows:
attribute fsm_encoding of {entity_name|signal_name}: {entity|signal} is
{auto|one-hot
|compact|sequential|gray|johnson|speed1|user};
The default is auto.
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* fsm_encoding = "{auto|one-hot
|compact|sequential|gray|johnson|speed1|user}" *)
The default is auto.
XCF Syntax Examples
Example One
MODEL entity_name fsm_encoding={auto|one-hot
|compact|sequential|gray|johnson|speed1|user};
Example Two
BEGIN MODEL entity_name
NET signal_name fsm_encoding={auto|one-hot
|compact|sequential|gray|johnson|speed1|user};
END;
XST Command Line Syntax Example
Define globally with the fsm_encoding command line option of the run command.
Following is the basic syntax:
-fsm_encoding {auto|one-hot
|compact|sequential|gray|johnson|speed1|user}
The default is auto.
318 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Project Navigator Syntax Example
In Project Navigator, FSM Encoding is controlled by the FSM Encoding Algorithm menu
under the HDL Options tab of the Process Properties dialog box in Project Navigator. Note
that the FSM Encoding Algorithm menu controls both the Automatic FSM Extraction
(fsm_extract) option and the FSM Encoding (fsm_encoding) option. Use these
options as follows:
If the FSM Encoding Algorithm menu is set to None, and fsm_extract is set to no,
fsm_encoding has no influence on the synthesis.
In all other cases, fsm_extract is set to yes and fsm_encoding is set to the
value selected in the menu. For more information, see Automatic FSM Extraction.
With a design selected in the Sources window, right-click Synthesize in the Processes
window to access the HDL Options tab of the Process Properties dialog box in Project
Navigator. Select a value from the drop-down list box.
Mux Extraction
The Mux Extract (MUX_EXTRACT) constraint enables or disables multiplexer macro
inference. Allowed values are yes, no and force (the values true and false are also
available in XCF).
By default, multiplexer inference is enabled (yes). For each identified multiplexer
description, based on some internal decision rules, XST actually creates a macro or
optimizes it with the rest of the logic. The force value overrides those decision rules and
forces XST to create the MUX macro.
Mux Extraction Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
XST User Guide www.xilinx.com 319
9.1i
HDL Constraints
R
Mux Extraction Applicable Elements
Applies globally, or to a VHDL entity, a Verilog module, or signal
Mux Extraction Propagation Rules
Applies to the entity, module, or signal to which it is attached
Mux Extraction Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using MUX_EXTRACT, declare it with the following syntax:
attribute mux_extract: string;
After declaring MUX_EXTRACT, specify the VHDL constraint as follows:
attribute mux_extract of {signal_name|entity_name}: {entity|signal} is
{yes|no|force};
The default value is yes.
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* mux_extract = "{yes|no|force}" *)
The default value is yes.
XCF Syntax Examples
Example One
MODEL entity_name mux_extract={yes|no|true|false|force};
Example Two
BEGIN MODEL entity_name
NET signal_name mux_extract={yes|no|true|false|force};
END;
XST Command Line Syntax Example
Define globally with the mux_extract command line option of the run command.
Following is the basic syntax:
-mux_extract {yes|no|force}
The default value is yes.
CoolRunner XPLA3 Yes
CoolRunner-II Yes
320 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Project Navigator Syntax Example
Define globally with the Mux Extraction option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Register Power Up
XST does not automatically calculate and enforce register power-up values. You must
explicitly specify them if needed with the Register Power Up (REGISTER_POWERUP)
constraint. This XST synthesis constraint can be assigned to a VHDL enumerated type, or
it may be directly attached to a VHDL signal or a Verilog register node through a VHDL
attribute or Verilog meta comment. The constraint value may be a binary string or a
symbolic code value.
Register Power Up Architecture Support
The following table shows whether the constraint may be used with that device.
Register Power Up Applicable Elements
Applies to signals and types
Register Power Up Propagation Rules
Applies to the signal or type to which it is attached
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 No
Spartan-3E No
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II No
Virtex-II Pro No
Virtex-II Pro X No
Virtex-4 No
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
XST User Guide www.xilinx.com 321
9.1i
HDL Constraints
R
Register Power Up Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Examples
Following are VHLD syntax examples for REGISTER_POWERUP.
REGISTER_POWERUP VHDL Syntax Example One
The register is defined with a predefined VHDL type such as std_logic_vector. The
constraint value is necessarily a binary code.
signal myreg : std_logic_vector (3 downto 0);
attribute register_powerup of myreg : signal is "0001";
REGISTER_POWERUP VHDL Syntax Example Two
The register is defined with an enumerated type (symbolic state machine). The
constraint is attached to the signal and its value is one of the symbolic states defined.
Actual power-up code will differ depending on the way the state machine is encoded.
type state_type is (s1, s2, s3, s4, s5);
signal state1 : state_type;
attribute register_powerup of state1 : signal is "s2";
REGISTER_POWERUP VHDL Syntax Example Three
The constraint is attached to an enumerated type. All registers defined with that type
inherit the constraint.
type state_type is (s1, s2, s3, s4, s5);
attribute register_powerup of state_type : type is "s1";
signal state1, state2 : state_type;
REGISTER_POWERUP VHDL Syntax Example Four
For enumerated type objects, the power-up value may also be defined as a binary code.
However, if automatic encoding is enabled and leads to a different encoding scheme
(in particular a different code width), the power-up value will be ignored.
type state_type is (s1, s2, s3, s4, s5);
attribute enum_encoding of state_type : type is "001 011 010 100 111";
attribute register_powerup of state_type : type is "100";
signal state1 : state_type;
Verilog Syntax Example
Place this attribute immediately before the signal declaration:
(* register_powerup = "<value>" *)
XCF Syntax Example
BEGIN MODEL entity_name
NET signal_name register_powerup=string;
END;
322 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Resource Sharing
The Resource Sharing (RESOURCE_SHARING) constraint enables or disables resource
sharing of arithmetic operators. Allowed values are yes (check box is checked) and no
(check box is not checked). The true and false values are also available in XCF. By
default, resource sharing is enabled.
Resource Sharing Architecture Support
The following table shows whether the constraint may be used with that device.
Resource Sharing Applicable Elements
Applies globally, or to design elements
Resource Sharing Propagation Rules
Applies to the entity or module to which it is attached
Resource Sharing Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using RESOURCE_SHARING declare it with the following syntax:
attribute resource_sharing: string;
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
XST User Guide www.xilinx.com 323
9.1i
HDL Constraints
R
After declaring RESOURCE_SHARING, specify the VHDL constraint as follows:
attribute resource_sharing of entity_name: entity is "{yes|no}";
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* resource_sharing = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name resource_sharing={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name resource_sharing={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the -resource_sharing command line option of the run
command. Following is the basic syntax:
-resource_sharing {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Resource Sharing option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Safe Recovery State
The Safe Recovery State (SAFE_RECOVERY_STATE) constraint defines a recovery state for
use when a finite state machine (FSM) is implemented in Safe Implementation mode. This
means that if during its work, the FSM enters an invalid state, XST uses additional logic to
force the FSM to a valid recovery state. By implementing FSM in safe mode, XST collects all
code not participating in the normal FSM behavior and considers it as illegal. XST uses
logic that returns the FSM synchronously to the known state (reset state, power up state or
state you specified via the SAFE_RECOVERY_STATE constraint). See Safe
Implementation for more information.
Safe Recovery State Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
324 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Safe Recovery State Applicable Elements
Applies to a signal representing a state register
Safe Recovery State Propagation Rules
Applies to a signal to which it is attached
Safe Recovery State Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using SAFE_RECOVERY_STATE, declare it with the following syntax:
attribute safe_recovery_state: string;
After declaring SAFE_RECOVERY_STATE, specify the VHDL constraint as follows:
attribute safe_recovery_state of {signal_name}:{signal} is "<value>";
Verilog Syntax Example
Place this attribute immediately before the signal declaration:
(* safe_recovery_state = "<value>" *)
XCF Syntax Example
BEGIN MODEL entity_name
NET signal_name safe_recovery_state="<value>";
END;
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
XST User Guide www.xilinx.com 325
9.1i
HDL Constraints
R
Safe Implementation
The Safe Implementation (SAFE_IMPLEMENTATION) constraint implements finite state
machines (FSMs) in Safe Implementation mode. Safe Implementation means that XST
generates additional logic that forces an FSM to a valid state (recovery state) if an FSM gets
into an invalid state. By default, XST automatically selects reset as the recovery state. If the
FSM does not have an initialization signal, XST selects power-up as the recovery state. The
recovery state can be manually defined via the RECOVERY_STATE constraint.
To activate Safe FSM implementation from Project Navigator, select the Safe
Implementation option from the HDL Options tab of the Synthesis Process Properties
dialog box in Project Navigator.
To activate Safe FSM implementation from your HDL code, apply the
SAFE_IMPLEMENTATION constraint to the hierarchical block or signal that
represents the state register in the FSM.
For more information, see Safe Recovery State.
Safe Implementation Architecture Support
The following table shows whether the constraint may be used with that device.
Safe Implementation Applicable Elements
Applies to an entire design via the XST command line, to a particular block (entity,
architecture, component), or to a signal
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
326 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Safe Implementation Propagation Rules
Applies to an entity, component, module, or signal to which it is attached
Safe Implementation Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using SAFE_IMPLEMENTATION, declare it with the following syntax:
attribute safe_implementation: string;
After declaring SAFE_IMPLEMENTATION, specify the VHDL constraint as follows:
attribute safe_implementation of
{entity_name|component_name|signal_name}: {entity|component|signal} is
"{yes|no}";
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* safe_implementation = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name safe_implementation={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name safe_implementation={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the safe_implementation command line option of the run
command. Following is the basic syntax:
-safe_implementation {yes|no}
The default is no.
Project Navigator Syntax Example
Define globally with the Safe Implementation option of the HDL Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Signal Encoding
The Signal Encoding (SIGNAL_ENCODING) constraint selects the coding technique to
use for internal signals. Available property values are auto, one-hot, and user. Selecting
one-hot forces the encoding to a one-hot encoding, and user forces XST to keep your
XST User Guide www.xilinx.com 327
9.1i
HDL Constraints
R
encoding. SIGNAL_ENCODING defaults to auto, meaning that the best coding technique
is automatically selected for each individual signal.
Signal Encoding Architecture Support
The following table shows whether the constraint may be used with that device.
Signal Encoding Applicable Elements
Applies globally, or to a VHDL entity, Verilog module, or signal
Signal Encoding Propagation Rules
Applies to the entity, module, or signal to which it is attached
Signal Encoding Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using SIGNAL_ENCODING, declare it with the following syntax:
attribute signal_encoding: string;
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner-II Yes
328 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
After declaring SIGNAL_ENCODING, specify the VHDL constraint as follows:
attribute signal_encoding of
{component_name|signal_name|entity_name|label_name}:
{component|signal|entity|label} is {auto|one-hot|user};
The default is auto.
Verilog Syntax Example
Place this attribute immediately before the signal declaration:
(* signal_encoding = "{auto|one-hot|user}" *)
The default is auto.
XCF Syntax Examples
Example One
MODEL "entity_name" signal_encoding = {auto|one-hot|user};
Example Two
BEGIN MODEL "entity_name"
NET "signal_name" signal_encoding = {auto|one-hot|user};
END;
XST Command Line Syntax Example
Define globally with the signal_encoding command line option of the run command.
Following is the basic syntax:
-signal_encoding {auto|one-hot|user}
The default is auto.
FPGA Constraints (Non-Timing)
This section describes FPGA HDL options. These options apply only to FPGA devices.
These options do not apply to CPLD devices.
In many cases, a particular constraint can be applied globally to an entire entity or model,
or alternatively, it can be applied locally to individual signals, nets or instances.See
Table 5-3 and Table 5-4 for valid constraint targets.
Asynchronous to Synchronous
The Asynchronous to Synchronous (ASYNC_TO_SYNC) constraint allows you to replace
Asynchronous Set/Reset signals with Synchronous signals throughout the entire design.
This allows absorption of registers by DSP48 and BRAMs, thereby improving your quality
of results. In addition, this feature may have a positive impact on power optimization. XST
can place FSMs on BRAMs, but in most cases an FSM will have an Asynchronous
Set/Reset signal, which does not allow their implementation on BRAMs. The
ASYNC_TO_SYNC constraint allows you to more easily place FSMs on BRAMs, by
eliminating the need to manually change the design.
Caution! Replacing Asynchronous Set/Reset signals by Synchronous signals makes the
generated NGC netlist NOT equivalent to the initial RTL description. You must ensure that the
XST User Guide www.xilinx.com 329
9.1i
FPGA Constraints (Non-Timing)
R
synthesized design satisfies the initial specification. XST will inform you via the following
Warning Message:
WARNING: You have requested that asynchronous control signals of
sequential elements be treated as if they were synchronous. If you
haven't done so yet, please carefully review the related documentation
material. If you have opted to asynchronously control flip-flop
initialization, this feature allows you to better explore the
possibilities offered by the Xilinx solution without having to go
through a painful rewriting effort. However, be well aware that the
synthesis result, while providing you with a good way to assess final
device usage and design performance, is not functionally equivalent to
your HDL description. As a result, you will not be able to validate your
design by comparison of pre-synthesis and post-synthesis simulation
results. Please also note that in general we strongly recommend
synchronous flip-flop initialization.
ASYNC_TO_SYNC Architecture Support
The following table shows whether the constraint may be used with that device.
ASYNC_TO_SYNC Applicable Elements
Applies to the entire design
ASYNC_TO_SYNC Propagation Rules
Not applicable
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
330 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
ASYNC_TO_SYNC Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define this option globally with the -async_to_sync command line option of the run
command. Following is the basic syntax:
-async_to_sync {yes|no}
The default is no.
Project Navigator Syntax Example
Define globally with the Asynchronous to Synchronous option of the HDL Options
tab of the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Automatic BRAM Packing
The Automatic BRAM Packing (AUTO_BRAM_PACKING) constraint allows you to pack
two small BRAMs in a single BRAM primitive as dual-port BRAM. XST will pack BRAMs
together only if they are situated in the same hierarchical level.
AUTO_BRAM_PACKING Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
XST User Guide www.xilinx.com 331
9.1i
FPGA Constraints (Non-Timing)
R
AUTO_BRAM_PACKING Applicable Elements
Applies to the entire design
AUTO_BRAM_PACKING Propagation Rules
Not applicable
AUTO_BRAM_PACKING Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define this option globally with the -auto_bram_packing command line option of the
run command. Following is the basic syntax:
-auto_bram_packing {yes|no}
The default is no.
Project Navigator Syntax Example
Define globally with the Automatic BRAM Packing option of the HDL Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
BRAM Utilization Ratio
The BRAM Utilization Ratio (BRAM_UTILIZATION_RATIO) constraint defines the
number of BRAM blocks that XST must not exceed during synthesis. BRAMs in the design
may come not only from BRAM inference processes, but from instantiation and BRAM
mapping optimizations. You may isolate an RTL description of logic in a separate block,
and then ask XST to map this logic to BRAM. For more information, see Mapping Logic
Onto Block RAM in Chapter 3.
Instantiated BRAMs are considered the primary candidates for available BRAM resources.
The inferred RAMs are placed on the remaining BRAM resources. However, if the number
of instantiated BRAMs exceeds the number of available resources, then XST does not
modify the instantiations and implement them as block RAMs. The same behavior occurs
if you force specific RAMs to be implemented as BRAMs. If there are no resources, XST
respects user constraints even if the number of BRAM resources is exceeded.
If the number of user-specified BRAMs exceeds the number of available BRAM resources
on the target FPGA device, XST issues a warning, and use sonly available BRAM resources
on the chip for synthesis process. However, you may disable automatic BRAM resource
management by using value -1. This can be used to see the number of BRAMs XST can
potentially infer for a specific design.
Caution! You may experience significant synthesis time if the number of BRAMs in the design
significantly exceeds the number of available BRAMs on the target FPGA device (hundreds of
BRAMs). This may happen due to a significant increase in design complexity when all non-
fittable BRAMs are converted to distributed RAMs.
332 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
BRAM_UTILIZATION_RATIO Architecture Support
The following table shows whether the constraint may be used with that device.
BRAM_UTILIZATION_RATIO Applicable Elements
Applies to the entire design
BRAM_UTILIZATION_RATIO Propagation Rules
Not applicable
BRAM_UTILIZATION_RATIO Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define this option globally with the -bram_utilization_ratio command line option
of the run command. Following is the basic syntax:
-bram_utilization_ratio <integer>[%][#]
where
<integer> range is [-1 to 100]
The default is 100.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
XST User Guide www.xilinx.com 333
9.1i
FPGA Constraints (Non-Timing)
R
Example One
-bram_utilization_ratio 50
means 50% of BRAMs blocks in the target device
Example Two
-bram_utilization_ratio 50%
means 50% of BRAMs blocks in the target device
Example Three
-bram_utilization_ratio 50#
means 50 BRAMs blocks
Notes
There must be no space between the number and the percent (%) or pound (#)
characters.
In some situations, you can disable automatic BRAM resource management (for
example, to see how many BRAMs XST can potentially infer for a specific design). To
disable automatic resource management, specify -1 (or any negative value) as a
constraint value.
Project Navigator Syntax Example
Define globally with the DSP Utilization Ratio option of the Synthesis Options tab of
the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the
Process Properties dialog box.
In Project Navigator, you can define the value of this option only as a percentage. The
definition of the value in the form of absolute number of slices is not supported.
Buffer Type
Buffer Type (BUFFER_TYPE) is a new name for the CLOCK_BUFFER constraint. Since
CLOCK_BUFFER will become obsolete in future releases, Xilinx strongly suggests that you
use this new name. This constraint selects the type of buffer to be inserted on the input port
or internal net.
The bufr value is supported for Virtex-4 and Virtex-5 devices only.
Buffer Type Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
334 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Buffer Type Applicable Elements
Applies to signals
Buffer Type Propagation Rules
Applies to the signal to which it is attached
Buffer Type Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using BUFFER_TYPE, declare it with the following syntax:
attribute buffer_type: string;
After declaring BUFFER_TYPE, specify the VHDL constraint as follows:
attribute buffer_type of signal_name: signal is
{bufgdll|ibufg|bufgp|ibuf|bufr|none};
Verilog Syntax Example
Place this attribute immediately before the signal declaration:
(* buffer_type = "{bufgdll|ibufg|bufgp|ibuf|bufr|none}" *)
XCF Syntax Example
BEGIN MODEL entity_name
NET signal_name
buffer_type={bufgdll|ibufg|bufgp|ibuf|bufr|none};
END;
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 335
9.1i
FPGA Constraints (Non-Timing)
R
BUFGCE
BUFGCE implements BUFGMUX functionality by inferring a BUFGMUX primitive. This
operation reduces the wiring: clock and clock enable signals are driven to n sequential
components by a single wire.
BUFGCE must be attached to the primary clock signal and may have two values: yes and
no. BUFGCE is accessible through HDL code. If bufgce=yes, XST implements
BUFGMUX functionality if possible (all flip-flops must have the same clock enable signal).
BUFGCE Architecture Support
The following table shows whether the constraint may be used with that device.
BUFGCE Applicable Elements
Applies to clock signals
BUFGCE Propagation Rules
Applies to the signal to which it is attached
BUFGCE Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
336 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
VHDL Syntax Example
Before using BUFGCE, declare it with the following syntax:
attribute bufgce : string;
After declaring BUFGCE, specify the VHDL constraint as follows:
attribute bufgce of signal_name: signal is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the signal declaration:
(* bufgce = "{yes|no}" *)
XCF Syntax Example
BEGIN MODEL entity_name
NET primary_clock_signal bufgce={yes|no|true|false};
END;
Cores Search Directories
The Cores Search Directories command line switch (sd) tells XST to look for cores in
directories other than the default one (by default XST searches for cores in the directory
specified in the ifn switch).
Cores Search Directories Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 337
9.1i
FPGA Constraints (Non-Timing)
R
Cores Search Directories Applicable Elements
Applies globally
Cores Search Directories Propagation Rules
Not applicable
Cores Search Directories Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the sd command line option of the run command. Allowed values
are names of directories. For more information, see Names with Spaces in Chapter 10.
-sd {directory_path [directory_path]}
There is no default.
Project Navigator Syntax Example
Define globally with the Cores Search Directory option of the Synthesis Options tab of
the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Decoder Extraction
The Decoder Extraction (DECODER_EXTRACT) constraint enables or disables decoder
macro inference.
Decoder Extraction Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
338 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Decoder Extraction Applicable Elements
Applies globally or to an entity, module or signal
Decoder Extraction Propagation Rules
When attached to a net or signal, DECODER_EXTRACT applies to the attached
signal.
When attached to an entity or module, DECODER_EXTRACT is propagated to all
applicable elements in the hierarchy within the entity or module.
Decoder Extraction Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using DECODER_EXTRACT, declare it with the following syntax:
attribute decoder_extract: string;
After declaring DECODER_EXTRACT, specify the VHDL constraint as follows:
attribute decoder_extract of {entity_name|signal_name}:
{entity|signal} is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* decoder_extract "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name decoder_extract={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name decoder_extract={yes|no|true|false};
END;
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 339
9.1i
FPGA Constraints (Non-Timing)
R
XST Command Line Syntax Example
Define DECODER_EXTRACT globally with the -decoder_extract command line
option of the run command. Following is the basic syntax:
-decoder_extract {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Decoder Extraction option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. Allowed values are yes (check box is checked)
and no (check box in not checked). By default, decoder inference is enabled (check box is
checked). With a design selected in the Sources window, right-click Synthesize in the
Processes window to access the Process Properties dialog box.
DSP Utilization Ratio
The DSP Utilization Ratio (DSP_UTILIZATION_RATIO) constraint defines the number of
DSP slices (in absolute number or percent of slices) that XST must not exceed during
synthesis optimization. The default value is 100% of the target device.
DSP Utilization Ratio Architecture Support
The following table shows whether the constraint may be used with that device.
DSP Utilization Ratio Applicable Elements
Applies globally
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D Yes
Virtex-II No
Virtex-II Pro No
Virtex-II Pro X No
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
340 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
DSP Utilization Ratio Propagation Rules
Not applicable
DSP Utilization Ratio Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the dsp_utilization_ratio command line option of the run
command.
Following is the basic syntax:
-dsp_utilization_ratio number[%|#]
To specify a percent of total slices use %. To specify an absolute number of slices use #. The
default is %. For example:
To specify 50% of DSP blocks of the target device enter the following:
-dsp_utilization_ratio 50
To specify 50% of DSP blocks of the target device enter the following:
-dsp_utilization_ratio 50%
To specify 50 DSP blocks enter the following:
-dsp_utilization_ratio 50#
Project Navigator Syntax Example
Define globally with the DSP Utilization Ratio option of the Synthesis Options tab of the
Process Properties dialog box in Project Navigator. In Project Navigator, you can define the
value of this option only as a percentage value. The definition of the value in the form of
absolute number of slices is not supported. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
FSM Style
The FSM Style constraint (FSM_STYLE) can be used to make large FSMs more compact
and faster by implementing them in the block RAM resources provided in Virtex and
later technologies. You can direct XST to use block RAM resources rather than LUTs (the
default) to implement FSMs by using the FSM_STYLE design constraint. This is both a
global and a local constraint.
FSM Style Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
XST User Guide www.xilinx.com 341
9.1i
FPGA Constraints (Non-Timing)
R
FSM Style Applicable Elements
Applies globally, or to a VHDL entity, Verilog module, or signal
FSM Style Propagation Rules
Applies to the entity, module, or signal to which it is attached
FSM Style Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using FSM_STYLE, declare it with the following syntax:
attribute fsm_style: string;
After declaring FSM_STYLE, specify the VHDL constraint as follows:
attribute fsm_style of {entity_name|signal_name}: {entity|signal} is
{lut|bram};
The default is lut.
Verilog Syntax Example
Place this attribute immediately before the instance, module, or signal declaration:
(* fsm_style = "{lut|bram}" *)
XCF Syntax Examples
Example One
MODEL entity_name fsm_style = {lut|bram};
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
342 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Example Two
BEGIN MODEL entity_name
NET "signal_name" fsm_style = {lut|bram};
END;
Example Three
BEGIN MODEL entity_name
INST "instance_name" fsm_style = {lut|bram};
END;
Project Navigator Syntax Example
Define globally with the FSM Style option of the Synthesis Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Power Reduction
The Power Reduction (POWER) command line option instructs XST to optimize the design
to consume as little power as possible. Macro processing decisions are made to implement
functions in a manner than uses minimal power. Use of the POWER option is allowed in
both AREA and SPEED modes, but its use may have negative affects on the final overall
area and speed of the design.
In the current release, power optimization done by XST is dedicated to DSP48 and BRAM
blocks. In some situations, XST may issue an HDL Advisor message giving you tips on
how to improve your design. For example, if XST detects that Read First mode is used for
BRAM, XST suggests that you use Write First or No Change modes.
POWER Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D No
Virtex-II No
Virtex-II Pro No
Virtex-II Pro X No
Virtex-4 Yes
XST User Guide www.xilinx.com 343
9.1i
FPGA Constraints (Non-Timing)
R
POWER Applicable Elements
The POWER constraint can be applied:
To the entire design via the XST command line
In VHDL to a component or entity
In Verilog to a model or label (instance)
In XCF to a model or INST (in model)
POWER Propagation Rules
Applies to the entity, module, or signal to which it is attached
POWER Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using POWER, declare it with the following syntax:
attribute power: string;
After declaring POWER, specify the VHDL constraint as follows:
attribute power of {component name|entity_name} : {component|entity} is
{yes|no};
The default is no.
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* power = "{yes|no}" *)
The default is no.
XCF Syntax Example
MODEL "entity_name" power = {yes|no|true|false};
The default is false.
XST Command Line Syntax Example
Define this option globally with the -power command line option of the run command.
Following is the basic syntax:
-power {yes|no}
The default is no.
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
344 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Project Navigator Syntax Example
Specify globally with the Power Reduction option in the Synthesis Option tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Read Cores
The Read Cores (READ_CORES) constraint allows you to enable or disable XSTs ability to
read EDIF or NGC core files for timing estimation and device utilization control. If a
specific core is read by XST, then XST is better able to optimize logic around the core, since
it sees how the logic is connected. However, in some cases the READ_CORES operation
must be disabled in XST in order to obtain the desired results. For example, the PCI core
must not be visible to XST, since the logic directly connected to the PCI core must be
optimized differently as compared to other cores. The READ_CORES constraint allows
you to enable or disable read operations on a core by core basis.
For more information, see Cores Processing in Chapter 3.
The Read Cores option has three possible values:
no (false)
Disables cores processing
yes (true)
Enables cores processing, but maintains the core as a black box and does not further
incorporate the core into the design
optimize
Enables cores processing, and merges the cores netlist into the overall design. This
value is available via the XST command line mode only.
READ_CORES Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
XST User Guide www.xilinx.com 345
9.1i
FPGA Constraints (Non-Timing)
R
READ_CORES Applicable Elements
Since READ_CORES can be used with BOX_TYPE , the set of objects on which the both
constraints can be applied must be the same.
READ_CORES can be applied:
To the entire design via the XST command line
In VHDL to a component or entity
In Verilog to a model or label (instance)
In XCF to a model or INST (in model)
If READ_CORES is applied to at least a single instance of a block, then READ_CORES is
applied to all other instances of this block for the entire design.
READ_CORES Propagation Rules
Not applicable
READ_CORES Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using READ_CORES, declare it with the following syntax:
attribute read_cores: string;
After declaring READ_CORES, specify the VHDL constraint as follows:
attribute read_cores of {component_name|entity_name} :
{component|entity} is {yes|no|optimize};
The default is yes.
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* read_cores = "{yes|no|optimize}" *)
The default is yes.
XCF Syntax Examples
Example One
MODEL entity_name read_cores = {yes|no|true|false|optimize};
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
346 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Example Two
BEGIN MODEL entity_name
INST instance_name read_cores = {yes|no|true|false|optimize};
END;
The default is yes.
XST Command Line Syntax Example
-read_cores {yes|no|optimize}
Project Navigator Syntax Example
Define globally with the Read Cores option of the Synthesis Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box. The optimize option is not available in Project Navigator.
Resynthesize
The RESYNTHESIZE constraint is related to Incremental Synthesis Flow. It forces or
prevents resynthesis of groups created via the INCREMENTAL_SYNTHESIS constraint.
See Incremental Synthesis for more information. Allowed values are yes and no (the
values true and false are available in XCF also). No global option is available.
Resynthesize Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 347
9.1i
FPGA Constraints (Non-Timing)
R
Resynthesize Applicable Elements
Applies to design elements only
Resynthesize Propagation Rules
Applies to the entity or module to which it is attached
Resynthesize Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using RESYNTHESIZE declare it with the following syntax:
attribute resynthesize: string;
After declaring RESYNTHESIZE, specify the VHDL constraint as follows:
attribute resynthesize of entity_name: entity is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* resynthesize = "{yes|no}" *)
XCF Syntax Example
MODEL entity_name resynthesize={yes|no};
Incremental Synthesis
The Incremental Synthesis (INCREMENTAL_SYNTHESIS) constraint controls the
decomposition of a design into several subgroups. This can be applied on a VHDL entity or
Verilog module so that XST generates a single and separate NGC file for it and its
descendents. For more information, see Partitions in Chapter 3.
INCREMENTAL_SYNTHESIS is not accessible via the Synthesize - XST Process Properties
dialog box. This directive is only available via VHDL attributes or Verilog meta comments,
or via an XST constraint file.
Incremental Synthesis Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
348 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Incremental Synthesis Applicable Elements
Applies to a VHDL entity or Verilog module
Incremental Synthesis Propagation Rules
Applies to the entity or module to which it is attached
Incremental Synthesis Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using INCREMENTAL_SYNTHESIS, declare it with the following syntax:
attribute incremental_synthesis: string;
After declaring INCREMENTAL_SYNTHESIS, specify the VHDL constraint as follows:
attribute incremental_synthesis of entity_name: entity is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* incremental_synthesis = "{yes|no}" *)
XCF Syntax Example
MODEL entity_name incremental_synthesis={yes|no};
Logical Shifter Extraction
The Logical Shifter Extraction (SHIFT_EXTRACT) constraint enables or disables logical
shifter macro inference. Allowed values are yes (check box is checked) and no (check box
is not checked). The values true and false are available in XCF also. By default, logical
shifter inference is enabled (yes).
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 349
9.1i
FPGA Constraints (Non-Timing)
R
Logical Shifter Extraction Architecture Support
The following table shows whether the constraint may be used with that device.
Logical Shifter Extraction Applicable Elements
Applies globally, or to design elements and nets
Logical Shifter Extraction Propagation Rules
Applies to the entity, module, or signal to which it is attached
Logical Shifter Extraction Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using SHIFT_EXTRACT declare it with the following syntax:
attribute shift_extract: string;
After declaring SHIFT_EXTRACT, specify the VHDL constraint as follows:
attribute shift_extract of {entity_name|signal_name}: {signal|entity}
is {yes|no};
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
350 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* shift_extract = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name shift_extract={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name shift_extract={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the shift_extract command line option of the run command.
Following is the basic syntax:
-shift_extract {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Logical Shifter Extraction option of the HDL Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Map Logic on BRAM
The Map Logic on BRAM (BRAM_MAP) constraint is used to map an entire hierarchical
block on the block RAM resources available in Virtex and later technologies. The values are
yes and no, with no being the default. This is both a global and a local constraint. See
Mapping Logic Onto Block RAM in Chapter 3, for more information.
BRAM_MAP Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
XST User Guide www.xilinx.com 351
9.1i
FPGA Constraints (Non-Timing)
R
BRAM_MAP Applicable Elements
Applies to BRAMs
BRAM_MAP Propagation Rules
You must isolate the logic (including output register) to be mapped on ram in a separate
hierarchical level. The logic must fit on a single block RAM, otherwise it will not be
mapped. Ensure that the whole entity fits, not just part of it.
The attribute BRAM_MAP is set on the instance or entity. If no block RAM can be inferred,
the logic is passed on to Global Optimization where it will be optimized. The macros will
not be inferred. Check to be sure that XST has mapped the logic.
BRAM_MAP Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using BRAM_MAP, declare it with the following syntax:
attribute bram_map: string;
After declaring BRAM_MAP, specify the VHDL constraint as follows:
attribute bram_map of component_name: component is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* bram_map = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name bram_map = {yes|no|true|false};
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
352 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Example Two
BEGIN MODEL entity_name
INST "instance_name" bram_map = {yes|no|true|false};
END;
Max Fanout
The Max Fanout (MAX_FANOUT) constraint limits the fanout of nets or signals. The
constraint value is an integer, and the default is 100 for Virtex, Virtex-E, Spartan-II, and
Spartan-IIE; and 500 for Spartan-3, Virtex-II, Virtex-II Pro, Virtex-II Pro X, and Virtex-4. It is
both a global and a local constraint.
Large fanouts can cause routability problems, therefore XST tries to limit fanout by
duplicating gates or by inserting buffers. This limit is not a technology limit but a guide to
XST. It may happen that this limit is not exactly respected, especially when this limit is
small (below 30).
In most cases, fanout control is performed by duplicating the gate driving the net with a
large fanout. If the duplication cannot be performed, then buffers will be inserted. These
buffers will be protected against logic trimming at the implementation level by defining a
KEEP attribute in the NGC file.
If the register replication option is set to no, only buffers are used to control fanout of flip-
flops and latches.
MAX_FANOUT is global for the design, but you can control maximum fanout
independently for each entity or module or for given individual signals by using
constraints.
If the actual net fanout is less than MAX_FANOUT value, then XST behavior depends on
the way the MAX_FANOUT is specified.
If MAX_FANOUT value is set via Project Navigator, in command line or attached to a
specific hierarchical block, then XST interprets its value as a guidance.
If MAX_FANOUT is attached to a specific net, then XST does not perform logic
replication. Putting MAX_FANOUT on the net may prevent XST from having better
timing optimization.
For example, suppose that the critical path goes through the net, which actual fanout is 80
and set MAX_FANOUT value to 100. If MAX_FANOUT is specified via Project Navigator,
then XST may replicate it, trying to improve timing. If MAX_FANOUT is attached to the
net itself, then XST will not perform logic replication.
MAX_FANOUT Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
XST User Guide www.xilinx.com 353
9.1i
FPGA Constraints (Non-Timing)
R
MAX_FANOUT Applicable Elements
Applies globally, or to a VHDL entity, a Verilog module, or signal
MAX_FANOUT Propagation Rules
Applies to the entity, module, or signal to which it is attached
MAX_FANOUT Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using MAX_FANOUT, declare it with the following syntax:
attribute max_fanout: string;
After declaring MAX_FANOUT, specify the VHDL constraint as follows:
attribute max_fanout of {signal_name|entity_name}: {signal|entity} is
integer;
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* max_fanout = "integer" *)
XCF Syntax Examples
Example One
MODEL entity_name max_fanout=integer;
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
354 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Example Two
BEGIN MODEL entity_name
NET signal_name max_fanout=integer;
END;
XST Command Line Syntax Example
Define globally with the -max_fanout command line option of the run command.
Following is the basic syntax:
-max_fanout integer
(a) One Hundred Thousand
Project Navigator Syntax Example
Define globally with the Max Fanout option of the Xilinx Specific Options tab in the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Move First Stage
The Move First Stage (MOVE_FIRST_STAGE) constraint controls the retiming of registers
with paths coming from primary inputs. The Move First Stage constraint, as well as the
Move Last Stage constraint, relate to the Register Balancing process.
Definitions
A flip-flop (FF in the diagram) belongs to the First Stage if it is on the paths coming
from primary inputs.
A flip-flop belongs to the Last Stage if it is on the paths going to primary outputs.
Table 5-1: Default Values of MAX_FANOUT
Devices Default Value
Virtex, Virtex-E 100
Spartan-II, Spartan-IIE 100
Spartan-3, Spartan-3E, Spartan-3A,
Spartan-3A D
500
Virtex-II, Virtex-II Pro, Virtex-II Pro X 500
Virtex-4 500
Virtex-5 100000
(a)
XST User Guide www.xilinx.com 355
9.1i
FPGA Constraints (Non-Timing)
R
During the register balancing process flip-flops belonging to the First Stage will be moved
forward and flip-flops, belonging to the last stage will be moved backward. This process
can dramatically increase input-to-clock and clock-to-output timing, which is not
desirable. To prevent this, you may use OFFSET_IN_BEFORE and OFFSET_IN_AFTER
constraints.
In the case:
The design does not have a strong requirements, or
You would like to see the first results without touching the first and last flip-flop
stages
Two additional constraints can be used: MOVE_FIRST_STAGE and MOVE_LAST_STAGE.
Both constraints may have two values: yes and no.
MOVE_FIRST_STAGE=no prevents the first flip-flop stage from moving
MOVE_LAST_STAGE=no prevents the last flip-flop stage from moving
Several constraints influence the register balancing process. For more information, see
Register Balancing.
MOVE_FIRST_STAGE Architecture Support
The following table shows whether the constraint may be used with that device.
Figure 5-2: Move First Stage
X9564
FF
FF
A
Y1
Y2
FF
FF
FF
FF
LOGIC LOGIC
LOGIC
LOGIC LOGIC
Last FF
Stage
First FF
Stage
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
356 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
MOVE_FIRST_STAGE Applicable Elements
Applies to the following only:
Entire design
Single modules or entities
Primary clock signal
MOVE_FIRST_STAGE Propagation Rules
See description above for details.
MOVE_FIRST_STAGE Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using MOVE_FIRST_STAGE, declare it with the following syntax:
attribute move_first_stage : string;
After declaring MOVE_FIRST_STAGE, specify the VHDL constraint as follows:
attribute move_first_stage of {entity_name|signal_name}:
{signal|entity} is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* move_first_stage = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name move_first_stage={yes|no|true|false};
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 357
9.1i
FPGA Constraints (Non-Timing)
R
Example Two
BEGIN MODEL entity_name
NET primary_clock_signal move_first_stage={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the move_first_stage command line option of the run
command. Following is the basic syntax:
-move_first_stage {yes|no}
The default is yes.
Project Navigator
Define globally with the Move First Flip-Flop Stage option of the Xilinx Specific Options
tab of the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Move Last Stage
The Move Last Stage (MOVE_LAST_STAGE) constraint controls the retiming of registers
with paths going to primary outputs. The Move Last Stage constraint, as well as theMove
First Stage, constraint, relate to the Register Balancing process.
MOVE_LAST_STAGE Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
358 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
MOVE_LAST_STAGE Applicable Elements
Applies to the following only:
Entire design
Single modules or entities
Primary clock signal
MOVE_LAST_STAGE Propagation Rules
See Move First Stage description for details.
MOVE_LAST_STAGE Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using MOVE_LAST_STAGE, declare it with the following syntax:
attribute move_last_stage : string;
After declaring MOVE_LAST_STAGE, specify the VHDL constraint as follows:
attribute move_last_stage of {entity_name|signal_name}:
{signal|entity} is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* move_last_stage = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name move_last_stage={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET primary_clock_signal move_last_stage={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the move_last_stage command line option of the run command.
Following is the basic syntax:
-move_last_stage {yes|no}
The default is yes.
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 359
9.1i
FPGA Constraints (Non-Timing)
R
Project Navigator Syntax Example
Define globally with the Move Last Flip-Flop Stage option of the Xilinx Specific Options
tab of the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Multiplier Style
The Multiplier Style (MULT_STYLE) constraint controls the way the macrogenerator
implements the multiplier macros. Allowed values are auto, block, pipe_block,
kcm, csd, lut, and pipe_lut. The pipe_block value is supported for Virtex-4 and
Virtex-5 devices only.
For Virtex-II, Virtex-II Pro, Virtex-II Pro X, Virtex-4, and Virtex-5 devices, the default is
auto. XST looks for the best implementation for each considered macro.
The pipe_lut option is for pipeline slice-based multipliers. The implementation style can
be manually forced to use block multiplier or LUT resources available in Virtex-II, Virtex-
II Pro, Virtex-II Pro X, Virtex-4, and Virtex-5 devices.
The pipe_block option is to pipeline DSP48 based multipliers. It is available for Virtex-4
and Virtex-5 devices only.
Multiplier Style Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
360 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Multiplier Style Applicable Elements
Applies globally, or to a VHDL entity, a Verilog module, or signal
Multiplier Style Propagation Rules
Applies to the entity, module, or signal to which it is attached
Multiplier Style Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using MULT_STYLE, declare it with the following syntax:
attribute mult_style: string;
After declaring MULT_STYLE, specify the VHDL constraint as follows:
attribute mult_style of {signal_name|entity_name}: {signal|entity} is
{auto|block|pipe_block|kcm|csd|lut|pipe_lut};
For Virtex, Virtex-E, Spartan-II, and Spartan-IIE, the default is lut.
For Virtex-II, Virtex-II Pro, Virtex-II Pro X, Virtex-4, Virtex-5, Spartan-3, Spartan-3E,
Spartan-3A, and Spartan-3A D, the default is auto.
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* mult_style = "{auto|block|pipe_block|kcm|csd|lut|pipe_lut}" *)
For Virtex, Virtex-E, Spartan-II, and Spartan-IIE, the default is lut.
For Virtex-II, Virtex-II Pro, Virtex-II Pro X, Virtex-4, Virtex-5, Spartan-3, Spartan-3E,
Spartan-3A, and Spartan-3A D, the default is auto.
XCF Syntax Examples
Example One
MODEL entity_name
mult_style={auto|block|pipe_block|kcm|csd|lut|pipe_lut};
Example Two
BEGIN MODEL entity_name
NET signal_name
mult_style={auto|block|pipe_block|kcm|csd|lut|pipe_lut};
END;
XST Command Line Syntax Example
Define globally with the -mult_style command line option of the run command.
Following is the basic syntax:
-mult_style {auto|block|pipe_block|kcm|csd|lut|pipe_lut}
XST User Guide www.xilinx.com 361
9.1i
FPGA Constraints (Non-Timing)
R
For Virtex, Virtex-E, Spartan-II, and Spartan-IIE devices, the default is lut.
For Virtex-II, Virtex-II Pro, Virtex-II Pro X, Spartan-3, Spartan-3E, and Spartan-3A devices,
the default is auto.
The -mult_style command line option is not supported for Virtex-4 or Virtex-5 devices.
For those devices, use the -use_dsp48 command line option.
Project Navigator Syntax Example
Define globally with the Multiplier Style property in the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a source file selected in the Sources in
Project window, right-click Synthesize in the Processes for Source window to access the
Process Properties dialog box.
Mux Style
The Mux Style (MUX_STYLE) constraint controls the way the macrogenerator implements
the multiplexer macros. Allowed values are auto, muxf and muxcy. The default value is
auto, meaning that XST looks for the best implementation for each considered macro.
Available implementation styles for the Virtex, Virtex-E, and Spartan-II, Spartan-IIE series
are based on either MUXF5 and MUXF6 resources, or MUXCY resources. In addition,
Spartan-3, Spartan3-E, Spartan-3A, Spartan-3A D, Virtex-II, Virtex-II Pro, Virtex-II Pro X,
Virtex-4, and Virtex-5 can use MUXF7, and MUXF8 resources as well.
MUX_STYLE Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
362 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
MUX_STYLE Applicable Elements
Applies globally, or to a VHDL entity, a Verilog module, or signal
MUX_STYLE Propagation Rules
Applies to the entity, module, or signal to which it is attached
MUX_STYLE Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using MUX_STYLE, declare it with the following syntax:
attribute mux_style: string;
After declaring MUX_STYLE, specify the VHDL constraint as follows:
attribute mux_style of {signal_name|entity_name}: {signal|entity} is
{auto|muxf|muxcy};
The default value is auto.
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* mux_style = "{auto|muxf|muxcy}" *)
The default value is auto.
XCF Syntax Examples
Example One
MODEL entity_name mux_style={auto|muxf|muxcy};
Example Two
BEGIN MODEL entity_name
NET signal_name mux_style={auto|muxf|muxcy};
END;
XST Command Line Syntax Example
Define globally with the mux_style command line option of the run command.
Following is the basic syntax:
-mux_style {auto|muxf|muxcy}
The default is auto.
Project Navigator Syntax Example
Define globally with the Mux Style option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
XST User Guide www.xilinx.com 363
9.1i
FPGA Constraints (Non-Timing)
R
Number of Global Clock Buffers
The Number of Global Clock Buffers (bufg) constraint controls the maximum number of
BUFGs created by XST. The constraint value is an integer. The default value depends on the
target family and is equal to the maximum number of available BUFGs.
Number of Global Clock Buffers Architecture Support
The following table shows whether the constraint may be used with that device.
Number of Global Clock Buffers Applicable Elements
Applies globally
Number of Global Clock Buffers Propagation Rules
Not applicable
Number of Global Clock Buffers Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the -bufg command line option of the run command.
Following is the basic syntax:
-bufg integer
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
364 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
The constraint value is an integer and the default values are different for different
architectures. The defaults for selected architectures are shown in the following table. The
number of BUFGs cannot exceed the maximum number of BUFGs for the target device.
Project Navigator Syntax Example
Define globally with the Number of Clock Buffers option of the Xilinx Specific Options
tab of the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Number of Regional Clock Buffers
The Number of Regional Clock Buffers (bufr) constraint controls the maximum number
of BUFRs created by XST. The constraint value is an integer. The default value depends on
the target family, and is equal to the maximum number of available BUFRs.
Number of Regional Clock Buffers Architecture Support
The following table shows whether the constraint may be used with that device.
Table 5-2: Default Values of Number of Global Clock Buffers
Devices Default Value
Virtex, Virtex-E 4
Virtex-II, Virtex-II Pro,
Virtex-II Pro X
16
Virtex-4, Virtex-5 32
Spartan-II, Spartan-IIE 4
Spartan-3 8
Spartan-3E, Spartan-3A,
Spartan-3A D
24
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D No
Virtex-II No
Virtex-II Pro No
Virtex-II Pro X No
XST User Guide www.xilinx.com 365
9.1i
FPGA Constraints (Non-Timing)
R
Number of Regional Clock Buffers Applicable Elements
Applies globally
Number of Regional Clock Buffers Propagation Rules
Not applicable
Number of Regional Clock Buffers Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the bufr command line option of the run command. Following is
the basic syntax:
-bufr integer
This constraint is available for Virtex-4 devices only. The constraint value is an integer and
the default value is different for each Virtex-4 device. This constraint is NOT available for
Virtex-5.
The number of BUFRs cannot exceed the maximum number of BUFRs for the target device.
Project Navigator Syntax Example
Define globally with the Number of Regional Clock Buffers option of the Xilinx Specific
Options tab of the Process Properties dialog box in Project Navigator. With a design
selected in the Sources window, right-click Synthesize in the Processes window to access
the Process Properties dialog box.
Optimize Instantiated Primitives
By default, XST does not optimize instantiated primitives in HDL code. The Optimize
Instantiated Primitives (OPTIMIZE_PRIMITIVES) constraint is used to deactivate the
default. This constraint allows XST to optimize Xilinx library primitives that have been
instantiated in HDL.
Optimization of instantiated primitives is limited by the following factors:
If an instantiated primitive has specific constraints such as RLOCs attached, XST
preserves it as is.
Not all primitives are considered by XST for optimization. Such hardware elements as
MULT18x18, BRAMs, and DSP48 are not optimized (modified) even if optimization of
instantiated primitives is enabled.
Virtex-4 Yes
Virtex-5 No
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
366 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Optimize Instantiated Primitives Architecture Support
The following table shows whether the constraint may be used with that device.
Optimize Instantiated Primitives Applicable Elements
Applies to hierarchical blocks, components, and instances
Optimize Instantiated Primitives Propagation Rules
Applies to the component or instance to which it is attached
Optimize Instantiated Primitives Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Schematic Syntax Examples
Attach to a valid instance
Attribute Name
OPTIMIZE_PRIMITIVES
Attribute Value
YES and NO (Default)
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 367
9.1i
FPGA Constraints (Non-Timing)
R
VHDL Syntax Example
Before using OPTIMIZE_PRIMITIVES, declare it with the following syntax:
attribute optimize_primitives: string;
After declaring OPTIMIZE_PRIMITIVES, specify the VHDL constraint as follows:
attribute optimize_primitives of
{component_name|entity_name|label_name}: {component|entity|label} is
{yes|no};
Verilog Syntax Example
Place this attribute immediately before the instance, module or signal declaration:
(* optimize_primitives = "{yes|no}" *)
XCF Syntax Example
MODEL entity_name optimize_primitives = {yes|no|true|false};
Project Navigator Syntax Example
Define globally with the Optimize Instantiated Primitives property in the Xilinx Specific
Options tab of the Process Properties dialog box in Project Navigator. With a source file
selected in the Sources in Project window, right-click Synthesize in the Processes for
Source window to access the Process Properties dialog box.
Pack I/O Registers Into IOBs
The Pack I/O Registers Into IOBs (IOB) constraint packs flip-flops in the I/Os to improve
input/output path timing. For more information, see IOB in the Xilinx Constraints Guide.
Priority Encoder Extraction
The Priority Encoder Extraction (PRIORITY_EXTRACT) constraint enables or disables
priority encoder macro inference. Allowed values are yes, no and force (true and
false are available in XCF as well).
By default, priority encoder inference is enabled (yes). For each identified priority encoder
description, based on some internal decision rules, XST will actually create a macro or
optimize it with the rest of the logic. The force value allows you to override those
decision rules and force XST to extract the macro.
Priority Encoder Extraction Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
368 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Priority Encoder Extraction Applicable Elements
Applies globally or to an entity, module, or signal
Priority Encoder Extraction Propagation Rules
Applies to the entity, module, or signal to which it is attached
Priority Encoder Extraction Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using PRIORITY_EXTRACT, declare it with the following syntax:
attribute priority_extract: string;
After declaring PRIORITY_EXTRACT, specify the VHDL constraint as follows:
attribute priority_extract of {signal_name|entity_name}:
{signal|entity} is {yes|no|force};
The default is yes.
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* priority_extract = "{yes|no|force}" *)
XCF Syntax Examples
Example One
MODEL entity_name priority_extract={yes|no|true|false|force};
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 369
9.1i
FPGA Constraints (Non-Timing)
R
Example Two
BEGIN MODEL entity_name
NET signal_name priority_extract={yes|no|true|false|force};
END;
XST Command Line Syntax Example
Define globally with the -priority_extract command line option of the run
command. Following is the basic syntax:
-priority_extract {yes|no|force}
The default is yes.
Project Navigator Syntax Example
Define globally with the Priority Encoder Extraction option of the HDL Options tab of
the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
RAM Extraction
The RAM Extraction (RAM_EXTRACT) constraint enable or disables RAM macro
inference. Allowed values are yes and no. The values true and false are also available
in XCF. By default, RAM inference is enabled (yes).
RAM Extraction Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
370 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
RAM Extraction Applicable Elements
Applies globally, or to an entity, module, or signal
RAM Extraction Propagation Rules
Applies to the entity, module, or signal to which it is attached
RAM Extraction Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using RAM_EXTRACT, declare it with the following syntax:
attribute ram_extract: string;
After declaring RAM_EXTRACT, specify the VHDL constraint as follows:
attribute ram_extract of {signal_name|entity_name}: {signal|entity} is
{yes|no};
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* ram_extract = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name ram_extract={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name ram_extract={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the -ram_extract command line option of the run command.
Following is the basic syntax:
-ram_extract {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the RAM Extraction option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 371
9.1i
FPGA Constraints (Non-Timing)
R
RAM Style
The RAM Style (RAM_STYLE) constraint controls the way the macrogenerator
implements the inferred RAM macros. Allowed values are auto, block and
distributed and pipe_distributed. The default value is auto, meaning that XST
looks for the best implementation for each inferred RAM. The implementation style can be
manually forced to use block RAM or distributed RAM resources.
You can only specify the pipe_distributed value through VHDL or Verilog or XCF
constraints.
RAM Style Architecture Support
The following table shows whether the constraint may be used with that device.
RAM Style Applicable Elements
Applies globally or to an entity, module, or signal
RAM Style Propagation Rules
Applies to the entity, module, or signal to which it is attached
RAM Style Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
372 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
VHDL Syntax Example
Before using RAM_STYLE, declare it with the following syntax:
attribute ram_style: string;
After declaring RAM_STYLE, specify the VHDL constraint as follows:
attribute ram_style of {signal_name|entity_name}: {signal|entity} is
{auto|block|distributed|pipe_distributed};
The default value is auto.
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* ram_style = "{auto|block|distributed|pipe_distributed}" *)
The default value is auto.
XCF Syntax Examples
Example One
MODEL entity_name
ram_style={auto|block|distributed|pipe_distributed};
Example Two
BEGIN MODEL entity_name
NET signal_name
ram_style={auto|block|distributed|pipe_distributed};
END;
XST Command Line Syntax Example
Define globally with the -ram_style command line option of the run command.
Following is the basic syntax:
-ram_style {auto|block|distributed}
The default is auto.
The pipe_distributed value is not accessible via the command line.
Project Navigator Syntax Example
Define globally with the RAM Style option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Register Balancing
The Register Balancing (REGISTER_BALANCING) constraint enables flip-flop retiming.
The main goal of register balancing is to move flip-flops and latches across logic to increase
clock frequency. There are two categories of register balancing:
Forward Register Balancing will move a set of flip-flops that are at the inputs of a LUT
to a single flip-flop at its output.
XST User Guide www.xilinx.com 373
9.1i
FPGA Constraints (Non-Timing)
R
Figure 5-3: Forward Register Balancing
Backward Register Balancing will move a flip-flop which is at the output of a LUT to a
set of flip-flops at its inputs.
Figure 5-4: Backward Register Balancing
As a consequence the number of flip-flops in the design can be increased or decreased.
This constraint may have the following values: yes, no, forward, and backward. The
values true and false are also available in XCF. The default is no, meaning that XST will
not perform flip-flop retiming. Yes means that both forward and backward retiming are
possible. Forward means that only forward retiming is allowed, while backward means
that only backward retiming is allowed.
This constraint can be applied:
Globally to the entire design via the command line or the application interface
To an entity or module
To a signal corresponding to the flip-flop description (RTL)
X9563
FF
FF
FF
B
A
B
A
LUT1
LUT1
LUT2
LUT2
X9566
FF
FF
FF
B
A
B
A
LUT1
LUT1
LUT2
LUT2
374 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Flip-flop instance
Primary Clock Signal. In this case the register balancing will be performed only for
flip-flops synchronized by this clock.
There are two additional constraints, called Move First Stage and Move Last Stage,
that control the register balancing process.
Several constraints influence the register balancing process.
Hierarchy Treatment
If the hierarchy is preserved, then flip-flops will be moved only inside the block
boundaries.
If the hierarchy is flattened, then flip-flops may leave the block boundaries.
IOB=TRUE
Register Balancing will be not applied to the flip-flops having this property.
OPTIMIZE_PRIMITIVES
Instantiated flip-flops are moved only if OPTIMIZE_PRIMITIVES=YES.
Flip-flops are moved across instantiated primitives only if
OPTIMIZE_PRIMITIVES=YES.
KEEP
If applied to the output flip-flop signal, then the flip-flop will not be moved forward.
Figure 5-5: Applied to the Output Flip-Flop Signal
If applied to the input flip-flop signal, then the flip-flop will not be moved backward.
Figure 5-6: Applied to the Input Flip-Flop Signal
If applied to both the input and output of the flip-flop, it is equivalent to
REGISTER_BALANCING=no.
When moving flip-flops, XST applies the following naming conventions:
X9565
FF
KEEP
LUT LUT
X9562
FF
KEEP
LUT LUT
XST User Guide www.xilinx.com 375
9.1i
FPGA Constraints (Non-Timing)
R
Backward Register BalancingThe new flip-flop will have the same name as the
original flip-flop with an indexed suffix as in the following.
OriginalFFName_BRBId
Forward Register BalancingWhen replacing several flip-flops with one, select
the name based on the name of the LUT across which the flip-flops are moving as
in the following.
LutName_FRBId
Register Balancing Architecture Support
The following table shows whether the constraint may be used with that device.
Register Balancing Applicable Elements
Applies globally or to an entity, module, or signal
Register Balancing Propagation Rules
Applies to the entity, module, or signal to which it is attached
Register Balancing Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
376 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
VHDL Syntax Example
Before using REGISTER_BALANCING, declare it with the following syntax:
attribute register_balancing: string;
After declaring REGISTER_BALANCING, specify the VHDL constraint as follows:
attribute register_balancing of {signal_name|entity_name}:
{signal|entity} is "{yes|no|foward|backward}";
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* register_balancing = "{yes|no|foward|backward}" *)
The default value is no.
XCF Syntax Examples
Example One
MODEL entity_name
register_balancing={yes|no|true|false|forward|backward};
Example Two
BEGIN MODEL entity_name
NET primary_clock_signal
register_balancing={yes|no|true|false|forward|backward};
END;
Example Three
BEGIN MODEL entity_name
INST instance_name
register_balancing={yes|no|true|false|forward|backward};
END;
XST Command Line Syntax Example
Define globally with the register_balancing command line option of the run
command. Following is the basic syntax:
-register_balancing {yes|no|forward|backward}
The default is no.
Project Navigator Syntax Example
Define globally with the Register Balancing option of the Xilinx Specific Options tab of
the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Register Duplication
The Register Duplication (REGISTER_DUPLICATION) constraint enables or disables
register replication. Allowed values are yes and no. (The values true and false are also
XST User Guide www.xilinx.com 377
9.1i
FPGA Constraints (Non-Timing)
R
available in XCF. The default is yes, and means that register replication is enabled, and is
performed during timing optimization and fanout control.
Register Duplication Architecture Support
The following table shows whether the constraint may be used with that device.
Register Duplication Applicable Elements
Applies globally, or to an entity or module
Register Duplication Propagation Rules
Applies to the entity or module to which it is attached
Register Duplication Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before REGISTER_DUPLICATION can be used, it must be declared with the following
syntax:
attribute register_duplication: string;
After declaring REGISTER_DUPLICATION, specify the VHDL constraint as follows:
attribute register_duplication of entity_name: entity is {yes|no};
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
378 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* register_duplication = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL "entity_name" register_duplication={yes|no|true|false};
Example Two
BEGIN MODEL "entity_name"
NET "signal_name" register_duplication={yes|no|true|false};
END;
Project Navigator Syntax Example
Define globally with the Register Duplication option of the Xilinx Specific Options tab of
the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
ROM Extraction
The ROM Extraction (ROM_EXTRACT) constraint enables or disables ROM macro
inference. Allowed values are yes, and no. The values true and false are also available
in XCF. The default is yes. Typically, a ROM can be inferred from a Case statement where
all assigned contexts are constant values.
ROM Extraction Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XST User Guide www.xilinx.com 379
9.1i
FPGA Constraints (Non-Timing)
R
ROM Extraction Applicable Elements
Applies globally, or to a design element or signal
ROM Extraction Propagation Rules
Applies to the entity, module, or signal to which it is attached
ROM Extraction Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using ROM_EXTRACT, declare it with the following syntax:
attribute rom_extract: string;
After declaring ROM_EXTRACT, specify the VHDL constraint as follows:
attribute rom_extract of {signal_name|entity_name}: {signal|entity} is
{yes|no};
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* rom_extract = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name rom_extract={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name rom_extract={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the rom_extract command line option of the run command.
Following is the basic syntax:
-rom_extract {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the ROM Extraction option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
380 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
ROM Style
ROM Style (ROM_STYLE) controls the way the macrogenerator implements the inferred
ROM macros. ROM_EXTRACT must be set to yes to use ROM_STYLE. Allowed values
are auto, block and distributed. The default value is auto, meaning that XST looks
for the best implementation for each inferred ROM. The implementation style can be
manually forced to use block ROM or distributed ROM resources.
ROM Style Architecture Support
The following table shows whether the constraint may be used with that device.
ROM Style Applicable Elements
Applies globally, or to an entity, module, or signal
ROM Style Propagation Rules
Applies to the entity, module, or signal to which it is attached
ROM Style Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 381
9.1i
FPGA Constraints (Non-Timing)
R
VHDL Syntax Example
ROM_EXTRACT must be set to yes to use ROM_STYLE.
Before using ROM_STYLE, declare it with the following syntax:
attribute rom_style: string;
After declaring ROM_STYLE, specify the VHDL constraint as follows:
attribute rom_style of {signal_name|entity_name}: {signal|entity} is
{auto|block|distributed};
The default value is auto.
Verilog Syntax Example
ROM_EXTRACT must be set to yes to use ROM_STYLE.
Place this attribute immediately before the module or signal declaration:
(* rom_style = "{auto|block|distributed}" *)
The default value is auto.
XCF Syntax Examples
ROM_EXTRACT must be set to yes to use ROM_STYLE.
Example One
MODEL entity_name rom_style={auto|block|distributed};
Example Two
BEGIN MODEL entity_name
NET signal_name rom_style={auto|block|distributed};
END;
XST Command Line Syntax Example
ROM_EXTRACT must be set to yes to use ROM_STYLE.
Define globally with the -rom_style command line option of the run command.
Following is the basic syntax:
-rom_style {auto|block|distributed}
The default is auto.
Project Navigator Syntax Example
ROM Extraction must be set to yes to use ROM Style.
Define globally with the ROM Style option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Shift Register Extraction
The Shift Register Extraction (SHREG_EXTRACT) constraint enables or disables shift
register macro inference. Allowed values are yes (check box is checked) and no (check box
382 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
is not checked). The values true and false are available in XCF. By default, shift register
inference is enabled.
Enabling this option for FPGA devices results in the usage of dedicated hardware
resources such as SRL16 and SRLC16. For more information, see Shift Registers in
Chapter 2.
Shift Register Extraction Architecture Support
The following table shows whether the constraint may be used with that device.
Shift Register Extraction Applicable Elements
Applies globally, or to design elements and signals
Shift Register Extraction Propagation Rules
Applies to design elements or signals to which it is attached
Shift Register Extraction Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using SHREG_EXTRACT, declare it with the following syntax:
attribute shreg_extract : string;
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 383
9.1i
FPGA Constraints (Non-Timing)
R
After declaring SHREG_EXTRACT, specify the VHDL constraint as follows:
attribute shreg_extract of {signal_name|entity_name}: {signal|entity}
is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* shreg_extract = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name shreg_extract={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name shreg_extract={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the shreg_extract command line option of the run command.
Following is the basic syntax:
-shreg_extract {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Shift Register Extraction option of the HDL Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Slice Packing
The Slice Packing (slice_packing) option enables the XST internal packer. The packer
attempts to pack critical LUT-to-LUT connections within a slice or a CLB. This exploits the
fast feedback connections among the LUTs in a CLB.
Slice Packing Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
384 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Slice Packing Applicable Elements
Applies globally
Slice Packing Propagation Rules
Not applicable
Slice Packing Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the slice_packing command line option of the run command.
Following is the basic syntax:
-slice_packing {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Slice Packing option of the Xilinx Specific Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
USELOWSKEWLINES
The USELOWSKEWLINES constraint is a basic routing constraint. From a Synthesis point
of view it prevents XST from using dedicated clock resources and logic replication, based
on the value of the MAX_FANOUT constraint. It specifies the use of low skew routing
resources for any net. For more information, see USELOWSKEWLINES in the Xilinx
Constraints Guide.
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 385
9.1i
FPGA Constraints (Non-Timing)
R
XOR Collapsing
The XOR Collapsing (XOR_COLLAPSE) constraint controls whether cascaded XORs
should be collapsed into a single XOR. Allowed values are yes (check box is checked) and
no (check box is not checked). The values true and false are available in XCF. By
default, XOR collapsing is enabled (yes).
XOR Collapsing Architecture Support
The following table shows whether the constraint may be used with that device.
XOR Collapsing Applicable Elements
Apply to cascaded XORs
XOR Collapsing Propagation Rules
Not applicable
XOR Collapsing Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before XOR_COLLAPSE can be used, it must be declared with the following syntax:
attribute xor_collapse: string;
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
386 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
After declaring XOR_COLLAPSE, specify the VHDL constraint as follows:
attribute xor_collapse {signal_name|entity_name}: {signal|entity} is
{yes|no};
The default value is yes.
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* xor_collapse = "{yes|no}" *)
The default value is yes.
XCF Syntax Examples
Example One
MODEL entity_name xor_collapse={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name xor_collapse={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the xor_collapse command line option of the run command.
Following is the basic syntax:
-xor_collapse {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the XOR Collapsing option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Slice Utilization Ratio
The Slice Utilization Ratio (SLICE_UTILIZATION_RATIO) constraint defines the area size
in absolute numbers or percent of total numbers of LUT-FF pairs (for Virtex-5) and slices
(for all other families) that XST must not exceed during timing optimization.
If the area constraint cannot be satisfied, XST will make timing optimization regardless of
the area constraint. To disable automatic resource management, specify -1 as a constraint
value. For more information, see Speed Optimization Under Area Constraint.
Slice Utilization Ratio Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
XST User Guide www.xilinx.com 387
9.1i
FPGA Constraints (Non-Timing)
R
Slice Utilization Ratio Applicable Elements
Applies globally, or to a VHDL entity or Verilog module
Slice Utilization Ratio Propagation Rules
Applies to the entity or module to which it is attached
Slice Utilization Ratio Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Examples
Before using SLICE_UTILIZATION_RATIO, declare it with the following syntax:
attribute slice_utilization_ratio: string;
After declaring SLICE_UTILIZATION_RATIO, specify the VHDL constraint as follows:
attribute slice_utilization_ratio of entity_name : entity is integer;
attribute slice_utilization_ratio of entity_name : entity is
"integer%";
attribute slice_utilization_ratio of entity_name : entity is
"integer#";
In the preceding example, XST interprets the integer values in the first two attributes as a
percentage and in the last attribute as an absolute number of slices or FF-LUT pairs.
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
388 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Syntax Examples
Place this attribute immediately before the module declaration or instantiation:
(* slice_utilization_ratio = "integer" *)
(* slice_utilization_ratio = "integer%" *)
(* slice_utilization_ratio = "integer#" *)
In the preceding examples, XST interprets the integer values in the first two attributes as a
percentage and in the last attribute as an absolute number of slices
XCF Syntax Examples
Example One
MODEL "entity_name" slice_utilization_ratio=integer;
Example Two
MODEL "entity_name" slice_utilization_ratio="integer%";
Example Three
MODEL "entity_name" slice_utilization_ratio="integer#";
In the preceding examples, XST interprets the integer values in the first two lines as a
percentage and in the last line as an absolute number of slices or FF-LUT pairs.
Be sure to observe the following:
There must be no space between the integer value and % and # characters.
You must surround the integer value and %/# mark with double quotes (") because %
and # are special characters in XCF.
XST Command Line Syntax Examples
Define globally with the slice_utilization_ratio command line option of the run
command. Following is the basic syntax:
-slice_utilization_ratio integer
-slice_utilization_ratio integer%
-slice_utilization_ratio integer#
In the preceding example, XST interprets the integer values in the first two lines as a
percentage and in the last line as an absolute number of slices or FF-LUT pairs.
The integer value range is -1 to 100.
Project Navigator Syntax Example
Define globally with the Slice Utilization Ratio option or LUT-FF Pairs
Utilization Ratio of the Synthesis Options tab of the Process Properties dialog box in
Project Navigator. With a design selected in the Sources window, right-click Synthesize in
the Processes window to access the Process Properties dialog box.
In Project Navigator, you can define the value of this option only as a percentage. The
definition of the value in the form of absolute number of slices is not supported.
XST User Guide www.xilinx.com 389
9.1i
FPGA Constraints (Non-Timing)
R
Slice Utilization Ratio Delta
The Slice Utilization Ratio Delta or LUT-FF Utilization Ratio Delta
(SLICE_UTILIZATION_RATIO_MAXMARGIN) constraint is closely related to the
SLICE_UTILIZATION_RATIO constraint. It defines the tolerance margin for the
SLICE_UTILIZATION_RATIO constraint. The value of the parameter can be defined in the
form of percentage as well as an absolute number of slices or LUT-FF pairs..
If the ratio is within the margin set, the constraint is met and timing optimization can
continue. See Speed Optimization Under Area Constraint in Chapter 3 for more
information.
Slice Utilization Ratio Delta Architecture Support
The following table shows whether the constraint may be used with that device.
Slice Utilization Ratio Delta Applicable Elements
Applies globally, or to a VHDL entity or Verilog module
Slice Utilization Ratio Delta Propagation Rules
Applies to the entity or module to which it is attached
Slice Utilization Ratio Delta Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
390 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
VHDL Syntax Examples
Before using SLICE_UTILIZATION_RATIO_MAXMARGIN, declare it with the following
syntax:
attribute slice_utilization_ratio_maxmargin: string;
After declaring SLICE_UTILIZATION_RATIO_MAXMARGIN, specify the VHDL
constraint as follows:
attribute slice_utilization_ratio_maxmargin of entity_name : entity is
integer;
attribute slice_utilization_ratio_maxmargin of entity_name : entity is
"integer%";
attribute slice_utilization_ratio_maxmargin of entity_name : entity is
"integer#";
In the preceding examples, XST interprets the integer values in the first two attributes as a
percentage, and in the last attribute as an absolute number of slices or FF-LUT pairs.
Integer range is 0 to 100.
Verilog Syntax Examples
Place this attribute immediately before the module declaration or instantiation:
(* slice_utilization_ratio_maxmargin = "integer" *)
(* slice_utilization_ratio_maxmargin = "integer%" *)
(* slice_utilization_ratio_maxmargin = "integer#" *)
In the preceding examples, XST interprets the integer values in the first two attributes as a
percentage, and in the last attribute as an absolute number of slices or FF-LUT pairs.
XCF Syntax Examples
Example One
MODEL entity_name slice_utilization_ratio_maxmargin=integer;
Example Two
MODEL "entity_name" slice_utilization_ratio_maxmargin="integer%";
Example Three
MODEL "entity_name" slice_utilization_ratio_maxmargin="integer#";
In the preceding examples, XST interprets the integer values in the first two lines as a
percentage and in the last line as an absolute number of slices or FF-LUT pairs.
Be sure to observe the following:
There must be no space between the integer value and % and # characters.
You must surround the integer value and %/# mark with double quotes (") because %
and # are special characters in XCF.
Integer range is 0 to 100.
XST User Guide www.xilinx.com 391
9.1i
FPGA Constraints (Non-Timing)
R
XST Command Line Syntax Examples
Define globally with the slice_utilization_ratio_maxmargin command line
option of the run command. Following is the basic syntax:
-slice_utilization_ratio_maxmargin integer
-slice_utilization_ratio_maxmargin integer%
-slice_utilization_ratio_maxmargin integer#
In the preceding example, XST interprets the integer values in the first two lines as a
percentage and in the last line as an absolute number of slices or FF-LUT pairs.
The integer range is 0 to 100.
Map Entity on a Single LUT
The Map Entity on a Single LUT (LUT_MAP) constraint forces XST to map a single block
into a single LUT. If a described function on an RTL level description does not fit in a single
LUT, XST issues an error message.
Using the UNISIM library allows you to directly instantiate LUT components in your HDL
code. To specify a function that a particular LUT must execute, apply an INIT constraint to
the instance of the LUT. If you want to place an instantiated LUT or register in a particular
slice, then attach an RLOC constraint to the same instance.
It is not always convenient to calculate INIT functions and different methods can be used
to achieve this. Instead, you can describe the function that you want to map onto a single
LUT in your VHDL or Verilog code in a separate block. Attaching a LUT_MAP constraint
(XST is able to automatically recognize the XC_MAP constraint supported by Synplicity)
to this block will indicate to XST that this block must be mapped on a single LUT. XST will
automatically calculate the INIT value for the LUT and preserve this LUT during
optimization. For more information, see Specifying INITs and RLOCs in Chapter 3.
Map Entity on a Single LUT Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
392 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Map Entity on a Single LUT Applicable Elements
Applies to a VHDL entity or Verilog module
Map Entity on a Single LUT Propagation Rules
Applies to the entity or module to which it is attached
Map Entity on a Single LUT Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using LUT_MAP, declare it with the following syntax:
attribute lut_map: string;
After declaring LUT_MAP, specify the VHDL constraint as follows:
attribute lut_map of entity_name : entity is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the module declaration or instantiation:
(* lut_map = "{yes|no}" *)
XCF Syntax Example
MODEL entity_name lut_map={yes|no|true|false};
Use Carry Chain
XST uses carry chain resources to implement certain macros, but there are situations where
you can get better results by avoiding the use of carry chain. The Use Carry Chain
(USE_CARRY_CHAIN) constraint can deactivate carry chain use for macro generation. It
is both a global and a local constraint, and has values of yes or no, with yes being the
default.
Use Carry Chain Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
XST User Guide www.xilinx.com 393
9.1i
FPGA Constraints (Non-Timing)
R
Use Carry Chain Applicable Elements
Applies globally, or to signals
Use Carry Chain Propagation Rules
Applies to the signal to which it is attached
Use Carry Chain Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
Schematic Syntax Example
Attach to a valid instance
Attribute Name
USE_CARRY_CHAIN
Attribute Value
YES, NO
VHDL Syntax Example
Before using USE_CARRY_CHAIN, declare it with the following syntax:
attribute use_carry_chain: string;
After declaring USE_CARRY_CHAIN, specify the VHDL constraint as follows:
attribute use_carry_chain of signal_name: signal is {yes|no};
Verilog Syntax Example
Place this attribute immediately before the signal declaration:
(* use_carry_chain = "{yes|no}" *)
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
394 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
XCF Syntax Examples
Example One
MODEL "entity_name" use_carry_chain={yes|no|true|false};
Example Two
BEGIN MODEL "entity_name"
NET "signal_name" use_carry_chain={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the use_carry_chain command line option of the run command.
Following is the basic syntax:
-use_carry_chain {yes|no}
The default is yes.
Convert Tristates to Logic
Since some devices do not support internal tristates, XST automatically replaces tristates
with equivalent logic. Because the logic generated from tristates can be combined and
optimized with surrounding logic, the replacement of internal tristates by logic for other
devices can lead to better speed, and in some cases, better area optimization. But in general
tristate to logic replacement may lead to area increase. If the optimization goal is Area, you
should apply the TRISTATE2LOGIC constraint set to no.
Limitations
Only internal tristates are replaced by logic, which means that the tristates of the top
module connected to output pads are preserved.
Internal tristates are not replaced by logic for modules when incremental synthesis is
active.
This switch does not apply to technologies that do not have internal tristates, like
Spartan-3 or Virtex-4 devices. In this case, the conversion of tristates to logic is
performed automatically. Please note, that in some situations XST is not able to make
the replacement automatically, due to the fact that this may lead to wrong design
behavior or multi-source. This may happen when the hierarchy is preserved or XST
does not have full design visibility (for example, design is synthesized on a block-by-
block basis). In these cases XST gives a warning message at low level optimization
step. Depending on the particular design situation, you may continue the design flow
and the replacement could be done by MAP, or you can force the replacement by
applying TRISTATE2LOGIC set to yes on a particular block or signal.
There are four situations in which XST is not able to replace a tristate by logic:
The tristate is connected to a black box.
The tristate is connected to the output of a block, and the hierarchy of the block is
preserved.
The tristate is connected to a top-level output.
TRISTATE2LOGIC is set to no on the block where tristates are placed, or on the
signals to which tristates are connected.
XST User Guide www.xilinx.com 395
9.1i
FPGA Constraints (Non-Timing)
R
Allowed values are yes and no (true and false are available in XCF as well). By default,
tristate to logic transformation is enabled (yes).
TRISTATE2LOGIC Architecture Support
The following table shows whether the constraint may be used with that device.
TRISTATE2LOGIC Applicable Elements
Applies to an entire design via the XST command line, to a particular block (entity,
architecture, component), or to a signal.
TRISTATE2LOGIC Propagation Rules
Applies to an entity, component, module or signal to which it is attached
TRISTATE2LOGIC Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using TRISTATE2LOGIC, declare it with the following syntax:
attribute tristate2logic: string;
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D No
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 No
Virtex-5 No
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
396 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
After declaring TRISTATE2LOGIC, specify the VHDL constraint as follows:
attribute tristate2logic of {entity_name|component_name|signal_name}:
{entity|component|signal} is "{yes|no}";
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* tristate2logic = "{yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name tristate2logic={yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name tristate2logic={yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the tristate2logic command line option of the run command.
Following is the basic syntax:
-tristate2logic {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Convert Tristates To Logic option of the Xilinx Specific Options
tab of the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Use Clock Enable
The Use Clock Enable (USE_CLOCK_ENABLE) constraint enables or disables the use of
the clock enable function in flip-flops. The disabling of the clock enable function is
typically used for ASIC prototyping on FPGA devices.
By detecting this constraint with a value of no or false, XST avoids using CE resources in
the final implementation. Moreover, for some designs, putting the Clock Enable function
on the data input of the flip-flop allows better logic optimization and therefore better QOR.
In auto mode, XST tries to estimate a trade off between using a dedicated clock enable
input of a flip-flop input and putting clock enable logic on the D input of a flip-flop. In a
case where a flip-flop is instantiated by you, XST removes the clock enable only if the
Optimize Instantiated Primitives switch is set to yes. Allowed values are auto, yes, and
no. The values true and false are also available in XCF. By default, the use of clock
enable signal is enabled (auto).
XST User Guide www.xilinx.com 397
9.1i
FPGA Constraints (Non-Timing)
R
Use Clock Enable Architecture Support
The following table shows whether the constraint may be used with that device.
Use Clock Enable Applicable Elements
Applies to an entire design via the XST command line, to a particular block (entity,
architecture, component), to a signal representing flip-flop, and to an instance representing
instantiated flip-flop.
Use Clock Enable Propagation Rules
Applies to an entity, component, module, signal, or instance to which it is attached
Use Clock Enable Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using USE_CLOCK_ENABLE, declare it with the following syntax:
attribute use_clock_enable: string;
After declaring USE_CLOCK_ENABLE, specify the VHDL constraint as follows:
attribute use_clock_enable of
{entity_name|component_name|signal_name|instance_name}:
{entity|component|signal|label} is "{auto|yes|no}";
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
398 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Syntax Example
Place this attribute immediately before the instance, module or signal declaration:
(* use_clock_enable = "{auto|yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name use_clock_enable={auto|yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name use_clock_enable={auto|yes|no|true|false};
END;
Example Three
BEGIN MODEL entity_name
INST instance_name use_clock_enable={auto|yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the use_clock_enable command line option of the run
command. Following is the basic syntax:
-use_clock_enable {auto|yes|no}
The default is auto.
Project Navigator Syntax Example
Define globally with the Use Clock Enable option of the Xilinx Specific Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Use Synchronous Set
The Use Synchronous Set (USE_SYNC_SET) constraint enables or disables the use of
synchronous set function in flip-flops. The disabling of the synchronous set function is
typically used for ASIC prototyping on FPGA devices. Detecting this constraint with a
value of no or false, XST avoids using synchronous reset resources in the final
implementation. Moreover, for some designs, putting synchronous reset function on data
input of the flip-flop allows better logic optimization and therefore better QOR. In auto
mode, XST tries to estimate a trade off between using dedicated Synchronous Set input of
a flip-flop input and putting Synchronous Set logic on the D input of a flip-flop. In a case
where a flip-flop is instantiated by you, XST removes the synchronous reset only if the
Optimize Instantiated Primitives switch is set to yes.
Allowed values are auto, yes, and no. The values true and false are also available in
XCF. By default, the use of synchronous reset signal is enabled (auto).
XST User Guide www.xilinx.com 399
9.1i
FPGA Constraints (Non-Timing)
R
Use Synchronous Set Architecture Support
The following table shows whether the constraint may be used with that device.
Use Synchronous Set Applicable Elements
Applies to an entire design via the XST command line, to a particular block (entity,
architecture, component), to a signal representing a flip-flop, and to an instance
representing an instantiated flip-flop.
Use Synchronous Set Propagation Rules
Applies to an entity, component, module, signal, or instance to which it is attached
Use Synchronous Set Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using USE_SYNC_SET, declare it with the following syntax:
attribute use_sync_set: string;
After declaring USE_SYNC_SET, specify the VHDL constraint as follows:
attribute use_sync_set of
{entity_name|component_name|signal_name|instance_name}:
{entity|component|signal|label} is "{auto|yes|no}";
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
400 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Syntax Example
Place this attribute immediately before the instance, module or signal declaration:
(* use_sync_set = "{auto|yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name use_sync_set={auto|yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name use_sync_set={auto|yes|no|true|false};
END;
Example Three
BEGIN MODEL entity_name
INST instance_name use_sync_set={auto|yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the use_sync_set command line option of the run command.
Following is the basic syntax:
-use_sync_set {auto|yes|no}
The default is auto.
Project Navigator Syntax Example
Define globally with the Use Synchronous Set option of the Xilinx Specific Options tab of
the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Use Synchronous Reset
The Use Synchronous Reset (USE_SYNC_RESET) constraint enables or disables the usage
of synchronous reset function of flip-flops. The disabling of the Synchronous Reset
function could be used for ASIC prototyping flow on FPGA devices.
Detecting this constraint with a value of no or false, XST avoids using synchronous reset
resources in the final implementation. Moreover, for some designs, putting synchronous
reset function on data input of the flip-flop allows better logic optimization and therefore
better QOR. In auto mode, XST tries to estimate a trade off between using a dedicated
Synchronous Reset input on a flip-flop input and putting Synchronous Reset logic on the D
input of a flip-flop. In a case where a flip-flop is instantiated by you, XST removes the
synchronous reset only if the Optimize Instantiated Primitives switch is set to yes.
Allowed values are auto, yes, and no. The values true and false are also available in
XCF. By default, the use of synchronous reset signal is enabled (auto).
XST User Guide www.xilinx.com 401
9.1i
FPGA Constraints (Non-Timing)
R
Use Synchronous Reset Architecture Support
The following table shows whether the constraint may be used with that device.
Use Synchronous Reset Applicable Elements
Applies to an entire design via XST command line, to a particular block (entity,
architecture, component), to a signal representing a flip-flop, and to an instance
representing an instantiated flip-flop.
Use Synchronous Reset Propagation Rules
Applies to an entity, component, module, signal, or instance to which it is attached
Use Synchronous Reset Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using USE_SYNC_RESET, declare it with the following syntax:
attribute use_sync_reset: string;
After declaring USE_SYNC_RESET, specify the VHDL constraint as follows:
attribute use_sync_reset of
{entity_name|component_name|signal_name|instance_name}:
{entity|component|signal|label} is "{auto|yes|no}";
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
402 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Verilog Syntax Example
Place this attribute immediately before the instance, module, or signal declaration:
(* use_sync_reset = "{auto|yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name use_sync_reset={auto|yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name use_sync_reset={auto|yes|no|true|false};
END;
Example Three
BEGIN MODEL entity_name
INST instance_name use_sync_reset={auto|yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the use_sync_reset command line option of the run command.
Following is the basic syntax:
-use_sync_reset {auto|yes|no}
The default is auto.
Project Navigator Syntax Example
Define globally with the Use Synchronous Reset option of the Xilinx Specific Options
tab of the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Use DSP48
XST enables you to use the resources of the DSP48 blocks introduced in Virtex-4 devices.
The default value is auto. In auto mode, XST automatically implements such macros as
MAC and accumulates on DSP48, but some of them as adders are implemented on slices.
You have to force their implementation on DSP48 using a value of yes or true. For more
information on supported macros and their implementation control, see Chapter 2, HDL
Coding Techniques.
Several macros (for example, MAC), which can be placed on DSP48 are in fact a
composition of more simple macros like multipliers, accumulators, and registers. In order
to present the best performance, XST by default tries to infer and implement the maximum
macro configuration. If you want to shape a macro in a specific way, use the KEEP
constraint. For example, DSP48 allows you to implement a multiple with two input
registers. If you want to leave the first register stage outside of the DSP48, place the KEEP
constraint in their outputs.
Allowed values are auto, yes and no. The values true and false are also available in
XCF. By default, safe implementation is enabled (auto).
XST User Guide www.xilinx.com 403
9.1i
FPGA Constraints (Non-Timing)
R
In auto mode you can control the number of available DSP48 resources for synthesis via
the DSP Utilization Ratio constraint. By default, XST tries to utilize, as much as possible,
all available DSP48 resources. For more information, see Using DSP48 Block Resources
in Chapter 3.
Use DSP48 Architecture Support
The following table shows whether the constraint may be used with that device.
Use DSP48 Applicable Elements
Applies to an entire design via the XST command line, to a particular block (entity,
architecture, component), and to a signal representing a macro described at the RTL level.
Use DSP48 Propagation Rules
Applies to an entity, component, module, or signal to which it is attached
Use DSP48 Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using USE_DSP48, declare it with the following syntax:
attribute use_dsp48: string;
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D Yes
Virtex-II No
Virtex-II Pro No
Virtex-II Pro X No
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
404 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
After declaring USE_DSP48, specify the VHDL constraint as follows:
attribute use_dsp48 of {entity_name|component_name|signal_name}:
{entity|component|signal} is "{auto|yes|no}";
Verilog Syntax Example
Place this attribute immediately before the module or signal declaration:
(* use_dsp48 = "{auto|yes|no}" *)
XCF Syntax Examples
Example One
MODEL entity_name use_dsp48={auto|yes|no|true|false};
Example Two
BEGIN MODEL entity_name
NET signal_name use_dsp48={auto|yes|no|true|false};
END;
XST Command Line Syntax Example
Define globally with the use_dsp48 command line option of the run command.
Project Navigator Syntax Example
Define globally with the Use DSP48 option of the HDL Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
Note: For Virtex-4 devices, this option is called Use DSP48. For Virtex-5, this option is called Use
DSP Block.
CPLD Constraints (Non-Timing)
The options in this section apply to CPLD devices only. They do not apply to FPGA
devices.
In many cases, a particular constraint can be applied globally to an entire entity or model,
or alternatively, it can be applied locally to individual signals, nets or instances. See
Table 5-3 and Table 5-4 for valid constraint targets.
Clock Enable
The Clock Enable (pld_ce) constraint specifies how sequential logic should be
implemented when it contains a clock enable, either using the specific device resources
available for that or generating equivalent logic.
This option allows you to specify the way the clock enable function will be implemented if
presented in the design. Two values are available:
yes (check box is checked): the synthesizer implements the use of the clock enable
signal of the device
no (check box is not checked): the clock enable function is implemented through
equivalent logic
XST User Guide www.xilinx.com 405
9.1i
CPLD Constraints (Non-Timing)
R
Keeping or not keeping the clock enable signal depends on the design logic. Sometimes,
when the clock enable is the result of a Boolean expression, saying no with this option may
improve the fitting result because the input data of the flip-flop is simplified when it is
merged with the clock enable expression.
Clock Enable Architecture Support
The following table shows whether the constraint may be used with that device.
Clock Enable Applicable Elements
Applies to an entire design via the XST command line
Clock Enable Propagation Rules
Not applicable
Clock Enable Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the pld_ce command line option of the run command. Following is
the basic syntax:
-pld_ce {yes|no}
The default is yes.
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D No
Virtex-II No
Virtex-II Pro No
Virtex-II Pro X No
Virtex-4 No
Virtex-5 No
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner II Yes
406 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Project Navigator Syntax Example
Define globally with the Clock Enable option of the Xilinx Specific Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Data Gate
The CoolRunner-II DataGate (DATA_GATE) feature provides direct means of reducing
power consumption in your design. Each I/O pin input signal passes through a latch that
can block the propagation of incident transitions during periods when such transitions are
not of interest to your CPLD design. Input transitions that do not affect the CPLD design
function still consume power, if not latched, as they are routed among the CPLD's Function
Blocks. By asserting the DataGate control I/O pin on the device, selected I/O pin inputs
become latched, thereby eliminating the power dissipation associated with external
transitions on those pins. For more information, see DATA_GATE in the Xilinx
Constraints Guide.
Macro Preserve
The Macro Preserve (pld_mp) option is useful for making the macro handling
independent of design hierarchy processing. This allows you to merge all hierarchical
blocks in the top module, while still keeping the macros as hierarchical modules. You can
also keep the design hierarchy except for the macros, which are merged with the
surrounding logic. Merging the macros sometimes gives better results for design fitting.
Two values are available for this option:
yes (check box is checked): macros are preserved and generated by Macro+.
no (check box is not checked): macros are rejected and generated by HDL synthesizer
Depending on the Flatten Hierarchy value, a rejected macro becomes a hierarchical block
(Flatten Hierarchy=no) or is merged in the design logic
(Flatten Hierarchy=yes). Very small macros (2-bit adders, 4-bit multiplexers) are
always merged, independent of the Macro Preserve or Flatten Hierarchy options.
Macro Preserve Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D No
Virtex-II No
XST User Guide www.xilinx.com 407
9.1i
CPLD Constraints (Non-Timing)
R
Macro Preserve Applicable Elements
Applies to an entire design via the XST command line
Macro Preserve Propagation Rules
Not applicable
Macro Preserve Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the pld_mp command line option of the run command. Following is
the basic syntax:
-pld_mp {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Macro Preserve option of the Xilinx Specific Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
No Reduce
The No Reduce (NOREDUCE) constraint prevents minimization of redundant logic terms
that are typically included in a design to avoid logic hazards or race conditions. This
constraint also identifies the output node of a combinatorial feedback loop to ensure
correct mapping. For more information, see NOREDUCE in the Xilinx Constraints Guide.
WYSIWYG
The goal of the WYSIWYG option is to have a netlist as much as possible reflect the user
specification. That is, all the nodes declared in the HDL design are preserved.
If WYSIWYG mode is enabled (yes), then XST preserves all the user internal signals
(nodes), creates SOURCE_NODE constraints in the NGC file for all these nodes, and skips
Virtex-II Pro No
Virtex-II Pro X No
Virtex-4 No
Virtex-5 No
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner II Yes
408 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
design optimization (collapse, factorization); only boolean equation minimization is
performed.
WYSIWYG Architecture Support
The following table shows whether the constraint may be used with that device.
WYSIWYG Applicable Elements
Applies to an entire design via the XST command line
WYSIWYG Propagation Rules
Not applicable
WYSIWYG Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the wysiwyg command line option of the run command. Following
is the basic syntax:
-wysiwyg {yes|no}
The default is no.
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D No
Virtex-II No
Virtex-II Pro No
Virtex-II Pro X No
Virtex-4 No
Virtex-5 No
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner II Yes
XST User Guide www.xilinx.com 409
9.1i
CPLD Constraints (Non-Timing)
R
Project Navigator Syntax Example
Define globally with the WYSIWYG option of the Xilinx Specific Options tab of the Process
Properties dialog box in Project Navigator. With a design selected in the Sources window,
right-click Synthesize in the Processes window to access the Process Properties dialog
box.
XOR Preserve
The XOR Preserve (pld_xp) constraint enables or disables hierarchical flattening of XOR
macros. Allowed values are yes (check box is checked) and no (check box is not checked).
By default, XOR macros are preserved (check box is checked).
The XORs inferred by HDL synthesis are also considered as macro blocks in the CPLD
flow, but they are processed separately to give more flexibility for the use of device
macrocells XOR gates. Therefore, you can decide to flatten its design (Flatten Hierarchy
yes, Macro Preserve no) but you want to preserve the XORs. Preserving XORs has a great
impact on reducing design complexity. Two values are available for this option:
yes
XOR macros are preserved
no
XOR macros are merged with surrounded logic
Preserving the XORs, generally, gives better results; that is, the number of PTerms is lower.
The no value is useful to obtain completely flat netlists. Sometimes, applying the global
optimization on a completely flat design improves the design fitting.
You obtain a completely flattened design when selecting the following options:
Flatten Hierarchy
yes
Macro Preserve
no
XOR Preserve
no
The no value for this option does not guarantee the elimination of the XOR operator from
the EDIF netlist. During the netlist generation, the netlist mapper tries to recognize and
infer XOR gates in order to decrease the logic complexity. This process is independent of
the XOR preservation done by HDL synthesis and is guided only by the goal of complexity
reduction.
XOR Preserve Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex No
Virtex-E No
Spartan-II No
Spartan-IIE No
410 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
XOR Preserve Applicable Elements
Applies to an entire design via the XST command line
XOR Preserve Propagation Rules
Not applicable
XOR Preserve Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define this constraint globally with the pld_xp command line option of the run
command. Following is the basic syntax:
-pld_xp {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the XOR Preserve option of the Xilinx Specific Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Timing Constraints
Timing constraints supported by XST can be applied either via the glob_opt command
line switch, which is the same as selecting Global Optimization Goal from the Synthesis
Options tab of the Process Properties menu in Project Navigator, or via the constraints file.
Spartan-3 No
Spartan-3E No
Spartan-3A No
Spartan-3A D No
Virtex-II No
Virtex-II Pro No
Virtex-II Pro X No
Virtex-4 No
Virtex-5 No
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner II Yes
XST User Guide www.xilinx.com 411
9.1i
Timing Constraints
R
Using the glob_opt (Global Optimization Goal) method allows you to apply the five
global timing constraints:
ALLCLOCKNETS
OFFSET_IN_BEFORE
OFFSET_OUT_AFTER
INPAD_TO_OUTPAD
MAX_DELAY
These constraints are applied globally to the entire design. You cannot specify a value for
these constraints as XST optimizes them for the best performance. These constraints are
overridden by constraints specified in the constraints file.
Using the constraint file method you can specify timing constraints using native UCF
syntax. XST supports constraints such as TNM_NET, TIMEGRP, PERIOD, TIG, and
FROM-TO, including wildcards and hierarchical names.
Timing constraints are only written to the NGC file when the Write Timing Constraints
property is checked yes in the Process Properties dialog box in Project Navigator, or the -
write_timing_constraints option is specified when using the command line. By
default, they are not written to the NGC file.
Regardless of the way timing constraints are specified, there are three additional options
that affect timing constraint processing. These are:
Cross Clock Analysis
Write Timing Constraints
Clock Signal
Cross Clock Analysis
The Cross Clock Analysis command (cross_clock_analysis) allows inter-clock
domain analysis during timing optimization. By default (no), XST does not perform this
analysis.
Cross Clock Analysis Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
412 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Cross Clock Analysis Applicable Elements
Applies to an entire design via the XST command line
Cross Clock Analysis Propagation Rules
Not applicable
Cross Clock Analysis Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the cross_clock_analysis command line option of the run
command. Following is the basic syntax:
cross_clock_analysis {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Cross Clock Analysis option of the Synthesis Options tab of the
Process Properties dialog box in Project Navigator. With a design selected in the Sources
window, right-click Synthesize in the Processes window to access the Process Properties
dialog box.
Write Timing Constraints
Timing constraints specified in the XCF file are written to the NGC file only when the
Write Timing Constraints property is checked YES in the Process Properties dialog
box in Project Navigator, or the write_timing_constraints option is specified when
using the command line. By default, they are not written to the NGC file.
Write Timing Constraints Architecture Support
The following table shows whether the constraint may be used with that device.
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner II No
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
XST User Guide www.xilinx.com 413
9.1i
Timing Constraints
R
Write Timing Constraints Applicable Elements
Applies to an entire design via the XST command line
Write Timing Constraints Propagation Rules
Not applicable
Write Timing Constraints Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
XST Command Line Syntax Example
Define globally with the write_timing_constraints command line option of the
run command. Following is the basic syntax:
-write_timing_constraints {yes|no}
The default is yes.
Project Navigator Syntax Example
Define globally with the Write Timing Constraints option of the Synthesis Options tab of
the Process Properties dialog box in Project Navigator. With a design selected in the
Sources window, right-click Synthesize in the Processes window to access the Process
Properties dialog box.
Clock Signal
If a clock signal goes through combinatorial logic before being connected to the clock input
of a flip-flop, XST cannot identify what input pin or internal signal is the real clock signal.
CLOCK_SIGNAL allows you to define the clock signal.
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV Yes
CoolRunner XPLA3 Yes
CoolRunner II Yes
414 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
CLOCK_SIGNAL Architecture Support
The following table shows whether the constraint may be used with that device.
CLOCK_SIGNAL Applicable Elements
Applies to signals
CLOCK_SIGNAL Propagation Rules
Applies to clock signals
CLOCK_SIGNAL Syntax Examples
Following are syntax examples using the constraint with particular tools or methods. If a
tool or method is not listed, the constraint may not be used with it.
VHDL Syntax Example
Before using CLOCK_SIGNAL, declare it with the following syntax:
attribute clock_signal : string;
After declaring CLOCK_SIGNAL, specify the VHDL constraint as follows:
attribute clock_signal of signal_name : signal is {yes|no};
Virtex Yes
Virtex-E Yes
Spartan-II Yes
Spartan-IIE Yes
Spartan-3 Yes
Spartan-3E Yes
Spartan-3A Yes
Spartan-3A D Yes
Virtex-II Yes
Virtex-II Pro Yes
Virtex-II Pro X Yes
Virtex-4 Yes
Virtex-5 Yes
XC9500, XC9500XL, XC9500XV No
CoolRunner XPLA3 No
CoolRunner-II No
XST User Guide www.xilinx.com 415
9.1i
Timing Constraints
R
Verilog Syntax Example
Place this attribute immediately before the signal declaration:
(* clock_signal = "{yes|no}" *)
XCF Syntax Example
BEGIN MODEL entity_name
NET primary_clock_signal clock_signal={yes|no|true|false};
END;
Global Timing Constraints Support
XST supports the following global timing constraints.
Global Optimization Goal
XST can optimize different regions (register to register, inpad to register, register to outpad,
and inpad to outpad) of the design depending on the global optimization goal. For
detailed description of supported timing constraints, see Partitions in Chapter 3. The
Global Optimization Goal (glob_opt) command line option selects the global
optimization goal.
You cannot specify a value for Global Optimization Goal/glob_opt. XST optimizes the
entire design for the best performance.
The following constraints can be applied by using the Global Optimization Goal option.
ALLCLOCKNETS: optimizes the period of the entire design
OFFSET_IN_BEFORE: optimizes the maximum delay from input pad to clock, either
for a specific clock or for an entire design
OFFSET_OUT_AFTER: optimizes the maximum delay from clock to output pad,
either for a specific clock or for an entire design
INPAD_TO_OUTPAD: optimizes the maximum delay from input pad to output pad
throughout an entire design
MAX_DELAY: incorporates all previously mentioned constraints
These constraints affect the entire design and only apply if no timing constraints are
specified via the constraint file.
Define globally with the -glob_opt command line option of the run command.
Following is the basic syntax:
-glob_opt {allclocknets|offset_in_before|offset_out_after
|inpad_to_outpad|max_delay}
You can specify glob_opt globally with the Global Optimization Goal option of the
Synthesis Options tab of the Process Properties dialog box in Project Navigator.
Domain Definitions
The possible domains are illustrated in the following schematic.
ALLCLOCKNETS (register to register)
Identifies by default, all paths from register to register on the same clock for all clocks
in a design. To take into account inter-clock domain delays, the command line switch
cross_clock_analysis must be set to yes.
416 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
OFFSET_IN_BEFORE (inpad to register)
Identifies all paths from all primary input ports to either all sequential elements or the
sequential elements driven by the given clock signal name.
OFFSET_OUT_AFTER (register to outpad)
Similar to the previous constraint, but sets the constraint from the sequential elements
to all primary output ports.
INPAD_TO_OUTPAD (inpad to outpad)
Sets a maximum combinational path constraint.
MAX_DELAY
Identifies all paths defined by the following timing constraints:
ALLCLOCKNETS
OFFSET_IN_BEFORE
OFFSET_OUT_AFTER
INPAD_TO_OUTPAD
XCF Timing Constraint Support
Caution! If you specify timing constraints in the XCF file, Xilinx strongly recommends that you
use '/' character as a hierarchy separator instead of '_'. For more information, see Hierarchy
Separator.
Caution! If all or part of a specified timing constraint is not supported by XST, then XST
generates a warning about this and ignores the unsupported timing constraint or unsupported
part of it in the Timing Optimization step. If the Write Timing Constraints option is set to yes, XST
propagates the entire constraint to the final netlist, even if it was ignored at the Timing
Optimization step.
The following timing constraints are supported in the XST Constraints File (XCF).
Period
PERIOD is a basic timing constraint and synthesis constraint. A clock period specification
checks timing between all synchronous elements within the clock domain as defined in the
destination element group. The group may contain paths that pass between clock domains
X8991
CLK CLK
Q D Q D IPAD OPAD
OPAD
IPAD
Inpad_to_Outpad
IPAD
Logic
Circuitry
Logic
Circuitry
Logic
Circuitry
Offset_in_Before AllClockNets/Period Offset_out_After
XST User Guide www.xilinx.com 417
9.1i
Timing Constraints
R
if the clocks are defined as a function of one or the other. For more information, see
PERIOD in the Xilinx Constraints Guide.
XCF Syntax Example
NET netname PERIOD = value [{HIGH|LOW} value];
Offset
OFFSET is a basic timing constraint. It specifies the timing relationship between an
external clock and its associated data-in or data-out pin. OFFSET is used only for pad-
related signals, and cannot be used to extend the arrival time specification method to the
internal signals in a design.
OFFSET allows you to:
Calculate whether a setup time is being violated at a flip-flop whose data and clock
inputs are derived from external nets
Specify the delay of an external output net derived from the Q output of an internal
flip-flop being clocked from an external device pin
For more information, see OFFSET in the Xilinx Constraints Guide.
XCF Syntax Example
OFFSET = {IN|OUT} offset_time [units] {BEFORE|AFTER}
clk_name [TIMEGRP group_name];
From-To
FROM-TO defines a timing constraint between two groups. A group can be user-defined
or predefined (FFS, PADS, RAMS). For more information, see FROM-TO in the Xilinx
Constraints Guide.
XCF Syntax Example
TIMESPEC TSname = FROM group1 TO group2 value;
TNM
TNM is a basic grouping constraint. Use TNM (Timing Name) to identify the elements that
make up a group which you can then use in a timing specification. TNM tags specific FFS,
RAMs, LATCHES, PADS, BRAMS_PORTA, BRAMS_PORTB, CPUS, HSIOS, and MULTS
as members of a group to simplify the application of timing specifications to the group.
The RISING and FALLING keywords may also be used with TNMs. For more information,
see TNM in the Xilinx Constraints Guide.
XCF Syntax Example
{INST|NET|PIN} inst_net_or_pin_name TNM = [predefined_group:]
identifier;
TNM Net
TNM_NET is essentially equivalent to TNM on a net except for input pad nets. (Special
rules apply when using TNM_NET with the PERIOD constraint for Virtex,
Virtex-E, Virtex-II, Virtex-II Pro, Virtex-II Pro X, Virtex-4 or Spartan-3 DLL/DCMs. For
418 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
more information, see the "PERIOD Specifications on CLKDLLs and DCMs" subsection of
PERIOD in the Xilinx Constraints Guide.
A TNM_NET is a property that you normally use in conjunction with an HDL design to tag
a specific net. All downstream synchronous elements and pads tagged with the TNM_NET
identifier are considered a group. For more information, see TNM_NET in the Xilinx
Constraints Guide.
XCF Syntax Example
NET netname TNM_NET = [predefined_group:] identifier;
TIMEGRP
TIMEGRP is a basic grouping constraint. In addition to naming groups using the TNM
identifier, you can also define groups in terms of other groups. You can create a group that
is a combination of existing groups by defining a TIMEGRP constraint.
You can place TIMEGRP constraints in a constraints file (XCF or NCF). You can use
TIMEGRP attributes to create groups using the following methods.
Combining multiple groups into one
Defining flip-flop subgroups by clock sense
For more information, see TIMEGRP in the Xilinx Constraints Guide.
XCF Syntax
TIMEGRP newgroup = existing_grp1 existing_grp2 [existing_grp3 ...];
TIG
The TIG constraint causes all paths going through a specific net to be ignored for timing
analyses and optimization purposes. This constraint can be applied to the name of the
signal affected. For more information, see TIG in the Xilinx Constraints Guide.
XCF Syntax Example
NET net_name TIG;
Constraints Summary
This section discusses XST-Specific Non-Timing Options and XST Timing Options.
XST-Specific Non-Timing Options
The following tables summarize all available XST-specific non-timing related options. This
table shows the allowed values for each constraint, the type of objects they can be applied
to, and any usage restrictions. Default values are indicated in bold.
XST User Guide www.xilinx.com 419
9.1i
Constraints Summary
R
In many cases, a particular constraint can be applied globally to an entire entity or model,
or alternatively, it can be applied locally to individual signals, nets or instances.
Table 5-3: XST-Specific Non-Timing Options: XST Constraints
Constraint
Name
Constraint
Value
XCF
Constraint
Syntax
Target
VHDL
Target
Verilog
Target
Cmd Line Cmd Value
box_type primitive
black_box
user_black_box
model
inst (in model)
entity
component
module
label
N/A N/A
bram_map yes
no
model entity module bram_map yes
no
bram_utilization_ratio integer
integer%
integer#
(range -1 to 100)
model entity module bram_utilization_ratio integer
integer%
integer#
(range -1 to
100)
buffer_type bufgdll
ibufg
bufgp
ibuf
none
net (in model) signal signal N/A bufgdll
ibufg
bufgp
ibuf
bufr
none
bufgce yes
no
net (in model) primary
clock signal
primary
clock
signal
N/A N/A
clock_signal yes
no
clock signal
net (in model)
clock signal clock
signal
N/A N/A
decoder_extract yes
no
model
net (in model)
entity
signal
entity
signal
decoder_extract yes
no
dsp_utilization_ratio integer
integer%
integer#
(range -1 to 100)
model entity module dsp_utilization_ratio integer
integer%
integer#
(range -1 to
100)
enum_encoding string containing
space-separated
binary codes
net (in model) type signal N/A N/A
equivalent_register_
removal
yes
no
model
net (in model)
entity
signal
module
signal
equivalent_register_
removal
yes
no
fsm_encoding auto
one-hot
compact
sequential
gray
johnson
speed1
user
model
net (in model)
entity
signal
module
signal
fsm_encoding auto
one-hot
compact
sequential
gray
johnson
speed1
user
fsm_extract yes
no
model
net (in model)
entity
signal
module
signal
fsm_extract yes
no
fsm_style lut
bram
model
net (in model)
entity
signal
module
signal
fsm_style lut
bram
420 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
full_case N/A N/A N/A case
statement
N/A N/A
incremental_synthesis yes
no
model entity module N/A N/A
iob true
false
auto
net (in model)
inst (in model)
signal
instance
signal
instance
iob true
false
auto
iostandard string: see the
Xilinx Constraints
Guide for details
net (in model)
inst (in model)
signal
instance
signal
instance
N/A N/A
keep yes
no
true
false
net (in model) signal signal N/A N/A
keep_hierarchy yes
no
soft
model entity module keep_hierarchy yes
no
soft
loc string net (in model)
inst (in model)
signal
(primary IO)
instance
signal
(primary
IO)
instance
N/A N/A
lut_map yes
no
model entity
architecture
module N/A N/A
max_fanout integer model
net (in model)
entity
signal
module
signal
max_fanout integer
move_first_stage yes
no
model
primary clock
signal
net (in model)
entity
primary
clock signal
module
primary
clock
signal
move_first_stage yes
no
move_last_stage yes
no
model
primary clock
signal
net (in model)
entity
primary
clock signal
module
primary
clock
signal
move_last_stage yes
no
mult_style auto
block
pipe_block
kcm
csd
lut
pipe_lut
model
net (in model)
entity
signal
module
signal
mult_style auto
block
pipe_block
kcm
csd
lut
pipe_lut
mux_extract yes
no
force
model
net (in model)
entity
signal
module
signal
mux_extract yes
no
force
mux_style auto
muxf
muxcy
model
net (in model)
entity
signal
module
signal
mux_style auto
muxf
muxcy
Table 5-3: XST-Specific Non-Timing Options: XST Constraints (Continued)
Constraint
Name
Constraint
Value
XCF
Constraint
Syntax
Target
VHDL
Target
Verilog
Target
Cmd Line Cmd Value
XST User Guide www.xilinx.com 421
9.1i
Constraints Summary
R
noreduce yes
no
net (in model) signal signal N/A N/A
opt_level 1
2
model entity module opt_level 1
2
opt_mode speed
area
model entity module opt_mode speed
area
optimize_primitives yes
no
model
instance
(in model)
entity
instance
module
instance
optimize_primitives yes
no
parallel_case N/A N/A N/A case
statement
N/A N/A
power yes
no
model entity module -power yes
no
priority_extract yes
no
force
model
net (in model)
entity
signal
module
signal
priority_extract yes
no
force
ram_extract yes
no
model
net (in model)
entity
signal
module
signal
ram_extract yes
no
ram_style auto
block
distributed
pipe_distributed
model
net (in model)
entity
signal
module
signal
ram_style auto
block
distributed
read_cores yes
no
optimize
model
inst (in model)
entity
component
module
label
read_cores yes
no
optimize
register_balancing yes
no
forward
backward
model
net (in model)
inst (in model)
entity
signal
FF instance
name
primary
clock signal
module
signal
FF instance
name
primary
clock
signal
register_balancing yes
no
forward
backward
register_duplication yes
no
model
net (in model)
entity
signal
module register_duplication yes
no
register_powerup string net (in model) type signal N/A N/A
resource_sharing yes
no
model
net (in model)
entity
signal
module
signal
resource_sharing yes
no
resynthesize yes
no
model entity module N/A N/A
rom_extract yes
no
model
net (in model)
entity
signal
module
signal
rom_extract yes
no
rom_style auto
block
distributed
model
net (in model)
entity
signal
module
signal
rom_style auto
block
distributed
Table 5-3: XST-Specific Non-Timing Options: XST Constraints (Continued)
Constraint
Name
Constraint
Value
XCF
Constraint
Syntax
Target
VHDL
Target
Verilog
Target
Cmd Line Cmd Value
422 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
safe_implementation yes
no
model
net (in model)
entity
signal
module
signal
safe_implementation yes
no
safe_recovery_state string net (in model) signal signal N/A N/A
shift_extract yes
no
model
net (in model)
entity
signal
module
signal
shift_extract yes
no
shreg_extract yes
no
model
net (in model)
entity
signal
module
signal
shreg_extract yes
no
signal_encoding auto
one-hot
user
model
net (in model)
entity
signal
module
signal
signal_encoding auto
one-hot
user
slice_utilization_ratio integer
integer%
integer#
(range -1 to 100)
model entity module slice_utilization_ratio integer
integer%
integer#
(range -1 to
100)
slice_utilization_ratio_
maxmargin
integer
integer%
integer#
(range 0 to 100)
model entity module slice_utilization_ratio_
maxmargin
integer
integer%
integer#
(range -1 to
100)
translate_off N/A N/A local
no target
local
no target
N/A N/A
translate_on N/A N/A local
no target
local
no target
N/A N/A
tristate2logic yes
no
true
false
(internal tristates
only)
model
net (in model)
entity
signal
module
signal
tristate2logic yes
no
use_carry_chain yes
no
model
net (in model)
entity
signal
module
signal
use_carry_chain yes
no
use_clock_enable auto
yes
no
model
net (in model)
inst (in model)
entity
signal
FF instance
name
module
signal
FF instance
name
use_clock_enable auto
yes
no
use_dsp48 auto
yes
no
model
net (in model)
entity
signal
module
signal
use_dsp48 auto
yes
no
use_sync_reset auto
yes
no
model
net (in model)
inst (in model)
entity
signal
FF instance
name
module
signal
FF instance
name
use_sync_reset auto
yes
no
use_sync_set auto
yes
no
model
net (in model)
inst (in model)
entity
signal
FF instance
name
module
signal
FF instance
name
use_sync_set auto
yes
no
Table 5-3: XST-Specific Non-Timing Options: XST Constraints (Continued)
Constraint
Name
Constraint
Value
XCF
Constraint
Syntax
Target
VHDL
Target
Verilog
Target
Cmd Line Cmd Value
XST User Guide www.xilinx.com 423
9.1i
Constraints Summary
R
XST Command Line Only Options
The following XST options are command line only.
uselowskewlines yes
no
net (in model) signal signal N/A N/A
xor_collapse yes
no
model
net (in model)
entity
signal
module
signal
xor_collapse yes
no
Table 5-3: XST-Specific Non-Timing Options: XST Constraints (Continued)
Constraint
Name
Constraint
Value
XCF
Constraint
Syntax
Target
VHDL
Target
Verilog
Target
Cmd Line Cmd Value
Table 5-4: XST-Specific Non-Timing Options: XST Command Line Only
Constraint Name Cmd Line Cmd Value
arch arch architecture_name
async_to_sync -async_to_sync yes
no
auto_bram_packing -auto_bram_packing yes
no
bufg bufg integer
bufr bufr integer
bus_delimiter bus_delimiter < > (default)
[ ]
{ }
( )
case case upper
lower
maintain
define -define {name = value}
duplication_suffix duplication_suffix string%dstring
ent ent entity_name
a
generics -generics {name = value}
hdl_compilation_order hdl_compilation_order yes
no
hierarchy_separator hierarchy_separator _
/ (default)
ifmt ifmt vhdl
verilog
mixed
ifn ifn auto
user
424 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
iobuf iobuf yes
no
iuc iuc yes
no
lso lso file_name
ofmt ofmt ngc
ofn ofn file_name
p p part-package-speed
b
pld_ce pld_ce yes
no
pld_ffopt pld_ffopt yes
no
pld_mp pld_mp yes
no
pld_xp pld_xp yes
no
rtlview rtlview yes
no
only
sd sd directory_path
slice_packing slice_packing yes
no
top top block_name
uc uc file_name.xcf
verilog2001 verilog2001 yes
no
vlgcase vlgcase full
parallel
full-parallel
vlgincdir vlgincdir dir_path
vlgpath yes N/A
work_lib work_lib dir_name
work
wysiwyg wysiwyg yes
no
xsthdpdir xsthdpdir directory_path
xsthdpini xsthdpini file_name
Table 5-4: XST-Specific Non-Timing Options: XST Command Line Only (Continued)
Constraint Name Cmd Line Cmd Value
XST User Guide www.xilinx.com 425
9.1i
Constraints Summary
R
XST Timing Options
This section includes:
Command Line or Process Properties Dialog Box
Timing options which can be specified only via the command line mode or the Process
Properties dialog box in ISE
Xilinx Constraint File (XCF)
Timing constraints which are supported via the XCF file only
Command Line or Process Properties Dialog Box
The following table shows the timing constraints supported by XST that you can invoke
only from the command line, or the Process Properties dialog box in Project Navigator.
The table applies to the following architectures:
Spartan-II, Spartan-IIE
Spartan-3, Spartan-3E, Spartan3-A
Virtex, Virtex-E
Virtex-II, Virtex-II Pro, Virtex-II Pro X
Virtex-4, Virtex-5
Xilinx Constraint File (XCF)
The XST timing constraints listed below can be applied for synthesis only through the
Xilinx Constraint File (XCF). These timing constraints will influence synthesis
a. Valid only when old VHDL project format is used (ifmt VHDL). Please use project format (ifmt
mixed) and top switch to specify which top level block to synthesize.
b. For example: xcv50-fg456-5: xcv50-fg456-6
Table 5-5: XST Timing Constraints Supported Only by Command Line or Process
Properties Dialog Box
Option
Process Property
(ProjNav)
Values
glob_opt Global
Optimization Goal
allclocknets
inpad_to_outpad
offset_in_before
offset_out_after
max_delay
cross_clock_analysis Cross Clock
Analysis
yes, no
write_timing_constraints Write Timing Constraints yes, no
426 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
optimization, and can be passed on to place and route by selecting the Write Timing
Constraints option.
PERIOD
OFFSET
TIMESPEC
TSIDENTIFIER
TMN
TNM_NET
TIMEGRP
TIG
FROM... TO
These constraints are supported by the following architectures:
Spartan-II, Spartan-IIE, Spartan-3, Spartan-3E, Spartan-3A, Spartan-3A D
Virtex, Virtex-E, Virtex-II, Virtex-II Pro, Virtex-II Pro X
Virtex-4, Virtex-5
For more information as to the Value and Target of each constraint, see the Xilinx
Constraints Guide.
Implementation Constraints
This section explains how XST handles implementation constraints. For more information
on the implementation constraints supported by XST, see the Xilinx Constraints Guide.
Handling by XST
Implementation constraints control placement and routing. They are not directly useful to
XST, and are simply propagated and made available to the implementation tools. In
addition, the object that an implementation constraint is attached to is preserved.
A binary equivalent of the implementation constraints is written to the NGC file, but since
it is a binary file, you cannot edit the implementation constraints there. Alternatively, you
can code implementation constraints in the XCF file according to one of the following
syntaxes.
To apply a constraint to an entire entity, use one of the following two XCF syntaxes.
MODEL EntityName PropertyName;
MODEL EntityName PropertyName=PropertyValue;
To apply a constraint to specific instances, nets or pins within an entity, use one of the two
following syntaxes.
Example One
BEGIN MODEL EntityName
{NET|INST|PIN} {NetName|InstName|SigName} PropertyName;
END;
XST User Guide www.xilinx.com 427
9.1i
Implementation Constraints
R
Example One
BEGIN MODEL EntityName
{NET|INST|PIN} {NetName|InstName|SigName} PropertyName=Propertyvalue;
END;
When written in VHDL code, they should be specified as follows:
attribute PropertyName of {NetName|InstName|PinName} : {signal|label}
is "PropertyValue";
In a Verilog description, they should be written as follows:
// synthesis attribute PropertyName of {NetName|InstName|PinName} is
"PropertyValue";
In Verilog-2001, where descriptions must precede the signal, module or instance they refer
to, it should be written as follows:
(* PropertyName="PropertyValue" *)
Example One
When targeting an FPGA device, use the RLOC constraint to indicate the placement of a
design element on the FPGA die relative to other elements. Assuming an SRL16 instance of
name srl1 to be placed at location R9C0.S0, you may specify the following in the Verilog
code:
// synthesis attribute RLOC of srl1 : "R9C0.S0";
You may specify the same attribute in the XCF file with the following lines:
BEGIN MODEL ENTNAME
INST sr11 RLOC=R9C0.SO;
END;
The binary equivalent of the following line is written to the output NGC file:
INST srl1 RLOC=R9C0.S0;
Example Two
The NOREDUCE constraint, available with CPLD devices, prevents the optimization of
the boolean equation generating a given signal. Assuming a local signal is assigned the
arbitrary function below, and a NOREDUCE constraint attached to the signal s:
signal s : std_logic;
attribute NOREDUCE : boolean;
attribute NOREDUCE of s : signal is "true";
...
s <= a or (a and b);
You may specify the same attribute in the XCF file with the following lines:
BEGIN MODEL ENTNAME
NET s NOREDUCE;
NET s KEEP;
END;
428 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
The following statements are written to the NGC file:
NET s NOREDUCE;
NET s KEEP;
Example Three
The PWR_MODE constraint, available when targeting CPLD families, controls the power
consumption characteristics of macrocells. The following VHDL statement specifies that
the function generating signal s should be optimized for low power consumption.
attribute PWR_MODE : string;
attribute PWR_MODE of s : signal is "LOW";
You may specify the same attribute in the XCF file with the following lines:
MODEL ENTNAME
NET s PWR_MODE=LOW;
NET s KEEP;
END;
The following statement is written to the NGC file by XST:
NET s PWR_MODE=LOW;
NET s KEEP;
If the attribute applies to an instance (for example, IOB, DRIVE, IOSTANDARD) and if the
instance is not available (not instantiated) in the HDL source, then the HDL attribute can
be applied to the signal on which XST infers the instance.
XST User Guide www.xilinx.com 429
9.1i
Third Party Constraints
R
Third Party Constraints
This section describes constraints of third-party synthesis vendors that are supported by
XST. For each of the constraints, the following table gives the XST equivalent. For
information on what these constraints actually do, see the corresponding vendor
documentation. N/A stands for "Not Available."
Several third party constraints are automatically (fully or partially) supported by XST, as
shown in the Automatic Recognition column in the following table. Constraints marked
Yes are fully supported. If a constraint is only partially supported, the support conditions
are shown in the Automatic Recognition column.
The following rules apply.
VHDL uses standard attribute syntax, and no changes are needed to the HDL code.
For Verilog with third party metacomment syntax, the metacomment syntax must be
changed to conform to XST conventions. The constraint name and its value can be
used as shown in the third party tool.
For Verilog 2001 attributes, no changes are needed to the HDL code. The constraint is
automatically translated as in the case of VHDL attribute syntax
.
Table 5-6: Third Party Constraints
Name Vendor XST Equivalent Automatic Recognition Available For
black_box Synplicity box_type N/A VHDL/
Verilog
black_box_pad_pin Synplicity N/A N/A N/A
black_box_tri_pins Synplicity N/A N/A N/A
cell_list Synopsys N/A N/A N/A
clock_list Synopsys N/A N/A N/A
Enum Synopsys N/A N/A N/A
full_case Synplicity/
Synopsys
full_case N/A Verilog
ispad Synplicity N/A N/A N/A
map_to_module Synopsys N/A N/A N/A
net_name Synopsys N/A N/A N/A
parallel_case Synplicity
Synopsys
parallel_case N/A Verilog
return_port_name Synopsys N/A N/A N/A
resource_sharing directives Synopsys resource_sharing
directives
N/A VHDL/
Verilog
set_dont_touch_network Synopsys not required N/A N/A
set_dont_touch Synopsys not required N/A N/A
set_dont_use_cel_name Synopsys not required N/A N/A
430 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
set_prefer Synopsys N/A N/A N/A
state_vector Synopsys N/A N/A N/A
syn_allow_retiming Synplicity register_balancing N/A VHDL/
Verilog
syn_black_box Synplicity box_type N/A VHDL/
Verilog
syn_direct_enable Synplicity N/A N/A N/A
syn_edif_bit_format Synplicity N/A N/A N/A
syn_edif_scalar_format Synplicity N/A N/A N/A
syn_encoding Synplicity fsm_encoding yes
a
VHDL/
Verilog
syn_enum_encoding Synplicity enum_encoding N/A VHDL
syn_hier Synplicity keep_hierarchy syn_hier = hard
recognized as
keep_hierarchy = soft
syn_hier = remove
recognized as
keep_hierarchy = no
b
VHDL/
Verilog
syn_isclock Synplicity N/A N/A N/A
syn_keep Synplicity keep
c
yes VHDL/
Verilog
syn_maxfan Synplicity max_fanout yes VHDL/
Verilog
syn_netlist_hierarchy Synplicity keep_hierarchy N/A VHDL/
Verilog
syn_noarrayports Synplicity N/A N/A N/A
syn_noclockbuf Synplicity buffer_type yes VHDL/
Verilog
syn_noprune Synplicity optimize_primitives yes VHDL/
Verilog
syn_pipeline Synplicity Register Balancing N/A VHDL/
Verilog
syn_probe Synplicity equivalent_register-
_removal
yes VHDL/
Verilog
syn_ramstyle Synplicity N/A N/A N/A
syn_reference_clock Synplicity N/A N/A N/A
syn_romstyle Synplicity N/A N/A N/A
Table 5-6: Third Party Constraints (Continued)
Name Vendor XST Equivalent Automatic Recognition Available For
XST User Guide www.xilinx.com 431
9.1i
Third Party Constraints
R
syn_sharing Synplicity register_duplication yes VHDL/
Verilog
syn_state_machine Synplicity fsm_extract N/A VHDL/
Verilog
syn_tco <n> Synplicity N/A N/A N/A
syn_tpd <n> Synplicity N/A N/A N/A
syn_tristate Synplicity N/A N/A N/A
syn_tristatetomux Synplicity N/A N/A N/A
syn_tsu <n> Synplicity N/A N/A N/A
syn_useenables Synplicity N/A N/A N/A
syn_useioff Synplicity iob N/A VHDL/
Verilog
synthesis translate_off /
synthesis translate_on
Synplicity/
Synopsys
synthesis
translate_off /
synthesis
translate_on
yes VHDL/
Verilog
xc_alias Synplicity N/A N/A N/A
xc_clockbuftype Synplicity buffer_type N/A VHDL/
Verilog
xc_fast Synplicity fast N/A VHDL/
Verilog
xc_fast_auto Synplicity fast N/A VHDL/
Verilog
xc_global_buffers Synplicity bufg N/A VHDL/
Verilog
xc_ioff Synplicity iob N/A VHDL/
Verilog
xc_isgsr Synplicity N/A N/A N/A
xc_loc Synplicity loc yes VHDL/
Verilog
xc_map Synplicity lut_map yes
d
VHDL/
Verilog
xc_ncf_auto_relax Synplicity N/A N/A N/A
xc_nodelay Synplicity nodelay N/A VHDL/
Verilog
xc_padtype Synplicity iostandard N/A VHDL/
Verilog
Table 5-6: Third Party Constraints (Continued)
Name Vendor XST Equivalent Automatic Recognition Available For
432 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
Syntax Examples
Following are Third Party Constraints syntax examples.
Verilog Syntax Example
module testkeep (in1, in2, out1);
input in1;
input in2;
output out1;
(* keep = "yes" *) wire aux1;
(* keep = "yes" *) wire aux2;
assign aux1 = in1;
assign aux2 = in2;
assign out1 = aux1 & aux2;
endmodule
XCF Syntax Example
The KEEP constraint can also be applied through the separate synthesis constraint file.
BEGIN MODEL testkeep
NET aux1 KEEP=true;
END;
These are the only two ways of preserving a signal/net in an HDL design and preventing
optimization on the signal or net during synthesis.
xc_props Synplicity N/A N/A N/A
xc_pullup Synplicity pullup pullup VHDL/
Verilog
xc_rloc Synplicity rloc yes VHDL/
Verilog
xc_fast Synplicity fast N/A VHDL/
Verilog
xc_slow Synplicity N/A N/A N/A
xc_uset Synplicity u_set yes VHDL/
Verilog
a. The value safe is not supported for automatic recognition. Use SAFE_IMPLEMENTATION in XST to activate this mode.
b. XST supports only the values hard and remove for syn_hier in automatic recognition.
c. Use KEEP instead of SIGNAL_PRESERVE.
d. XST supports only the value lut is for automatic recognition.
Table 5-6: Third Party Constraints (Continued)
Name Vendor XST Equivalent Automatic Recognition Available For
XST User Guide www.xilinx.com 433
9.1i
Constraints Precedence
R
Constraints Precedence
Priority depends on the file in which the constraint appears. A constraint in a file accessed
later in the design flow overrides a constraint in a file accessed earlier in the design flow.
Priority is as follows (first listed is the highest priority, last listed is the lowest).
1. Synthesis Constraint File
2. HDL file
3. Command Line/Process Properties dialog box in Project Navigator
434 www.xilinx.com XST User Guide
9.1i
Chapter 5: Design Constraints
R
XST User Guide www.xilinx.com 435
9.1i
R
Chapter 6
VHDL Language Support
This chapter explains how VHDL is supported for XST. It provides details on the VHDL
language, supported constructs, and synthesis options in relationship to XST. This chapter
contains the following sections:
Introduction
VHDL IEEE Support
File Type Support
Data Types in VHDL
Record Types
Initial Values
Objects in VHDL
Operators
Entity and Architecture Descriptions
Combinatorial Circuits
Sequential Circuits
Functions and Procedures
Assert Statement
Packages
VHDL Constructs Supported in XST
VHDL Reserved Words
For a complete specification of the VHDL hardware description language, see the IEEE
VHDL Language Reference Manual.
For a description of supported design constraints, see Chapter 5, Design Constraints. For
a description of VHDL attribute syntax, see VHDL Attribute Syntax in Chapter 5.
Introduction
VHDL is a hardware description language that offers a broad set of constructs for
describing even the most complicated logic in a compact fashion. The VHDL language is
designed to fill a number of requirements throughout the design process. VHDL:
Allows the description of the structure of a system how it is decomposed into
subsystems, and how those subsystems are interconnected.
Allows the specification of the function of a system using familiar programming
language forms.
436 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
Allows the design of a system to be simulated prior to being implemented and
manufactured. This feature allows you to test for correctness without the delay and
expense of hardware prototyping.
Provides a mechanism for easily producing a detailed, device-dependent version of a
design to be synthesized from a more abstract specification. This feature allows you to
concentrate on more strategic design decisions, and reduce the overall time to market
for the design.
VHDL IEEE Support
XST supports:
VHDL IEEE std 1076-1987
VHDL IEEE std 1076-1993
VHDL IEEE std 1076-2006 (partially implemented) *
* XST allows instantiation when:
The formal port is a buffer and the associated actual is an out.
The formal port is an out and the associated actual is a buffer.
VHDL IEEE Conflicts
VHDL IEEE std 1076-1987 constructs are accepted if they do not conflict with VHDL IEEE
std 1076-1993. In case of a conflict, VHDL IEEE Std 1076-1993 behavior overrides VHDL
IEEE std 1076-1987.
In cases where:
VHDL IEEE std 1076-1993 requires a construct to be an erroneous case, but
VHDL IEEE std 1076-1987 accepts it,
XST issues a warning instead of an error. (An error would stop analysis.)
Example
VHDL IEEE std 1076-1993 requires an impure function to use the impure keyword
while declaring a function.
VHDL IEEE std 1076-1987 has no such requirement.
In this case, XST:
Accepts the VHDL code written for VHDL IEEE std 1076-1987
Issues a warning stating VHDL IEEE std 1076-1993 behavior
Non-LRM Compliant Constructs
XST supports some non-LRM compliant constructs. XST supports a specific non-LRM
compliant construct when:
The construct is supported by majority of synthesis or simulation third-party tools;
and
It is a real language limitation for design coding, and has no impact on quality of
results or problem detection in the design.
XST User Guide www.xilinx.com 437
9.1i
File Type Support
R
For example, the LRM does not allow instantiation when the formal port is a buffer and
the effective one is an out (and vice-versa).
File Type Support
XST supports a limited File Read and File Write capability for VHDL. You can use this file
read capability, for example, to initialize RAMs from an external file. You can use file write
capability for debugging processes or to write a specific constant or generic value to an
external file. For more information, see Initializing RAM Coding Examples in Chapter 2.
You can use any of the read functions shown in the following table, which are supported
by the standard, std.textio and ieee.std_logic_textio packages, respectively.
Table 6-1: Supported File Types
Function Package
file (type "text" only) standard
access (type "line" only) standard
file_open (file, name, open_kind) standard
file_close (file) standard
endfile (file) standard
text std.textio
line std.textio
width std.textio
readline (text, line) std.textio
readline (line, bit, boolean) std.textio
read (line, bit) std.textio
readline (line, bit_vector, boolean) std.textio
read (line, bit_vector) std.textio
read (line, boolean, boolean) std.textio
read (line, boolean) std.textio
read (line, character, boolean) std.textio
read (line, character) std.textio
read (line, string, boolean) std.textio
read (line, string) std.textio
write (file, line) std.textio
write (line, bit, boolean) std.textio
write (line, bit) std.textio
write (line, bit_vector, boolean) std.textio
write (line, bit_vector) std.textio
438 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
For more information on how to use a file read operation, see Initializing RAM Coding
Examples in Chapter 2.
Debugging Using Write Operation
The following example shows how you can use a write operation for a debugging process.
--
-- Print 2 constants to the output file
--
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use STD.TEXTIO.all;
use IEEE.STD_LOGIC_TEXTIO.all;
write (line, boolean, boolean) std.textio
write (line, boolean) std.textio
write (line, character, boolean) std.textio
write (line, character) std.textio
write (line, integer, boolean) std.textio
write (line, integer) std.textio
write (line, string, boolean) std.textio
write (line, string) std.textio
read (line, std_ulogic, boolean) ieee.std_logic_textio
read (line, std_ulogic) ieee.std_logic_textio
read (line, std_ulogic_vector), boolean ieee.std_logic_textio
read (line, std_ulogic_vector) ieee.std_logic_textio
read (line, std_logic_vector, boolean) ieee.std_logic_textio
read (line, std_logic_vector) ieee.std_logic_textio
write (line, std_ulogic, boolean) ieee.std_logic_textio
write (line, std_ulogic) ieee.std_logic_textio
write (line, std_ulogic_vector, boolean) ieee.std_logic_textio
write (line, std_ulogic_vector) ieee.std_logic_textio
write (line, std_logic_vector, boolean) ieee.std_logic_textio
write (line, std_logic_vector) ieee.std_logic_textio
hread ieee.std_logic_textio
Table 6-1: Supported File Types (Continued)
Function Package
XST User Guide www.xilinx.com 439
9.1i
File Type Support
R
entity file_support_1 is
generic (data_width: integer:= 4);
port( clk, sel: in std_logic;
din: in std_logic_vector (data_width - 1 downto 0);
dout: out std_logic_vector (data_width - 1 downto 0));
end file_support_1;
architecture Behavioral of file_support_1 is
file results : text is out "test.dat";
constant base_const: std_logic_vector(data_width - 1 downto 0):=
conv_std_logic_vector(3,data_width);
constant new_const: std_logic_vector(data_width - 1 downto 0):=
base_const + "1000";
begin
process(clk)
variable txtline : LINE;
begin
write(txtline,string'("--------------------"));
writeline(results, txtline);
write(txtline,string'("Base Const: "));
write(txtline,base_const);
writeline(results, txtline);
write(txtline,string'("New Const: "));
write(txtline,new_const);
writeline(results, txtline);
write(txtline,string'("--------------------"));
writeline(results, txtline);
if (clk'event and clk='1') then
if (sel = '1') then
dout <= new_const;
else
dout <= din;
end if;
end if;
end process;
end Behavioral;
Limitations
During a std_logic read operation, the only characters that may appear in the file
being read are '0' and '1'. Other std_logic values are not supported (for example, 'X' or
'Z' are not supported). If any line of the file includes characters other than '0' and '1',
XST rejects the design. If a space character is detected in the file, that character will be
ignored.
Avoid using identical names for files placed in different directories.
440 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
Avoid using conditional calls to read procedures, as shown in the following example.
This can cause problems during simulation.
if SEL = '1' then
read (MY_LINE, A(3 downto 0));
else
read (MY_LINE, A(1 downto 0));
end if;
When using the endfile function, if you use the following description style:
while (not endfile (MY_FILE)) loop
readline (MY_FILE, MY_LINE);
read (MY_LINE, MY_DATA);
end loop;
XST rejects the design and generates the following error message:
Line <MY_LINE> has not enough elements for target <MY_DATA>.
To fix the problem, add "exit when endfile (MY_FILE);" to the while loop as shown in the
following example:
while (not endfile (MY_FILE)) loop
readline (MY_FILE, MY_LINE);
exit when endfile (MY_FILE);
read (MY_LINE, MY_DATA);
end loop;
Data Types in VHDL
XST accepts the following VHDL basic types.
Enumerated Types
BIT ('0','1')
BOOLEAN (false, true)
REAL ($-. to $+.)
STD_LOGIC ('U','X','0','1','Z','W','L','H','-') where:
- 'U' means uninitialized
- 'X' means unknown
- '0' means low
- '1' means high
- 'Z' means high impedance
- 'W' means weak unknown
- 'L' means weak low
- 'H' means weak high
- '-' means don't care
For XST synthesis, the '0' and 'L' values are treated identically, as are '1' and 'H'.
The 'X', and '-' values are treated as don't care. The 'U' and 'W' values are not
accepted by XST. The 'Z' value is treated as high impedance.
User-Defined Enumerated Type
type COLOR is (RED,GREEN,YELLOW);
XST User Guide www.xilinx.com 441
9.1i
Data Types in VHDL
R
Bit Vector Types
BIT_VECTOR
STD_LOGIC_VECTOR
Unconstrained types (types whose length is not defined) are not accepted.
Integer Type: INTEGER
The following types are VHDL predefined types.
BIT
BOOLEAN
BIT_VECTOR
INTEGER
REAL
The following types are declared in the STD_LOGIC_1164 IEEE package.
STD_LOGIC
STD_LOGIC_VECTOR
This package is compiled in the IEEE library. In order to use one of these types, the
following two lines must be added to the VHDL specification:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
Overloaded Data Types
The following basic types can be overloaded.
Enumerated Types
STD_ULOGIC: contains the same nine values as the STD_LOGIC type, but does
not contain predefined resolution functions
X01: subtype of STD_ULOGIC containing the 'X', '0' and '1' values
X01Z: subtype of STD_ULOGIC containing the 'X', '0', '1' and 'Z' values
UX01: subtype of STD_ULOGIC containing the 'U', 'X', '0' and '1' values
UX01Z: subtype of STD_ULOGIC containing the 'U', 'X', '0','1' and 'Z' values
Bit Vector Types
STD_ULOGIC_VECTOR
UNSIGNED
SIGNED
Unconstrained types (types whose length is not defined) are not accepted.
Integer Types
NATURAL
POSITIVE
Any integer type within a user-defined range. As an example, "type MSB is range 8 to
15;" means any integer greater than 7 or less than 16.
The types NATURAL and POSITIVE are VHDL predefined types.
442 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
The types STD_ULOGIC (and subtypes X01, X01Z, UX01, UX01Z), STD_LOGIC,
STD_ULOGIC_VECTOR and STD_LOGIC_VECTOR are declared in the
STD_LOGIC_1164 IEEE package. This package is compiled in the library IEEE. In order to
use one of these types, the following two lines must be added to the VHDL specification:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
The types UNSIGNED and SIGNED (defined as an array of STD_LOGIC) are declared in
the STD_LOGIC_ARITH IEEE package. This package is compiled in the library IEEE. In
order to use these types, the following two lines must be added to the VHDL specification:
library IEEE;
use IEEE.STD_LOGIC_ARITH.all;
Multi-Dimensional Array Types
XST supports multi-dimensional array types of up to three dimensions. Arrays can be
signals, constants, or VHDL variables. You can do assignments and arithmetic operations
with arrays. You can also pass multi-dimensional arrays to functions, and use them in
instantiations.
The array must be fully constrained in all dimensions. An example is shown below:
subtype WORD8 is STD_LOGIC_VECTOR (7 downto 0);
type TAB12 is array (11 downto 0) of WORD8;
type TAB03 is array (2 downto 0) of TAB12;
You can also declare an array as a matrix, as in the following example:
subtype TAB13 is array (7 downto 0,4 downto 0)
of STD_LOGIC_VECTOR (8 downto 0);
The following examples demonstrate the various uses of multi-dimensional array signals
and variables in assignments.
Consider the declarations:
subtype WORD8 is STD_LOGIC_VECTOR (7 downto 0);
type TAB05 is array (4 downto 0) of WORD8;
type TAB03 is array (2 downto 0) of TAB05;
signal WORD_A : WORD8;
signal TAB_A, TAB_B : TAB05;
signal TAB_C, TAB_D : TAB03;
constant CST_A : TAB03 := (
("0000000","0000001","0000010","0000011","0000100")
("0010000","0010001","0010010","0100011","0010100")
("0100000","0100001","0100010","0100011","0100100"));
A multi-dimensional array signal or variable can be completely used:
TAB_A <= TAB_B;
TAB_C <= TAB_D;
TAB_C <= CNST_A;
Just an index of one array can be specified:
TAB_A (5) <= WORD_A;
TAB_C (1) <= TAB_A;
XST User Guide www.xilinx.com 443
9.1i
Record Types
R
Just indexes of the maximum number of dimensions can be specified:
TAB_A (5) (0) <= '1';
TAB_C (2) (5) (0) <= '0'
Just a slice of the first array can be specified:
TAB_A (4 downto 1) <= TAB_B (3 downto 0);
Just an index of a higher level array and a slice of a lower level array can be specified:
TAB_C (2) (5) (3 downto 0) <= TAB_B (3) (4 downto 1);
TAB_D (0) (4) (2 downto 0) <= CNST_A (5 downto 3)
Now add the following declaration:
subtype MATRIX15 is array(4 downto 0, 2 downto 0)
of STD_LOGIC_VECTOR (7 downto 0);
A multi-dimensional array signal or variable can be completely used:
MATRIX15 <= CNST_A;
Just an index of one row of the array can be specified:
MATRIX15 (5) <= TAB_A;
Just indexes of the maximum number of dimensions can be specified:
MATRIX15 (5,0) (0) <= '1';
Just a slice of one row can be specified:
MATRIX15 (4,4 downto 1) <= TAB_B (3 downto 0);
Note: Indices may be variable.
Record Types
XST supports record types. An example of a record is shown below.
type REC1 is record
field1: std_logic;
field2: std_logic_vector (3 downto 0)
end record;
Record types can contain other record types.
Constants can be record types.
Record types cannot contain attributes.
XST supports aggregate assignments to record signals.
Initial Values
In VHDL, you can initialize registers when you declare them.
The value:
Must be a constant
Cannot depend on earlier initial values
Cannot be a function or task call
Can be a parameter value propagated to a register
444 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
When you give a register an initial value in a declaration, XST sets this value on the output
of the register at global reset, or at power up. A value assigned this way is carried in the
NGC file as an INIT attribute on the register, and is independent of any local reset.
Example
signal arb_onebit : std_logic := '0';
signal arb_priority : std_logic_vector(3 downto 0) := "1011";
You can also assign a set/reset value to a register via your behavioral VHDL code. Do this
by assigning a value to a register when the registers reset line goes to the appropriate
value as in the following example.
Example
process (clk, rst)
begin
if rst='1' then
arb_onebit <= '0';
end if;
end process;
When you set the initial value of a variable in the behavioral code, it is implemented in the
design as a flip-flop whose output can be controlled by a local reset; as such it is carried in
the NGC file as an FDP or FDC flip-flop.
Local Reset/Global Reset
Note that local reset is independent of global reset. Registers controlled by a local reset may
be set to a different value from registers whose value is only reset at global reset (power
up). In the following example, the register arb_onebit is set to '1' at global reset, but a pulse
on the local reset (rst) can change its value to '0'.
Example
entity top is
Port (
clk, rst : in std_logic;
a_in : in std_logic;
dout : out std_logic);
end top;
architecture Behavioral of top is
signal arb_onebit : std_logic := '1';
begin
process (clk, rst)
begin
if rst='1' then
arb_onebit <= '0';
elsif (clk'event and clk='1') then
arb_onebit <= a_in;
end if;
end process;
dout <= arb_onebit;
end Behavioral;
XST User Guide www.xilinx.com 445
9.1i
Objects in VHDL
R
This sets the initial value on the registers output to '1' at initial power up, but since this
is dependent upon a local reset, the value changes to '0' whenever the local set/reset is
activated.
Default Initial Values on Memory Elements
Because every memory element in a Xilinx
2
1 2
XST User Guide www.xilinx.com 467
9.1i
Packages
R
Real number functions as shown in the following table.
The procedure uniform, which generates successive values between 0.0 and 1.0
Functions and procedures in the math_real packages, as well as the real type, are for
calculations only. They are not supported for synthesis in XST.
Example
library ieee;
use IEEE.std_logic_signed.all;
signal a, b, c : std_logic_vector (5 downto 0);
c <= a + b;
-- this operator "+" is defined in package std_logic_signed.
-- Operands are converted to signed vectors, and function "+"
-- defined in package std_logic_arith is called with signed
-- operands.
Synopsys Packages
The following Synopsys packages are supported in the IEEE library.
std_logic_arith: supports types unsigned, signed vectors, and all overloaded
arithmetic operators on these types. It also defines conversion and extended functions
for these types.
std_logic_unsigned: defines arithmetic operators on std_ulogic_vector and considers
them as unsigned operators.
std_logic_signed: defines arithmetic operators on std_logic_vector and considers
them as signed operators.
std_logic_misc: defines supplemental types, subtypes, constants, and functions for the
std_logic_1164 package (and_reduce, or_reduce,...).
math_pi_over_2 math_1_oversqrt_2
math_pi_over_3 math_sqrt_pi
math_pi_over_4 math_deg_to_rad
math_3_pi_over_2 math_rad_to_deg
Table 6-5: Real Number Functions
ceil(x) realmax(x,y) exp(x) cos(x) cosh(x)
floor(x) realmin(x,y) log(x) tan(x) tanh(x)
round(x) sqrt(x) log2(x) arcsin(x) arcsinh(x)
trunc(x) cbrt(x) log10(x) arctan(x) arccosh(x)
sign(x) "**"(n,y) log(x,y) arctan(y,x) arctanh(x)
"mod"(x,y) "**"(x,y) sin(x) sinh(x)
Table 6-4: Real Number Constants (Continued)
Constant Value Constant Value
2 1 2
3
4 2 360
3 2 360 2
468 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
VHDL Constructs Supported in XST
The following tables indicate which VHDL constructs are supported in XST.
Design Entities and Configurations
Table 6-6: Entity Headers
Generics Supported
(integer type only)
Ports Supported
(no unconstrained ports)
Entity Declarative Part Supported
Entity Statement Part Unsupported
Table 6-7: Architecture Bodies
Architecture Declarative Part Supported
Architecture Statement Part Supported
Table 6-8: Configuration Declarations
Block Configuration Supported
Component Configuration Supported
Table 6-9: Subprograms
Functions Supported
Procedures Supported
Table 6-10: Packages
STANDARD Type TIME is not supported
TEXTIO Supported
STD_LOGIC_1164 Supported
STD_LOGIC_ARITH Supported
STD_LOGIC_SIGNED Supported
STD_LOGIC_UNSIGNED Supported
STD_LOGIC_MISC Supported
NUMERIC_BIT Supported
NUMERIC_UNSIGNED Supported
NUMERIC_STD Supported
MATH_REAL Supported
XST User Guide www.xilinx.com 469
9.1i
VHDL Constructs Supported in XST
R
ASYL.ARITH Supported
ASYL.SL_ARITH Supported
ASYL.PKG_RTL Supported
ASYL.ASYL1164 Supported
Table 6-11: Enumeration Types
BOOLEAN, BIT Supported
STD_ULOGIC,
STD_LOGIC
Supported
XO1, UX01, XO1Z, UX01Z Supported
Table 6-12: Integer Types
INTEGER Supported
POSITIVE Supported
NATURAL Supported
Table 6-13: Physical Types
TIME Ignored
REAL Supported (only in functions for constant
calculations)
Table 6-14: Composite
BIT_VECTOR Supported
STD_ULOGIC_VECTOR Supported
STD_LOGIC_VECTOR Supported
UNSIGNED Supported
SIGNED Supported
Record Supported
Access Supported
File Supported
Table 6-15: Mode
In, Out, Inout Supported
Buffer Supported
Linkage Unsupported
Table 6-10: Packages (Continued)
470 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
XST does not allow underscores as the first character of signal names -- for example,
_DATA_1.
Table 6-16: Declarations
Type Supported for enumerated types, types
with positive range having constant
bounds, bit vector types, and multi-
dimensional arrays
Subtype Supported
Table 6-17: Objects
Constant Declaration Supported (deferred constants are not
supported)
Signal Declaration Supported ("register" or "bus" type
signals are not supported)
Variable Declaration Supported
File Declaration Supported
Alias Declaration Supported
Attribute Declaration Supported for some attributes, otherwise
skipped (see Chapter 5, Design
Constraints)
Component Declaration Supported
Table 6-18: Specifications
Attribute Supported for some predefined attributes
only: HIGH, LOW, LEFT, RIGHT,
RANGE, REVERSE_RANGE, LENGTH,
POS, ASCENDING, EVENT,
LAST_VALUE.
Otherwise, ignored.
Configuration Supported only with the "all" clause for
instances list. If no clause is added, XST
looks for the entity/architecture
compiled in the default library.
Disconnection Unsupported
Table 6-19: Names
Simple Names Supported
Selected Names Supported
Indexed Names Supported
Slice Names Supported (including dynamic ranges)
XST User Guide www.xilinx.com 471
9.1i
VHDL Constructs Supported in XST
R
Expressions
Table 6-20: Operators
Logical Operators:
and, or, nand, nor, xor, xnor, not
Supported
Relational Operators:
=, /=, <, <=, >, >=
Supported
& (concatenation) Supported
Adding Operators: +, - Supported
* Supported
/,rem Supported if the right operand is a
constant power of 2
mod Supported
Shift Operators:
sll, srl, sla, sra, rol, ror
Supported
abs Supported
** Only supported if the left operand is 2
Sign: +, - Supported
Table 6-21: Operands
Abstract Literals Only integer literals are supported
Physical Literals Ignored
Enumeration Literals Supported
String Literals Supported
Bit String Literals Supported
Record Aggregates Supported
Array Aggregates Supported
Function Call Supported
Qualified Expressions Supported for accepted predefined
attributes
Types Conversions Supported
Allocators Unsupported
Static Expressions Supported
472 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
Supported VHDL Statements
Table 6-22: Wait Statement
Wait on sensitivity_list until
Boolean_expression. See Sequential
Circuits for details.
Supported with one signal in the
sensitivity list and in the Boolean
expression. In case of multiple Wait
statements, the sensitivity list and the
Boolean expression must be the same for
each Wait statement.
Note: XST does not support Wait statements
for latch descriptions.
Wait for time_expression... See Sequential
Circuits for details.
Unsupported
Assertion Statement Supported (only for static conditions)
Signal Assignment
Statement
Supported (delay is ignored)
Variable Assignment
Statement
Supported
Procedure Call Statement Supported
If Statement Supported
Case Statement Supported
Table 6-23: Loop Statement
"for... loop... end loop" Supported for constant bounds only. Disable
statements are not supported.
"while... loop... end loop" Supported
"loop ... end loop" Only supported in the particular case of multiple
Wait statements
Next Statement Supported
Exit Statement Supported
Return Statement Supported
Null Statement Supported
Table 6-24: Concurrent Statement
Process Statement Supported
Concurrent Procedure Call Supported
Concurrent Assertion Statement Ignored
XST User Guide www.xilinx.com 473
9.1i
VHDL Constructs Supported in XST
R
Concurrent Signal
Assignment Statement
Supported (no "after" clause, no "transport" or
"guarded" options, no waveforms)
"UNAFFECTED" is supported.
Component Instantiation
Statement
Supported
"For ... Generate" Statement supported for constant bounds only
"If ... Generate" Statement supported for static condition only
Table 6-24: Concurrent Statement (Continued)
474 www.xilinx.com XST User Guide
9.1i
Chapter 6: VHDL Language Support
R
VHDL Reserved Words
The following are VHDL reserved words.
Table 6-25: VHDL Reserved Words
abs access after alias
all and architecture array
assert attribute begin block
body buffer bus case
component configuration constant disconnect
downto else elsif end
entity exit file for
function generate generic group
guarded if impure in
inertial inout is label
library linkage literal loop
map mod nand new
next nor not null
of on open or
others out package port
postponed procedure process pure
range record register reject
rem report return rol
ror select severity signal
shared sla sll sra
srl subtype then to
transport type unaffected units
until use variable wait
when while with xnor
xor
XST User Guide www.xilinx.com 475
9.1i
R
Chapter 7
Verilog Language Support
This chapter describes XST support for Verilog constructs and meta comments. This
chapter contains the following sections:
Introduction
Behavioral Verilog Features
Variable Part Selects
Structural Verilog Features
Parameters
Parameter/Attribute Conflicts
Verilog Limitations in XST
Verilog Attributes and Meta Comments
Verilog Language Support
Primitives
Verilog Reserved Keywords
Verilog-2001 Support in XST
For more information on Verilog design constraints and options, see Chapter 5, Design
Constraints. For more information on Verilog attribute syntax, see Verilog-2001
Attributes in Chapter 5. For more information on setting Verilog options in the Process
window of Project Navigator, see General Constraints in Chapter 5.
Introduction
Complex circuits are commonly designed using a top down methodology. Various
specification levels are required at each stage of the design process. As an example, at the
architectural level, a specification may correspond to a block diagram or an Algorithmic
State Machine (ASM) chart. A block or ASM stage corresponds to a register transfer block
(for example register, adder, counter, multiplexer, glue logic, finite state machine) where
the connections are N-bit wires. Use of an HDL language like Verilog allows expressing
notations such as ASM charts and circuit diagrams in a computer language. Verilog
provides both behavioral and structural language structures which allow expressing
design objects at high and low levels of abstraction. Designing hardware with a language
like Verilog allows usage of software concepts such as parallel processing and object-
oriented programming. Verilog has a syntax similar to C and Pascal, and is supported by
XST as IEEE 1364.
The Verilog support in XST provides an efficient way to describe both the global circuit and
each block according to the most efficient "style." Synthesis is then performed with the best
synthesis flow for each block. Synthesis in this context is the compilation of high-level
476 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
behavioral and structural Verilog HDL statements into a flattened gate-level netlist, which
can then be used to custom program a programmable logic device such as the Virtex
FPGA family. Different synthesis methods are used for arithmetic blocks, glue logic, and
finite state machines.
This manual assumes that you are familiar with the basic notions of Verilog. For a complete
specification, see the IEEE Verilog HDL Reference Manual.
Behavioral Verilog Features
This section describes the behavioral features of Verilog.
Variable Declaration
Variables in Verilog may be declared as integers or real. These declarations are intended
only for use in test code. Verilog provides data types such as reg and wire for actual
hardware description.
The difference between reg and wire is whether the variable is given its value in a
procedural block (reg) or in a continuous assignment (wire) Verilog code. Both reg and
wire have a default width being one bit wide (scalar). To specify an N-bit width (vectors)
for a declared reg or wire, the left and right bit positions are defined in square brackets
separated by a colon. In Verilog-2001, both reg and wire data types can be signed or
unsigned.
Example
reg [3:0] arb_priority;
wire [31:0] arb_request;
wire signed [8:0] arb_signed;
where
arb_request[31] is the MSB
arb_request[0] is the LSB
Initial Values
In Verilog-2001, you can initialize registers when you declare them.
The value:
Must be a constant
Cannot depend on earlier initial values
Cannot be a function or task call
Can be a parameter value propagated to the register
All bits of vector must be specified
When you give a register an initial value in a declaration, XST sets this value on the
output of the register at global reset, or at power up. A value assigned this way is
XST User Guide www.xilinx.com 477
9.1i
Behavioral Verilog Features
R
carried in the NGC file as an INIT attribute on the register, and is independent of
any local reset.
Example
reg arb_onebit = 1'b0;
reg [3:0] arb_priority = 4'b1011;
You can also assign a set/reset (initial) value to a register via your behavioral Verilog code.
Do this by assigning a value to a register when the registers reset line goes to the
appropriate value as in the following example.
Example
always @(posedge clk)
begin
if (rst)
arb_onebit <= 1'b0;
end
end
When you set the initial value of a variable in the behavioral code, it is implemented in the
design as a flip-flop whose output can be controlled by a local reset; as such it is carried in
the NGC file as an FDP or FDC flip-flop.
Local Reset Global Reset
Note that local reset is independent of global reset. Registers controlled by a local reset may
be set to a different value than ones whose value is only reset at global reset (power up). In
the following example, the register, arb_onebit, is set to '0' at global reset, but a pulse on
the local reset (rst) can change its value to '1'.
Example
module mult(clk, rst, A_IN, B_OUT);
input clk,rst,A_IN;
output B_OUT;
reg arb_onebit = 1'b0;
always @(posedge clk or posedge rst)
begin
if (rst)
arb_onebit <= 1'b1;
else
arb_onebit <= A_IN;
end
end
B_OUT <= arb_onebit;
endmodule
This sets the set/reset value on the registers output at initial power up, but since this is
dependent upon a local reset, the value changes whenever the local set/reset is activated.
478 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Arrays
Verilog allows arrays of reg and wires to be defined as in the following two examples:
reg [3:0] mem_array [31:0];
The above describes an array of 32 elements each, 4 bits wide which can be assigned via
behavioral Verilog code.
wire [7:0] mem_array [63:0];
The above describes an array of 64 elements each 8 bits wide which can only be assigned
via structural Verilog code.
Multi-Dimensional Arrays
XST supports multi-dimensional array types of up to two dimensions. Multi-dimensional
arrays can be any net or any variable data type. You can code assignments and arithmetic
operations with arrays, but you cannot select more than one element of an array at one
time. You cannot pass multi-dimensional arrays to system tasks or functions, or regular
tasks or functions.
Examples
The following describes an array of 256 x 16 wire elements each 8 bits wide, which can only
be assigned via structural Verilog code.
wire [7:0] array2 [0:255][0:15];
The following describes an array of 256 x 8 register elements, each 64 bits wide, which can
be assigned via behavioral Verilog code.
reg [63:0] regarray2 [255:0][7:0];
The following is a three dimensional array. It can be described as an array of 15 arrays of
256 x 16 wire elements, each 8 bits wide, which can be assigned via structural Verilog code.
wire [7:0] array3 [0:15][0:255][0:15];
Data Types
The Verilog representation of the bit data type contains the following four values:
0: logic zero
1: logic one
x: unknown logic value
z: high impedance
XST includes support for the following Verilog data types:
Net: wire, tri, triand/wand, trior/wor
Registers: reg, integer
Supply nets: supply0, supply1
Constants: parameter
Multi-Dimensional Arrays (Memories)
Net and registers can be either single bit (scalar) or multiple bit (vectors).
The following example gives some examples of Verilog data types (as found in the
declaration section of a Verilog module).
XST User Guide www.xilinx.com 479
9.1i
Behavioral Verilog Features
R
Example 7-1 Basic Data Types
wire net1; // single bit net
reg r1; // single bit register
tri [7:0] bus1; // 8 bit tristate bus
reg [15:0] bus1; // 15 bit register
reg [7:0] mem[0:127]; // 8x128 memory register
parameter state1 = 3b001; // 3 bit constant
parameter component = "TMS380C16"; // string
Legal Statements
The following are statements that are legal in behavioral Verilog.
Variable and signal assignment:
Variable = expression
if (condition) statement
if (condition) statement else statement
case (expression)
expression: statement
default: statement
endcase
for (variable = expression; condition; variable = variable + expression) statement
while (condition) statement
forever statement
functions and tasks
All variables are declared as integer or reg. A variable cannot be declared as a wire.
Expressions
An expression involves constants and variables with arithmetic (+, -, *,**, /,%), logical (&,
&&, |, ||, ^, ~,~^, ^~, <<, >>,<<<,>>>), relational (<, ==, ===, <=, >=,!=,!==, >), and
conditional (?) operators. The logical operators are further divided as bit-wise versus
logical depending on whether it is applied to an expression involving several bits or a
single bit. The following table lists the expressions supported by XST.
Table 7-1: Expressions
Concatenation {} Supported
Replication {{}} Supported
Arithmetic
+, -, *,** Supported
/ Supported only if second operand is a
power of 2
Modulus % Supported only if second operand is a
power of 2
Addition + Supported
480 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Subtraction - Supported
Multiplication * Supported
Power ** Supported
Both operands must be constants
with the second operand being
non-negative.
If the first operand is a 2, then the
second operand may be a variable.
XST does not support the real data
type. Any combination of operands
that results in a real type causes an
error.
The values X (unknown) and Z
(high impedance) are not allowed.
Division / Supported
XST generates incorrect logic for the
division operator between signed and
unsigned constants. Example: -
1235/3b111
Relational >, <, >=, <= Supported
Logical Negation ! Supported
Logical AND && Supported
Logical OR || Supported
Logical Equality == Supported
Logical Inequality != Supported
Case Equality === Supported
Case Inequality !== Supported
Bitwise Negation ~ Supported
Bitwise AND & Supported
Bitwise Inclusive OR | Supported
Bitwise Exclusive OR ^ Supported
Bitwise Equivalence ~^, ^~ Supported
Reduction AND & Supported
Reduction NAND ~& Supported
Reduction OR | Supported
Reduction NOR ~| Supported
Reduction XOR ^ Supported
Reduction XNOR ~^, ^~ Supported
Table 7-1: Expressions (Continued)
XST User Guide www.xilinx.com 481
9.1i
Behavioral Verilog Features
R
The following table lists the results of evaluating expressions using the more frequently
used operators supported by XST.
The (===) and (!==) are special comparison operators useful in simulations to check if a
variable is assigned a value of (x) or (z). They are treated as (==) or (!=) in synthesis.
Blocks
Block statements are used to group statements together. XST only supports sequential
blocks. Within these blocks, the statements are executed in the order listed. Parallel blocks
are not supported by XST. Block statements are designated by begin and end keywords,
and are discussed within examples later in this chapter.
Left Shift << Supported
Right Shift Signed >>> Supported
Left Shift Signed <<< Supported
Right Shift >> Supported
Conditional ?: Supported
Event OR or, ',' Supported
Table 7-2: Results of Evaluating Expressions
a b a==b a===b a!=b a!==b a&b a&&b a|b a||b a^b
0 0 1 1 0 0 0 0 0 0 0
0 1 0 0 1 1 0 0 1 1 1
0 x x 0 x 1 0 0 x x x
0 z x 0 x 1 0 0 x x x
1 0 0 0 1 1 0 0 1 1 1
1 1 1 1 0 0 1 1 1 1 0
1 x x 0 x 1 x x 1 1 x
1 z x 0 x 1 x x 1 1 x
x 0 x 0 x 1 0 0 x x x
x 1 x 0 x 1 x x 1 1 x
x x x 1 x 0 x x x x x
x z x 0 x 1 x x x x x
z 0 x 0 x 1 0 0 x x x
z 1 x 0 x 1 x x 1 1 x
z x x 0 x 1 x x x x x
z z x 1 x 0 x x x x x
Table 7-1: Expressions (Continued)
482 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Modules
In Verilog a design component is represented by a module. The connections between
components are specified within module instantiation statements. Such a statement
specifies an instance of a module. Each module instantiation statement must be given a
name (instance name). In addition to the name, a module instantiation statement contains
an association list that specifies which actual nets or ports are associated with which local
ports (formals) of the module declaration.
All procedural statements occur in blocks that are defined inside modules. There are two
kinds of procedural blocks: the initial block and the always block. Within each block,
Verilog uses a begin and end to enclose the statements. Since initial blocks are ignored
during synthesis, only always blocks are discussed. Always blocks usually take the
following format:
always
begin
statement
...
end
where each statement is a procedural assignment line terminated by a semicolon.
Module Declaration
In the module declaration, the I/O ports of the circuit are declared. Each port has a name
and a mode (in, out, and inout) as shown in the example below.
module EXAMPLE (A, B, C, D, E);
input A, B, C;
output D;
inout E;
wire D, E;
...
assign E = oe ? A : 1bz;
assign D = B & E;
...
endmodule
The input and output ports defined in the module declaration called EXAMPLE are the
basic input and output I/O signals for the design. The inout port in Verilog is analogous to
a bi-directional I/O pin on the device with the data flow for output versus input being
controlled by the enable signal to the tristate buffer. The preceding example describes E as
a tristate buffer with a high-true output enable signal. If oe = 1, the value of signal A is
output on the pin represented by E. If oe = 0, then the buffer is in high impedance (Z) and
any input value driven on the pin E (from the external logic) is brought into the device and
fed to the signal represented by D.
Verilog Assignments
There are two forms of assignment statements in the Verilog language, Continuous
Assignments and Procedural Assignments.
Continuous Assignments
Continuous assignments are used to model combinatorial logic in a concise way. Both
explicit and implicit continuous assignments are supported. Explicit continuous
XST User Guide www.xilinx.com 483
9.1i
Behavioral Verilog Features
R
assignments are introduced by the assign keyword after the net has been separately
declared. Implicit continuous assignments combine declaration and assignment.
Delays and strengths given to a continuous assignment are ignored by XST.
Example of an explicit continuous assignment:
wire par_eq_1;
...
assign par_eq_1 = select ? b : a;
Example of an implicit continuous assignment:
wire temp_hold = a | b;
Continuous assignments are only allowed on wire and tri data types.
Procedural Assignments
Procedural assignments are used to assign values to variables declared as regs and are
introduced by always blocks, tasks, and functions. Procedural assignments are usually
used to model registers and FSMs.
XST includes support for combinatorial functions, combinatorial and sequential tasks, and
combinatorial and sequential always blocks.
Combinatorial Always Blocks
Combinatorial logic can be modeled efficiently using two forms of time control, the # and
@ Verilog time control statements. The # time control is ignored for synthesis and hence
this section describes modeling combinatorial logic with the @ statement.
A combinatorial always block has a sensitivity list appearing within parentheses after the
word "always @". An always block is activated if an event (value change or edge) appears
on one of the sensitivity list signals. This sensitivity list can contain any signal that appears
in conditions (If, Case, for example), and any signal appearing on the right hand side of an
assignment. By substituting a * without parentheses, for a list of signals, the always block
is activated for an event in any of the always blocks signals as described above.
In combinatorial processes, if a signal is not explicitly assigned in all branches of "If" or
"Case" statements, XST generates a latch to hold the last value. To avoid latch creation, be
sure that all assigned signals in a combinatorial process are always explicitly assigned in all
paths of the process statements.
Different statements can be used in a process:
Variable and signal assignment
If... else statement
Case statement
For and while loop statement
Function and task call
The following sections provide examples of each of these statements.
If...Else Statement
If... else statements use true/false conditions to execute statements. If the expression
evaluates to true, the first statement is executed. If the expression evaluates to false (or
x or z), the else statement is executed. A block of multiple statements may be executed
484 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
using begin and end keywords. If...else statements may be nested. The following
example shows how a MUX can be described using an If...else statement.
Example 7-2 MUX Description Using If... Else Statement
module mux4 (sel, a, b, c, d, outmux);
input [1:0] sel;
input [1:0] a, b, c, d;
output [1:0] outmux;
reg [1:0] outmux;
always @(sel or a or b or c or d)
begin
if (sel[1])
if (sel[0])
outmux = d;
else
outmux = c;
else
if (sel[0])
outmux = b;
else
outmux = a;
end
endmodule
Case Statement
Case statements perform a comparison to an expression to evaluate one of a number of
parallel branches. The Case statement evaluates the branches in the order they are written.
The first branch that evaluates to true is executed. If none of the branches match, the
default branch is executed.
Do not use unsized integers in case statements. Always size integers to a specific number
of bits, or results can be unpredictable.
Casez treats all z values in any bit position of the branch alternative as a dont care.
Casex treats all x and z values in any bit position of the branch alternative as a dont care.
The question mark (?) can be used as a "dont care" in either the casez or casex case
statements. The following example shows how a MUX can be described using a Case
statement.
Example 7-3 MUX Description Using Case Statement
module mux4 (sel, a, b, c, d, outmux);
input [1:0] sel;
input [1:0] a, b, c, d;
output [1:0] outmux;
reg [1:0] outmux;
always @(sel or a or b or c or d)
begin
case (sel)
2'b00: outmux = a;
2'b01: outmux = b;
2'b10: outmux = c;
default: outmux = d;
endcase
XST User Guide www.xilinx.com 485
9.1i
Behavioral Verilog Features
R
end
endmodule
The preceding Case statement evaluates the values of the input sel in priority order. To
avoid priority processing, it is recommended that you use a parallel-case Verilog attribute
which ensures parallel evaluation of the sel inputs as in the following.
Example
(* parallel_case *) case(sel)
For and Repeat Loops
When using always blocks, repetitive or bit slice structures can also be described using the
for statement or the repeat statement.
The for statement is supported for:
Constant bounds
Stop test condition using operators <, <=, > or >=
Next step computation falling in one of the following specifications:
var = var + step
var = var - step
(where var is the loop variable and step is a constant value).
The repeat statement is supported for constant values only.
Disable statements are not supported.
The following example shows the use of a For Loop.
Example 7-4 For Loop Description
module countzeros (a, Count);
input [7:0] a;
output [2:0] Count;
reg [2:0] Count;
reg [2:0] Count_Aux;
integer i;
always @(a)
begin
Count_Aux = 3'b0;
for (i = 0; i < 8; i = i+1)
begin
if (!a[i])
Count_Aux = Count_Aux+1;
end
Count = Count_Aux;
end
endmodule
While Loops
When using always blocks, use the while statement to execute repetitive procedures. A
while loop executes other statements until its test expression becomes false. It is not
executed if the test expression is initially false.
486 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
The test expression is any valid Verilog expression.
To prevent endless loops, use the loop_iteration_limit switch.
While loops can have Disable statements. The Disable statement must be use inside a
labeled block, since the syntax is disable <blockname>.
The following example shows the use of a While Loop.
Example 7-5 While Loop Description
parameter P = 4;
always @(ID_complete)
begin : UNIDENTIFIED
integer i;
reg found;
unidentified = 0;
i = 0;
found = 0;
while (!found && (i < P))
begin
found = !ID_complete[i];
unidentified[i] = !ID_complete[i];
i = i + 1;
end
end
Sequential Always Blocks
Sequential circuit description is based on always blocks with a sensitivity list.
The sensitivity list contains a maximum of three edge-triggered events: the clock signal
event (which is mandatory), possibly a reset signal event, and a set signal event. One, and
only one If...else statement is accepted in such an always block.
An asynchronous part may appear before the synchronous part in the first and the second
branch of the If...else statement. Signals assigned in the asynchronous part must be
assigned to the constant values '0', '1', 'X' or 'Z' or any vector composed of these
values.
These same signals must also be assigned in the synchronous part (that is, the last branch
of the If...else statement). The clock signal condition is the condition of the last branch
of the If...else statement. The following example gives the description of an 8-bit
register.
Example 7-6 8 Bit Register Using an Always Block
module seq1 (DI, CLK, DO);
input [7:0] DI;
input CLK;
output [7:0] DO;
reg [7:0] DO;
always @(posedge CLK)
DO <= DI ;
endmodule
Example 7-7 8 Bit Register with Asynchronous Reset (High-True) Using an Always
Block
module EXAMPLE (DI, CLK, RST, DO);
XST User Guide www.xilinx.com 487
9.1i
Behavioral Verilog Features
R
input [7:0] DI;
input CLK, RST;
output [7:0] DO;
reg [7:0] DO;
always @(posedge CLK or posedge RST)
if (RST == 1'b1)
DO <= 8'b00000000;
else
DO <= DI;
endmodule
Example 7-8 8 Bit Counter with Asynchronous Reset (low-true) Using an Always
Block
module seq2 (CLK, RST, DO);
input CLK, RST;
output [7:0] DO;
reg [7:0] DO;
always @(posedge CLK or posedge RST)
if (RST == 1'b1)
DO <= 8'b00000000;
else
DO <= DO + 8'b00000001;
endmodule
Assign and Deassign Statements
Assign and deassign statements are supported within simple templates.
General Template Example
The following is an example of the general template for assign/deassign statements:
module assig (RST, SELECT, STATE, CLOCK, DATA_IN);
input RST;
input SELECT;
input CLOCK;
input [0:3] DATA_IN;
output [0:3] STATE;
reg [0:3] STATE;
always @ (RST)
if(RST)
begin
assign STATE = 4'b0;
end
else
begin
deassign STATE;
end
always @ (posedge CLOCK)
begin
STATE <= DATA_IN;
end
endmodule
488 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Support Limitations
The main limitations on support of the assign/deassign statement in XST are as follows:
For a given signal, there must be only one assign/deassign statement. For example, XST
rejects the following design:
module dflop (RST, SET, STATE, CLOCK, DATA_IN);
input RST;
input SET;
input CLOCK;
input DATA_IN;
output STATE;
reg STATE;
always @ (RST) // block b1
if(RST)
assign STATE = 1'b0;
else
deassign STATE;
always @ (SET) // block b1
if(SET)
assign STATE = 1'b1;
else
deassign STATE;
always @ (posedge CLOCK) // block b2
begin
STATE <= DATA_IN;
end
endmodule
The assign/deassign statement must be performed in the same always block through an
if/else statement. For example, XST rejects the following design:
module dflop (RST, SET, STATE, CLOCK, DATA_IN);
input RST;
input SET;
input CLOCK;
input DATA_IN;
output STATE;
reg STATE;
always @ (RST or SET) // block b1
case ({RST,SET})
2'b00: assign STATE = 1'b0;
2'b01: assign STATE = 1'b0;
2'b10: assign STATE = 1'b1;
2'b11: deassign STATE;
endcase
always @ (posedge CLOCK) // block b2
begin
STATE <= DATA_IN;
end
endmodule
XST User Guide www.xilinx.com 489
9.1i
Behavioral Verilog Features
R
You cannot assign a bit/part select of a signal through an assign/deassign statement. For
example, XST rejects the following design:
module assig (RST, SELECT, STATE, CLOCK, DATA_IN);
input RST;
input SELECT;
input CLOCK;
input [0:7] DATA_IN;
output [0:7] STATE;
reg [0:7] STATE;
always @ (RST) // block b1
if(RST)
begin
assign STATE[0:7] = 8'b0;
end
else
begin
deassign STATE[0:7];
end
always @ (posedge CLOCK) // block b2
begin
if (SELECT)
STATE [0:3] <= DATA_IN[0:3];
else
STATE [4:7] <= DATA_IN[4:7];
end
Assignment Extension Past 32 Bits
If the expression on the left-hand side of an assignment is wider than the expression on the
right-hand side, the left-hand side is padded to the left according to the following rules.
If the right-hand expression is signed, the left-hand expression is padded with the
sign bit (0 for positive, 1 for negative, z for high impedance or x for unknown).
If the right-hand expression is unsigned, the left-hand expression is padded with
'0's.
For unsized x or z constants only the following rule applies. If the value of the right-
hand expressions left-most bit is z (high impedance) or x (unknown), regardless of
whether the right-hand expression is signed or unsigned, the left-hand expression is
padded with that value (z or x, respectively).
The above rules follow the Verilog-2001 standard, and are not backward compatible with
Verilog-1995.
Tasks and Functions
The declaration of a function or task is intended for handling blocks used multiple times in
a design. They must be declared and used in a module. The heading part contains the
parameters: input parameters (only) for functions and input/output/inout parameters for
tasks. The return value of a function can be declared either signed or unsigned. The content
is similar to the combinatorial always block content.
Example 7-9 shows a function declared within a module. The ADD function declared is a
single-bit adder. This function is called 4 times with the proper parameters in the
490 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
architecture to create a 4-bit adder. The same example, described with a task, is shown in
Example 7-10.
Example 7-9 Function Declaration and Function Call
module comb15 (A, B, CIN, S, COUT);
input [3:0] A, B;
input CIN;
output [3:0] S;
output COUT;
wire [1:0] S0, S1, S2, S3;
function signed [1:0] ADD;
input A, B, CIN;
reg S, COUT;
begin
S = A ^ B ^ CIN;
COUT = (A&B) | (A&CIN) | (B&CIN);
ADD = {COUT, S};
end
endfunction
assign S0 = ADD (A[0], B[0], CIN),
S1 = ADD (A[1], B[1], S0[1]),
S2 = ADD (A[2], B[2], S1[1]),
S3 = ADD (A[3], B[3], S2[1]),
S = {S3[0], S2[0], S1[0], S0[0]},
COUT = S3[1];
endmodule
Example 7-10 Task Declaration and Task Enable
module EXAMPLE (A, B, CIN, S, COUT);
input [3:0] A, B;
input CIN;
output [3:0] S;
output COUT;
reg [3:0] S;
reg COUT;
reg [1:0] S0, S1, S2, S3;
task ADD;
input A, B, CIN;
output [1:0] C;
reg [1:0] C;
reg S, COUT;
begin
S = A ^ B ^ CIN;
COUT = (A&B) | (A&CIN) | (B&CIN);
C = {COUT, S};
end
endtask
always @(A or B or CIN)
begin
ADD (A[0], B[0], CIN, S0);
ADD (A[1], B[1], S0[1], S1);
ADD (A[2], B[2], S1[1], S2);
XST User Guide www.xilinx.com 491
9.1i
Behavioral Verilog Features
R
ADD (A[3], B[3], S2[1], S3);
S = {S3[0], S2[0], S1[0], S0[0]};
COUT = S3[1];
end
endmodule
Recursive Tasks and Functions
Verilog-2001 adds support for recursive tasks and functions. You can only use recursion
with the automatic keyword.
The syntax using recursion is shown in the following example:
function automatic [31:0] fac;
input [15:0] n;
if (n == 1)
fac = 1;
else
fac = n * fac(n-1); //recursive function call
endfunction
Constant Functions
Verilog-2001 adds support for constant functions. Function calls to calculate constant
values are now supported by XST.
The evaluation of a constant function is shown in the following example:
module rams_cf (clk, we, a, di, do);
parameter DEPTH=1024;
input clk;
input we;
input [4:0] a;
input [3:0] di;
output [3:0] do;
reg [3:0] ram [size(DEPTH):0];
always @(posedge clk) begin
if (we)
ram[a] <= di;
end
assign do = ram[a];
function integer size;
input depth;
integer i;
begin
size=1;
for (i=0; 2**i<depth; i=i+1)
size=i+1;
end
endfunction
endmodule
492 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Blocking Versus Non-Blocking Procedural Assignments
The # and @ time control statements delay execution of the statement following them until
the specified event is evaluated as true. Use of blocking and non-blocking procedural
assignments have time control built into their respective assignment statement.
The # delay is ignored for synthesis.
The syntax for a blocking procedural assignment is shown in the following example:
reg a;
a = #10 (b | c);
or
if (in1) out = 1'b0;
else out = in2;
As the name implies, these types of assignments block the current process from continuing
to execute additional statements at the same time. These should mainly be used in
simulation.
Non-blocking assignments, on the other hand, evaluate the expression when the statement
executes, but allow other statements in the same process to execute as well at the same
time. The variable change only occurs after the specified delay.
The syntax for a non-blocking procedural assignment is as follows:
variable <= @(posedge_or_negedge_bit) expression;
The following shows an example of how to use a non-blocking procedural assignment.
if (in1) out <= 1'b1;
else out <= in2;
Constants, Macros, Include Files and Comments
This section discusses constants, macros, include files, and comments.
Constants
By default, constants in Verilog are assumed to be decimal integers. They can be specified
explicitly in binary, octal, decimal or hexadecimal by prefacing them with the appropriate
syntax. For example, 4'b1010, 4'o12, 4'd10 and 4'ha all represent the same value.
Macros
Verilog provides a way to define macros as shown in the following example.
`define TESTEQ1 4'b1101
Later in the design code a reference to the defined macro is made as follows.
if (request == `TESTEQ1)
This is shown in the following example.
`define myzero 0
assign mysig = `myzero;
Verilog provides the `ifdef and `endif constructs to determine whether a macro is defined
or not. These constructs are used to define conditional compilation. If the macro called out
by the `ifdef command has been defined, that code is compiled. If not, the code following
the `else command is compiled. The `else is not required, but the `endif must complete the
XST User Guide www.xilinx.com 493
9.1i
Behavioral Verilog Features
R
conditional statement. The `ifdef and `endif constructs are shown in the following
example.
`ifdef MYVAR
module if_MYVAR_is_declared;
...
endmodule
`else
module if_MYVAR_is_not_declared;
...
endmodule
`endif
The DEFINE command line option allows you to define (or redefine) Verilog macros. This
allows you to easily modify the design configuration without any HDL source
modifications, such as for IP core generation and testing flows. For more information, see
Verilog Macros (DEFINE) in Chapter 5.
Include Files
Verilog allows separating source code into more than one file. To use the code contained in
another file, the current file has the following syntax:
`include "path/file-to-be-included"
The path can be relative or absolute.
Multiple `include statements are allowed in a single Verilog file. This feature makes your
code modular and more manageable in a team design environment where different files
describe different modules of the design.
To have the file in your `include statement recognized, you must identify the directory
where it resides either to ISE or to XST.
By default, ISE searches the ISE project directory, so adding the file to your project
directory will identify the file to ISE.
You can direct ISE to a different directory by including a path (relative or absolute) in
the `include statement in your source code.
You can point XST directly to your include file directory by using the Verilog Include
Directories option. See Verilog Include Directories (Verilog Only) in Chapter 5.
If the include file is required for ISE to construct the design hierarchy, this file must
either reside in the project directory, or be referenced by a relative or absolute path.
The file need not be added to the project.
Be aware that conflicts can occur. For example, at the top of a Verilog file you might see the
following:
`timescale 1 ns/1 ps
`include "modules.v"
...
If the specified file (in this case, modules.v) has been added to an ISE project directory
and is specified with an `include, conflicts may occur and an error message displays:
ERROR:Xst:1068 - fifo.v, line 2. Duplicate declarations of
module'RAMB4_S8_S8'
494 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Comments
There are two forms of comments in Verilog similar to the two forms found in a language
like C++.
// Allows definition of a one-line comment
/* You can define a multi-line comment by enclosing it as illustrated by this
sentence */
Generate Statement
Generate is a construct that allows you to dynamically create Verilog code from conditional
statements. This allows you to create repetitive structures or structures that are only
appropriate under certain conditions. Structures that are likely to be created via a generate
statement are:
Primitive or module instances
Initial or always procedural blocks
Continuous assignments
Net and variable declarations
Parameter redefinitions
Task or function definitions
XST supports the following types of generate statements:
generate for
generate if
generate case
Generate For
Use a generate for loop to create one or more instances that can be placed inside a module.
Use the generate for loop the same way you would a normal Verilog for loop with the
following limitations.
The index for a generate for loop must have a genvar variable.
The assignments in the for loop control must refer to the genvar variable.
The contents of the for loop must be enclosed by begin and end statements, and the
begin statement must be named with a unique qualifier.
The following is an example of an 8-bit adder using a generate for loop.
generate
genvar i;
for (i=0; i<=7; i=i+1)
begin : for_name
adder add (a[8*i+7 : 8*i], b[8*i+7 : 8*i],
ci[i], sum_for[8*i+7 : 8*i], c0_or[i+1]);
end
endgenerate
XST User Guide www.xilinx.com 495
9.1i
Variable Part Selects
R
Generate If... else
A generate if statement can be used inside a generate block to conditionally control what
objects get generated.
The following is an example of a generate If... else statement. The generate controls what
type of multiplier is instantiated. The contents of each branch of the if... else
statement must be enclosed by begin and end statements, and the begin statement must
be named with a unique qualifier.
generate
if (IF_WIDTH < 10)
begin : if_name
adder # (IF_WIDTH) u1 (a, b, sum_if);
end
else
begin : else_name
subtractor # (IF_WIDTH) u2 (a, b, sum_if);
end
endgenerate
Generate Case
A generate case statement can be used inside a generate block to conditionally control
what objects get generated. Use a generate case statement when there are several
conditions to be tested to determine what the generated code would be. Each test
statement in a generate case statement must be enclosed by begin and end statements,
and the begin statement must be named with a unique qualifier.
The following is an example of a generate case statement. The generate controls what type
of adder is instantiated.
generate
case (WIDTH)
1:
begin : case1_name
adder #(WIDTH*8) x1 (a, b, ci, sum_case, c0_case);
end
2:
begin : case2_name
adder #(WIDTH*4) x2 (a, b, ci, sum_case, c0_case);
end
default:
begin : d_case_name
adder x3 (a, b, ci, sum_case, c0_case);
end
endcase
endgenerate
Variable Part Selects
Verilog 2001 adds the capability to use variables to select a group of bits from a vector. A
variable part select is defined by the starting point of its range and the width of the vector,
instead of being bounded by two explicit values. The starting point of the part select can
vary, but the width of the part select remains constant.
+: Indicates that the part select increases from the starting point.
-: Indicates that the part select decreases from the starting point.
496 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Example
reg [3:0] data;
reg [3:0] select; // a value from 0 to 7
wire [7:0] byte = data[select +: 8];
Structural Verilog Features
Structural Verilog descriptions assemble several blocks of code and allow the introduction
of hierarchy in a design. The basic concepts of hardware structure are the module, the port
and the signal. The component is the building or basic block. A port is a component I/O
connector. A signal corresponds to a wire between components.
In Verilog, a component is represented by a design module. The module declaration
provides the "external" view of the component; it describes what can be seen from the
outside, including the component ports. The module body provides an "internal" view; it
describes the behavior or the structure of the component.
The connections between components are specified within component instantiation
statements. These statements specify an instance of a component occurring within another
component or the circuit. Each component instantiation statement is labeled with an
identifier. Besides naming a component declared in a local component declaration, a
component instantiation statement contains an association list (the parenthesized list) that
specifies which actual signals or ports are associated with which local ports of the
component declaration.
The Verilog language provides a large set of built-in logic gates which can be instantiated
to build larger logic circuits. The set of logical functions described by the built-in gates
includes AND, OR, XOR, NAND, NOR and NOT.
Here is an example of building a basic XOR function of two single bit inputs a and b.
module build_xor (a, b, c);
input a, b;
output c;
wire c, a_not, b_not;
not a_inv (a_not, a);
not b_inv (b_not, b);
and a1 (x, a_not, b);
and a2 (y, b_not, a);
or out (c, x, y);
endmodule
Each instance of the built-in modules has a unique instantiation name such as a_inv, b_inv,
out. The wiring up of the gates describes an XOR gate in structural Verilog.
Example 7-11 gives the structural description of a half adder composed of four, 2 input
nand modules.
XST User Guide www.xilinx.com 497
9.1i
Structural Verilog Features
R
Example 7-11 Structural Description of a Half Adder
module halfadd (X, Y, C, S);
input X, Y;
output C, S;
wire S1, S2, S3;
nand NANDA (S3, X, Y);
nand NANDB (S1, X, S3);
nand NANDC (S2, S3, Y);
nand NANDD (S, S1, S2);
assign C = S3;
endmodule
The structural features of Verilog HDL also allow you to design circuits by instantiating
pre-defined primitives such as gates, registers and Xilinx specific primitives like
CLKDLL and BUFGs. These primitives are other than those included in the Verilog
language. These pre-defined primitives are supplied with the XST Verilog libraries
(unisim_comp.v).
Example 7-12 Structural Instantiation of Register and BUFG
module foo (sysclk, in, reset, out);
input sysclk, in, reset;
output out;
reg out;
wire sysclk_out;
FDC register (sysclk, reset, in, out); //position based referencing
BUFG clk (.O(sysclk_out), .I(sysclk)); //name based referencing
...
endmodule
The unisim_comp.v library file supplied with XST, includes the definitions for FDC and
BUFG.
(* BOX_TYPE="PRIMITIVE" *) // Verilog-2001
module FDC ( C, CLR, D, Q);
input C;
input CLR;
Figure 7-1: Synthesized Top Level Netlist
A
B
Y NANDA
A
B
Y NANDD
A
B
Y NANDC
A
B
Y NANDB
S3
S2
S1
Y
X
C
S
X8952
498 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
input D;
output Q;
endmodule
(* BOX_TYPE="PRIMITIVE" *) // Verilog-2001
module BUFG ( O, I);
output O;
input I;
endmodule
Parameters
Verilog modules support defining constants known as parameters which can be passed to
module instances to define circuits of arbitrary widths. Parameters form the basis of
creating and using parameterized blocks in a design to achieve hierarchy and stimulate
modular design techniques. The following is an example of the use of parameters. Null
string parameters are not supported.
Example 7-13 Using Parameters
module lpm_reg (out, in, en, reset, clk);
parameter SIZE = 1;
input in, en, reset, clk;
output out;
wire [SIZE-1 : 0] in;
reg [SIZE-1 : 0] out;
always @(posedge clk or negedge reset)
begin
if (!reset)
out <= 1b0;
else
if (en)
out <= in;
else
out <= out; //redundant assignment
end
endmodule
module top (); //portlist left blank intentionally
...
wire [7:0] sys_in, sys_out;
wire sys_en, sys_reset, sysclk;
lpm_reg #8 buf_373 (sys_out, sys_in, sys_en, sys_reset, sysclk);
...
endmodule
Instantiation of the module lpm_reg with a instantiation width of 8 causes the instance
buf_373 to be 8 bits wide.
The GENERICS command line option allows you to redefine parameters (Verilog) values
defined in the top-level design block. This allows you to easily modify the design
configuration without any HDL source modifications, such as for IP core generation and
testing flows. For more information, see Generics in Chapter 5.
XST User Guide www.xilinx.com 499
9.1i
Parameter/Attribute Conflicts
R
Parameter/Attribute Conflicts
Since parameters and attributes can be applied to both instances and modules in your
Verilog code, and attributes can also be specified in a constraints file, from time to time,
conflicts will arise. To resolve these conflicts, XST uses the following rules of precedence.
1. Whatever is specified on an instance (lower level) takes precedence over what is
specified on a module (higher level).
2. If a parameter and an attribute are specified on either the same instance or the same
module, the parameter takes precedence, and XST issues a message warning of the
conflict.
3. An attribute specified in the XCF file will always take precedence over attributes or
parameters specified in your Verilog code.
When an attribute specified on an instance overrides a parameter specified on a module in
XST, it is possible that your simulation tool may nevertheless use the parameter. This may
cause the simulation results to not match the synthesis results.
Use the following matrix as a guide in determining precedence.
Security attributes on the module definition always have higher precedence than any other
attribute or parameter.
Verilog Limitations in XST
This section describes Verilog limitations in XST support for case sensitivity, and blocking
and nonblocking assignments.
Case Sensitivity
Verilog is case sensitive, so module or instance names can be made unique by changing the
capitalization of the letters in the name. However, for compatibility with file names, mixed
language support, and other tools, Xilinx recommends that you rely on more than just
capitalization to make instances unique.
XST will not allow module names to differ by only capitalization, and will rename
instances and signal names to ensure that any lack of case sensitivity support in other tools
in your flow will not cause problems with your design.
Table 7-3: Precedence
Parameter on an Instance Parameter on a Module
Attribute
on an Instance
Apply Parameter
(XST issues warning
message)
Apply Attribute
(possible simulation
mismatch)
Attribute
on a Module
Apply Parameter Apply Parameter
(XST issues warning
message)
Attribute in XCF
Apply Attribute
(XST issues warning
message)
Apply Attribute
500 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
XST Support for Case Sensitivity
XST supports case sensitivity as follows:
Designs can use case equivalent names for I/O ports, nets, regs and memories.
Equivalent names are renamed using a postfix ("rnm<Index>").
A rename construct is generated in the NGC file.
Designs can use Verilog identifiers that differ only in case. XST renames them using a
postfix as with equivalent names.
Following is an example.
module upperlower4 (input1, INPUT1, output1, output2);
input input1;
input INPUT1;
For the above example, INPUT1 is renamed to INPUT1_rnm0.
Verilog Restrictions Within XST
The following restrictions apply to Verilog within XST:
Designs using equivalent names (named blocks, tasks, and functions) are rejected.
Example
...
always @(clk)
begin: fir_main5
reg [4:0] fir_main5_w1;
reg [4:0] fir_main5_W1;
This code generates the following error message:
ERROR:Xst:863 - "design.v", line 6: Name conflict
(<fir_main5/fir_main5_w1> and <fir_main5/fir_main5_W1>)
Designs using case equivalent module names are also rejected.
Example
module UPPERLOWER10 (...);
...
module upperlower10 (...);
...
This example generates the following error message:
ERROR:Xst:909 - Module name conflict (UPPERLOWER10 and upperlower10)
Blocking and Nonblocking Assignments
XST rejects Verilog designs if a given signal is assigned through both blocking and
nonblocking assignments as in the following example.
always @(in1)
begin
if (in2)
out1 = in1;
else
out1 <= in2;
end
XST User Guide www.xilinx.com 501
9.1i
Verilog Limitations in XST
R
If a variable is assigned in both a blocking and nonblocking assignment, the following
error message is generated:
ERROR:Xst:880 - "design.v", line n: Cannot mix blocking and non blocking
assignments on signal <out1>.
There are also restrictions when mixing blocking and nonblocking assignments on bits and
slices.
The following example is rejected even if there is no real mixing of blocking and non
blocking assignments:
if (in2)
begin
out1[0] = 1b0;
out1[1] <= in1;
end
else
begin
out1[0] = in2;
out1[1] <= 1b1;
end
Errors are checked at the signal level, not at the bit level.
If there is more than a single blocking/non blocking error, only the first one is reported.
In some cases, the line number for the error might be incorrect (as there might be multiple
lines where the signal has been assigned).
Integer Handling
There are several cases where XST handles integers differently from other synthesis tools,
and so they must be coded in a particular way.
In Case statements, do not use unsized integers in case item expressions, as this causes
unpredictable results. In the following example, the case item expression "4" is an unsized
integer that causes unpredictable results. To avoid problems, size the "4" to 3 bits as shown
below.
reg [2:0] condition1;
always @(condition1)
begin
case(condition1)
4 : data_out = 2; // < will generate bad logic
3'd4 : data_out = 2; // < will work
endcase
end
In concatenations, do not use unsized integers, as this causes unpredictable results. If you
must use an expression that results in an unsized integer, assign the expression to a
temporary signal, and use the temporary signal in the concatenation as shown below.
reg [31:0] temp;
assign temp = 4'b1111 % 2;
assign dout = {12/3,temp,din};
502 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Verilog Attributes and Meta Comments
XST supports both Verilog-2001 style attributes and meta comments in Verilog. Verilog-
2001 attributes are recommended as they are more generally accepted. Meta comments are
comments that are understood by the Verilog parser.
Verilog-2001 attributes must be bounded by the characters (* and *), and are written using
the following syntax:
(* attribute_name = "attribute_value" *)
where
The attribute must precede the signal, module or instance declaration it refers to.
The attribute_value must be a string; no integer or scalar values are allowed.
The attribute_value must be between quotes.
The default value is 1. (* attribute_name *) is the same as
(* attribute_name = "1" *)
Examples
(* RLOC = "R11C1.S0" *)
(* HUSET = "MY_SET" *)
(* fsm_extract = "yes" *)
(* fsm_encoding = "gray" *)
Meta comments can be used as follows:
Set constraints on individual objects (for example, module, instance, net)
Set directives on synthesis:
parallel_case and full_case directives
translate_on translate_off directives
all tool specific directives (for example, syn_sharing)
For more information, see Chapter 5, Design Constraints.
Meta comments can be written using the C-style (/* ... */) or the Verilog style (// ...) for
comments. C-style comments can be multiple line. Verilog style comments end at the end
of the line.
XST supports the following:
Both C-style and Verilog style meta comments
translate_on translate_off directives
// synthesis translate_on
// synthesis translate_off
parallel_case, full_case directives
// synthesis parallel_case full_case
// synthesis parallel_case
// synthesis full_case
Constraints on individual objects
The general syntax is:
// synthesis attribute AttributeName [of] ObjectName [is] AttributeValue
XST User Guide www.xilinx.com 503
9.1i
Verilog Language Support
R
Examples
// synthesis attribute RLOC of u123 is R11C1.S0
// synthesis attribute HUSET u1 MY_SET
// synthesis attribute fsm_extract of State2 is "yes"
// synthesis attribute fsm_encoding of State2 is "gray"
For a full list of constraints, see Chapter 5, Design Constraints.
Verilog Language Support
The following tables indicate which Verilog constructs are supported in XST. Previous
sections in this chapter describe these constructs and their use within XST.
XST does not allow underscores as the first character of signal names (for
example, _DATA_1).
Table 7-4: Constants
Integer Constants Supported
Real Constants Supported
Strings Constants Unsupported
Table 7-5: Data Types
Nets
net type
wire Supported
tri Supported
supply0, supply1 Supported
wand, wor, triand,
trior
Supported
tri0, tri1, trireg Unsupported
drive strength Ignored
Registers
reg Supported
integer Supported
real Unsupported
realtime Unsupported
Vectors
net Supported
reg Supported
vectored Supported
scalared Supported
Multi-Dimensional
Arrays
(<= 2 dimensions)
Supported
504 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Parameters Supported
Named Events Unsupported
Table 7-6: Continuous Assignments
Drive Strength Ignored
Delay Ignored
Table 7-7: Procedural Assignments
Blocking Assignments Supported
Non-Blocking Assignments Supported
Continuous Procedural Assignments
assign Supported with
limitations See Assign
and Deassign
Statements
deassign
force Unsupported
release Unsupported
if Statement if, if else Supported
case Statement case, casex, casez Supported
forever Statement Unsupported
repeat Statement Supported (repeat value
must be constant)
while Statement Supported
for Statement Supported (bounds
must be static)
fork/join Statement Unsupported
Timing Control on Procedural
Assignments
delay (#) Ignored
event (@) Unsupported
wait Unsupported
named events Unsupported
Sequential Blocks Supported
Parallel Blocks Unsupported
Specify Blocks Ignored
Table 7-5: Data Types (Continued)
XST User Guide www.xilinx.com 505
9.1i
System Tasks and Functions
R
System Tasks and Functions
initial Statement Supported
always Statement Supported
task Supported
functions Supported
disable Statement Supported
Table 7-8: Design Hierarchy
Module definition Supported
Macromodule definition Unsupported
Hierarchical names Unsupported
defparam Supported
Array of instances Supported
Table 7-9: Compiler Directives
`celldefine `endcelldefine Ignored
`default_nettype Supported
`define Supported
`ifdef `else `endif Supported
`undef, `ifndef, `elsif, Supported
`include Supported
`resetall Ignored
`timescale Ignored
`unconnected_drive
`nounconnected_drive
Ignored
`uselib Unsupported
`file, `line Supported
Table 7-7: Procedural Assignments (Continued)
Table 7-10: System Task and Function Support
$display Supported
a
$fclose Supported
$fdisplay Supported
$fgets Supported
506 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Any system tasks that are not supported are ignored by the XST Verilog compiler.
The $signed and $unsigned system tasks can be called on any expression using the
following syntax:
$signed(expr) or $unsigned(expr)
The return value from these calls will be of the same size as the input value, and its sign
will be forced regardless of any previous sign.
The $readmemb and $readmemh system tasks can be used to initialize block memories.
For more information, see Initializing RAM From An External File Coding Examples in
Chapter 2.
The remainder of the system tasks can be used to display information to your computer
screen and log file during processing, or to open and use a file during synthesis. You must
call these tasks from within initial blocks. XST supports a subset of escape sequences,
specifically %h, %d, %o, %b, %c and %s. Following is sample code showing the syntax for
$display that reports the value of a binary constant in decimal format:
parameter c = 8'b00101010;
initial
begin
$display ("The value of c is %d", c);
end
$finish Supported
b
$fopen Supported
$fscanf Supported
c
$fwrite Supported
$monitor Ignored
$random Ignored
$readmemb Supported
$readmemh Supported
$signed Supported
$stop Ignored
$strobe Ignored
$time Ignored
$unsigned Supported
$write Supported
d
all others Ignored
a. Escape sequences are limited to %d, %b, %h, %o, %c and %s
b. $finish is supported for statically never active conditional branches only
c. Escape sequences are limited to %b and %d
d. Escape sequences are limited to %d, %b, %h, %o, %c and %s
Table 7-10: System Task and Function Support (Continued)
XST User Guide www.xilinx.com 507
9.1i
Primitives
R
The following information is written to the log file during the HDL Analysis phase:
Analyzing top module <example>.
c = 8'b00101010
"foo.v" line 9: $display : The value of c is 42
Primitives
XST supports certain gate level primitives. The supported syntax is as follows:
gate_type instance_name (output, inputs, ...);
The following example shows Gate Level Primitive Instantiations.
and U1 (out, in1, in2);
bufif1 U2 (triout, data, trienable);
508 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
The following table shows which primitives are supported.
Verilog Reserved Keywords
The following table shows the Verilog reserved keywords.
Table 7-11: Primitives
Gate Level Primitives
and nand nor or xnor xor Supported
buf not Supported
bufif0 bufif1 notif0 notif1 Supported
pulldown pullup Unsupported
drive strength Ignored
delay Ignored
array of primitives Supported
Switch Level Primitives
cmos nmos pmos rcmos
rnmos rpmos
Unsupported
rtran rtranif0 rtranif1 tran
tranif0 tranif1
Unsupported
User-Defined Primitives Unsupported
Table 7-12: Verilog Reserved Keywords
always and assign automatic
begin buf bufif0 bufif1
case casex casez cell*
cmos config* deassign default
defparam design* disable edge
else end endcase endconfig*
endfunction endgenerate endmodule endprimitive
endspecify endtable endtask event
for force forever fork
function generate genvar highz0
highz1 if ifnone incdir*
include* initial inout input
instance* integer join large
liblist* library* localparam* macromodule
medium module nand negedge
nmos nor noshow-cancelled* not
XST User Guide www.xilinx.com 509
9.1i
Verilog-2001 Support in XST
R
* These keywords are reserved by Verilog, but not supported by XST.
Verilog-2001 Support in XST
XST supports the following Verilog-2001 features. For details on Verilog-2001, see Verilog-
2001: A Guide to the New Features by Stuart Sutherland, or IEEE Standard Verilog Hardware
Description Language manual, (IEEE Standard 1364-2001).
Generate statements
Combined port/data type declarations
ANSI-style port lists
Module parameter port lists
ANSI C style task/function declarations
Comma separated sensitivity list
Combinatorial logic sensitivity
Default nets with continuous assigns
Disable default net declarations
Indexed vector part selects
Multi-dimensional arrays
Arrays of net and real data types
Array bit and part selects
Signed reg, net, and port declarations
notif0 notif1 or output
parameter pmos posedge primitive
pull0 pull1 pullup pulldown
pulsestyle-
_ondetect*
pulsestyle-
_onevent*
rcmos real
realtime reg release repeat
rnmos rpmos rtran rtranif0
rtranif1 scalared show-cancelled* signed
small specify specparam strong0
strong1 supply0 supply1 table
task time tran tranif0
tranif1 tri tri0 tri1
triand trior trireg use*
vectored wait wand weak0
weak1 while wire wor
xnor xor
Table 7-12: Verilog Reserved Keywords (Continued)
510 www.xilinx.com XST User Guide
9.1i
Chapter 7: Verilog Language Support
R
Signed based integer numbers
Signed arithmetic expressions
Arithmetic shift operators
Automatic width extension past 32 bits
Power operator
N sized parameters
Explicit in-line parameter passing
Fixed local parameters
Enhanced conditional compilation
File and line compiler directives
Variable part selects
Recursive Tasks and Functions
Constant Functions
XST User Guide www.xilinx.com 511
9.1i
R
Chapter 8
Mixed Language Support
This chapter describes how to run an XST project that mixes Verilog and VHDL designs.
This chapter contains the following sections:
Introduction
Mixed Language Project File
VHDL And Verilog Boundary Rules
Port Mapping
Generics Support in Mixed Language Projects
Library Search Order File
Introduction
XST supports mixed VHDL and Verilog projects. The following are key features of mixed
language support:
Mixing of VHDL and Verilog is restricted to design unit (cell) instantiation only. A
VHDL design can instantiate a Verilog module, and a Verilog design can instantiate a
VHDL entity. Any other kind of mixing between VHDL and Verilog is not supported.
In a VHDL design, a restricted subset of VHDL types, generics and ports is allowed
on the boundary to a Verilog module. Similarly, in a Verilog design, a restricted subset
of Verilog types, parameters and ports is allowed on the boundary to a VHDL entity
or configuration.
XST binds VHDL design units to a Verilog module during the Elaboration step.
Component instantiation based on default binding is used for binding Verilog
modules to a VHDL design unit.
Configuration specification, direct instantiation and component configurations are not
supported for a Verilog module instantiation in VHDL.
In supporting mixed projects:
VHDL and Verilog project files are unified.
VHDL and Verilog libraries are logically unified.
Specification of work directory for compilation (xsthdpdir), previously available
only for VHDL, is also available for Verilog.
The xhdp.ini mechanism for mapping a logical library name to a physical directory
name on the host file system, previously available only for VHDL, is also available for
Verilog.
512 www.xilinx.com XST User Guide
9.1i
Chapter 8: Mixed Language Support
R
Mixed language projects accept a search order used for searching unified logical
libraries in design units (cells). During elaboration, XST follows this search order for
picking and binding a VHDL entity or a Verilog module to the mixed language
project.
Mixed Language Project File
XST uses a dedicated mixed language project file to support mixed VHDL and Verilog
designs. You can use this mixed language format not only for mixed projects, but also for
purely VHDL or Verilog projects. If you use Project Navigator to run XST, Project
Navigator creates the project file, and it is always a mixed language project file. If you run
XST from the command line, you must create a mixed language project file for your mixed
language projects.
To create a mixed language project file at the command line, use the ifmt command line
switch set to mixed or with its value is omitted. You can still use the VHDL and Verilog
formats for existing designs. To use the VHDL format, set ifmt to vhdl, and to use the
Verilog format, set ifmt to verilog.
The syntax for invoking a library or any external file in a mixed language project is as
follows:
language library file_name.ext
The following is an example of how to invoke libraries in a mixed language project:
vhdl work my_vhdl1.vhd
verilog work my_vlg1.v
vhdl my_vhdl_lib my_vhdl2.vhd
verilog my_vlg_lib my_vlg2.v
Each line specifies a single HDL design file:
The first column specifies whether the HDL file is VHDL or Verilog.
The second column specifies the logic library, where the HDL is compiled. By default
the logic library is "work".
The third column specifies the name of the HDL file.
VHDL And Verilog Boundary Rules
The boundary between VHDL and Verilog is enforced at the design unit level. A VHDL
design can instantiate a Verilog module. A Verilog design can instantiate a VHDL entity.
Instantiating a Verilog Module in a VHDL Design
To instantiate a Verilog module in your VHDL design, do the following.
1. Declare a VHDL component with the same name (respecting case sensitivity) as the
Verilog module you want to instantiate. If the Verilog module name is not all lower
case, use the Case property to preserve the case of your Verilog module. In Project
Navigator, select Maintain for the Case option of the Synthesis Options tab of the
Process Properties dialog box, or set the case command line option to maintain at the
command line.
XST User Guide www.xilinx.com 513
9.1i
VHDL And Verilog Boundary Rules
R
2. Instantiate your Verilog component as if you were instantiating a VHDL component.
Using a VHDL configuration declaration, one could attempt to bind this component to
a particular design unit from a particular library. Such binding is not supported. Only
default Verilog module binding is supported.
The only Verilog construct that can be instantiated in a VHDL design is a Verilog module.
No other Verilog constructs are visible to VHDL code.
During elaboration, all components subject to default binding are regarded as design units
with the same name as the corresponding component name. In the binding process, XST
treats a component name as a VHDL design unit name and searches for it in the logical
library "work." If a VHDL design unit is found, then XST binds it. If XST cannot find a
VHDL design unit, it treats the component name as a Verilog module name and searches
for it using a case sensitive search. XST searches for the Verilog module in the user-
specified list of unified logical libraries in the user-specified search order. See Library
Search Order File for search order details. XST selects the first Verilog module matching
the name, and binds it.
Since libraries are unified, a Verilog cell by the same name as that of a VHDL design unit
cannot co-exist in the same logical library. A newly compiled cell/unit overrides a
previously compiled one.
Instantiating a VHDL Design Unit in a Verilog Design
To instantiate a VHDL entity, declare a module name with the same as name as the VHDL
entity (optionally followed by an architecture name) that you want to instantiate, and
perform a normal Verilog instantiation. The only VHDL construct that can be instantiated
in a Verilog design is a VHDL entity. No other VHDL constructs are visible to Verilog code.
When you do this, XST uses the entity/architecture pair as the Verilog/VHDL boundary.
XST performs the binding during elaboration. In the binding process, XST searches for a
Verilog module name (it ignores any architecture name specified in the module
instantiation) using the name of the instantiated module in the user-specified list of unified
logical libraries in the user-specified order. See Library Search Order File for search order
details. If found, XST binds the name. If XST cannot find a Verilog module, it treats the
name of the instantiated module as a VHDL entity, and searches for it using a case sensitive
search for a VHDL entity. XST searches for the VHDL entity in the user-specified list of
unified logical libraries in the user-specified order, assuming that a VHDL design unit was
stored with extended identifier. See Library Search Order File for search order details. If
found, XST binds the name. XST selects the first VHDL entity matching the name, and
binds it.
XST has the following limitations when instantiating a VHDL design unit from a Verilog
module:
Explicit port association must be used. That is, formal and effective port names must
be specified in the port map.
All parameters must be passed at instantiation, even if they are unchanged.
The parameter override shall be named and not ordered. The parameter override
must be done though instantiation and not through defparams.
The following is an example of the correct use of parameter override.
ff #(.init(2'b01)) u1 (.sel(sel), .din(din), .dout(dout));
514 www.xilinx.com XST User Guide
9.1i
Chapter 8: Mixed Language Support
R
The following is an incorrect use of the of parameter override, and is not accepted by
XST.
ff u1 (.sel(sel), .din(din), .dout(dout));
defparam u1.init = 2'b01;
Port Mapping
XST uses the following rules and limitations for port mapping in mixed language projects.
For VHDL entities instantiated in Verilog designs, XST supports the following port
types.
in
out
inout
XST does not support VHDL buffer and linkage ports.
For Verilog modules instantiated in VHDL designs, XST supports the following port
types.
input
output
inout
XST does not support connection to bi-directional pass switches in Verilog.
XST does not support unnamed Verilog ports for mixed language boundaries.
Use an equivalent component declaration for connecting to a case sensitive port in a
Verilog module. By default, XST assumes Verilog ports are in all lower case.
XST supports the following VHDL data types for mixed language designs.
bit
bit_vector
std_logic
std_ulogic
std_logic_vector
std_ulogic_vector
XST supports the following Verilog data types for mixed language designs.
wire
reg
Generics Support in Mixed Language Projects
XST supports the following VHDL generic types, and their Verilog equivalents for mixed
language designs.
integer
real
string
boolean
XST User Guide www.xilinx.com 515
9.1i
Library Search Order File
R
Library Search Order File
The Library Search Order (LSO) file specifies the search order that XST uses to link the
libraries used in VHDL and Verilog mixed language designs. By default, XST searches the
files specified in the project file in the order in which they appear in that file. XST uses the
default search order when either the DEFAULT_SEARCH_ORDER keyword is used in the
LSO file or the LSO file is not specified.
Project Navigator
In Project Navigator, the default name for the LSO file is project_name.lso. If a
project_name.lso file does not already exist, Project Navigator automatically creates
one. If Project Navigator detects an existing project_name.lso file, this file is preserved
and used as it is. Please remember that in Project Navigator, the name of the project is the
name of the top-level block. In creating a default LSO file, Project Navigator places the
DEFAULT_SEARCH_ORDER keyword in the first line of the file.
Command Line
When using XST from the command line, specify the Library Search Order file by using the
lso command line switch. If the lso switch is omitted, XST automatically uses the
default library search order without using an LSO file.
Search Order Rules
XST follows the following search order rules when processing a mixed language project.
When the LSO file contains only the DEFAULT_SEARCH_ORDER keyword, XST:
Searches the specified library files in the order in which they appear in the project
file
Updates the LSO file by:
- removing the DEFAULT_SEARCH_ORDER keyword
- adding the list of libraries to the LSO file in the order in which they appear in
the project file
See Example One.
When the LSO file contains the DEFAULT_SEARCH_ORDER keyword, and a list of
the libraries, XST:
Searches the specified library files in the order in which they appear in the project
file
Ignores the list of library files in the LSO file
Leaves the LSO file unchanged
See Example Two.
When the LSO file contains a list of the libraries without the
DEFAULT_SEARCH_ORDER keyword, XST:
Searches the library files in the order in which they appear in the LSO file
Leaves the LSO file unchanged
See Example Three.
516 www.xilinx.com XST User Guide
9.1i
Chapter 8: Mixed Language Support
R
When the LSO file is empty, XST:
Generates a warning message stating that the LSO file is empty
Searches the files specified in the project file using the default library search order
Updates the LSO file by adding the list of libraries in the order that they appear in
the project file
When the LSO file contains a library name that does not exist in the project or INI file,
and the LSO file does not contain the DEFAULT_SEARCH_ORDER keyword, XST
ignores the library.
See Example Four.
Example One
For a project file, my_proj.prj, with the following contents:
vhdl vhlib1 f1.vhd
verilog rtfllib f1.v
vhdl vhlib2 f3.vhd
LSO file Created by ProjNav
and an LSO file, my_proj.lso, created by Project Navigator, with the following
contents:
DEFAULT_SEARCH_ORDER
XST uses the following search order.
vhlib1
rtfllib
vhlib2
After processing, the contents of my_proj.lso will be:
vhlib1
rtfllib
vhlib2
Example Two
For a project file, my_proj.prj, with the following contents:
vhdl vhlib1 f1.vhd
verilog rtfllib f1.v
vhdl vhlib2 f3.vhd
and an LSO file, my_proj.lso, created with the following contents:
rtfllib
vhlib2
vhlib1
DEFAULT_SEARCH_ORDER
XST uses the following search order:
vhlib1
rtfllib
vhlib2
XST User Guide www.xilinx.com 517
9.1i
Library Search Order File
R
After processing, the contents of my_proj.lso will be:
rtfllib
vhlib2
vhlib1
DEFAULT_SEARCH_ORDER
Example Three
For a project file, my_proj.prj, with the following contents:
vhdl vhlib1 f1.vhd
verilog rtfllib f1.v
vhdl vhlib2 f3.vhd
and an LSO file, my_proj.lso, created with the following contents:
rtfllib
vhlib2
vhlib1
XST uses the following search order:
rtfllib
vhlib2
vhlib1
After processing, the contents of my_proj.lso will be:
rtfllib
vhlib2
vhlib1
Example Four
For a project file, my_proj.prj, with the following contents:
vhdl vhlib1 f1.vhd
verilog rtfllib f1.v
vhdl vhlib2 f3.vhd
and an LSO file, my_proj.lso, created with the following contents:
personal_lib
rtfllib
vhlib2
vhlib1
XST uses the following search order:
rtfllib
vhlib2
vhlib1
After processing, the contents of my_proj.lso will be:
rtfllib
vhlib2
vhlib1
518 www.xilinx.com XST User Guide
9.1i
Chapter 8: Mixed Language Support
R
XST User Guide www.xilinx.com 519
9.1i
R
Chapter 9
Log File Analysis
This chapter describes the XST log file, and explains what it contains. This chapter contains
the following sections:
Introduction
Reducing the Size of the LOG File
Timing Report
FPGA Log File
CPLD Log File
Introduction
The XST log file related to FPGA optimization contains the following sections:
Copyright Statement
Table of Contents
Use this section to quickly navigate to different LOG file sections. These headings are
not linked. Use the Find function in your text editor.
Synthesis Options Summary
HDL Compilation
See HDL Analysis below.
Design Hierarchy Analyzer
See "HDL Analysis" below.
HDL Analysis
During HDL Compilation, Design Hierarchy Analyzer, and HDL Analysis, XST:
Parses and analyzes VHDL and Verilog files
Recognizes the design hierarchy
Gives the names of the libraries into which they are compiled
During this step XST may report potential mismatches between synthesis and
simulation results, potential multi-sources, and other issues.
HDL Synthesis
During this step, XST tries to recognize as many basic macros as possible to create a
technology specific implementation. This is done on a block by block basis. At the end
of this step XST gives an HDL Synthesis Report.
See HDL Coding Techniques in Chapter 2 for more details about the processing of
each macro and the corresponding messages issued during the synthesis process.
520 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
Advanced HDL Synthesis
During this step XST performs advanced macro recognition and inference. In this step,
XST recognizes, for example, dynamic shift registers, implements pipelined
multipliers, and codes state machines. This report contains a summary of recognized
macros in the overall design, sorted by macro type.
Low Level Synthesis
During this step XST reports the potential removal of, for example, equivalent flip-
flops and register replication.
For more information, see Log File Analysis in Chapter 3.
Partition Report
This section contains information detailing the design Partitions if the design was
partitioned.
Final Report
The Final report is different for FPGA and CPLD flows as follows.
FPGA and CPLD: includes the output file name, output format, target family and
cell usage.
FPGA only: In addition to the above, the report includes the following
information for FPGA devices.
- Device Utilization Summary: where XST estimates the number of slices, and
gives, for example, the number of flip-flops, IOBs, and BRAMS. This report is
very close to the one produced by MAP.
- Partition Resource Summary: where XST estimates the number of slices, and
gives, for example, the number of flip-flops, IOBs, and BRAMS for each
partition. This report is very close to the one produced by MAP.
- Clock Information: gives information about the number of clocks in the
design, how each clock is buffered and how many loads it has.
- Timing report: contains Timing Summary and Detailed Timing Report. For
more information, see Log File Analysis in Chapter 3.
- Encrypted Modules: if a design contains encrypted modules, XST hides the
information about these modules.
Reducing the Size of the LOG File
There are several ways to reduce the size of the LOG file generated by XST, Quiet Mode,
Silent Mode, and Hiding Specific Messages.
When running XST from in Project Navigator, you can use a Message Filtering wizard to
select specific messages to filter out of the log file. See Using the Message Filters in the ISE
Help for more information.
Quiet Mode
Quiet mode allows you to limit the number of messages that are printed to the computer
screen (stdout).
Quiet mode can be invoked by using the intstyle command line switch with its value
set to either ise or xflow as appropriate. The ise option formats messages for ISE, while the
xflow option formats messages for XFLOW use. You can also use the old quiet switch,
XST User Guide www.xilinx.com 521
9.1i
Reducing the Size of the LOG File
R
but Xilinx
strongly recommends that you not use this method because it will become
obsolete in coming releases.
Normally, XST prints the entire log to stdout. In quiet mode, XST does not print the
following portions of the log to stdout:
Copyright Message
Table Of Contents
Synthesis Options Summary
The following portions of the Final Report
Final Results header for CPLD devices
Final Results section for FPGA devices
The following note in the Timing Report
Note: These timing numbers are only a synthesis estimate. For accurate timing
information, see the trace report generated after place-and-route.
Timing Detail
CPU (XST run time)
Memory usage
Note: Device Utilization Summary, Clock Information, and Timing Summary are still available
for FPGA devices.
Silent Mode
Silent mode allows you keep any messages from going to the computer screen (stdout),
while XST continues to generate the entire LOG file. Silent mode can be invoked using the
intstyle switch with value set to silent.
Hiding Specific Messages
You can hide specific messages generated by XST at the HDL or Low Level Synthesis steps
in specific situations by using the XIL_XST_HIDEMESSAGES environment variable. This
environment variable can have one of the following values.
none maximum verbosity. All messages are printed out. This is the default.
hdl_level reduce verbosity during VHDL or Verilog Analysis and HDL Basic and
Advanced Synthesis.
low_level reduce verbosity during Low-level Synthesis
hdl_and_low_levels reduce verbosity at all stages.
The following messages are hidden when hdl_level and hdl_and_low_levels values are
specified for the XIL_XST_HIDEMESSAGES environment variable.
WARNING:HDLCompilers:38 - design.v line 5 Macro 'my_macro'
redefined
Note: This message is issued by the Verilog compiler only.
WARNING:Xst:916 - design.vhd line 5: Delay is ignored for
synthesis.
WARNING:Xst:766 - design.vhd line 5: Generating a Black Box for
component comp.
Instantiating component comp from Library lib.
522 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
Set user-defined property "LOC = X1Y1" for instance inst in
unit block.
Set user-defined property "RLOC = X1Y1" for instance inst in
unit block.
Set user-defined property "INIT = 1" for instance inst in unit
block.
Register reg1 equivalent to reg2 has been removed.
The following messages are hidden when low_level and hdl_and_low_levels values are
specified for the XIL_XST_HIDEMESSAGES environment variable.
WARNING:Xst:382 - Register reg1 is equivalent to reg2.
Register reg1 equivalent to reg2 has been removed.
WARNING:Xst:1710 - FF/Latch reg (without init value) is
constant in block block.
WARNING:Xst 1293 - FF/Latch reg is constant in block block.
WARNING:Xst:1291 - FF/Latch reg is unconnected in block block.
WARNING:Xst:1426 - The value init of the FF/Latch reg hinders
the constant cleaning in the block block. You could achieve
better results by setting this init to value.
Timing Report
At the end of synthesis, XST reports the timing information for the design. The report
shows the information for all four possible domains of a netlist: "register to register", "input
to register", "register to outpad" and "inpad to outpad".
See the TIMING REPORT section of the example given in the FPGA Log File section for
an example of the timing report sections in the XST log.
FPGA Log File
The following is an example of an XST log file for FPGA synthesis.
Release 9.1i - xst J.27
Copyright (c) 1995-2006 Xilinx, Inc. All rights reserved.
TABLE OF CONTENTS
1) Synthesis Options Summary
2) HDL Compilation
3) Design Hierarchy Analysis
4) HDL Analysis
5) HDL Synthesis
5.1) HDL Synthesis Report
6) Advanced HDL Synthesis
6.1) Advanced HDL Synthesis Report
7) Low Level Synthesis
8) Partition Report
9) Final Report
9.1) Device utilization summary
9.2) Partition Resource Summary
9.3) TIMING REPORT
XST User Guide www.xilinx.com 523
9.1i
FPGA Log File
R
=========================================================================
* Synthesis Options Summary *
=========================================================================
---- Source Parameters
Input File Name : "stopwatch.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "stopwatch"
Output Format : NGC
Target Device : xc4vlx15-12-sf363
---- Source Options
Top Module Name : stopwatch
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
FSM Style : lut
RAM Extraction : Yes
RAM Style : Auto
ROM Extraction : Yes
Mux Style : Auto
Decoder Extraction : YES
Priority Encoder Extraction : YES
Shift Register Extraction : YES
Logical Shifter Extraction : YES
XOR Collapsing : YES
ROM Style : Auto
Mux Extraction : YES
Resource Sharing : YES
Automatic Register Balancing : No
---- Target Options
Add IO Buffers : YES
Global Maximum Fanout : 500
Add Generic Clock Buffer(BUFG) : 32
Number of Regional Clock Buffers : 16
Register Duplication : YES
Slice Packing : YES
Pack IO Registers into IOBs : auto
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Keep Hierarchy : NO
RTL Output : Yes
Global Optimization : AllClockNets
Write Timing Constraints : NO
Hierarchy Separator : /
Bus Delimiter : <>
Case Specifier : maintain
Slice Utilization Ratio : 100
BRAM Utilization Ratio : 100
DSP48 Utilization Ratio : 100
Auto BRAM Packing : NO
Slice Utilization Ratio Delta : 5
---- Other Options
524 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
power : NO
lso : stopwatch.lso
Read Cores : YES
cross_clock_analysis : NO
verilog2001 : YES
safe_implementation : No
async_to_sync : NO
use_dsp48 : auto
Optimize Instantiated Primitives : NO
use_clock_enable : Auto
use_sync_set : Auto
use_sync_reset : Auto
=========================================================================
=========================================================================
* HDL Compilation *
=========================================================================
Compiling vhdl file "C:/temp/timer/smallcntr.vhd" in Library work.
Architecture inside of Entity smallcntr is up to date.
Compiling vhdl file "C:/temp/timer/statmach.vhd" in Library work.
Architecture inside of Entity statmach is up to date.
Compiling vhdl file "C:/temp/timer/decode.vhd" in Library work.
Architecture behavioral of Entity decode is up to date.
Compiling vhdl file "C:/temp/timer/cnt60.vhd" in Library work.
Architecture inside of Entity cnt60 is up to date.
Compiling vhdl file "C:/temp/timer/hex2led.vhd" in Library work.
Architecture hex2led_arch of Entity hex2led is up to date.
Compiling vhdl file "C:/temp/timer/stopwatch.vhd" in Library work.
Architecture inside of Entity stopwatch is up to date.
=========================================================================
* Design Hierarchy Analysis *
=========================================================================
Analyzing hierarchy for entity <stopwatch> in library <work> (architecture <inside>).
Analyzing hierarchy for entity <statmach> in library <work> (architecture <inside>).
Analyzing hierarchy for entity <decode> in library <work> (architecture <behavioral>).
Analyzing hierarchy for entity <cnt60> in library <work> (architecture <inside>).
Analyzing hierarchy for entity <hex2led> in library <work> (architecture <hex2led_arch>).
Analyzing hierarchy for entity <smallcntr> in library <work> (architecture <inside>).
=========================================================================
* HDL Analysis *
=========================================================================
Analyzing Entity <stopwatch> in library <work> (Architecture <inside>).
WARNING:Xst:2211 - "C:/temp/timer/stopwatch.vhd" line 68: Instantiating black box module
<tenths>.
Entity <stopwatch> analyzed. Unit <stopwatch> generated.
Analyzing Entity <statmach> in library <work> (Architecture <inside>).
Entity <statmach> analyzed. Unit <statmach> generated.
XST User Guide www.xilinx.com 525
9.1i
FPGA Log File
R
Analyzing Entity <decode> in library <work> (Architecture <behavioral>).
Entity <decode> analyzed. Unit <decode> generated.
Analyzing Entity <cnt60> in library <work> (Architecture <inside>).
Entity <cnt60> analyzed. Unit <cnt60> generated.
Analyzing Entity <smallcntr> in library <work> (Architecture <inside>).
Entity <smallcntr> analyzed. Unit <smallcntr> generated.
Analyzing Entity <hex2led> in library <work> (Architecture <hex2led_arch>).
Entity <hex2led> analyzed. Unit <hex2led> generated.
=========================================================================
* HDL Synthesis *
=========================================================================
Performing bidirectional port resolution...
Synthesizing Unit <statmach>.
Related source file is "C:/temp/timer/statmach.vhd".
Found finite state machine <FSM_0> for signal <current_state>.
-----------------------------------------------------------------------
| States | 6 |
| Transitions | 11 |
| Inputs | 1 |
| Outputs | 2 |
| Clock | CLK (rising_edge) |
| Reset | RESET (positive) |
| Reset type | asynchronous |
| Reset State | clear |
| Power Up State | clear |
| Encoding | automatic |
| Implementation | LUT |
-----------------------------------------------------------------------
Summary:
inferred 1 Finite State Machine(s).
Unit <statmach> synthesized.
Synthesizing Unit <decode>.
Related source file is "C:/temp/timer/decode.vhd".
Found 16x10-bit ROM for signal <one_hot>.
Summary:
inferred 1 ROM(s).
Unit <decode> synthesized.
Synthesizing Unit <hex2led>.
Related source file is "C:/temp/timer/hex2led.vhd".
Found 16x7-bit ROM for signal <LED>.
Summary:
inferred 1 ROM(s).
Unit <hex2led> synthesized.
Synthesizing Unit <smallcntr>.
Related source file is "C:/temp/timer/smallcntr.vhd".
Found 4-bit up counter for signal <qoutsig>.
526 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
Summary:
inferred 1 Counter(s).
Unit <smallcntr> synthesized.
Synthesizing Unit <cnt60>.
Related source file is "C:/temp/timer/cnt60.vhd".
Unit <cnt60> synthesized.
Synthesizing Unit <stopwatch>.
Related source file is "C:/temp/timer/stopwatch.vhd".
WARNING:Xst:646 - Signal <strtstopinv> is assigned but never used.
Unit <stopwatch> synthesized.
=========================================================================
HDL Synthesis Report
Macro Statistics
# ROMs : 3
16x10-bit ROM : 1
16x7-bit ROM : 2
# Counters : 2
4-bit up counter : 2
=========================================================================
=========================================================================
* Advanced HDL Synthesis *
=========================================================================
Analyzing FSM <FSM_0> for best encoding.
Optimizing FSM <MACHINE/current_state> on signal <current_state[1:3]> with gray encoding.
----------------------
State | Encoding
----------------------
clear | 000
zero | 001
start | 011
counting | 010
stop | 110
stopped | 111
----------------------
Loading device for application Rf_Device from file '4vlx15.nph' in environment
c:\cao\xilinx\j.27\rtf;c:\cao\xilinx\j.27\rtf.
=========================================================================
Advanced HDL Synthesis Report
Macro Statistics
# FSMs : 1
# ROMs : 3
16x10-bit ROM : 1
16x7-bit ROM : 2
# Counters : 2
4-bit up counter : 2
# Registers : 3
Flip-Flops : 3
XST User Guide www.xilinx.com 527
9.1i
FPGA Log File
R
=========================================================================
=========================================================================
* Low Level Synthesis *
=========================================================================
Optimizing unit <stopwatch> ...
Mapping all equations...
Building and optimizing final netlist ...
Found area constraint ratio of 100 (+ 5) on block stopwatch, actual ratio is 0.
LIT_DBG: TOTAL Evaluate = 0.070000
LIT_DBG: TOTAL Perform = 0.000000
Final Macro Processing ...
=========================================================================
Final Register Report
Macro Statistics
# Registers : 11
Flip-Flops : 11
=========================================================================
=========================================================================
* Partition Report *
=========================================================================
Partition Implementation Status
-------------------------------
No Partitions were found in this design.
-------------------------------
=========================================================================
* Final Report *
=========================================================================
Final Results
RTL Top Level Output File Name : stopwatch.ngr
Top Level Output File Name : stopwatch
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : NO
Cell Usage :
# BELS : 48
# LUT2 : 2
# LUT3 : 7
# LUT4 : 34
# LUT4_D : 2
# LUT4_L : 3
# FlipFlops/Latches : 11
# FDC : 11
# Clock Buffers : 1
# BUFGP : 1
# IO Buffers : 26
528 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
# IBUF : 2
# OBUF : 24
# Others : 1
# tenths : 1
=========================================================================
Device utilization summary:
---------------------------
Selected Device : 4vlx15sf363-12
Number of Slices: 26 out of 6144 0%
Number of Slice Flip Flops: 11 out of 12288 0%
Number of 4 input LUTs: 48 out of 12288 0%
Number of IOs: 27
Number of bonded IOBs: 27 out of 240 11%
Number of GCLKs: 1 out of 32 3%
---------------------------
Partition Resource Summary:
---------------------------
No Partitions were found in this design.
---------------------------
=========================================================================
TIMING REPORT
NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE.
FOR ACCURATE TIMING INFORMATION PLEASE REFER TO THE TRACE REPORT
GENERATED AFTER PLACE-and-ROUTE.
Clock Information:
------------------
-----------------------------------+------------------------+-------+
Clock Signal | Clock buffer(FF name) | Load |
-----------------------------------+------------------------+-------+
CLK | BUFGP | 11 |
-----------------------------------+------------------------+-------+
Asynchronous Control Signals Information:
----------------------------------------
-------------------------------------+-------------------------------+-------+
Control Signal | Buffer(FF name) | Load |
-------------------------------------+-------------------------------+-------+
sixty/msbclr(sixty/msbclr:O) | NONE(sixty/msbcount/qoutsig_2)| 4 |
rstint(MACHINE/current_state_Out01:O)| NONE(sixty/lsbcount/qoutsig_0)| 4 |
RESET | IBUF | 3 |
-------------------------------------+-------------------------------+-------+
Timing Summary:
---------------
Speed Grade: -12
Minimum period: 2.244ns (Maximum Frequency: 445.603MHz)
Minimum input arrival time before clock: 1.820ns
Maximum output required time after clock: 4.637ns
XST User Guide www.xilinx.com 529
9.1i
FPGA Log File
R
Maximum combinational path delay: 4.316ns
Timing Detail:
--------------
All values displayed in nanoseconds (ns)
=========================================================================
Timing constraint: Default period analysis for Clock 'CLK'
Clock period: 2.244ns (frequency: 445.603MHz)
Total number of paths / destination ports: 77 / 11
-------------------------------------------------------------------------
Delay: 2.244ns (Levels of Logic = 3)
Source: sixty/lsbcount/qoutsig_0 (FF)
Destination: sixty/msbcount/qoutsig_3 (FF)
Source Clock: CLK rising
Destination Clock: CLK rising
Data Path: sixty/lsbcount/qoutsig_0 to sixty/msbcount/qoutsig_3
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
FDC:C->Q 13 0.272 0.677 sixty/lsbcount/qoutsig_0
(sixty/lsbcount/qoutsig_0)
LUT3:I0->O 2 0.147 0.401 sixty/msbce_SW0_SW0 (N73)
LUT4_D:I3->O 1 0.147 0.436 sixty/msbce (sixty/msbce)
LUT3:I2->O 1 0.147 0.000 sixty/msbcount/qoutsig_3_rstpot (N78)
FDC:D 0.017 sixty/msbcount/qoutsig_3
----------------------------------------
Total 2.244ns (0.730ns logic, 1.514ns route)
(32.5% logic, 67.5% route)
=========================================================================
Timing constraint: Default OFFSET IN BEFORE for Clock 'CLK'
Total number of paths / destination ports: 11 / 11
-------------------------------------------------------------------------
Offset: 1.820ns (Levels of Logic = 3)
Source: XCOUNTER:Q_THRESH0 (PAD)
Destination: sixty/msbcount/qoutsig_3 (FF)
Destination Clock: CLK rising
Data Path: XCOUNTER:Q_THRESH0 to sixty/msbcount/qoutsig_3
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
tenths:Q_THRESH0 3 0.000 0.525 XCOUNTER (xtermcnt)
LUT3:I1->O 2 0.147 0.401 sixty/msbce_SW0_SW0 (N73)
LUT4_D:I3->O 1 0.147 0.436 sixty/msbce (sixty/msbce)
LUT3:I2->O 1 0.147 0.000 sixty/msbcount/qoutsig_3_rstpot (N78)
FDC:D 0.017 sixty/msbcount/qoutsig_3
----------------------------------------
Total 1.820ns (0.458ns logic, 1.362ns route)
(25.2% logic, 74.8% route)
=========================================================================
Timing constraint: Default OFFSET OUT AFTER for Clock 'CLK'
Total number of paths / destination ports: 61 / 16
-------------------------------------------------------------------------
Offset: 4.637ns (Levels of Logic = 2)
Source: sixty/lsbcount/qoutsig_1 (FF)
530 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
Destination: ONESOUT<6> (PAD)
Source Clock: CLK rising
Data Path: sixty/lsbcount/qoutsig_1 to ONESOUT<6>
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
FDC:C->Q 14 0.272 0.697 sixty/lsbcount/qoutsig_1
(sixty/lsbcount/qoutsig_1)
LUT4:I0->O 1 0.147 0.266 lsbled/Mrom_LED31 (lsbled/Mrom_LED2)
OBUF:I->O 3.255 ONESOUT_2_OBUF (ONESOUT<2>)
----------------------------------------
Total 4.637ns (3.674ns logic, 0.963ns route)
(79.2% logic, 20.8% route)
=========================================================================
Timing constraint: Default path analysis
Total number of paths / destination ports: 41 / 11
-------------------------------------------------------------------------
Delay: 4.316ns (Levels of Logic = 2)
Source: XCOUNTER:Q<1> (PAD)
Destination: TENTHSOUT<9> (PAD)
Data Path: XCOUNTER:Q<1> to TENTHSOUT<9>
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
tenths:Q<1> 10 0.000 0.648 XCOUNTER (Q<1>)
LUT4:I0->O 1 0.147 0.266 TENTHSOUT<9>1 (TENTHSOUT_9_OBUF)
OBUF:I->O 3.255 TENTHSOUT_9_OBUF (TENTHSOUT<9>)
----------------------------------------
Total 4.316ns (3.402ns logic, 0.914ns route)
(78.8% logic, 21.2% route)
=========================================================================
CPU : 20.75 / 21.01 s | Elapsed : 21.00 / 21.00 s
-->
Total memory usage is 225732 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings : 2 ( 0 filtered)
Number of infos : 0 ( 0 filtered)
CPLD Log File
The following is an example of an XST log file for CPLD synthesis.
Release 9.1i - xst J.27
Copyright (c) 1995-2006 Xilinx, Inc. All rights reserved.
TABLE OF CONTENTS
1) Synthesis Options Summary
2) HDL Compilation
3) Design Hierarchy Analysis
4) HDL Analysis
XST User Guide www.xilinx.com 531
9.1i
CPLD Log File
R
5) HDL Synthesis
5.1) HDL Synthesis Report
6) Advanced HDL Synthesis
6.1) Advanced HDL Synthesis Report
7) Low Level Synthesis
8) Final Report
=========================================================================
* Synthesis Options Summary *
=========================================================================
---- Source Parameters
Input File Name : "stopwatch.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
---- Target Parameters
Output File Name : "stopwatch"
Output Format : NGC
Target Device : XC9500XL CPLDs
---- Source Options
Top Module Name : stopwatch
Automatic FSM Extraction : YES
FSM Encoding Algorithm : Auto
Mux Extraction : YES
Resource Sharing : YES
---- Target Options
Add IO Buffers : YES
MACRO Preserve : YES
XOR Preserve : YES
Equivalent register Removal : YES
---- General Options
Optimization Goal : Speed
Optimization Effort : 1
Keep Hierarchy : YES
RTL Output : Yes
Hierarchy Separator : /
Bus Delimiter : <>
Case Specifier : maintain
---- Other Options
lso : stopwatch.lso
verilog2001 : YES
safe_implementation : No
Clock Enable : YES
wysiwyg : NO
=========================================================================
=========================================================================
* HDL Compilation *
=========================================================================
Compiling vhdl file "C:/temp/timer/smallcntr.vhd" in Library work.
Architecture inside of Entity smallcntr is up to date.
Compiling vhdl file "C:/temp/timer/statmach.vhd" in Library work.
Architecture inside of Entity statmach is up to date.
532 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
Compiling vhdl file "C:/temp/timer/decode.vhd" in Library work.
Architecture behavioral of Entity decode is up to date.
Compiling vhdl file "C:/temp/timer/cnt60.vhd" in Library work.
Architecture inside of Entity cnt60 is up to date.
Compiling vhdl file "C:/temp/timer/hex2led.vhd" in Library work.
Architecture hex2led_arch of Entity hex2led is up to date.
Compiling vhdl file "C:/temp/timer/stopwatch.vhd" in Library work.
Architecture inside of Entity stopwatch is up to date.
=========================================================================
* Design Hierarchy Analysis *
=========================================================================
Analyzing hierarchy for entity <stopwatch> in library <work> (architecture <inside>).
Analyzing hierarchy for entity <statmach> in library <work> (architecture <inside>).
Analyzing hierarchy for entity <decode> in library <work> (architecture <behavioral>).
Analyzing hierarchy for entity <cnt60> in library <work> (architecture <inside>).
Analyzing hierarchy for entity <hex2led> in library <work> (architecture <hex2led_arch>).
Analyzing hierarchy for entity <smallcntr> in library <work> (architecture <inside>).
=========================================================================
* HDL Analysis *
=========================================================================
Analyzing Entity <stopwatch> in library <work> (Architecture <inside>).
WARNING:Xst:2211 - "C:/temp/timer/stopwatch.vhd" line 68: Instantiating black box module
<tenths>.
Entity <stopwatch> analyzed. Unit <stopwatch> generated.
Analyzing Entity <statmach> in library <work> (Architecture <inside>).
Entity <statmach> analyzed. Unit <statmach> generated.
Analyzing Entity <decode> in library <work> (Architecture <behavioral>).
Entity <decode> analyzed. Unit <decode> generated.
Analyzing Entity <cnt60> in library <work> (Architecture <inside>).
Entity <cnt60> analyzed. Unit <cnt60> generated.
Analyzing Entity <smallcntr> in library <work> (Architecture <inside>).
Entity <smallcntr> analyzed. Unit <smallcntr> generated.
Analyzing Entity <hex2led> in library <work> (Architecture <hex2led_arch>).
Entity <hex2led> analyzed. Unit <hex2led> generated.
=========================================================================
* HDL Synthesis *
=========================================================================
Performing bidirectional port resolution...
Synthesizing Unit <statmach>.
Related source file is "C:/temp/timer/statmach.vhd".
Found finite state machine <FSM_0> for signal <current_state>.
-----------------------------------------------------------------------
XST User Guide www.xilinx.com 533
9.1i
CPLD Log File
R
| States | 6 |
| Transitions | 11 |
| Inputs | 1 |
| Outputs | 2 |
| Clock | CLK (rising_edge) |
| Reset | RESET (positive) |
| Reset type | asynchronous |
| Reset State | clear |
| Power Up State | clear |
| Encoding | automatic |
| Implementation | automatic |
-----------------------------------------------------------------------
Summary:
inferred 1 Finite State Machine(s).
Unit <statmach> synthesized.
Synthesizing Unit <decode>.
Related source file is "C:/temp/timer/decode.vhd".
Found 16x10-bit ROM for signal <one_hot>.
Summary:
inferred 1 ROM(s).
Unit <decode> synthesized.
Synthesizing Unit <hex2led>.
Related source file is "C:/temp/timer/hex2led.vhd".
Found 16x7-bit ROM for signal <LED>.
Summary:
inferred 1 ROM(s).
Unit <hex2led> synthesized.
Synthesizing Unit <smallcntr>.
Related source file is "C:/temp/timer/smallcntr.vhd".
Found 4-bit up counter for signal <qoutsig>.
Summary:
inferred 1 Counter(s).
Unit <smallcntr> synthesized.
Synthesizing Unit <cnt60>.
Related source file is "C:/temp/timer/cnt60.vhd".
Unit <cnt60> synthesized.
Synthesizing Unit <stopwatch>.
Related source file is "C:/temp/timer/stopwatch.vhd".
WARNING:Xst:646 - Signal <strtstopinv> is assigned but never used.
Unit <stopwatch> synthesized.
=========================================================================
HDL Synthesis Report
Macro Statistics
# ROMs : 3
16x10-bit ROM : 1
16x7-bit ROM : 2
534 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
# Counters : 2
4-bit up counter : 2
=========================================================================
=========================================================================
* Advanced HDL Synthesis *
=========================================================================
Analyzing FSM <FSM_0> for best encoding.
Optimizing FSM <FSM_0> on signal <current_state[1:3]> with sequential encoding.
----------------------
State | Encoding
----------------------
clear | 000
zero | 001
start | 010
counting | 011
stop | 100
stopped | 101
----------------------
=========================================================================
Advanced HDL Synthesis Report
Macro Statistics
# ROMs : 3
16x10-bit ROM : 1
16x7-bit ROM : 2
# Counters : 2
4-bit up counter : 2
=========================================================================
=========================================================================
* Low Level Synthesis *
=========================================================================
Optimizing unit <stopwatch> ...
Optimizing unit <statmach> ...
implementation constraint: INIT=r : current_state_FFd3
implementation constraint: INIT=r : current_state_FFd1
implementation constraint: INIT=r : current_state_FFd2
Optimizing unit <decode> ...
Optimizing unit <hex2led> ...
Optimizing unit <smallcntr> ...
Optimizing unit <cnt60> ...
=========================================================================
* Final Report *
=========================================================================
Final Results
RTL Top Level Output File Name : stopwatch.ngr
Top Level Output File Name : stopwatch
XST User Guide www.xilinx.com 535
9.1i
CPLD Log File
R
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : YES
Target Technology : XC9500XL CPLDs
Macro Preserve : YES
XOR Preserve : YES
Clock Enable : YES
wysiwyg : NO
Cell Usage :
# BELS : 392
# AND2 : 117
# AND3 : 8
# AND4 : 5
# INV : 166
# OR2 : 89
# XOR2 : 7
# FlipFlops/Latches : 11
# FDCE : 8
# FTC : 3
# IO Buffers : 27
# IBUF : 3
# OBUF : 24
# Others : 1
# tenths : 1
=========================================================================
CPU : 5.29 / 5.54 s | Elapsed : 5.00 / 5.00 s
-->
Total memory usage is 116616 kilobytes
Number of errors : 0 ( 0 filtered)
Number of warnings : 2 ( 0 filtered)
Number of infos : 0 ( 0 filtered)
536 www.xilinx.com XST User Guide
9.1i
Chapter 9: Log File Analysis
R
XST User Guide www.xilinx.com 537
9.1i
R
Chapter 10
Command Line Mode
This chapter describes how to run XST using the command line, including the XST run and
set commands and their options. This chapter contains the following sections:
Introduction
Setting Up an XST Script
Synthesizing Designs Using Command Line Mode
Introduction
You can run synthesis with XST in command line mode instead of from the Process
window in Project Navigator. To run synthesis from the command line, you must use the
XST executable file. If you work on a workstation, the name of the executable is xst. On a
PC, the name of the executable is xst.exe.
File Types
XST generates the following types of files:
Design output file, NGC (.ngc)
This file is generated in the current output directory (see the ofn option). If run in
incremental synthesis mode, XST generates multiple NGC files.
RTL netlist for RTL and Technology Viewers (.ngr)
Synthesis LOG file (.srp)
Temporary files
Temporary files are generated in the XST temp directory. By default the XST temp
directory is /tmp on workstations and the directory specified by either the TEMP or
TMP environment variables under Windows. The XST temp directory can be changed
by using the set tmpdir <directory> directive.
538 www.xilinx.com XST User Guide
9.1i
Chapter 10: Command Line Mode
R
VHDL or Verilog compilation files
VHDL or Verilog compilation files are generated in the temp directory. The default
temp directory is the xst subdirectory of the current directory.
Xilinx strongly suggests that you clean the XST temp directory regularly. This directory
contains the files resulting from the compilation of all VHDL and Verilog files during all XST
sessions. Eventually, the number of files stored in the temp directory may severely impact
CPU performances. This directory is not automatically cleaned by XST.
Names with Spaces
XST supports file and directory names with spaces. If a file or directory name contains
spaces, you must enclose this name in double quotes ("") as in the following example.
"C:\my project"
Due to this change, the command line syntax for switches supporting multiple directories
(sd,vlgincdir) has changed. If multiple directories are specified for these switches,
you must enclose them in braces ({}) as in the following example.
-vlgincdir {"C:\my project" C:\temp}
In previous releases multiple directories were included in double quotes (" "). This
previous convention is still supported by XST if directory names do not contain spaces.
Xilinx
strongly recommends that you change existing scripts to the new syntax.
Launching XST
You can run XST in two ways.
XST Shell
Type xst to enter directly into an XST shell. Enter your commands and execute them.
To run synthesis, specify a complete command with all required options before
running. XST does not accept a mode where you can first enter set option_1, then set
option_2, and then enter run.
All of the options must be set up at once. Therefore, this method is very cumbersome
and Xilinx suggests that you use the script file method.
Script File
Store your commands in a separate script file and run all of them at once. To execute
your script file, run the following workstation or PC command:
xst ifn in_file_name ofn out_file_name intstyle {silent|ise|xflow}
The ofn option is not mandatory. If you omit it, XST automatically generates a log file
with the file extension .srp, and all messages display on the screen. Use the intstyle
silent option and the XIL_XST_HIDEMESSAGES environment variable to limit the
number of messages printed to the screen. See the Reducing the Size of the LOG File in
Chapter 9 for more information.
For example, assume that the text below is contained in a file foo.scr.
run
ifn tt1.prj
top tt1
ifmt MIXED
opt_mode SPEED
XST User Guide www.xilinx.com 539
9.1i
Setting Up an XST Script
R
opt_level 1
ofn tt1.ngc
p <parttype>
This script file can be executed under XST using the following command:
xst ifn foo.scr
You can also generate a log file with the following command:
xst ifn foo.scr ofn foo.log
A script file can be run either using xst ifn script name, or executed under the XST prompt,
by using the script script_name command.
script foo.scr
If you make a mistake in an XST command, command option or its value, XST issues an
error message and stops execution. For example, if in the previous script example VHDL is
incorrectly spelled (VHDLL), XST gives the following error message:
-> ERROR:Xst:1361 - Syntax error in command run for option "-ifmt" :
parameter "VHDLL" is not allowed.
If you created your project using ISE, and have run XST at least once from ISE, you can
switch to XST command line mode and use script and project files which were created by
ISE. In order to run XST from the command line, run the following command from project
directory
xst ifn <top_level_block>.xst ofn <top_level_block>.syr
Setting Up an XST Script
An XST script is a set of commands, each command having various options. XST
recognizes the following commands: Run Command, Set Command, and Elaborate
Command.
Run Command
The Run command is the main synthesis command. It allows you to run the entire
synthesis process, beginning with the parsing of the HDL files, and ending with the
generation of the final netlist. The run keyword must be used only once per script file.
The Run command begins with a keyword run, which is followed by a set of options
and its values.
run option_1 value option_2 value ...
In order to improve the readability of your script file, you can place each option-value
pair on a separate line, as shown in the following example.
run
option_1 value
option_2 value