Академический Документы
Профессиональный Документы
Культура Документы
Release v2018.2
This document contains information that is proprietary to Mentor Graphics Corporation. The original recipient of this
document may duplicate this document in whole or in part for internal business purposes only, provided that this entire
notice appears in all copies. In duplicating any part of this document, the recipient agrees to make every reasonable
effort to prevent the unauthorized use and distribution of the proprietary information.
Note - Viewing PDF files within a web browser causes some links not to function (see MG595892).
Use HTML for full navigation.
This document is for information and instruction purposes. Mentor Graphics reserves the right to make
changes in specifications and other information contained in this publication without prior notice, and the
reader should, in all cases, consult Mentor Graphics to determine whether any changes have been
made.
The terms and conditions governing the sale and licensing of Mentor Graphics products are set forth in
written agreements between Mentor Graphics and its customers. No representation or other affirmation
of fact contained in this publication shall be deemed to be a warranty or give rise to any liability of Mentor
Graphics whatsoever.
MENTOR GRAPHICS MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE.
MENTOR GRAPHICS SHALL NOT BE LIABLE FOR ANY INCIDENTAL, INDIRECT, SPECIAL, OR
CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS)
ARISING OUT OF OR RELATED TO THIS PUBLICATION OR THE INFORMATION CONTAINED IN IT,
EVEN IF MENTOR GRAPHICS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
U.S. GOVERNMENT LICENSE RIGHTS: The software and documentation were developed entirely at
private expense and are commercial computer software and commercial computer software
documentation within the meaning of the applicable acquisition regulations. Accordingly, pursuant to
FAR 48 CFR 12.212 and DFARS 48 CFR 227.7202, use, duplication and disclosure by or for the U.S.
Government or a U.S. Government subcontractor is subject solely to the terms and conditions set forth in
the license agreement provided with the software, except for provisions which are contrary to applicable
mandatory federal laws.
TRADEMARKS: The trademarks, logos and service marks ("Marks") used herein are the property of
Mentor Graphics Corporation or other parties. No one is permitted to use these Marks without the prior
written consent of Mentor Graphics or the owner of the Mark, as applicable. The use herein of a third-
party Mark is not an attempt to indicate Mentor Graphics as a source of a product, but is intended to
indicate a product from, or associated with, a particular third party. A current list of Mentor Graphics’
trademarks may be viewed at: mentor.com/trademarks.
The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of
Linus Torvalds, owner of the mark on a world-wide basis.
End-User License Agreement: You can print a copy of the End-User License Agreement from:
mentor.com/eula.
Chapter 1
DesignChecker Base Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
DesignChecker Base Rule Configuration Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 2
Base Rules References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Parameters Common to all Base Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Allow Base Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Allowed Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Allowed Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Allowed Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Allowed Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Allowed Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Allowed Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Allowed Implied Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Allowed Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Allowed Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Allowed Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Allowed Pragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Allowed System Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Allowed Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Assignment Base Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Continuous Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Duplicate Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Initialization Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Input Port Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Mixed Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Multiple Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Multiple Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Unassigned Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Vector Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Case Base Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Case Statement Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Case Statement Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Clock and Reset Base Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Asynchronous Reset Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Clock Declaration Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Consistent Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Consistent Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Controllable Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Edge Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Gated Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Appendix A
Simple Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Appendix B
Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Appendix C
System and Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
End-User License Agreement
The DesignChecker static checking and analysis tool ensures interoperability and consistency
across design styles and coding practices for developers and development teams creating
complex designs. DesignChecker is a powerful solution for individual engineers and can be
useful in situations where a number of individuals or teams are involved in the design and
development processes.
DesignChecker includes a set of parameterized base rules, which you use as the building blocks
to create the checks you need to run. Base rules are available in a configurable and extensible
form that allows you to tailor base rules to your precise requirements in a simple and intuitive
manner. The tool contains a large number of read-only base rules, which you can use to create
writable copies and configure parameters according to your coding standards. Base rules
support VHDL, Verilog, SystemVerilog, or mixed VHDL and Verilog language designs.
The Base Rules Reference Guide provides full details of the parameters and configuration
options for all DesignChecker’s base rules. You can access the full description of a specific base
rule by right-clicking on the base rule in DesignChecker and choosing Base Rule Details.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
DesignChecker Base Rules
DesignChecker Base Rule Configuration Overview
Related Topics
DesignChecker User Guide
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Chapter 2
Base Rules References
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Parameters Common to all Base Rules
Parameters:
• Name
Specify an arbitrary, user-entered string to act as a name for the configured rule. The
name must be unique within the RuleSet. The default is <Base Rule Name>.
• Severity
Specify the severity rating for a configured rule. Available ratings are defined using the
Rule Severity and Design Quality Settings dialog box and are applied to the RuleSet.
The default is Error (Except the Report base rules in which the default is Note.).
o Error
o Warning
o Note
• Score/ Weight
Shows the default score and weight corresponding to the Severity (as defined in the Rule
Severity and Design Quality Settings dialog box)
On configuring a rule, you can override the default values if needed. The Score and
Weight parameters are only available if the option to perform design quality analysis is
set (as they are used to calculate the quality percentage of the design).
Since the default Severity for base rules is “Error”, then the default Score is 5 and the
default Weight is 2. (Except the Report base rules in which the default Severity is
“Note”, and hence the default Score is 1 and the default Weight is 1.)
• Language
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Parameters Common to all Base Rules
Specify to which language the rule applies. The default is VHDL Any and/or Verilog
Any depending on appropriate language/s.
• Hint (optional)
Specify additional information on the possible causes of violations of the rule.
• Short Description (optional)
Specify an arbitrary string which describes the configured rule.
• Keywords (optional)
Specify any number of keywords to associate with the configured rule. Keywords and
their synonyms can be used to identify rules when using the search functionality. When
specifying keywords for a configured rule, it is recommended that they are chosen from
a consistent set of keywords used throughout a given RuleSet. A new configured rule
will automatically initialize with the keywords from the corresponding Base Rule. These
can then be edited as required.
Related Topics
Design Correctness and Synthesizability [DesignChecker User Guide]
Register and Control Signal Inference [DesignChecker User Guide]
Finite State Machines (FSMs) [DesignChecker User Guide]
Miscellaneous [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allow Base Rules
Allowed Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Allowed Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Allowed Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Allowed Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Allowed Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Allowed Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Allowed Implied Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Allowed Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Allowed Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Allowed Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Allowed Pragmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Allowed System Calls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Allowed Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Arrays
Allowed Arrays
Language support: All (including SystemVerilog)
Checks that only specified types and maximum dimension count arrays are used. You can
specify any of the types and array styles. You can also define the maximum allowed dimension
count for the arrays. Any array declaration that has more than the allowed number of
dimensions is flagged as an error. You can also specify the types that are internally coded as
vectors, so that an extra dimension is added when using these types.
Usage
Allowed Arrays
Common Parameters
Applies To
Array Types
Maximum Allowed Dimension
Types Internally Coded As Vectors
Other Qualifiers
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
A required parameter for specifying the types to which the check applies. The default is
Verilog/System-Verilog Variables.
o Ports
o Nets
o Verilog/System-Verilog Variables
o VHDL Variables
o Signals
• Array Types
A required parameter for specifying the types of array styles to check. The default is
Associative Arrays.
o Fixed Size Arrays
o Dynamic Arrays
o Associative Arrays
o Queues
o Bound Queues
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Arrays
Rule Configuration
• Applies To — Ports
• Array Types — Fixed Size Arrays, Dynamic Arrays, Associative Arrays, Queues,
Bound Queues
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Arrays
Analyzed Code
module allowed_arrays_1 (data_in, data_out);
input reg [3:0][3:0] data_in; // Violation
output reg [15:0] data_out;
reg clk;
always@(posedge clk)
for (int i = 0; i< 4; i++)
for (int j = 0; j < 4; j++)
data_out[i*4 + j] = data_in[i][j];
endmodule
Violation Produced
ERROR, "data_in" is 2-dimensional which exceeds maximum allowed "1" dimension(s) for
"fixed size arrays"
Example 2
Check that Verilog/SystemVerilog variables are always of scalar type (no dimension allowed).
Rule Configuration
• Applies To — Verilog/SystemVerilog Variables
• Array Types — Fixed Size Arrays, Dynamic Arrays, Associative Arrays, Queues,
Bound Queues
Violations Produced
• ERROR, "assocArr" is of disallowed "associative arrays" type – Violation 1
• ERROR, "dynArr" is of disallowed "dynamic arrays" type – Violation 2
• ERROR, "Q" is of disallowed "queues" type – Violation 3
• ERROR, "BQ" is of disallowed "bound queues" type – Violation 4
Related Topics
Allowed Types
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Attributes
Allowed Attributes
Language support: All
Checks for the use of specific kinds of VHDL Attributes. This includes Function, Range,
SignalType attributes (e.g. base), Common Attributes (e.g. Left, Right) and Range Attributes
(e.g. reverse_range). You can check for either allowed kinds of Attributes (those that may be
used) or disallowed kinds of Attributes (those that must not be used).
Note
Important notes:
• Usage of Attributes other than those in an Allowed set will cause a violation.
• Usage of any Attributes in a Disallowed set will cause a violation.
Usage
Allowed Attributes
Common Parameters
Action
Attribute Name
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Action
Specify whether the kind of Attribute is required or disallowed. The default is Disallow.
o Allow
o Disallow
• Attribute Name
Specify which attributes or groups of attributes to check for. You can choose from the
supplied options and/or enter your own values. The default is All Attributes.
o All Attributes
o Function Attributes:
[active, driving, driving_value, event, high, image, last_active, last_event,
last_value, left, leftof, low, pos, pred, right, rightof, succ, val, value]
o Range Attributes:
[range, reverse_range]
o Signal Attributes:
[delayed, stable, quiet, transaction]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Attributes
o Type Attributes:
[base]
o Value Attributes:
[ascending, high, instance_name, left, length, low, path_name, right, simple_name ]
o ACTIVE
o ASCENDING
o BASE
o DELAYED
o DRIVING
o DRIVING_VALUE
o EVENT
o HIGH
o IMAGE
o INSTANCE_NAME
o LAST_ACTIVE
o LAST_EVENT
o LAST_VALUE
o LEFT
o LEFTOF
o LENGTH
o LOW
o PATH_NAME
o POS
o PRED
o QUIET
o RANGE
o REVERSE_RANGE
o RIGHT
o RIGHTOF
o SIMPLE_NAME
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Attributes
o STABLE
o SUCC
o TRANSACTION
o VAL
o VALUE
o <user-defined>
Examples
Example 1
Analyzed Code
ser_out_muxcombo_proc: PROCESS(status, zeros, ser_if_select)
BEGIN
CASE ser_if_select IS
WHEN "10" => ser_if_data(3) <= status’left; -- Avoid using
disallowed attribute ‘left’
WHEN OTHERS => ser_if_data<= zero;
END CASE;
END PROCESS ser_out_muxcombo_proc;
Violation Produced
ALLOWED_ATTRIBUTES 402
Avoid using disallowed attribute "'LEFT"
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Characters
Allowed Characters
Language support: All (including SystemVerilog)
Checks for the use of special characters which includes control characters and foreign
characters.
Usage
Allowed Characters
Common Parameters
Allowed Characters
Check Comments
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Allowed Characters
Specify which characters are allowed. The default is ASCII characters (32-126), CR, HT
and LF.
ASCII Characters (32-126)
Named ASCII Characters
o Controls for Code Extensions:
Escape (ESC)Shift In (SI), Shift Out (SO)
o Format Effectors:
Backspace (BS), Carriage Return (CR), Form Feed (FF), Horizontal Tab (HT), Line
Feed (LF), Vertical Tab (VT)
o Information Separators:
File Separator (FS), Group Separator (GS), Record Separator (RS), Unit Separator
(US)
o Logical Communication Controls:
Acknowledge (ACK), Data Link Escape (DLE), End of Text (ETX), End of
Transmission (EOT), End of Transmission Block (ETB), Enquiry (ENQ), Negative
Acknowledge (NAK), Start of Header (SOH), Start of Text (STX), Synchronous
Idle (SYN),
o Physical Communication Controls:
Cancel (CAN), Delete (DEL), End of Medium (EM), Null (NUL), Substitute (SUB)
o Physical Device Controls:
Bell (BEL), DC1, DC2, DC3, DC4
o <Custom Parameter>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Characters
Note
Custom Parameter text box can accept a single ASCII numeric value or character
only. For example:
• A: (Single Character)
• (: (Single Character)
• 65: (Numeric value representing Character ‘A’)
• 40: (Numeric value representing Character ‘(‘ )
• Check Comments
Specify whether characters inside comments also need to be checked. It takes the values Yes
or No. The default is Yes.
Examples
Example 1
Checks that only Line feed, Carriage Return and ASCII characters are allowed.
Rule Configuration
• Language — Verilog Any
Violation Produced
Do not use disallowed character HT (decimal 9)
Related Topics
Allowed Types
Allowed Operators
Case Statement Directives
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Constructs
Allowed Constructs
Language support: All (including SystemVerilog)
Checks for the use of specific language constructs.
Usage
Allowed Constructs
Common Parameters
Disallowed Constructs
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Disallowed Constructs
Specify which constructs are not allowed. The default is <all non-synthesizable constructs>
and <all non-portable constructs>.
Values Applicable to VHDL Only:
o <all non synthesizable constructs>:
ALIAS, BUFFER, Enumeration Type as Array Index, FILE, Global Signals,
Incomplete Types, INERTIAL Delay, Infinite Loops, POSTPONED, PURE
FUNCTION, TRANSPORT Delay, WAIT, WAIT with Timeout
o <all non portable constructs>:
BLOCK, BUS Signals, DISCONNECT, GENERATE, GENERIC, GUARDED
Ports, IMPURE FUNCTION, LINKAGE Ports, Non-text Files, REGISTER Signals,
SHARED VARIABLE
o <Verilog reserved words in VHDL designs>
o <obsolete VHDL 87 constructs>
o ACCESS Types
o ASSERT Statements
o Loop EXIT
o Loop NEXT
o RECORD Types
o Resolution Functions
o <VARIABLE>
Process, Subprogram
o VHDL Replacement Characters
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Constructs
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Constructs
o DPI import
o DPI-C task export
o Wildcard index
o Randc
o Wait_order
o Semaphore extension
o mailbox
o string replication
Common Values Applicable to VHDL & Verilog:
o <all non synthesizable constructs>:
Delayed Assignments, Functions Returning Type Real, Multiple Wait Statements on
Same Clock, Real Types, while Loops, Zero Delayed Assignments
o INOUT Ports
o Four State Logic
o Wait Statements inside For Loops
Note
Examples
Example 1
Check for generics, delays and variables.
Rule Configuration
• Disallowed Constructs — <all non synthesizable constructs>: Delayed Assignments,
VARIABLE
<all non portable constructs>: GENERIC
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Constructs
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY top5 IS
GENERIC (bus_width : integer := 3; flag : bit := '0'); -- Violation 1
PORT (clk_master : IN std_logic;
rst_master : IN std_logic;
in_sig : IN std_logic;
out_sig : OUT std_logic);
END top5;
Violations Produced
• Avoid using VHDL non-portable construct GENERIC – Violation 1
• Net or assignment delay has been used. – Violation 2
• Variable Declaration "var": preferably avoid using variables for synthesis purposes –
Violation 3
• Net or assignment delay has been used. – Violation 4
Example 2
Check for delayed assignments, gate delays or gate strengths, net strengths, built-in primitives
and VHDL reserved words in Verilog designs.
Rule Configuration
• Disallowed Constructs — <all non synthesizable constructs>: Delayed Assignments,
Gate Delays / Gate Strengths, Net Strengths
<all non portable constructs>: Built-in Primitives
<VHDL reserved words in Verilog designs>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Constructs
Analyzed Code
module allowed (input enable, a, b, in, output out3, f, output reg out1,
out2); // Violation 1
wire (strong1, pull0) mynet1 = enable ; // Violation 2
assign out3 = mynet1;
or #5 g3 (f, a, b); // Violation 3, 4
always @(in)
begin
#25 out1 = ~in; // Violation 5
out2 = ~in;
end
endmodule
Violations Produced
• Do not use VHDL 87 reserved word""in" in Verilog designs – Violation 1
• Do not use built-in primitive or gate "or". Primitives and gates might not be portable
between different technologies. – Violation 2
• Strength has been used with net, instance or assignment. – Violation 3
• Net or assignment delay has been used. – Violation 4
• Gate delay or strength has been used. – Violation 5
Example 3
Check for Non-Enum/Non-Int Static Cast and Cast to Strings.
Rule Configuration
• Disallowed Constructs — Non-Enum/Non-Int Static Cast, Cast to Strings
Analyzed Code
module castTest;
int i = int’(2.0*3.0); // Violation 1
string str = string’(“sample”); // Violation 2 & 3
endmodule
Violations Produced
• Disallowed Static casts on Non Int or Non Enum Types. – Violation 1
• Disallowed Static cast to Strings. – Violation 2
• Disallowed Static casts on Non Int or Non Enum Types. – Violation 3
Related Topics
Allowed Types
Allowed Operators
Case Statement Directives
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Declarations
Allowed Declarations
Language support: Verilog Any (including SystemVerilog)
Checks the use of a specified declaration types is used in the allowed scopes. It also checks for
the use of any data in global namespace and usage of chandle only for the storage of C pointers
passed via DPI. The base rule is applicable only for Verilog. Usage of Declaration types in any
scope other than in the Allowed scope will cause a violation. Usage of chandle with value other
than non-chandle or non-null value will cause a violation. Also any declaration of data in global
namespace will cause a violation.
Usage
Allowed Declarations
Common Parameters
Declarations Types
Allowed Scopes
Additional Checks
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Declarations Types
Specify to which type the check applies. The default is typedef struct.
o wire
o typedef struct
o <don’t care>
• Allowed Scopes
Specify in which scope the type is allowed. The default is class.
o interface
o class
o <don’t care>
• Additional Checks
Specify which additional check/s with the above rule. The default is <don’t care>.
o Use chandle only to store C pointers passed via DPI
o No declarations allowed in global namespace
o <don’t care>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Declarations
Note
Declaration type wire is disallowed in class scope.
Examples
Example 1
Checks for the use of wire declarations in interface scope.
Rule Configuration
• Declaration Types — wire
Violation Produced
“wire” declarations are allowed only in “interface” scope.
Example 2
Checks for the use of typedef struct declarations in class scope.
Rule Configuration
• Declaration Types — typedef struct
Violation Produced
“typedef struct” declarations are allowed only in “class” scope
Example 3
Checks for the use of declarations in global namespace.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Declarations
Rule Configuration
• Declaration Types — <don’t care>
Violations Produced
• “myGlobVal” declared in global scope is disallowed
• “myWire” declared in global scope is disallowed
Related Topics
Allowed Types
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Expressions
Allowed Expressions
Language support: All
Checks for the use of disallowed values within various expression types. Also, checks for the
use of specific values within expressions such as assignments, IF conditions, LOOP conditions
etc. The rule can also check that the right-hand-side operand of all shift operators are static
values.
Usage
Allowed Expressions
Common Parameters
Expression Type
Disallowed Expression Values
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Expression Type
Specify which expression types to check. The default is All.
o Assignment Operand
o Case Alternative Choice
o Case Statement Expression
o Conditional Assignment Condition, [WHEN …]
o For Loop Expression
o If Condition
o Shift Operator Right Operand, [Applies only to Non-static Expression]
o Ternary Operator Condition, [op = enable ? data : 8`bz]
o While Loop Condition
• Disallowed Expression Values
Specify which signal value/s are not allowed. The default is X.
o U
o W
o X
o Z
o 0
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Expressions
o 1
o Non-integer Expression
o Non-static Expression, [Applies only to Shift Operator Right Operand]
o Static Expression
o <user-defined>
Note
The value “Shift Operator Right Operand” must only be used with the disallowed
expression value “Non-static Expression”. This combination checks that the right-hand-side
operand of all shift operators are static values.
This base rule checks for valid combination of Disallowed Expression Value and Expression
Type. For example, "Non-integer values" can only be selected with "For Loop Expression".
Examples
Example 1
Illegal value
ser_out_muxcombo_proc: PROCESS(status, zeros, ser_if_select)
BEGIN
CASE ser_if_select IS
WHEN "10" => ser_if_data <= status;
WHEN "11" => ser_if_data <= zeros;
WHEN OTHERS => ser_if_data <= (OTHERS => 'X');
-- Avoid using illegal value “X” in assignments or initializations
END CASE;
END PROCESS ser_out_muxcombo_proc;
Violation Produced
Avoid using illegal value "X" in assignments or initializations
Example 2
Non-static shift operators - VHDL
OUTPUT_2 <= "11001001" sra INPUT; -- RHS operands of shift operators
should be static
Violation Produced
RHS operands of shift operators should be static
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Implied Logic
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Implied Logic
be read and hence buffers/inverters are preserved in this case. Hence these are valid
constructs to model delay chains.
Input Double-Data-Rate Flip-Flops:
These flops are characterized by the following:
a. Same D-input.
b. Same output.
c. Opposing edge of the same clock.
d. D-input is a port.
Internal Tristates:
Internal tristates are tristates whose outputs do not reach the primary outputs. This is a
design-wide check.
Tristates Driving Primary Outputs:
These are tristates whose output reaches a top output port. This output port can be an
explicit output-port or a bidirectional port acting as an output. This is a design-wide check.
Examples
Example 1
Counters with width less than 4-bits are disallowed.
Rule Configuration
• Language — Any
Violation Produced
Counter 'cnt[1 : 0]' of width '2' violates the lower limit of 4 bits for counters
Example 2
Delay chains are disallowed.
Rule Configuration
• Language — Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Implied Logic
Violations Produced
• Delay chain detected from 'out1' to 'in1' – Violation 1
• Assignment to 'temp4' causes a delay chain – Associated Violation 2
• Assignment to 'temp3' causes a delay chain – Associated Violation 3
• Assignment to 'temp2' causes a delay chain – Associated Violation 4
• Assignment to 'temp1' causes a delay chain – Associated Violation 5
Example 3
Double-data-rate flip-flops are disallowed.
Rule Configuration
• Language — Any
Violations Produced
• Register 'out1[2 : 3]' which is being driven at the positive edge of the clock 'clk' is also
driven at its negative edge – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Implied Logic
• Double-data-rate register 'out1[2 : 3]' is being registered at the negative edge of the
clock 'clk' – Associated Violation 2
• Register 'out1[4]' which is being driven at the positive edge of the clock 'clk' is also
driven at its negative edge –Violation 3
• Double-data-rate register 'out1[4]' is being registered at the negative edge of the clock
'clk' – Associated Violation 4
Example 4
Internal tristates and tristates driving primary outputs are disallowed.
Rule Configuration
• Language — Any
module mid1 (
input c,
output reg d);
assign d = c ? c : 1'bz; // violation 1
endmodule;
Violations Produced
• Detected tri-state driver 'top.inst1.d' driving primary output port 'b': avoid using tri-state
drivers in designs – Violation 1
• Tri-state path passes through port 'd' in instance 'top.inst1' – Associated Violation 2
• Tri-state path passes through port 'g' in instance 'top.inst2' – Associated Violation 3
• Tri-state path passes through port 'e' in instance 'top.inst2.inst3' – Associated Violation 4
• Tri-state path passes through port 'f' in instance 'top.inst2.inst3' – Associated Violation 5
• Tri-state path passes through port 'h' in instance 'top.inst2' – Associated Violation 6
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Implied Logic
• Internal tri-state driver 'p1' detected : avoid using tri-state drivers in designs –Violation 7
Related Topics
Arithmetic Gate Report
Feedthrough
Memory Element Report
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Libraries
Allowed Libraries
Language support: VHDL Any
Checks for the use of specified VHDL Libraries. It can check for either allowed Libraries (those
that may be used) or disallowed Libraries (those that must not be used).
Checking specifically is done for references of libraries Library clauses, Library use clauses,
Entity Instances, Config Instances and Entity Aspects.
Note
References to Libraries other than those in an Allowed set will cause a violation.
Usage
Allowed Libraries
Common Parameters
Action
Libraries
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Action
Specify whether the specified Libraries are allowed or disallowed. The default is Disallow.
o Allow
o Disallow
• Libraries
Specify which VHDL Library names to check for. You can choose from the supplied
options and/or enter your own values. The default is <none>.
o IEEE
o <user-defined>
Note
A validation error is issued if Action field is set to “Disallow” and “std” is specified
in Libraries.
Examples
Example 1
Disallow libraries “ieee” and “lib1”.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Libraries
Rule Configuration
• Action — Disallow
entity fulladder is
port (a : in std_logic;
b : in std_logic;
cin : in std_logic;
sum : out std_logic;
carry : out std_logic );
end fulladder;
end;
Violations Produced
• Found disallowed library ‘ieee’. – Primary Violation 1
• Found disallowed library ‘ieee’. – Associated Violation 2
• Found disallowed library ‘ieee’. – Associated Violation 3
• Found disallowed library ‘lib1’. – Primary Violation 4
• Found disallowed library ‘lib1’. – Associated Violation 5
• Found disallowed library ‘lib1’. – Associated Violation 6
Example 2
Allow “ieee” library.
Rule Configuration
• Action — Allow
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Libraries
• Libraries — ieee
Analyzed Code
library drs; -- Primary violation 1
configuration addr4c_config of add4c is
for circuits
for a0 : fadd
use entity drs.fulladder(behavior); --Associated violation 2
end for;
for a1 : fadd
use entity drs.fulladder(behavior); -- Associated violtion 3
end for;
end addr4c_config
Violations Produced
• Found disallowed library ‘drs’. – Primary Violation 1
• Found disallowed library ‘drs’. – Associated Violation 2
• Found disallowed library ‘drs’. – Associated Violation 3
Related Topics
Allowed Types
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Methods
Allowed Methods
Language support: Verilog Any (including SystemVerilog)
Checks that disallowed methods are not used.This rule checks that the methods specified by the
user for the selected types like strings, arrays etc. are not used.
Usage
Allowed Methods
Common Parameters
Applies To
DisAllowed Methods
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify the type on which the disallowed methods are applicable. The default is Strings.
o Strings
o Fixed Size Arrays
o Dynamic Arrays
o Associative Arrays
o Queues
• DisAllowed Methods
Specify the methods which are disallowed. The default is <custom method>.
o <custom method>
o <user-defined>
Examples
Example 1
Checks that disallowed methods “exists” and “num” are not used on associative arrays.
Rule Configuration
• Applies To — Associative Arrays
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Methods
Analyzed Code
program assoc_t;
int map[string];
string s;
initial begin
$display("The number of entries in the array map is %0d",map.num()); //
violation 1
if(map.exists("hello")) // violation 2
map["hello"] += 1;
else
map["hello"] = 0;
end
endprogram
Violations Produced
• Method “num” for “associative arrays” is disallowed – Violation 1
• Method “exists” for “associative arrays” is disallowed – Violation 2
Related Topics
Allowed Types
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Operators
Allowed Operators
Language support: All (including SystemVerilog)
Checks for the use of specific operators. This rule checks if the disallowed operators are used
within the scopes which are specified to be checked. Note that DesignChecker does not check
operators that are implicitly used.
Usage
Allowed Operators
Common Parameters
Scope
Disallowed Operators
Ignore
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Scope
Specify the scope of the disallowed operators. The default is <Design Units>, <Blocks> and
<Sub-Programs>.
o <Design Units>
Architecture, Class, Configuration, Entity, Interface, Module, Package body,
Package header, Program, SV Packages
o <Sub-Programs>
Function, Procedure, Task
o <Blocks>
Always block, Block, Final Block, Generate, Initial Block, Process
o Conditional Statement
o File
• Disallowed Operators
Specify which operators are not allowed. The default is Case Equality (===), Case
Inequality (!==), Multiplication (*), Wild Equality(==?) and Wild Inequality(!=?).
o Arithmetic
Arithmetic: (%), Arithmetic: (&), Arithmetic: (*), Arithmetic: (**), Arithmetic: (+
binary), Arithmetic: (+ unary), Arithmetic: (++ post), Arithmetic: (++ pre),
Arithmetic: (- binary), Arithmetic: (- unary), Arithmetic: (-- post), Arithmetic: (--
pre), Arithmetic: (/), Arithmetic: (abs), Arithmetic: (mod), Arithmetic: (rem)
o Bitwise
Bitwise: (& binary), Bitwise: (& unary), Bitwise: (^ binary), Bitwise: (^ unary),
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Operators
Bitwise: (^~ binary), Bitwise: (^~ unary), Bitwise: (| binary), Bitwise: (| unary),
Bitwise: (~), Bitwise: (~&), Bitwise: (~^), Bitwise: (~|)
o Case Equality(===)
o Case Inequality(!==)
o Condition
Condition: (??)
o Logical
Logical: (!), Logical: (&&), Logical: (and), Logical: (nand), Logical: (nor), Logical:
(not), Logical: (or), Logical: (xnor), Logical: (xor), Logical: (||)
o Multiplication ( * )
o Procedural Blocking Assignment
Procedural Blocking Assignment: (%=), Procedural Blocking Assignment: (&=),
Procedural Blocking Assignment: (*=), Procedural Blocking Assignment: (+=),
Procedural Blocking Assignment: (-=), Procedural Blocking Assignment: (/=),
Procedural Blocking Assignment: (<<<=), Procedural Blocking Assignment: (<<=),
Procedural Blocking Assignment: (>>=), Procedural Blocking Assignment: (>>>=),
Procedural Blocking Assignment: (^=), Procedural Blocking Assignment: (|=)
o Relational
Matching Relational: (?/=), Matching Relational: (?<), Matching Relational: (?<=),
Matching Relational: (?=), Matching Relational: (?>), Matching Relational: (?>=),
Relational: (==), Relational: (/=), Relational: (<), Relational: (<=), Relational: (=),
Relational: (==), Relational: (>), Relational: (>=)
o Shift
Shift: (<<), Shift: (<<<), Shift: (>>), Shift: (>>>), Shift: (rol), Shift: (ror), Shift:
(sla), Shift: (sll), Shift: (sra), Shift: (srl)
o Ternary
Ternary: (?)
o Wild Equality ( ==? )
o Wild Inequality ( !=? )
• Ignore
Specify the items to ignore on checking disallowed operators. The default is <don’t care>.
o <don’t care>
o Ignore increment/decrement operators in for_step assignments
Examples
Example 1
Check for the use of ampersand character in a conditional statement.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Operators
Rule Configuration
• Language — VHDL Any
Violation Produced
Avoid using disallowed operator " & " in conditional statements
Example 2
Check for the use of ( === ) character in a conditional statement.
Rule Configuration
• Language — VHDL Any
Violation Produced
Avoid using disallowed operator " === "
Example 3
Check for the use of +, -, * operators inside the “Module” scope.
Rule Configuration
• Language — Verilog Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Operators
• Scope — Module
Violations Produced
• Avoid using disallowed operator " + binary " – Violation 1
• Avoid using disallowed operator " * " – Violation 2
• Avoid using disallowed operator " - binary" – Violation 3
• Avoid using disallowed operator " + binary" – Violation 4
• Avoid using disallowed operator " * " – Violation 5
Example 4
Check for the use of the specified operators inside the Generate Block.
Rule Configuration
• Language — Verilog Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Operators
Analyzed Code
module generate_block(in1,in2,output1) ;
int a,b;
assign a =1;
assign b = 2;
reg c;
generate
begin
if (a==b) ifname : begin // Violation 1
always @ (in1)
begin
output1 = in1&&in2; // Violation 2
end
end
case (a*b) // Violation 3
1,c*2: // Violation 4
assign x =1;
endcase
end
gen2: begin
case (a*b) // Violation 5
1,2:
assign x =1;
3,4 :
assign x =2;
endcase
end
endgenerate
endmodule
Violations Produced
• Avoid using disallowed operator " == " – Violation 1
• Avoid using disallowed operator " && " – Violation 2
• Avoid using disallowed operator " * " – Violation 3
• Avoid using disallowed operator " * " – Violation 4
• Avoid using disallowed operator " * " – Violation 5
Example 5
Check for disallowed operators (++,--,*) and the ability to use (++,--) inside the increment area
of the loop.
Rule Configuration
• Language — Verilog Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Operators
Violations Produced
• Avoid using disallowed operator " -- pre " – Violation 1
• Avoid using disallowed operator " ++ post " – Violation 2
• Avoid using disallowed operator " * " – Violation 3
Related Topics
Allowed Constructs
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Pragmas
Allowed Pragmas
Language support: All
Checks for the use of certain pragmas. This rule checks for the use of pragmas other than a
specified allowed set.
Usage
Allowed Pragmas
Common Parameters
Disallowed Pragmas
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Disallowed Pragmas
Specify the allowed pragmas. The rule can check for the use of “Translate on/off” and
“Synthesis on/off” pragmas irrespective of the Pragma Class keyword. The default is Other
Specific Pragmas.
o HDL Designer Series Specific Pragmas
o Other Specific Pragmas
o SYNTHESIS ON/OFF
o TRANSLATE ON/OFF
Choosing the option “Other Specific Pragmas” will check for other pragmas (other than
translate_on/off, synthesis_on/off) that are tool-specific of the form <pragma_class>
<pragma_name>
Where <pragma_class> is any of the following:
pragma <pragma_name>
exemplar <pragma_name>
synopsys <pragma_name>,
and <pragma_name> is any of the following:
async_set_reset
synthesis_off, synthesis_on
full_case, parallel_case
enum, map_to_entity, map_to_module
return_port, return_port_nam
state_vector
syn_encoding
syn_keep
label
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Pragmas
sync_set_reset
template
resolution_method
dc_script_begin, dc_script_end
Examples
Example 1
ARCHITECTURE rtl OF top IS
TYPE MYVECTOR IS ARRAY (7 downto 0) OF bit;
Violation Produced
Pragma “my_pragma": Avoid using disallowed synthesis pragmas
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed System Calls
Rule Configuration
• Disallowed Calls — $cast, $display
Analyzed Code
module allowed_sys_call;
int num;
byte b1;
always@(*)
if($cast(num, b1)) // Violation 1
$display("Casting successful."); // Viollation 2
else
$display("Casting failed."); // Violation 3
endmodule
Violations Produced
• ERROR, System call "$cast" is disallowed – Violation 1
• ERROR, System call "$display" is disallowed– Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed System Calls
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Types
Allowed Types
Language support: All (including SystemVerilog)
Checks for the use of specified VHDL Types, VHDL Packages and multi-dimensional VHDL/
Verilog arrays. Also, can check for either allowed Types, Packages, and Types inside Packages
(those that may be used), or it can check for disallowed Types, Packages, and Types inside
Packages (those that must not be used).
Enumerated types used to describe state variables can be excluded from the check.
The usage of Types/Packages/Types defined in Packages other than those in an “Allowed” set
will cause a violation. Similarly, the usage of any Types/Packages/Types defined in Packages in
a “Disallowed” set will cause a violation.
Usage
Allowed Types
Common Parameters
Applies To
Action
Packages
Types
Excluded Types
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify to which construct/s the check applies. The default is [VHDL] <all>.
o [VHDL]
<all>, Ports, Generics, Signals, Global Signals, VHDL Variables, Constants, Types,
Subprogram Arguments, Array Bounds
o [Verilog] <all> Ports, Nets, Verilog/System-Verilog Constants, Verilog/System-
Verilog Variables, Verilog/System-Verilog Types, Packed Struct Members,
Associative Array Indices, Associative Array Elements, For-Loop Iterators
Note
The value "Variables" can be used for VHDL and Verilog. For VHDL, “Variables”
refers to regular VHDL variables, whereas for Verilog, it refers to all variable data
types (for example: reg, integer, real, real time, time).
• Action
Specify whether the Types/Packages are allowed or disallowed. The default is Disallow.
o Allow
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Types
o Disallow
• Packages
Specify which VHDL Packages to check for. You can choose from the supplied options
and/or enter your own values. The default is ieee.std_logic_arith.
o ieee.*
o ieee.numeric_std
o ieee.std_logic_arith
o <user-defined>
o <don’t care>
• Types
Specify which VHDL and Verilog Types to check for. You can choose from the supplied
options and/or enter your own values. The default is std.bit and std.bit_vector.
o <VHDL Types>
<IEEE Types>
ieee.signed, ieee.std_logic, ieee.std_logic_vector, ieee.std_ulogic,
ieee.std_ulogic_vector, ieee.unsigned, <other IEEE Types>
<STD Types>
<integer types>, <other STD Types>, std.bit, std.bit_vector
<VHDL array of array>
record
vhdl enum
o <Verilog Types>
<Integer data types>
int, integer, longint, shortint
<Net data types>
wand, wire, wor
<Real and time data types>
real, realtime, shortreal, time
<Variable data types>
bit (SystemVerilog), byte, chandle, event, logic, reg, string,
class
enum
struct
typedef
union
o <Multi-Dimension Arrays>
o <don't care>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Types
• Excluded Types
Specify whether enumerated state types should be excluded from this check. The default is
<don’t care>.
o FSM State Variables Enum Type
o <don’t care>
Note
The value of the Packages parameter cannot be set as “<don't care>” when the Types
parameter is set as “<don't care>”.
The Types parameter cannot have any value along with the “<don't care>” value.
Regarding <user-defined> values:
• If you manually enter a type name which already exists within one of the package
options in the parameter list, the entry will be regarded as a duplicate and will not be
retained when you close the tool.
• If you wish to only check specific types from within one of the listed packages,
please prefix the type with the appropriate package name. For example, to check for
type “real”, enter “std.real”. Similarly for “time”, “string” or “integer” enter
“std.time”, “std.string” or “std.integer”.
Examples
Example 1
Check for disallowed type “std_ulogic” and its sub types.
Rule Configuration
• Applies To — Types
• Action — Disallow
• Types — std_ulogic
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Types
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
PACKAGE my_dummy_pkg IS
subtype my_X01 is std_ulogic; -- Violation 1 (for std_ulogic subtype)
subtype my_X02 is my_X01; -- Violation 2 (for std_ulogic subtype,
my_X02 resolves to disallowed type std_ulogic)
type my_std_ulogic_array02 is array (NATURAL range <>) of my_X01; --
Violation ( "my_std_ulogic_array02" resolves to dis-allowed type
std_ulogic)
type my_std_ulogic_array01 is array (NATURAL range <>) of my_X02; --
Violation ("my_std_ulogic_array01" resolves to dis-allowed type
std_ulogic)
END my_dummy_pkg;
END my_dummy_pkg;
Violations Produced
• Type "ieee.std_ulogic", used for subtype "my_X01", is among disallowed types
"ieee.std_ulogic" -- Violation 1
• Type "my_X01", used for subtype "my_X02", is among disallowed types
"ieee.std_ulogic". "my_X01" is a subtype of "ieee.std_ulogic" – Violation 2
Example 2
Check for disallowed types “array of array” and “multi-dimension array” in VHDL files.
Rule Configuration
• Applies To — Types
• Action — Disallow
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Types
Analyzed Code
ENTITY ArrayOfArray IS
END ArrayOfArray;
ARCHITECTURE ArrayOfArrayArch OF x IS
TYPE t1 IS ARRAY(0 TO 1, 0 TO 1) OF bit; --Violation 1 “multi-dim
array”
TYPE t2 IS ARRAY(0 TO 1) OF bit; --“array”
TYPE t3 IS ARRAY(0 TO 1) OF t2; --Violation 2 “array of array”
TYPE t4 IS ARRAY(0 TO 1) OF t1; --Violation 3 “array of multi-dim
array”
TYPE t5 IS ARRAY(0 TO 1, 0 TO 1) of t2; --Violation 4,5 “multi-dim
array of array”
TYPE t6 IS ARRAY(0 TO 1, 0 TO 1) of t1; --Violation 6,7 “multi-dim
array of multi-dim array”
SUBTYPE t7 IS t5; --Violation 8,9 “multi-dim array”
SUBTYPE t8 is t3; --Violation 10 “array of array”
TYPE t9 IS ARRAY(0 TO 1) OF std_logic_vector(10 downto 0); --Violation
11 “array of array”
SIGNAL S : t8; --Violation 12
BEGIN
END ArrayOfArrayArch;
Violations Produced
• Multi-dimensional array declaration for "t1" – Violation 1
• Array of array declaration for "t3" – Violation 2
• Array of array declaration for "t4" – Violation 3
• Array of array declaration for "t5" – Violation 4
• Multi-dimensional array declaration for "t5" – Violation 5
• Array of array declaration for "t6" – Violation 6
• Multi-dimensional array declaration for "t6" – Violation 7
• Array of array declaration for "t7" – Violation 8
• Multi-dimensional array declaration for "t7" – Violation 9
• Array of array declaration for "t8" – Violation 10
• Array of array declaration for "t9" – Violation 11
• Array of array declaration for "S" – Violation 12
Example 3
Check for disallowed type “multi-dimension array” in Verilog files.
Rule Configuration
• Applies To — Types
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Types
• Action — Disallow
Violations Produced
• Multi-dimensional array declaration for "joe" – Violation 1
• Multi-dimensional array declaration for "a_2D" – Violation 2
• Multi-dimensional array declaration for "a" – Violation 3
• Multi-dimensional array declaration for "b" – Violation 4
Related Topics
Allowed Libraries
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Assignment Base Rules
Continuous Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Duplicate Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Initialization Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Input Port Assignments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Mixed Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Multiple Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Multiple Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Unassigned Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Vector Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Continuous Assignments
Continuous Assignments
Language support: Verilog Any
Checks for the use of procedural continuous assignments as they are typically non-
synthesizable.
Usage
Continuous Assignments
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Analyzed Code
module test;
reg a, b, c, d;
wire e;
initial begin
assign d = a & b & c; // Violation 1
a = 1;
b = 0;
c = 1;
#10 force d = (a | b | c); // Violation 2
#10 release d; // Violation 3
send
endmodule
Violations Produced
• Procedural continuous assign statements are not supported. – Violation 1
• FORCE statements are not supported. – Violation 2
• RELEASE statements are not supported. – Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Duplicate Assignments
Duplicate Assignments
Language support: All
Checks for duplicate assignments.
Usage
Duplicate Assignments
Common Parameters
Exclude Partial Overlaps
Description
In a sequential process there may be multiple assignments to a single variable. The variable may
be assigned a value at one point in the process and assigned again later in the process. Such
cases are regarded as “Duplicate Assignments”.
Assignments to the same variable in parallel branches of if-else or case structures would not be
treated as duplicated as in such situations only one of assignment is executed and hence the
values are not overwritten.
• Full overlap
The subsequent assignment always over-writes the previous assignment eg:
out1 <= in1;
…
out1 <= in2;
where “out1” is always assigned a new value and the previous assignment is overwritten.
• Partial overlap
The subsequent assignment overwrites but only under certain conditions eg:
out1 <= in1;
…
if (cond) out1 <= in2;
The rule allows for exclusion of checking for partial over-writes through parameterization.
Please see the Examples section for further details.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Duplicate Assignments
Rule Configuration
• Exclude Partial Overlaps — Yes
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity Example1 is
end Example1;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Duplicate Assignments
Violations Produced
• Example1.vhd, 14 : Assignment(s) to 'nst' done on current line fully over-write(s)
previous assignment(s). – Violation 1
• Example1.vhd, 13 : Assignment(s) to 'nst' done on current line is(are) fully over-written
later. – Associated Violation 1
• Example1.vhd, 15 : Assignment(s) to 'nst' done inside current block fully over-write(s)
previous assignment(s). – Violation 2
• Example1.vhd, 14 : Assignment(s) to 'nst' done on current line is(are) fully over-written
later. – Associated Violation 2
Example 2
Checks for both fully and partially overlapping assignments.
Rule Configuration
• Exclude Partial Overlaps — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Duplicate Assignments
Analyzed Code
module Example2 (input [1:0] d, input mclk,
input sel1, input sel2,
output reg [1:0] q);
reg [1:0] cst, nst;
always@(posedge mclk)
begin
q <= 0; // Associated Violation 1, as this assignment in
conditionally over-written later
if (sel1) // Violation 1, as assignments inside this block
conditionally over-write a previous assignment
begin // Associated Violation 2, as this assignment is always
over-written later
q <= d;
end
q <= 1; // Violation 2, as this assignment always overwrites
assignments done inside a previous block
end
always@(cst)
begin
case (cst) // Associated Violation 3, as assignment in this block
are partially over-written by the later block
0 : begin nst <= 2'b00; end
1 : begin nst <= 2'b10; end
2 : begin nst <= 2'b11; end
3 : begin nst <= 2'b01; end
endcase
case (cst) // Violation 3, as assignments in this block partially
overwrite assignments done in the previous block
1 : begin nst<= 2'b10; end
2 : begin nst <= 2'b11; end
endcase
end
endmodule
Violations Produced
• Example2.v, 8 : Assignment(s) to 'q' done inside current block partially over-write(s)
previous assignment(s). – Violation 1
• Example2.v, 7 : Assignment(s) to 'q' done on current line is(are) partially over-written
later. – Associated Violation 1
• Example2.v, 12 : Assignment(s) to 'q' done on current line fully over-write(s) previous
assignment(s). – Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Duplicate Assignments
• Example2.v, 8 : Assignment(s) to 'q' done inside current block is(are) fully over-written
later. – Associated Violation 2
• Example2.v, 31 : Assignment(s) to 'nst' done inside current block partially over-write(s)
previous assignment(s). – Violation 3
• Example2.v, 25 : Assignment(s) to 'nst' done inside current block is(are) partially over-
written later. – Associated Violation 3
Note
Do not assign to the same signal more than once within the same statement block.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Initialization Assignments
Initialization Assignments
Language support: All (including SystemVerilog)
Checks for the use of initialization assignments rather than explicit resets at declaration time.
More specifically this rule checks VHDL – Initial values on signals and variables (e.g. signal x :
std_logic := ‘0’;) and Verilog – Variable declaration assignment (e.g. reg [3:0] h = 4’hf)
Also, checks either all signals/variables for initialization assignments or can be restricted to
combinationally driven output ports only. Generally, sequentially driven outputs can be
initialized by the reset; however the same cannot be done for combinationally driven outputs,
and hence these should be assigned in all paths rather than specifying an initial value.Besides
this, the rule also checks for the presence of initial blocks which are a common mechanism of
specifying initial values in Verilog.
Usage
Initialization Assignments
Common Parameters
Check
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Check
Specify the types of initialization styles that need to be checked. The default is
Combinationally driven output ports, All signals/variables and Initial blocks.
o Combinationally driven output ports
o All signals/variables
o Initial blocks
Examples
Example 1
Check for various initialization styles.
Rule Configuration
• Check — Combinationally driven output ports, All signals/variables, Initial blocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Initialization Assignments
Analyzed Code
module init2 (in1, in2, clk, out1, out2);
input [3:0] in1, in2;
input clk;
output [3:0] out1, out2;
reg [3:0] out1 = 4'b0000; // Violation 1, 5
reg [3:0] out2 = 4'b1111; // Violation 2
reg [3:0] temp1;
reg [3:0] temp2 = 4'ha; // Violation 3
initial // Violation 4
temp1 = 4'b1010;
always @(in1 or in2)
begin
temp1 = in1;
temp2 = in2;
out1 = temp1& temp2;
end
always @(posedge clk)
out2 = in1 | in2;
endmodule
Violations Produced
• 'out1' has been initialized at declaration time. – Violation 1
• 'out2' has been initialized at declaration time. – Violation 2
• 'temp2' has been initialized at declaration time. – Violation 3
• Initial block has been used. – Violation 4
• Combinationally driven output port 'out1' has been initialized at declaration time. –
Violation 5
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Input Port Assignments
Rule Configuration
Default parameter values.
Analyzed Code
module test2 (input a, b, output c); // Violation
assign c = b;
assign a = b;
endmodule
Violation Produced
Cannot assign to an input: 'a'.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Mixed Assignments
Mixed Assignments
Language support: Verilog Any (including SystemVerilog)
Checks if a Verilog variable is being assigned using a mixture of blocking and non-blocking
assignments in a single always block. It should be noted that mixed assignments are non-
synthesizable and hence any violation of this rule will result in a synthesizability violation as
well. Note that the effects of synthesis may result in different violations from those expected
from looking purely at the code.
Usage
Mixed Assignments
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for a mixture of blocking and non-blocking assignments.
Rule Configuration
Default parameter values.
Analyzed Code
module mixedassign (input [3:0] in1, input cond, output reg [3:0] out1); /
/ Violation 1
always @(cond or in1)begin
if(cond)
out1 = 4'b0000; // Associated Violation 2
else
out1 <= in1; // Associated Violation 3
end
endmodule
Violations Produced
• 'out1' has been assigned using both blocking and non-blocking assignments. – Violation
1
• + 'out1' has been assigned using blocking assignment. – Associated Violation 2
• + 'out1' has been assigned using non-blocking assignment. – Associated Violation 3
Related Topics
Design Correctness and Synthesizability [DesignChecker User Guide]
Blocking Nonblocking Assignments
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Drivers
Multiple Drivers
Language support: All (including SystemVerilog)
Checks for the presence of multiple, simultaneously active drivers on a signal/shared variable
(VHDL) or on a net/variable (Verilog). The active drivers may belong to sequential/
combinatorial process/always blocks or can be concurrent drivers.
Additionally, the condition wherein there are multiple tri-state drivers with non-inverted
conditions is also reported as a potential multiple driver scenario.
Usage
Multiple Drivers
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for multiple drivers across combinational processes.
Rule Configuration
• Language — VHDL Any
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity top is
port(a1, a2 : in std_logic_vector(7 downto 0);
a3 : out std_logic_vector(7 downto 0));
end;
test_proc: PROCESS(a2)
begin
a3 <= a2; -- Associated Violation
end process;
end rtl;
Violations Produced
• Unresolved multiple drivers detected on signal ‘a3’. – Violation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Drivers
Rule Configuration
Default parameter values.
Analyzed Code
module trist (input in1, in2, input sel1, input sel2, output reg out1);
always @( in2 or sel2)
out1 = sel2 ? in2 : 1'bz; // Violation
Violations Produced
• Unresolved multiple drivers detected on signal ‘out1'. – Violation
• + Multiple drivers for signal ‘out1' assigned by a tristate driver. – Associated Violation
Related Topics
Duplicate Assignments
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Waveforms
Multiple Waveforms
Language support: VHDL Any
Checks for the use of multiple waveforms on the right-hand side of a signal assignment, where a
waveform consists of an assignment value expression and an optional assignment delay
expression. Only the first element of a waveform may be synthesizable.
For example, the following clock generator contains 2 waveforms:
clk <= '1', '0' AFTER half_period;
Usage
Multiple Waveforms
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for multiple waveforms.
Analyzed Code
ENTITY test IS
PORT( x1, x2, x3, x4: IN bit;
y1, y2: OUT bit);
END ENTITY test;
Violation Produced
Found Multiple Waveforms
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Waveforms
Note
Multiple waveforms are non-synthesizable.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unassigned Objects
Unassigned Objects
Language support: All
Checks that an object (e.g. signal, variable, port) has been assigned a value before it is used.
Usage
Unassigned Objects
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
conv_proc: PROCESS (read_data, input_data)
BEGIN
IF NOT (read_data = input_data) THEN
--Signal/port “read_data” should be assigned before being read
END IF;
END PROCESS conv_proc;
Violation Produced
Signal/port "data_local" should be assigned before being read.
Related Topics
Unconnected Ports
Undefined Design Units
Unused Declarations
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Vector Assignment
Vector Assignment
Language support: VHDL Any
Checks for the use of hard-coded values to pad/initialize vectors.
When assigning elements of vectors to the same signal value, such as for initializing or
resetting, this should be done in a way which is independent of the size of the vector. This limits
the impact of changing vector sizes. This check looks for the assignment of hard-coded values
when an aggregate assignment (eg others => ‘0’) could have been used.
Please note that aggregate assignments are not flagged even though it may be possible to
represent these as nested aggregate assignments. For example,
(others => “00000000”) can be rewritten as (others => (others => ‘0’)), but this is not flagged
by the tool.
Usage
Vector Assignment
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
PROCESS sync_proc (clk, rst)
If (rst = ‘0’) then
xmitdt <= “00000000”;
-- Use aggregate style (others => ‘0’) for assigning all bits of vector
xmitdt to the same value ‘0’.
Violation Produced
Use aggregate style (others => '0') for assigning all bits of vector "data_vector" to the same
value '0'
Note
Use (others => <val>) to minimize the impact of changes to the vector size.
Related Topics
Hard Coded Numeric Values
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case Statement Directives
Rule Configuration
• Disallowed Directive — parallel_case, parallel_case in Non-parallel Case Statements
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case Statement Directives
Analyzed Code
module test1(in1,out1);
input [2:0] in1;
output [2:0] out1;
wire [2:0] in1,out_local;
reg [2:0] out1;
reg [2:0] in_local;
reg [2:0] in_local_2;
always@(*)
begin
casex(in_local) //pragma parallel_case // Violation 1, 2
3'b0xx: begin out1 = in1 - 1'b1; in_local = in_local + 1'b1; end
3'bx0x: begin out1 = in1 + 1'b1; in_local = in_local + 1'b1; end
3'bxx0: begin out1 = in1; in_local = in_local + 1'b1; end
endcase
end
endmodule
Violations Produced
• Pragma "parallel_case" is disallowed. – Violation 1
• Do not use the parallel_case pragma with non-parallel case statement. – Violation 2
Related Topics
Case Statement Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case Statement Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case Statement Style
Rule Configuration
• Disallowed Styles — Incomplete Case Statement, Overlapping Case Items, Others/
Default clause not last case item, Unequal Case Expression and Case Item lengths, when
others => null, Case statement without others/default
Analyzed Code
module example_case (input [2:0] in1, in2, output reg [2:0] out1, out2);
always @(in1 or in2)
begin
casex (in1) // Violation 2, 5, 7
3'b00x : out1 = in2;
3'b0x1 : out1 = 3'b111; // Associated Violation 3
3'b01x : out1 = in2; // Associated Violation 4
4'b0100 : out1 = 3'b110; // Violation 1
3'b001 : out1 = in2; // Violation 6
endcase
end
endmodule
Violations Produced
• Case item '4'b0100' (width 4) is of different size than case select expression (width 3). –
Violation 1
• Case statement is not parallel. – Violation 2
• + Case item '0x1' is overlapping with case item '00x', at line 6, for value '001'. –
Associated Violation 3
• + Case item '01x' is overlapping with case item '0x1', at line 7, for value '011'. –
Associated Violation 4
• Case statement is not full. – Violation 5
• Case item statement is not reachable. – Violation 6
• Case statement does not have a ‘default’ branch. – Violation 7
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case Statement Style
Related Topics
Case Statement Directives
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock and Reset Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Asynchronous Reset Release
Note
All inputs to the combo logic in Figure 2 must be driven or “hard-wired” high or low. These
inputs cannot be left floating (unconnected).
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Asynchronous Reset Release
The circuit in Figure 3 represents a synchronizer for an internal active-high asynchronous reset.
Note that Figure 3 illustrates an active-high register controlled reset input to the synchronizer.
The circuit in Figure 4 represents a synchronizer where CLR and SET are connected to ground.
A violation is generated if an asynchronous reset is not synchronized before being used. The
primary violation points to the source reset signal. The associated violations point to all the
always blocks/processes in the design which use the source reset signal as an asynchronous
reset. The synchronizer should have at least two registers to be recognized as a valid
synchronizer.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Asynchronous Reset Release
Note
This rule does not report any violations produced for a circuit that is detected as a reset
synchronizer circuit.
Also, in addition to the conditions illustrated in the four previous figures to create a reset
synchronizer circuit, there is another condition: To consider any of the previous four figures a
reset synchronizer circuit, its output should be used as a reset signal for any flip-flop, otherwise
this circuit is considered a normal circuit and it raises violations.
Note
Synthesis effects may result in different violations from those expected when manually
reviewing the source code.
Additional Information:
If an asynchronous reset of a register is de-asserted before the active clock edge, such that the
reset recovery time specification of a register is not met, then the output of the register which is
changing its state due to the reset release can become metastable. Therefore, there should be
sufficient time separating the reset de-assertion and the subsequent active clock edge to ensure
proper register functionality. Further, if the reset is released asynchronous to the active clock
edge, minor differences in propagation delays in the reset tree and the clock tree across the
device can cause some registers to exit their reset states while others are still in their reset states
during the first clock cycle after the reset release. In order to overcome this problem, care
should be taken to ensure that an asynchronous reset is released synchronously. This is
accomplished with the help of a reset synchronizer as shown above. When the output of such a
synchronizer is used to reset internal registers asynchronously, it ensures the registers are reset
asynchronously and released synchronously from their reset states.
Note
If the reset is released on the opposite edge of the clock edge driving the internal registers, it
is not considered as a violation since a sufficient reset recovery time interval will be
assumed.
It may be worthwhile to note that the reset synchronizer must consist of a chain of at least two
flip-flops. This is because the output of the first flip-flop can become metastable due to the
asynchronous reset signal driving its D-input pin. The second flip-flop is necessary to remove
this metastability. The second flip-flop does not suffer from metastability because the transition
of its output occurs on the second active clock edge after reset removal, unlike the first flip-flop
in the synchronizer chain.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Asynchronous Reset Release
Limitations:
If the clock which controls the synchronizer flip-flops and the rest of the design is a gated clock
and is not isolated in a different module, then the tool may not be able to detect the clock signal
driving the synchronizer and the rest of the design is the same signal. Hence, a violation will be
generated. However, if gated clocks are not used or the gated clock is isolated, then this
limitation does not exist.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check if asynchronous resets are synchronously released.
Analyzed Code
module test12(input clk, a, d, output m); // Violation 1
wire e, f, i;
mid1 inst1(.clk(clk), .b(1), .c(a), .e(e), .f(f));
mid2 inst2(.clk(clk), .g(e), .h(f), .i(i));
mid3 inst3(.clk(clk), .j(i), .k(d), .l(m));
endmodule
Violations Produced
• Asynchronous reset 'test12.a' is not synchronized before being used. – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Asynchronous Reset Release
Analyzed Code
module test8(input clk1, clk2, rst1, rst2, d, output reg q3);
reg q, q2;
wire rst = rst1 & rst2;
always @(posedge clk1 or posedge rst)
if (rst)
q <= 1;
else
q <= 0;
always @(posedge clk1 or posedge rst) // Violation 1
if (rst)
q2 <= 1;
else
q2 <= q;
always @(posedge clk2 or negedge q2) // Associated Violation 2
if (!q2)
q3<= 1;
else
q3 <= d;
endmodule
Violations Produced
• Asynchronous reset 'test8.q2' is not synchronized before being used. – Violation 1
• + Asynchronous reset 'q2' of always block is not synchronized with respect to the used
clock. – Associated Violation 2
Example 3
Check for asynchronous reset being used on an incorrect active level.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Asynchronous Reset Release
Analyzed Code
module test16(input clk, a, d, output m);
wire e, f, i;
mid1 inst1(.clk(clk), .b(0), .c(a), .e(e), .f(f));
mid2 inst2(.clk(clk), .g(e), .h(f), .i(i));
mid3 inst3(.clk(clk), .j(i), .k(d), .l(m));
endmodule
Violations Produced
• Asynchronous reset 'test16.inst2.i' is not synchronized before being used. – Violation 1
• + Asynchronous reset 'j' of always block is used at the opposite active level after being
synchronized. – Associated Violation 2
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Internally Generated Resets
Register Reset Control
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock Declaration Style
Rule Configuration
Default parameter values.
Analyzed Code
module test(inout [5:9] clk, input rst, input d, output reg q); //
Violation 1, 2
always @(posedge clk)
if (rst)
q<= 0;
else
q <= d;
endmodule
Violations Produced
• Avoid using a bus to define clock 'clk[9]'. – Violation 1
• Avoid using bi-directional port for clock 'clk[9]'. – Violation 2
Related Topics
Edge Detection
Multiple Clocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock Declaration Style
Multiple Resets
Mixed Clocks Resets
Clock Used As Data
Edge Trigger Control
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Clocks
Consistent Clocks
Language support: All
Checks that clocks within a specified scope have a consistent polarity. This is optionally a
design-wide check depending on the chosen parameter settings.
Usage
Consistent Clocks
Common Parameters
Hierarchy Level
Applies To
Consistency
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Hierarchy Level
Specify the hierarchy level in which to check for a consistent clock polarity. “Entire
Design” means all the design files used in a given DesignChecker analysis. The default is
Process.
o Process, [VHDL Process, Verilog Always]
o Block, [VHDL Architecture or Verilog Module]
o Entire Design
• Applies To
Specify the type of registers to which the check should apply. The default is FSM State
Variable Registers and Other Registers
o FSM State Variable Registers
o Other Registers
• Consistency
Specify whether all clock signals should be used in a consistent way individually or whether
this consistency should be checked even across different signals. The detection of being
same signal or different signals is based on the condition whether the signals under
consideration form a single clock tree or not. The default is Single Clock.
o Single Clock
o Across Clocks
Also, this clock tree detection is based on the selected value of the Hierarchy Level
parameter. For Process, two signals should be the same RTL net to be considered as same
clock. For Block level, if the two signals are derived from the same signal inside the
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Clocks
module/architecture, they are deemed to be the same clock signal. When performing the
check at the design-wide level, full clock trees for the whole design are created and two
clocks are considered same only if they belong to same design clock tree.
Examples
Example 1
Check for same clock used with multiple polarities at a block-level.
Rule Configuration
• Hierarchy Level — Block
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Clocks
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity superMix4 is
port (din, din2, din3, rst, clk, load, clk_fsm,clk_fsm2 : in std_logic;
-- Violation 1
dout,dout_2 : out std_logic);
end superMix4;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Clocks
end rtl;
Violations Produced
• Clock 'clk' is not used at a single edge, inside architecture 'rtl’. – Violation 1
• + Clock 'clk1' is used at 'positive edge’. – Associated Violation 2
• + Clock 'clk2' is used at 'negative edge'. – Associated Violation 3
Example 2
Check FSM Register Clocks for multiple polarities at block level.
Rule Configuration
• Hierarchy Level — Block
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Clocks
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity superMix6 is
port (din, din2, din3, rst, clk, load, clk_fsm,clk_fsm2 : in std_logic;
dout,dout_2 : out std_logic);
end superMix6;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Clocks
Violations Produced
• FSM Clocks not used at a single edge, inside architecture 'rtl'. – Violation 1
• + FSM Clock 'clk_fsm' is used at 'positive edge’. – Associated Violation 2
• + FSM Clock 'clk_fsm2' is used at 'negative edge'. – Associated Violation 3
Related Topics
Edge Trigger Control
Register Reset Control
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
Consistent Resets
Language support: All
Checks This rule checks that resets within a specified scope have a consistent style
(synchronous/ asynchronous) and polarity. This is optionally a design-wide check depending on
the chosen parameter settings.
Note that the effects of synthesis may result in different violations from those expected from
looking purely at the code. Please see Register and Control Signal inference for more details.
Usage
Consistent Resets
Common Parameters
Disallow
Hierarchy Level
Applies To
Consistency
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Disallow
Specify the consistency parameters. You can disallow the mixing of reset styles and/or
polarities. The default is Mixed Synchronous/Asynchronous Styles and Mixed Polarities.
o Mixed Synchronous/Asynchronous Styles
o Mixed Polarities
Mixed Polarity of Asynchronous Resets, Mixed Polarity of Synchronous Resets
Note
Important notes:
• Selecting "Mixed Polarity of Asynchronous Resets" produces violations only if both
occurrences of the reset are Asynchronous.
• Selecting "Mixed Polarity of Synchronous Resets" produces violations only if both
occurrences of the reset are Synchronous.
• Selecting "Mixed Polarities" produces violations on mixed polarity regardless of the
style of both resets (even if one is Asynchronous and the other is Synchronous).
• Hierarchy Level
Specify the hierarchy level in which to check for a consistent reset style. “Entire Design”
means all the design files used in a given DesignChecker analysis. The default is Process.
o Process, [VHDL Process, Verilog Always]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
Rule Configuration
• Disallow — Mixed Synchronous/Asynchronous Styles, Mixed Polarities
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity superMix4 is
port (din, din2, din3, rst, clk, load, clk_fsm,clk_fsm2 : in std_logic;
dout,dout_2 : out std_logic);
end superMix4;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
end process;
end rtl;
Violations Produced
• Reset 'rst' is used with mixed polarity, inside architecture 'rtl' – Violation 1
• + Reset 'rst1' is used as an 'active high' reset – Associated Violation 2
• + Reset 'rst2' is used as an 'active low' reset – Associated Violation 3
• Reset 'rst' is used with mixed style, inside architecture 'rtl' – Violation 4
• + Reset 'rst2' is used as an asynchronous reset – Associated Violation 5
• + Reset 'rst1' is used as a synchronous reset – Associated Violation 6
Example 2
Check FSM register resets for mixed style/polarity at block level.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity superMix6 is
port (din, din2, din3, rst, clk, load, clk_fsm,clk_fsm2 : in std_logic;
dout,dout_2 : out std_logic);
end superMix6;architecture rtl of superMix6 is -- Violation 1
signal clk1 : std_logic;
signal clk2 : std_logic;
signal rst1 : std_logic;
signal rst2 : std_logic;
signal cst, nst, cst2, nst2 : std_logic_vector (2 downto 0);
begin
two_clks: process (clk1, clk2)
begin
if (clk1'event and clk1 = '1') then
if (rst1 = '1') then
dout <= '1';
else
dout <= din;
end if;
end if;
if (rst2 = '0') then
dout_2 <= '0';
else
if (clk2'event and clk2 = '0') then
dout_2 <= din2;
end if;
end if;
end process;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
Violations Produced
• FSM Resets used with mixed polarity, inside architecture 'rtl'. – Violation 1
• + FSM Reset 'rst1' is used as an 'active high' reset. – Associated Violation 2
• + FSM Reset 'rst2' is used as an 'active low' reset. – Associated Violation 3
Example 3
Check mixed reset polarity for asynchronous resets.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
Analyzed Code
LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
ENTITY polarity_async IS
PORT (rst, clk : IN std_logic); –- Violation 1
END polarity_async;
Violations Produced
• Reset 'rst' is used with mixed polarity, inside architecture 'rtl'. – Violation 1
• + Reset 'rst' is used as an 'active high' reset. – Associated Violation 2
• + Reset 'rst' is used as an 'active low' reset. – Associated Violation 3
Example 4
Check mixed reset polarity for synchronous resets.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Consistent Resets
Analyzed Code
module polarity_sync (din, rst, clk, dout1, dout2);
input din, rst, clk; // Violation 1
output dout1, dout2;
reg dout1, dout2;
Violations Produced
• Reset 'rst' is used with mixed polarity, inside module 'polarity_sync'. – Violation 1
• + Reset 'rst' is used as an 'active low' reset. – Associated Violation 2
• + Reset 'rst' is used as an 'active high' reset. – Associated Violation 3
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Edge Trigger Control
Register Reset Control
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Controllable Resets
Controllable Resets
Language support: All (including SystemVerilog)
Checks if the reset signal is tied high (VCC) or tied low (GND) (i.e. the reset is always active or
always inactive) or is undriven. This is a design-wide check.Note that the effects of synthesis
may result in different violations from those expected from looking purely at the code. Please
see Register and Control Signal inference for more details.
Usage
Controllable Resets
Common Parameters
Disallowed Resets
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Disallowed Resets
Specify which of fixed / undriven values are not allowed. The default is Tied High (VCC)
and Tied Low (GND).
o Tied High (VCC)
o Tied Low (GND)
o Undriven
Examples
Example 1
Rule Configuration
• Disallowed Resets — Tied High (VCC), Tied Low (GND), Undriven
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Controllable Resets
Analyzed Code
module test30(input clk, rst, d, output q, q3, q2, q4);
test30_lca inst1(clk, rst, d, q, q3);
test30_lca inst2(clk, rst, d, q2, q4);
endmodule
Violations Produced
• Reset 'set' is tied low. –Violation 1
• Asynchronous reset 'set' of always block is tied low. – Associated Violation 2
• Reset 's_rst' is tied high. –Violation 3
• Synchronous reset 's_rst' of always block is tied high. – Associated Violation 4
• Reset 's_set' is undriven. –Violation 5
• Synchronous reset 's_set' of always block is undriven. – Associated Violation 6
• Reset 'test30_lca.inst2.in1' is tied low. –Violation 7
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Controllable Resets
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Edge Detection
Edge Detection
Language support: VHDL Any
Checks the coding style used in VHDL edge detection conditions.
Usage
Edge Detection
Common Parameters
Condition Style
Disallow Other Signals/Variables
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Condition Style
Specify allowed edge detection condition style. The default is 'EVENT only.
o VHDL Edge Function [rising_edge(clk) or falling_edge(clk)]
o 'EVENT only [clk'event and clk='1']
o 'EVENT & 'LASTVALUE [clk`EVENT and clk=’1’ and clk`LAST_VALUE=’0’]
• Disallow Other Signals/Variables
Indicate whether the specified edge detection condition style/s may be used for any signal/
variable or must only be used for clock signals. The default is No.
o Yes [Specified edge conditions allowed for clocks only]
o No [Specified edge conditions allowed for non-clock signals]
Examples
Example 1
Analyzed Code
synch_proc: process (clk, rst)
begin
if (rst = '0') then
………
else
if (clk'event and clk = '1') then
– Use ‘EVENT and ‘LASTVALUE attributes to detect clock edges
……
end if;
end if;
end process;
Violation Produced
Use "rising_edge/falling_edge" functions to detect clock edges
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Edge Detection
Tip
Use the allowed clock condition style
Related Topics
Edge Trigger Control
Register Reset Control
Untested Edge Trigger
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Gated Clocks
Gated Clocks
Language support: All (including SystemVerilog)
Checks for the usage of gated clocks in the design. Gated clocks can cause clock skews and are
sensitive to glitches which can lead to incorrect data being registered. This is a design-wide
check.
Usage
Gated Clocks
Common Parameters
Ignore
Description
Optionally, gated clocks wherein the enable signal transitions occur only on the inactive edge of
the master clock can be ignored. For this the gated clock needs to be and-ed/or-ed with a
synchronized enable signal as shown below.
Additional Information
An asynchronously changing clock gating enable signal can cause the clock signal to get
truncated violating the setup/hold time of flip-flops or can introduce glitches in the clock signal.
To overcome this problem, it is desired that the enable signal be continuously stable around the
active edge of the used clock and change only with the inactive edge of the clock. This would
ensure that the enable signal is synchronized with the clock signal and does not truncate the
clock pulse or introduce any glitches.
The circuit of Figure 1 exactly achieves this.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Ignore
Specify if specific gated clock styles need to be ignored. The default is <don’t care>.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Gated Clocks
Rule Configuration
Default parameter values.
Analyzed Code
module design_top (in1,design_clk,design_rst,design_en,out1);
input in1,design_clk,design_rst,design_en;
output wire out1;
wire rst,en;
wire [1:0] clk;
clkRstGenerator inst1(.clk(clk),.rst(rst),.en(en), // Violation
.in_clk(design_clk),
.in_rst(design_rst),
.in_en(design_en));
middle m1(in1,clk[0],rst,en,out1);
endmodule
module middle(in1,clk,rst,en,out1);
input wire in1,clk,rst,en;
output reg out1;
always @(posedge clk) // Associated Violation
if(rst)
out1<= 1'b1;
else
out1 <= in1;
endmodule
Violations Produced
• Clock gating at ‘inst1.clk[0]’. – Violation
• The clock for synchronous block is gated. – Associated Violation
Example 2
Enable transitions not at opposing edge of clock.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Gated Clocks
Rule Configuration
• Ignore — Gated Clocks with Enable at Inactive Clock Edge
Analyzed Code
module test15(input a, b, d1, output h, output reg q, output q2, q4);
wire e;
mid1 inst1(.c(~a), .d(b), .d3(d1), .e(e), .q3(q2), .q4(q4)); //
Violation 1
mid2 inst2(.f(e), .d2(d1), .g(h));
always @(posedge e) // Associated Violation 3
q <= d1;
endmodule
Violations Produced
• Clock gating at 'inst1.e'. – Violation 1
• + The clock for synchronous block is not used at the opposite edge of that used for
enable transition. – Associated Violation 2
• + The clock for synchronous block is not used at the opposite edge of that used for
enable transition. – Associated Violation 3
Related Topics
Internally Generated Clocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Clocks
Note
In case an internally generated clock is used at multiple locations, only one usage of this
clock will be highlighted.
Additional Information
In this section, clock generators and isolation parameters are explained in greater detail as
understood by the tool.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Clocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Clocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Clocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Clocks
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Action
Specify whether isolated internally generated clocks are allowed or not. The default is
Allow if isolated at Top-Level.
o Allow if isolated at any level
o Allow if isolated at same level where clock is used
o Allow if isolated at Top-Level
o Allow if isolated and routed to top-level
o Disallow
Examples
Example 1
Check that internally generated clocks are not used in the design.
Rule Configuration
• Action — Disallow
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Clocks
Analyzed Code
module test2 (input a, b, output reg c);
reg clk;
always @(posedge a) // Violation
clk <= ~clk;
always @(posedge clk) // Associated Violation
c<= b;
endmodule
Violations Produced
• Internally generated clock 'clk' in top design unit 'test2' is not allowed. – Violation
• + Clock 'clk' of register 'c' in top design unit 'test2' is internally generated. – Associated
Violation
Example 2
Check that internally generated clocks are not used in the design unless they are isolated and
routed to top before being used.
Rule Configuration
• Action — Allow if isolated and routed to top-level
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Clocks
Analyzed Code
module test5 (input a, g, h, i, output f, w);
wire c, m, n, o, c1, p;
reg r;
mid1 mid1_inst(.b(a), .j(g), .k(h),
.l(i), .c(c), .m(m), .n(n), .o(o));
mid2 mid2_inst(.d(c), .p(p), .q(n),
.r(r), .e(e), .c1(c1), .v(w));
assign p = m;
always @(posedge n)
r <= o;
assign f = c1;
endmodule
Violations Produced
• Internally generated clock 'y' in instance 'mid1.bot1_inst' is not isolated and routed to
top. – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Clocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Resets
The default behavior of this rule is to detect internally generated resets (synchronous or
asynchronous) that are not isolated at the top level. This is a design-wide check.
An asynchronous reset release circuit Asynchronous Reset Release generates an internal reset,
and optionally such resets can be excluded from this check. Note that the effects of synthesis
may result in different violations from those expected from looking purely at the code. Please
see Register and Control Signal inference for more details.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Resets
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Action
Specify whether isolated internally generated resets are allowed or not. The default is Allow
if isolated at top-level.
o Allow if isolated at any level
o Allow if isolated at same level where reset is used
o Allow if isolated at top-level
o Allow if isolated and routed to top-level
o Disallow
• Reset Style
Specify the style of the internally generated reset to be detected. The default is <don’t care>.
o Synchronous
o Asynchronous
o <don’t care>
• Ignore
Specify the type of internally generated resets which should be ignored. The default is
<don’t care>.
o Synchronously de-asserted asynchronous resets
o <don’t care>
Examples
Example 1
Check for synchronous internally generated resets.
Rule Configuration
• Action — Disallow
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Resets
Analyzed Code
module test1(input a, b, c, clk, output l, m);
wire f;
mid1 mid1_inst(.d(a), .e(b), .f(f), .clk(clk)); // Violation
mid2 mid2_inst(.g(f), .k(c), .h(a), .i(l), .j(m), .clk(clk));
endmodule
Violations Produced
• Internally generated reset 'mid1_inst.f' in top design unit 'test1' is not allowed. –
Violation
• + Synchronous reset 'g' of register 'i' in instance 'test1.mid2_inst' is internally generated.
– Associated Violation
Note
If the Reset Style parameter is set as “Asynchronous”, then the example above will not
produce violations. This is because the internally generated reset in this example is
synchronous. Also, if the Action parameter is set as “Allow if isolated at top-level”, then the
example above will again not produce violations. This is because the internally generated reset
in this example is isolated at the top level.
Example 2
Check for internally generated resets that are not isolated at the top level.
Rule Configuration
• Action — Allow if isolated at top-level
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Internally Generated Resets
Analyzed Code
module test2(input a, b, f, x1, v, j, k, l, clk, output e, r, s,
output i, output reg r1);
wire c, h, q;
assign c = a & b;
mid1 mid1_inst1(.c(c), .g(f), .d(e), .h(h));
assign i = h;
always @(negedge clk)
if (h)
r1 <= 0;
else
r1 <= x1;
mid2 mid2_inst (.u(q), .t(r), .q(q), .p(s), .o(l), .n(k),
.m(j), .w(v), .clk(clk));
endmodule
Violations Produced
• Internally generated reset 'gen_inst.f1' in instance 'mid2.bot_inst' is not isolated at the
top level. – Violation
• + Asynchronous reset 'u' of register 't' in design unit 'mid2' is internally generated. –
Associated Violation
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Register Reset Control
Internally Generated Resets
Asynchronous Reset Release
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Mixed Clocks Resets
In case a given signal is being used as a clock and/or a reset at more than one location, only one
occurrence of the signal as clock and one occurrence of the signal as reset are highlighted.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Mixed Clocks Resets
Note
The effects of synthesis may result in different violations from those expected from looking
purely at the code. Please see Register and Control Signal inference for more details.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for a signal being used as both a clock and a reset.
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Mixed Clocks Resets
Analyzed Code
module top(input [16:19] a, output [11:10] q); // Violation 1
wire [4:6] w;
middle1 inst1 (.b({a[19], a[16], a[17]}), .d(w[4:5]));
middle2 inst2 (.f(w), .g(q[11]));
middle3 inst3 (.c(a[17:19]), .h({w[6], q[10]})); // Violation 4
endmodule
Violations Produced
• Port 'a[19]' is used both as clock and asynchronous reset. – Violation 1
• + Clock of register 'q' is used as asynchronous reset elsewhere. – Associated Violation 2
• + Asynchronous reset of register 'q' is used as clock elsewhere. – Associated Violation 3
• Port 'inst3.c[4]' is used both as clock and synchronous reset. – Violation 4
• + Clock of register 'q' is used as synchronous reset elsewhere. – Associated Violation 5
• + Synchronous reset of register 'q' is used as clock elsewhere.- Associated Violation 6
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Clocks
Multiple Clocks
Language support: All (including SystemVerilog)
Checks if there is a single clock used inside a unit/module or always/process block. In case there
are multiple clocks at a module level, then only one of the corresponding always blocks/
processes for each clock is highlighted.
Usage
Multiple Clocks
Common Parameters
Hierarchical Level
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Hierarchical Level
Specify which level(s) of the design to check. The default is Process/Always Block.
o Process/Always Block
o Design Unit
Examples
Example 1
Check for the usage of multiple clocks in a VHDL process.
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Clocks
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity test2 is
generic(n1: natural :=4; n2: natural :=4);
port(input : inout std_logic_vector(n1-1 downto 0);
output : out std_logic_vector(n2-1 downto 0)
);
end test2;
Violation Produced
Synchronous process block uses multiple clocks 'input(2)' and 'input(0)'.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Resets
Multiple Resets
Language support: All (including SystemVerilog)
Checks that only one reset signal is used in the specified scope. This is optionally a design-wide
check based on the parameter setting. Further, this rule also checks if separate if-conditions
have been enforced for modeling resets.
Note that the effects of synthesis may result in different violations from those expected from
looking purely at the code. Please see Register and Control Signal inference for more details.
Usage
Multiple Resets
Common Parameters
Reset Style
Scope
Enforce Separate If Conditions
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Reset Style
Specify reset style to check. The default is <don’t care>.
o Synchronous
o Asynchronous
o <don’t care>
• Scope
Specify which level/s of the design to check. The default is Process/Always Block.
o Process/Always Block
o Design Unit
o Entire Design
Note
Multiple reset detection depends upon the scope selected. For a process/always
block, 2 different RTL signals will be considered as multiple resets. However, it
could be possible that the 2 RTL signals are actually driven by the same signal. This will
not be detected when the visibility is restricted to process/always block. On similar lines,
multiple resets detected when “Design Unit” is selected may actually belong to the same
reset tree from a design perspective, but this will not be detected because visibility is
restricted to one design unit at a time. When “Entire Design” is selected, a violation
would be produced only if the 2 signals belong to distinct reset trees.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Resets
Note
If “Yes” is selected then a violation is produced every time a complex condition,
which can possibly be split into if-else if, is used to code a reset. “Only when mixed”
violates when a complex condition leads to inference of an asynchronous and a
synchronous reset. A <don’t care> selection does not trigger this check at all.
Examples
Example 1
Check for multiple resets in a design unit.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Resets
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity MultRst1 is
port (din, din2, din3, rst, rst1, rst2, clk : in std_logic;
dout, dout_2, dout_3 : out std_logic);
end MultRst1;
Violations Produced
• Multiple asynchronous resets used in architecture 'rtl'. – Violation 1
• + Reset 'rst' is one of multiple resets used in architecture 'rtl'. – Associated Violation 2
• + Reset 'rst1' is one of multiple resets used in architecture 'rtl'. – Associated Violation 3
• + Reset 'rst2' is one of multiple resets used in architecture 'rtl'. – Associated Violation 4
Example 2
Enforce separate if-conditions when resets are mixed.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Multiple Resets
Rule Configuration
• Reset Style — <don’t care>
Violation Produced
Separate if conditions are not used to code mixed resets.
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Consistent Resets
Multiple Clocks
Register Reset Control
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Reset Logic Function
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Reset Logic Function
In case a given signal is being used as a reset and/or is being used in a logic function at more
than one location, only one occurrence of the signal as reset and one occurrence of the signal in
a logic function are highlighted.
Note
The effects of synthesis may result in different violations from those expected from looking
purely at the code. Please see Register and Control Signal inference for more details.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check that reset signals are not used for any purpose other than resetting registers or latches.
Rule Configuration
Default parameter values.
Analyzed Code
module test (input k, m, a, b, output c, d);
wire w1, w2, w3;
middle1 inst1 (.e(a), .f(b), .g(w1), .h(w2), .i(w3)); // Violation 1
middle2 inst2 (.l(k), .n(m), .j(w1), .s(c));
middle3 inst3 (.p(w2), .q(w3), .r(d)); // Associated Violation 2
endmodule
Violations Produced
• Port 'inst1.e' is used both in a logic function and as a synchronous reset. – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Reset Logic Function
• + Port 'inst3.p' that is used in a logic function is also used as a synchronous reset
elsewhere. – Associated Violation 2
• + Synchronous reset of register 's' is also used in a logic function elsewhere. –
Associated Violation 3
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Untested Edge Trigger
Rule Configuration
Default parameter values.
Analyzed Code
module untested_bad(output reg out_sig, input In_sig, clk_master, clear,
enable);
always @(negedge clk_master or negedge enable or negedge clear) //
Violation
begin : process2
if (!clear)
out_sig = 2'b0;
else
out_sig = In_sig;
end
endmodule
Violation Produced
More than one untested edge trigger. Cannot infer clock for this always statement.
Example 2
This example illustrates a scenario in which the absence of untested edge triggers will not result
in a violation.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Untested Edge Trigger
Rule Configuration
Default parameter values.
Analyzed Code
module untested_good(output reg out_sig, input In_sig, clk_master, clear);
always @(negedge clk_master or negedge clear)
// Last tested edge trigger (clk_master) inferred as the clock, so there
is no violation
// even though there is no single untested edge trigger.
begin : process2
if (!clear)
out_sig = 2'b0;
else if(!clk_master)
out_sig = In_sig;
end
endmodule
Violation Produced
None
Related Topics
Design Correctness and Synthesizability [DesignChecker User Guide]
Edge Detection
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments and Blank Lines Density
Note
Important Notes:
• When calculating the density, DesignChecker only takes into account the used
architectures of a VHDL design unit (that is, the architectures used in instantiating a
design unit). Otherwise, if there are no used architectures, then only the default
architecture is taken into account.
• If there is an Include directive inside a design unit, the lines of the included file
contribute in the calculated values of the design unit.
• Density is calculated for a package header and its body collectively.
• Density is calculated once for a design unit instantiated multiple times in the design
hierarchy and once for a package used by different design units.
• All HDL directives in the files having design units belonging to the design are
counted, except if they are inside design units that are not in the design hierarchy.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments and Blank Lines Density
• Density Formula
Specify the formula used in calculating the comments density or blank lines density. The
default is Formula 1: Comments Lines / (Comments Lines + HDL Lines).
o Formula 1: Comments Lines / (Comments Lines + HDL Lines)
o Formula 2: Comments Lines / HDL Lines
o Formula 3: Comments Only Lines / (Comments Only Lines + HDL Lines)
o Formula 4: Comments Only Lines / HDL Lines
o Formula 5: Blank Lines / (Blank Lines + HDL Lines)
o Formula 6: Blank Lines / HDL Lines
The variables used in calculating the above formulas are defined as follows:
HDL Lines: Lines having HDL code. The HDL line may have HDL code only or HDL
code and comments.
ARCHITECTURE rtl OF top IS
--
-- signal declarations
--
SIGNAL: buffer_data : std_logic; -- buffer for data
SIGNAL: buffer_address : std_logic; -- buffer for address
BEGIN END ARCHITECTURE;
Comments Only Lines: Lines having only comments without any HDL code.
ARCHITECTURE rtl OF top IS
--
-- signal declarations
--
SIGNAL: buffer_data : std_logic; -- buffer for data
SIGNAL: buffer_address : std_logic; -- buffer for address
BEGIN
END ARCHITECTURE;
Comments Lines: Lines having comments. A comments line may be a line having HDL
code with comments or a line having comments only.
ARCHITECTURE rtl OF top IS
--
-- signal declarations
--
SIGNAL: buffer_data : std_logic; -- buffer for data
SIGNAL: buffer_address : std_logic; -- buffer for address
BEGIN
END ARCHITECTURE;
Blank Lines: Lines having neither HDL code nor comments. Blank lines may only have
spaces, tabs, or just a carriage return.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments and Blank Lines Density
Note
Important Notes:
• Design unit header means any commented block(s) defined before the design unit
and after a preceding design unit (if any), or after the beginning of the file (if there is
no preceding design unit).
• The header of an architecture is counted as part of the header of its entity.
Rule Configuration
• Applies To — Design Unit
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments and Blank Lines Density
// internal wires
wire out1_temp;
wire out2_temp;
// instance 1
and2_v and2_1(in1, in2, out1_temp);
// instance 2
and2_v and2_2(in1, in3, out2_temp);
// instance 3
or2_v or2_1(out1_temp, out2_temp, out1);
endmodule
Violations Produced
• Module 'top_v' has comments density (44%) which is below the acceptable minimum
(60%) – Violation 1
• Module 'or2_v' has comments density (33.3%) which is below the acceptable minimum
(60%) – Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments and Blank Lines Density
• Module 'and2_v' has comments density (40%) which is below the acceptable minimum
(60%) – Violation 3
Example 2
Check comments density for the design hierarchy.
Rule Configuration
• Applies To — Design Hierarchy
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments and Blank Lines Density
Analyzed Code
ENTITY top IS -- Violation 1
--
-- ports
--
PORT(in1 : IN std_logic;
in2 : IN std_logic;
in3 : IN std_logic;
out1 : OUT std_logic);
END top;
COMPONENT and2
PORT (
in1 : IN std_logic;
in2 : IN std_logic;
out1 : OUT std_logic
);
END COMPONENT;
COMPONENT or2
PORT (
in1 : IN std_logic;
in2 : IN std_logic;
out1 : OUT std_logic
);
END COMPONENT;
FOR and2_1 : and2 USE ENTITY and2(arch1);
FOR and2_2 : and2 USE ENTITY and2(arch2);
FOR ALL : or2 USE ENTITY or2;
-- declarations
BEGIN
-- hds hds_inst
and2_1 : and2
PORT MAP (
in1 => in1,
in2 => in2,
out1 => out1_temp
);
-- hds hds_inst
and2_2 : and2
PORT MAP (
in1 => in1,
in2 => in3,
out1 =>out2_temp
);
-- hds hds_inst
or2_1 : or2
PORT MAP (
in1 => out1_temp,
in2 => out2_temp,
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments and Blank Lines Density
Violation Produced
Design hierarchy of 'top' has comments density (18.3%) which is below the acceptable
minimum (20%)
Example 3
Check the blank lines density per design unit.
Rule Configuration
• Applies To — Design Unit
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Comments and Blank Lines Density
Violations Produced
• Module 'top_v' has blank lines density (35.3%) which is below the acceptable minimum
(40%) – Violation 1
• Module 'or2_v' has blank lines density (25%) which is below the acceptable minimum
(40%) – Violation 2
• Module 'and2_v' has blank lines density (25%) which is below the acceptable minimum
(40%) – Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Header
File Header
Language support: All (including SystemVerilog)
Checks that the file header is exactly matching a predefined template and/or that the file header
contains certain information (such as the author, creation date, and so on).
The file header to be checked is the first commented block of lines which appears in the file
before any HDL code.
Usage
File Header
Common Parameters
Applies To
Fields
Allow Blank Lines
Template
Regular Expression Variables
Match Case
Allow Mismatched Whitespaces
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
This parameter allows choosing either to run the rule on the files that contain the top units
only, non-top units or all units in the design. The default is <Top Units> and <Other Units>.
o <Top Units>
Architectures, Configurations, Entities, Modules
o <Other Units>
• Fields
This parameter allows defining the different fields that must be found as a part or section in
the file header. The default is file_info: #(comment_token)#(text)%(file_name)#(text).
o file_info: #(comment_token)#(text)%(file_name)#(text)
o <user-defined>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Header
Note
Only selected fields are checked. Each field defines a template in a multi-line text.
The entered text may contain references to system variables in the form %(<system
variable name>) which can be substituted by the tool or it may contain references to
regular expression variables defined by the user in the “Regular Expression Variables”
parameter in the form #(<template variable name>). Fields cannot reference regular
expressions directly, it should reference them using regular expression variables.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Header
Note
Important notes:
• An error message is displayed if “Template” parameter is set to contain blank lines
while “Allow Blank Lines” parameter is set to “No”.
• A warning message is displayed if the “Allow Blank Lines” parameter is set to “No”
while “Template” parameter contains blank lines.
• Template
This is a multi-line parameter which allows entering the template text that should be exactly
matched with the file header (not only matched with part of the file header). Like the
“Fields” parameter, the entered text may contain references to system variables in the form
%(<system variable name>) which is substituted by the tool, or it may contain references to
regular expression variables defined by the user in the “Regular Expression Variables”
parameter in the form #(<template variable name>). Please refer to the supported system
variables table in the Fields section.
In addition, this parameter can reference a field defined in the “Fields” parameter in the
form &(<field name>). References to fields must appear in separate lines with no preceding
or following text in the same line; however they can be enclosed by a repeated block. The
default is <none>.
o <user-defined>
o <none>
• Regular Expression Variables
This parameter allows defining regular expression variables to be referenced in the “Fields”
or “Template” parameters to allow creating complex header templates. The default is
comment_token="--|//", text=".*" and year="[0-9]{4}"
o <none>
o comment_token="--|//"
o text=".*"
o year="[0-9]{4}"
o <user-defined>
Each variable is entered as a string value in the form <variable name>=”<variable value>”
where <variable name> is a string and <variable value> is any regular expression value.
Variable names are case insensitive. A variable name must start with an alphabetic
character. The rest of the variable name can contain alphanumeric characters or underscores.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Header
• Match Case
Specify whether the matching between the file header and the template should be case-
sensitive or not. The default is No.
o “Yes” means that the file header matching with the template is case-sensitive.
o “No” means that the file header matching with the template is case-insensitive.
• Allow Mismatched Whitespaces
Specify whether mismatched whitespaces are allowed or not (that is, whitespaces that are
not identical in the file header and the template). The default is Yes.
o “Yes” means that the lines of the file header may contain different number and type
of whitespaces than those in the defined template. Different number means that a
single whitespace in the file header can match one or more whitespaces in the
defined template and vice versa. Different type means that a “Space” (or more) for
example in the file header can match a “Tab” (or more) in the defined template.
o “No” means that whitespaces in the lines of the file header must be exactly the same
in number and type as those in the lines of the defined template.
Examples
Example 1
Check the file header.
Rule Configuration
• Applies To — <Top Units>, <Other Units>
• Fields —
Copyrights:
-- COPYRIGHT (c) #(company), #(year)
-- The copyright to the document herein is the property of
#(company).
--
-- All rights reserved.
Author:
-- Author: #(name)
-- Created: #(date_time)
??<
-- Revision date: #(date)
??>??<
-- Revised by: #(name)
??>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Header
Description:
-- Description:
--
++<
-- #(text)
++>
Dialect:
-- VHDL Dialect: #(dialect)
• Template —
-------------------------------------------------------------------
&(copyrights)
-------------------------------------------------------------------
&(author)
--
-------------------------------------------------------------------
&(description)
--
-------------------------------------------------------------------
&(dialect)
--
-------------------------------------------------------------------
• Match Case — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Header
Analyzed Code
--------------------------------------------------------------------
-- COPYRIGHT (c) ABC, 2009
-- The copyright to the document herein is the property of ABC.
--
-- All rights reserved.
--------------------------------------------------------------------
--
-- Author: User
-- Created: 05-01-2009 13:24
-- Revision date: 14-07-2009
--
--------------------------------------------------------------------
-- Description:
--
-- This is the top design unit of the whole design hierarchy.
-- It mainly instantiates the sub-components.
--
--------------------------------------------------------------------
-- VHDL: VHDL '93
--
--------------------------------------------------------------------
ENTITY top IS
END ENTITY top;
Violations Produced
• File header does not match the defined template. – Violation
• File header does not contain defined fields. – Violation
• + File header does not contain 'dialect' field. – Associated Violation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Statements Comments
Statements Comments
Language support: All (including SystemVerilog)
Checks the existence of comments for specific types of statements. Adding comments to the
HDL code is important for maintainability. This rule can be configured to control which
statements are to be checked and to specify the allowed locations which can have comments.
Usage
Statements Comments
Common Parameters
Applies To
Comments Location
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify the type of statements that must have comments. The default is <statements> and
<declarations>.
o <statements>
<blocks>: Always Blocks [Verilog Only], Functions, Initial Blocks [Verilog Only],
Procedures [VHDL Only], Processes [VHDL Only], Tasks [Verilog Only], VHDL
Blocks [VHDL Only]
Concurrent Assignments [VHDL Only]
Continuous Assignments [Verilog Only]
Instances [Component Instances]
o <declarations>
Constants [VHDL Only]
Internal Nets [Verilog Only – Net declarations which are not ports.]
Internal Regs [Verilog Only – Reg declarations which are not ports.]
Parameters [Verilog Only]
Ports: Block Ports, Component Ports, Entity Ports, Module Ports [In Verilog, a port
may have comments for the port name in the port list or for the port IO declaration
(see Example 1).]
Signals [VHDL Only]
Subtypes [VHDL Only]
Types [VHDL Only]
Variables [VHDL Only]
• Comments Location
Specify the allowed locations that can have a comment for a statement. It is acceptable to
have comments at “any” of the specified locations. Empty comments which do not contain
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Statements Comments
any text are not considered as actual comments. The default is Above a group of similar
statements, Above the statement and End of statement line.
o Above a group of similar statements
o Above the statement
o End of statement line
“Above a group of similar statements” indicates that a comment must appear above each
group of statements of the same type (such as concurrent assignments). A group of
statements is defined as a set of statements of the same type existing in a continuous set of
lines. The group is broken if there are blank lines or a statement of a different type. The
comment should appear above the first statement in the group (see the details below on the
parameter value “Above the statement”). This value is not applicable to the “<blocks>”
value in the “Applies To” parameter since it is recommended that each block should have a
separate comment describing it. Example of a group of similar statements broken by a blank
line:
-- Group comment of signal declarations ‘x’, ‘y’ but not ‘z’.
SIGNAL x : std_logic;
SIGNAL y : std_logic;
SIGNAL z : std_logic;
“Above the statement” indicates that a comment must appear above each statement. The
comment above a statement is defined as the continuous set of comments starting in the
preceding lines of the statement (not the same statement line). There may exist at most one
blank line between the end of this set of comments and the beginning of the statement.
Example:
-- This line is not part of signal declaration ‘x’ comment.
-- First line of comment of signal declaration ‘x’.
-- Second line of comment of signal declaration ‘x’.
SIGNAL x : std_logic;
“End of statement line” indicates that a comment must appear at the end of the last line of
the statement. This value is not applicable to the “<blocks>” value in the “Applies To”
parameter since it is recommended that block statements have comments above the
statement describing the block and not at the end of the statement. Example:
SIGNAL x : std_logic; -- End of line comment.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Statements Comments
Examples
Example 1
Check that there are comments above ports and statement blocks.
Rule Configuration
• Applies To — <blocks>, Ports
reg out1;
reg tmp;
// comment for "Temporary_Output" block
always @(in1, in2)
begin : Temporary_Output
tmp = in1 && in2;
end
// comment too far (more than one line) from "Final_Output" block
always @(tmp, in3) // Violation 3
begin : Final_Output
out1 = tmp&& in3;
end
endmodule
Violations Produced
• No comments found at specified locations for port declaration 'in1 – Violation 1
• No comments found at specified locations for port declaration 'out1' – Violation 2
• No comments found at specified locations for always block 'Final_Output' – Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Statements Comments
Note
Note the following in Example 1:
• Port “in1”: A violation is flagged. This object only has an end-of-line comment at port
IO declaration.
• Port “in2”: No violations are flagged. This object has a comment above the IO
declaration.
• Port “in3”: No violations are flagged. This object has a comment above the port name in
the ports list.
• Port “out1”: A violation is flagged. This object does not have any comments.
• Always Block “Temporary_Output”: No violations are flagged. This object has a
comment above the block.
• Always Block “Final_Output”: A violation is flagged. This object does not have a
comment (the comment line is too far from the always block).
Related Topics
File Header
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Complexity Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Complexity
FSM Complexity
Language support: All (including SystemVerilog)
Checks the maximum and/or minimum no. of FSMs/FSM states within the selected scope. This
is optionally a design-wide rule.
Note that the effects of synthesis may result in different violations from those expected from
looking purely at the code.
Usage
FSM Complexity
Common Parameters
Object
Scope
Maximum
Minimum
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Object
Specify the object to which the check applies. The default is FSMs.
o FSMs
o FSM States
• Scope
Specify the scope to which the check applies. The default is Design Unit.
o Entire Design
o Design Unit
o FSM
• Maximum
Specify the maximum number of objects allowed in the selected scope. The default is 50.
o <user-defined>
o <don’t care>
• Minimum
Specify the minimum number of objects allowed in the selected scope. The default is <don’t
care>.
o <user-defined>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Complexity
o <don’t care>
o 0
Examples
Example 1
Check for FSMs in the entire design.
Rule Configuration
• Object — FSMs
• Maximum — 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Complexity
Analyzed Code
module top (clk, rst, enb); // Violation
input clk, enb, rst;
mid1 inst1 (clk, rst, enb);
mid2 inst2 (clk, rst, enb);
mid3 inst3 (clk, rst, enb);
endmodule
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Complexity
else
casex (cst)
s0: cst <= s1;
s1: cst <= s2;
s2: cst <= s3;
default: cst <= s0;
endcase
end
endmodule
Violation Produced
Number of FSMs in entire design is 3 which violates a maximum limit of 2.
Example 2
Check for FSM states in an FSM.
Rule Configuration
• Object — FSM States
• Scope — FSM
• Maximum — 4
• Minimum — 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Complexity
Analyzed Code
module top (clk, rst, enb);
input clk, enb, rst;
mid1 inst1 (clk, rst, enb);
endmodule
Violations Produced
• Number of states in FSM with state variable 'cst' is 8 which violates a maximum limit of
4. – Violation 1
• Number of states in FSM with state variable 'nst' is 6 which violates a maximum limit of
4. – Violation 2
Related Topics
Finite State Machines (FSMs) [DesignChecker User Guide]
FSM Transitions
Number of Objects
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Nesting
Nesting
Language support: All
Checks that a specified maximum nesting depth and format for specified constructs is followed.
Controlling the nesting depth and format improves readability and reduces complexity. This is a
design-wide check.
Usage
Nesting
Common Parameters
Applies To
Maximum Nesting Level
Maximum Indentation Level
Indentation Style
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify to which construct/s the check applies. The default is `ifdef Constructs and
Sequential Statements.
o [VHDL only]
VHDL Blocks [nested VHDL blocks], Packages [nested packages eg pkgA "uses"
pkgB]
o [Verilog only]
`ifdef Constructs [nested Verilog `ifdef/`ifndef directives], Event control in tasks
[nested event control statements in a Verilog task], Conditional Operators [nested
conditional operators A?B:C]
o [Common]
If Constructs [nested if statements], Case Constructs [nested case statements], Loop
Constructs [nested loop statements], Sequential Statements [any kind of nested
sequential statements (including assignments & procedural blocks) within in any
sequential or procedural blocks], Design Hierarchy [hierarchy depth]
• Maximum Nesting Level
Specify the maximum allowed number of nested levels. Note that the second occurrence
counts as nesting level 1. The default is 3.
o <user-defined>
o <don’t care>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Nesting
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Nesting
A primary violation would be populated corresponding to the green oval (the point at which the
threshold is exceeded), and associated violations would be populated corresponding to the
orange ovals (leaf-level constructs).
Examples
Example 1
Check the nesting depth does not exceed 1.
Rule Configuration
• Language — Verilog Any
• Applies To — If Constructs
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Nesting
Analyzed Code
module nesting;
wire w1, w2, w3, w4;
always begin
if(w1) begin
if(w2) begin
if(w3) begin // Violation
if(w4) begin // Associated Violation
end
end
end
end
end
Violations Produced
• Unresolved multiple drivers detected on signal ‘a3’. – Violation
• + Multiple drivers for signal ‘a3’ assigned concurrently. – Associated Violation
Example 2
Check the nesting depth and indentation does not exceed 1.
Rule Configuration
• Language — VHDL Any
• Applies To — If Constructs
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Nesting
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity nested2 is
port (in1, in2, in3, in4 : in std_logic_vector(3 downto 0);
out1 : out std_logic_vector(3 downto 0));
end;
Violations Produced
• An if statement is indented 2 levels, which exceeds the maximum of 1 – Violation 1
• An if statement is indented 4 levels, which exceeds the maximum of 1 – Violation 2
• An if statement is indented 6 levels, which exceeds the maximum of 1 – Violation 3
• Nesting at an if statement exceeds the maximum of 1 – Violation 4
• + An if statement has 5 levels of nesting – Associated Violation 5
• An if statement is indented 8 levels, which exceeds the maximum of 1 – Violation 6
• An if statement is indented 10 levels, which exceeds the maximum of 1 – Violation 7
• An if statement is indented 12 levels, which exceeds the maximum of 1 – Violation 8
Note
Do not use too many levels of nesting in constructs to simplify HDL code.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Number of Objects
Number of Objects
Language support: All
Checks the maximum and/or minimum number of objects within a given scope. This is
optionally a design-wide check depending on the chosen parameter settings.
Usage
Number of Objects
Common Parameters
Objects
Scope
Maximum
Minimum
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Objects
Specify to which objects within the specified scope the check applies. The default is HDL
Statements.
o VHDL
Processes, Generics, ENUM Literals, Subtypes, Architectures, Entities,
Configurations, Packages, when…else Branches
o Verilog
Modules, Module Parameters, Includes [Number of `included files], Define Includes
[Number of `included files containing `define statements], References to Same
Include File [Number of references to the same include file]
o Common
HDL Lines, HDL Statements, Ports, Input Ports, Output Ports, InOut Ports, Design
Units, Case Branches
• Scope
Specify the scope to which the check applies. The default is <Design Units>,
<Subprograms>, Process, Block, Always Block and Initial Block.
o VHDL
Entity (Functional), Entity (Structural), Architecture (Functional), Architecture
(Structural), Configuration, Component, Package Header, Package Body, Process,
Function, Procedure, Block, Enumerated Type, Conditional Signal Assignment
o Verilog
Module (Functional), Module (Structural), Always Block, Initial Block, Task
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Number of Objects
o Common
Entire Design, <Design Units>, <Subprograms>, File, FSM, Case Statement
• Maximum
Specify the maximum allowed number of specified objects within the specified scope. The
default is 50.
o <user-defined>
o <don’t care>
• Minimum
Specify the minimum allowed number of specified objects within the specified scope. The
default is <don’t care>.
o <don’t care>
o 0
Note
Selecting a value in the Objects parameter updates the possible values of the Scope
parameter with values applicable to the selected objects.
Examples
Example 1
ENTITY uart_top IS
PORT(
-- 3-bit address bus
addr : IN std_logic_vector (2 DOWNTO 0);
clk : IN std_logic;
cs : IN std_logic;
datin : IN std_logic_vector (7 DOWNTO 0);
nrw : IN std_logic;
rst : IN std_logic;
sin : IN std_logic;
datout : OUT std_logic_vector (7 DOWNTO 0); -
int : OUT std_logic;
sout : OUT std_logic
);
Violation Produced
Entity “uart_top” has 7 input ports which exceeds a maximum of 4
Example 2
Check the minimum number of objects within a Case Statement.
Rule Configuration
• Language — Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Number of Objects
• Minimum — 7
Analyzed Code
module fsm18 (clk);
input clk;
parameter [2:0] s0 = 3'h0, s1 = 3'h1, s2 = 3'h2, s3 = 3'h3,
s4 = 3'h4, s5 = 3'h5, s6 = 3'h6, s7 = 3'h7;
reg [2:0] cst;
Violation Produced
Case statement has 4 case branches which falls below the minimum limit of 7.
Example 3
Check the maximum/minimum number of objects within a Conditional Signal Assignment.
Rule Configuration
• Language — VHDL
• Maximum — 5
• Minimum — 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Number of Objects
Analyzed Code
LIBRARY IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.Numeric_Std.all;
ENTITY top IS
PORT (data_out : out std_ulogic_vector(7 downto 0));
END top;
ARCHITECTURE arch OF top IS
SIGNAL next_state_s : integer range 1 to 8;
BEGIN
data_out <= "00000001" when (next_state_s = 1) else --Violation
"00000011" when (next_state_s = 2) else
"00000111" when (next_state_s = 3) else
"00001111" when (next_state_s = 4) else
"00011111" when (next_state_s = 5) else
"00111111" when (next_state_s = 6) else
"01111111" when (next_state_s = 7) else
"11111111";
END arch;
Violation Produced
Conditional signal assignment has 8 branches which exceeds the maximum 5.
Note
Number of objects should not exceed the recommended maximum for a given scope.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Type Conversion
Type Conversion
Language support: All
Checks the maximum number of type conversions within a given scope, and makes sure they
adhere to a specified format.
Usage
Type Conversion
Common Parameters
Scope
Applies To
Name Pattern
Maximum
Allowed Forms
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Scope
Specify the scope to which the check applies. The default is <Design Units>.
o <Design Units>
Architecture (Functional), Architecture (Structural), Entity (Functional), Entity
(Structural), Module (Functional), Module (Structural), Package body, Package
header
o <Subprograms>
Function, Procedure, Task
o <Blocks>
Always Block, Block, Generate, Initial Block, Process
• Applies To
Specify whether the check applies to declarations of Type Conversion Functions or
references (calls) to Type Conversion Functions. The default is References.
o Declarations [Type Conversion Function declarations]
o References [Calls to Type Conversion Functions]
Note
Type conversion declarations and references should not exceed the recommended
maximum for a given scope.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Type Conversion
• Name Pattern
Specify naming patterns for type conversion functions and/or type conversion expressions.
The naming pattern can be specified in any of the following formats
a. <library>.<package>.<conversion regular expression>
b. <package>.<conversion regular expression>
c. <conversion regular expression>
The default is \\$rtoi, \\$itor, \\$realtobits, \\$bitstoreal, ^TO_ and ^CONV_.
o <IEEE NUMERIC_STD Conversions>
o <IEEE NUMERIC_SIGNED Conversions>
o <IEEE NUMERIC_UNSIGNED Conversions>
o <IEEE STD_LOGIC_1164 Conversions>
o <IEEE STD_LOGIC_ARITH Conversions>
o <IEEE STD_LOGIC_SIGNED Conversions>
o <IEEE STD_LOGIC_UNSIGNED Conversions>
o \\$rtoi
o \\$itor
o \\$realtobits
o \\$bitstoreal
o ^TO_
o ^CONV_
o <user-defined>
• Maximum
Optionally specify the maximum allowed number of type conversion functions within the
specified scope. The default is <don’t care>.
o <don’t care>
o 0
• Allowed Forms
Optionally check if the Type Conversion is performed in a single, separate assignment eg
conv_val <= to_integer(val). The default is Isolated in a Single Assignment.
o <don’t care>
o Isolated in a Single Assignment
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Type Conversion
Note
Expected Violations:
• The number of referenced type conversions inside architecture "rtl" is 5, which
exceeds a maximum of 2.
• Type conversion "TO_INTEGER" is not isolated within a single assignment
statement.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Condition Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Logical and Bitwise Operators
Violation Produced
Do not use "bitwise" operators: "&" in "conditions"
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Non-Unrollable Loops
Non-Unrollable Loops
Language support: All (including SystemVerilog)
Checks for the usage of non-unrollable loops, since they are not synthesizable. Synthesis tools
typically unroll loops to a limit, and if the loop is still not terminated, it is considered to be non-
unrollable. For DesignChecker, this limit is 5000 iterations.
Note that the effects of synthesis may result in different violations from those expected from
looking purely at the code.
Usage
Non-Unrollable Loops
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for the usage of non-unrollable For loops.
Rule Configuration
Default parameter values.
Analyzed Code
module nonunroll(output reg [255:0] local1, local2,
input [31:0] in1, in2, input [255:0] data);
reg [31:0] index;
integer j, k;
Violation Produced
Loop is non-unrollable.
Related Topics
Design Correctness and Synthesizability [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Scalar Conditions
Scalar Conditions
Language support: Verilog Any (including SystemVerilog)
Checks that all Verilog scalar conditions (if, for, while, ternary operator, etc.) result in a 1-bit
value allowing them to be treated as Boolean, thus simplifying the condition expression. For
example “if(cs && ena)”.
Usage
Scalar Conditions
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Checks for non-scalar conditions.
Rule Configuration
Default parameter values.
Analyzed Code
module test;
logic out;
logic clk;
class myclass;
logic a;
logic b;
endclass
myclass cond1;
typedef struct packed {
bit a;
logic b;
}mystructType;
mystructType cond2;
always @(posedge clk)
if(cond1) // Violation 1
out = cond2 ? 4 : 5; // Violation 2
endmodule
Violations Produced
• Condition "cond1" must be an expression that results in a 1-bit value. – Violation 1
• Condition "cond2" must be an expression that results in a 1-bit value. – Violation 2
Example 2
Checks for non-scalar conditions.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Scalar Conditions
Rule Configuration
Default parameter values.
Analyzed Code
program test;
logic inp;
integer out;
initial begin
if(myfunction(inp)) // Violation
out = 2;
end
endprogram
Violation Produced
Condition "myfunction(inp)" must be an expression that results in a 1-bit value.
Related Topics
Allowed Operators
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Configuration Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Configurations
VHDL Configurations
Language support: VHDL Any
Checks a number of aspects of the coding style used for VHDL Configurations. The parameters
allow the tool to check in which circumstances a configuration should be used, whether to use
in-line specifications or separate declarations and whether generics should be mapped within
the configuration. This is a design-wide check.
Usage
VHDL Configurations
Common Parameters
Required
Default Binding
Style
Map Generics
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Required
Specify under which circumstances a Configuration is required. The default is Only If > 1
Architecture.
o Always
o Only If > 1 Architecture
o <don’t care>
• Default Binding
Specify is default binding is allowed. The default is Allowed For Gate Level Only.
o Not Allowed
o Allowed For Gate Level Only
o <don't care>
• Style
Specify which style of configuration to use. The default is Configuration Declaration.
o In-Line Specification
o Configuration Declaration
o <don't care>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Configurations
• Map Generics
Specify if Generics should be mapped within the configuration. The default is Always.
o Always
o <don't care>
Examples
Example 1
configuration top_cfg of top_entity is
for rtl
-- Separate specification used to configure components inside
-- architecture “rtl” instead of “inline” configuration
end for;
end top_cfg;
Violations Produced
• Mapped Generics
Entity "mydesign" has generics: "delay1, delay2", that are not mapped within the
configuration specification of "inst1: mydesign_comp"
[+] Associated Messages:
Entity "mydesign" bound to component "mydesign_comp""
• Embedded vs Separate Configuration
Embedded" specification used to configure components inside architecture "rtl" instead
of "separate configuration"
• Configuration Required for Multiple Architectures
No configuration created for the multi-architecture entity "top"
• Default Configuration
Component Instantiation "inst1: comp" has no primary binding indication, default
binding will be applied
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Dead Logic Base Rules
Reachability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Undriven and Unused Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Reachability
Reachability
Language support: All (including SystemVerilog)
Checks for any blocks of code which are unreachable in a design unit. The check is based on all
instantiations of the module in the design. Any block of code which can be potentially reached
for any of the instantiations of the module will not be reported.
The rule can optionally ignore unreachable defaults of a case statement wherein all possibilities
have been explicitly covered. The rule can also report IF statement conditions that are always
true.
Note that the effects of synthesis may result in different violations from those expected from
looking purely at the code.
Usage
Reachability
Common Parameters
Detect
Ignore
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Detect
Specify which of the reachability checks to perform. The default is Unreachable Blocks.
o Always True Conditions
o Always True Sub-Conditions
o Unreachable Blocks
• Ignore
Specify the types of unreachable blocks to ignore. The default is <none>.
o Unreachable others/default when all case choices are covered
o Unreachable others/default altogether
o <none>
Examples
Example 1
Check for unreachable blocks in parameterized modules.
Rule Configuration
• Detect — Unreachable Blocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Reachability
• Ignore — <none>
Analyzed Code
module top (input [3:0] in1, in2, input sel1, sel2, output [3:0] out1,
out2);
middle #(.p1(3)) inst1 (in1, sel1, out1);
middle #(.p1(5)) inst2 (in2, sel2, out2);
endmodule
module middle (input [3:0] in1, input sel, output reg [3:0] out1);
parameter p1 = 0;
always @(in1 or sel)
begin
if(sel)
out1 = 4’b0000;
else if(p1 == 5) // Reachable within inst2
out1 = 4’b1010;
else if (p1 > 2)
out1 = in1;
else
out1 = 4’b1111; // Violation - Unreachable across all instances
of middle
end
endmodule
Violation Produced
Block of code is unreachable in design.
Example 2
Check for always true if conditions.
Rule Configuration
• Detect — Always True Conditions
• Ignore — <none>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Reachability
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY Reachability_AlwaysTrue IS
PORT(in1 : IN std_logic;
sel : IN std_logic;
out1 : OUT std_logic);
END ENTITY Reachability_AlwaysTrue;
--
ARCHITECTURE arch OF Reachability_AlwaysTrue IS
BEGIN
PROCESS
BEGIN
IF sel <= '1' THEN -- violation
out1<= in1;
ELSE
out1 <= NOT in1;
END IF;
END PROCESS;
END ARCHITECTURE arch;
Violation Produced
Condition is always true.
Example 3
Check for always true if sub-conditions
Rule Configuration
• Detect — Always True Sub-Conditions
• Ignore — <none>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Reachability
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY Reachability_SubCond IS
PORT(in1 : IN std_logic;
in2 : IN std_logic;
out1 : OUT std_logic);
END ENTITY Reachability_SubCond;
--
ARCHITECTURE arch OF Reachability_SubCond IS
BEGIN
PROCESS
BEGIN
IF (in1 = '0' AND in2 >= '0') THEN -- violation
out1<= '0';
ELSE
out1 <= '1';
END IF;
END PROCESS;
END ARCHITECTURE arch;
Violation Produced
Expression "(in2>='0')" is always true.
Related Topics
Miscellaneous [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Undriven and Unused Logic
Rule Configuration
• Language — Verilog Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Undriven and Unused Logic
Analyzed Code
module Unused1 (input wire [3:0] in1, input clk, rst, output reg [3:0]
out1, output out2);
reg hanging1, hanging2;
reg reg0, reg1, reg2, reg3, reg4, reg5, reg6;
wire hanging3; // Violation 8
always@(posedge clk)
begin
if (rst)
reg0 <= 0;
else
reg0 <= in1[0];
end
always@(posedge clk)
begin
if (rst)
reg1 <= 0;
else
reg1 <= in1[1];
end
always@(posedge clk)
begin
if (rst)
reg2 <= 0;
else
reg2 <= in1[2];
end
always@(posedge clk)
begin
if (rst)
reg3 <= 0;
else
reg3 <= in1[3];
end
always@(*)
begin
hanging1 <= reg4 & reg5; // Violation 1
hanging2 <= ~reg6; // Violation 4
end
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Undriven and Unused Logic
else
reg6 <= reg4 | reg5;
end
always@(posedge clk)
begin
out1[0] <= reg0;
out1[1] <= reg1;
out1[2] <= reg2;
out1[3] <= reg3;
end
endmodule
Violations Produced
• Net 'hanging1' is unused. – Violation 1
• + Logic driving 'reg4' is unused. – Associated Violation 2
• + Logic driving 'reg5' is unused. – Associated Violation 3
• Net 'hanging2' is unused. – Violation 4
• + Logic driving 'reg6' is unused. – Associated Violation 5
• + Logic driving 'reg4' is unused. – Associated Violation 6
• + Logic driving 'reg5' is unused. – Associated Violation 7
• Net ‘hanging3’ is undriven. – Violation 8
Note
The violations produced do not point to the declarations of unused signals, but rather point
to the location where these signals are driven. As shown in Example 1, for registers, the
location where the signal is driven is that of its corresponding always block.
Example 2
Another example is illustrated in the following figure.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Undriven and Unused Logic
As seen from the figure above, n1 and n2 are not used in the design and hence constitute unused
logic violations. Moreover, the registers in red are only feeding nets which are unused, and
consequently those registers are unused as well. These are reported as associated violations.
However, the other registers are used since they drive output Z and hence they are not reported,
even though they also drive unused logic n1 and n2.
Example 3
This example illustrates the rule behavior when the “Check Partial Buses” parameter is set to
“No”.
Rule Configuration
• Language — Verilog Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Undriven and Unused Logic
Analyzed Code
module partialuul (input [3:0] in1, in2, input clk, reset, // Violation 1
output reg [3:0] out1, out2); // Violation 2
always @(posedge clk or posedge reset)
begin
if(reset)
begin
out1[1:0]<= 2'b00; // Out1 is partially driven, hence no violation
for out1
end
else
begin
out1[1:0] <= in1[1:0]; // in1 is partially used, hence no violation
for in1
end
end
endmodule
Violations Produced
• Net 'in2' is unused. – Violation 1
• Net 'out2' is undriven. – Violation 2
Related Topics
Miscellaneous [DesignChecker User Guide]
Unused Declarations
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Declarations Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Bad VHDL Type Usage
Violation Produced
Various
Note
Types should be used in a safe way.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Class Members Existence
Rule Configuration
• Applies To (base class) — uvm_monitor
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Class Members Existence
Analyzed Code
package class_members_existence_pkg;
import uvm_pkg::*;
class My_Analysis_Port extends uvm_analysis_port;
// ...
endclass
module class_members_existence();
import class_members_existence_pkg::*;
// ...
endmodule
Violation Produced
Class 'ma_monitor_base' does not have a member of type 'uvm_analysis_port' – Violation 1
Related Topics
Class Methods Existence
Class Members Visibility
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Class Members Visibility
Rule Configuration
• Applies To (base class) — uvm_agent
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Class Members Visibility
module class_members_visibility();
import class_members_visibility_pkg::*;
// ...
endmodule
Violation Produced
Class 'ma_agent' must not provide public visibility for 'req_ap' data member – Violation 1
Related Topics
Class Members Existence
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Class Methods Existence
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Class Methods Existence
Rule Configuration
• Applies To (base class) — uvm_driver
• Methods — build
module class_methods_existence();
import class_methods_existence_pkg::*;
// ...
endmodule
Violation Produced
Class 'ma_driver_bad' does not have 'build' method defined – Violation 1
Related Topics
Class Members Existence
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Entity Declarations
Entity Declarations
Language support: VHDL
Checks that there are no declarations in the entity's declarative region. An entity may have many
types of declarations, like signals, constants, shared variables, functions, procedures, …
The rule violates on the entity if it has any type of declaration except attributes. Only ports,
generics and attributes are allowed in the entity declarative region.
Usage
Entity Declarations
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check the existence of any declaration in the entity.
Rule Configuration
Default parameter values.
Analyzed Code
ENTITY entity_having_decls IS -- VIOLATION 1
FUNCTION func RETURN bit;
TYPE enum IS (e0, e1, e2);
END entity_having_decls;
Violation Produced
Entity "entity_having_decls" has declarations – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Explicit Net Declarations
Violation Produced
Implicit net declaration is enforced for "x"
Note
Declare all nets explicitly.
Related Topics
Verilog Statement Order
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Hard Coded Numeric Values
• 0 to/downto/: 0
• 1 to/downto/: 0
• 1 to/downto/: 1
• 1/0 to/: <constant>
• <constant> downto/: 0/1
• <constant_1> to/downto/: <constant_2>
The check also applies to all types of VHDL & Verilog loops: for, while & repeat loops.
• VHDL “for” loops are checked for hardcoded ranges if the “Hard Coded Values”
parameter is set to “Ranges” and the “Apply to” parameter is set to "Variables".
• Verilog “for” loop, Verilog & VHDL “while” loop and Verilog “repeat” loop
conditions/expressions are checked if the “Hard Coded Values” parameter is set to
"Operands".
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Hard Coded Values
Specify which aspects should be checked. The default is Operands and Ranges.
o Operands: [Multi-value vector assignment values e.g. “101”]
o Ranges: [Ranges or Vector bounds eg [7:0] or (7 downto 0)]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Hard Coded Numeric Values
Violations Produced
• Bounds:
Avoid using hard coded numeric values such as “(15 downto 0)” for declaring ranges of
the multi-bus test
• Assignments:
Avoid using hard coded numeric values such as “10” for literals used in assignment
expressions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Hard Coded Numeric Values
Note
Avoid using hard coded numeric values in assignment constant values or in vector
dimensions.
Related Topics
Numeric Width Declarations
Vector Assignment
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Interface List
Interface List
Language support: VHDL Any
Checks a variety of interface lists (for example, Entity Port List, Component Generic List,
Procedure Parameters, and so on) to ensure the IO modes and/or Object Categories (for
example, signal, variable, constant, and so on) are specified.
Usage
Interface List
Common Parameters
Interface Element
Applies To
Action
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Interface Element
Specify which aspect/s should be checked.The default is IO Mode.
o IO Mode
o Object Category
• Applies To
Specify to which interface list type/s the check should apply. The default is All.
o Entity Port Lists
o Entity Generic Lists
o Component Port Lists
o Component Generic Lists
o Procedure Parameters
o Function Parameters
o Function Generic Lists
o Procedure Generic Lists
• Action
Specify the required check.The default is Explicitly Specify.
o Explicitly Specify
o Exclude (Omit)
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Interface List
Examples
Example 1
Analyzed Code
function arch_func
(
signal a,b:in std_logic;
c : in std_logic;
-- Object category of parameter "c" of function "arch_func"
-- interface list must be explicitly specified
signal f: std_logic
-- The IO mode of parameter "f" in function "arch_func"
-- interface list must be explicitly specified
) return natural is
begin
end function;
Example 2
Rule Configuration
• Interface Element — IO Mode, Object Category
Example 3
Rule Configuration
• Interface Element — IO Mode, Object Category
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Interface List
Analyzed Code
entity top is port
(
signal my_port : bit
-- Object category of port “my_port”, in entity top interface list must
be omitted
clk : IN std_logic;
-- IO Mode of port “clk”, in entity top interface list must be omitted
); end top;
Violations Produced
• The category of parameter "c" of function "arch_func" is not explicitly specified.
• The IO mode of parameter "e" of function "process_func" is not explicitly specified.
Note
Ensure the sub-program parameters category and IO mode are specified.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Numeric Width Declarations
Violation Produced
Use numeric values when specifying width of port “write_ptr”.
Note
Use numeric width values when specifying declaring objects.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Numeric Width Declarations
Related Topics
Hard Coded Numeric Values
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Undefined Design Units
Analyzed Code
module undefinst(input in1, in2, clk, output out1);
undefinedmod inst (.in1(in1), .in2(in2), .clk(clk), .output1(out1)); //
Violation
endmodule;
Violation Produced
Design unit 'undefinedmod' is undefined
Example 2
Check for undefined design units (VHDL).
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Undefined Design Units
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity undefinst2 is
port (in1, in2, clk : in std_logic; out1 : out std_logic);
end;
begin
inst : nodef port map (in1 => in1, in2 => in2, clk => clk, out1 =>
out1); -- Violation
end;
Violation Produced
Design unit 'nodef' is undefined
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unused Declarations
Unused Declarations
Language support: All
Checks for objects which have been declared but are never actually used either by being
assigned values or read. This is a design-wide check.
It should be noted that this rule does not consider unused signals in packages, that is, no
violations will be raised in such cases. Note that the effects of synthesis may result in different
violations from those expected from looking purely at the code.
Usage
Unused Declarations
Common Parameters
Detect
Consider Identifier Slices
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Detect
Specify which objects should be checked. The default is All.
o Identifiers: Read but not Written
o Identifiers: Written but not Read
o Identifiers: Neither Read nor Written
o Generics: Not Used
o Functions: Not Called
o Procedures: Not Called
o Tasks: Not Called
o Libraries: Not Used
o Constants: Not Used
o Parameters: Not Used
o genvar Declarations: Not Used
Note
“Identifiers” refer to signals, variables, ports and nets only. Further note that
identifiers of non-RTL types like TIME are not violated for.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unused Declarations
Note
If any portion of the signal is written or read, the entire signal will be considered
written or read. This is applicable only when you select “No”.
Examples
Example 1
Check for unread/unwritten identifiers.
Rule Configuration
• Detect — Identifiers: Read but not Written, Identifiers: Written but not Read,
Identifiers: Neither Read nor Written
ENTITY unuseddecl IS
PORT (in1 : IN std_logic_vector (3 DOWNTO 0); -- Violation 1
out1, out2 : OUT std_logic_vector(3 DOWNTO 0)); -- Violation 2, 3
END;
Violations Produced
• Input port 'in1(3 downto 1)' is never used (read from) in architecture unuseddecl of
unuseddecl. – Violation 1
• Output port 'out1(2 downto 0)' is never assigned (written to) in architecture unuseddecl
of unuseddecl. – Violation 2
• Output port 'out2' is never assigned (written to) in architecture unuseddecl of
unuseddecl. – Violation 3
• Signal 'temp1' is never used (read from) in architecture unuseddecl of unuseddecl. –
Violation 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unused Declarations
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Verilog Constant Style
Violation Produced
Use parameters instead of text macros(`define) for the symbolic constant definition "A"
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Deferred Constants
Analyzed Code
package pkg is
procedure DW_max(L, R: bit);
constant MaxTimerVal:integer; – Violation
end pkg;
use work.all;
use work.pkg.all;
entity bottom is
port (i1, i2: in BIT;
o1: out BIT);
begin end;
Violation Produced
Found deferred constant ‘MaxTimerVal’.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Directive Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Verilog `define Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Verilog `define Style
Examples
Violations Produced
• Redefined Macro: Macro redefinition. Macro "MAXIMUM" previously assigned to
"old_value".
• Undefined Macro: Macro has subsequent redefinitions. Macro "B" should be undefined
using ‘undef within its "file/module" scope.
Note
Verilog macros should not be redefined and should preferably be undefined in the same
module.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Verilog `timescale Style
Note
Parameter Checks:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Verilog `timescale Style
Examples
Violation Produced
Timescale Directive: Use `timescale “<string>” instead of `timescale “<string>” for defining
timescale compiler directive
Note
Include a consistent `timescale directive before each module declaration.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Coding Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Coding Style
• Output Style
Optionally specify the required state machine type. The default is Moore.
o Mealy
o Moore
o Mixed
o <don’t care>
Examples
Example 1
Check whether the FSM is coded using a single clocked process and whether it is a Moore
machine.
Rule Configuration
• Coding Style — Single Clocked Process Only
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Coding Style
Analyzed Code
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity test01 is
generic ( S0: INTEGER range 0 to 3:= 0;
S1: INTEGER range 0 to 3:= 1;
S2: INTEGER range 0 to 3:= 2;
S3: INTEGER range 0 to 3:= 3);
port (CLOCK, RESET : in STD_LOGIC;
A, B, C, D, E: in BOOLEAN;
SINGLE, MULTI, CONTIG: out BOOLEAN);
end test01;
Violations Produced
• FSM is not of type Moore. – Violation 1
• FSM is not coded using Single Clocked Process. – Violation 2
Related Topics
Finite State Machines (FSMs) [DesignChecker User Guide]
FSM State Encoding Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Coding Style
FSM Transitions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM State Encoding Style
For Verilog, “Enumeration” is similar to “Parameter” but refers to the use of the “enum”
pragma in the Parameter definition. For example:
parameter [1:0] // pragma enum current_state_code gray
idle = 2'd0 ,
reading_from_reg = 2'd1 ,
clearing_flags = 2'd2 ;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM State Encoding Style
For SystemVerilog, “Enumeration” refers to the enumerated data type. For example:
enum {RED, YELLOW, GREEN} cs;
Examples
Example 1
Checks for state encoding using “Parameters” in Verilog.
Rule Configuration
• State Encoding Style — Parameter
Analyzed Code
module fsm1 (input [3:0] in1, input clk, rst, output reg [3:0] out1);
parameter S0 = 4'b0001;
parameter S1 = 4'b0010;
parameter S2 = 4'b0100;
parameter S3 = 4'b1000;
Violation Produced
FSM states should not be Hardcoded.
Related Topics
Finite State Machines (FSMs) [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM State Encoding Style
FSM Transitions
FSM Coding Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Transitions
FSM Transitions
Language support: All (including SystemVerilog)
Checks for unreachable/dead-end states in finite state machines (FSM) and also detects whether
the FSM has a reset state and default handling.
Usage
FSM Transitions
Common Parameters
Detect
State Variables
Description
This rule detects unreachable states (states without any incoming transitions) and dead-end
states (states without any outgoing transitions) in FSMs (see below for more details).
The rule can also check if there is a default handling for the FSM, based on the size of the state
variable. It should be noted that a violation for default handling will not appear for a state
variable of size n if all the 2^n choices for the state variable are covered or if there is a default
branch. This rule also checks if there is a well-defined reset state for initializing the FSM.
The following explains how the tool infers FSM transitions and externally reachable states:
1. SM transition:
An FSM transition is characterized by a definite pair of states (s0, s1), where s0 is said to
have an outgoing transition to s1 (and correspondingly s1 an incoming transition from
s0), if and only if the state transition to s1 happens under the condition that the current
state is s0 and s0 != s1. The following code snippet is an example where a transition
from s0 to s1 takes place:
if (state == s0)
if (condition)
state <= s1;
A reset state is also an externally reachable state. The tool does not consider any state in an FSM
to have an outgoing transition to an externally reachable state unless there is an explicit
transition to that state as outlined in point 1 (above). State reachability analysis starts from an
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Transitions
externally reachable state and in the absence of such a state, all the states of the FSM will be
reported as unreachable.
Note
The effects of synthesis may result in different violations from those expected from looking
purely at the code.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Detect
Specify which types of transitions should be checked. The default is Transitions Without
Default Handling, States Without Incoming Transitions and States Without Outgoing
Transitions.
o Transitions Without Default Handling
o States Without Incoming Transitions
o States Without Outgoing Transitions
o <don’t care>
• State Variables
Specify whether the state variable has a specific reset value. The default is Reset to Known
State.
o Reset to Known State
o <don’t care>
Examples
Example 1
Check for transitions without incoming/outgoing transitions and without default handling.
Rule Configuration
• Detect — Transitions Without Default Handling, States Without Incoming Transitions,
States Without Outgoing Transitions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Transitions
Analyzed Code
module dut (clk, rst, a, b, p);
input clk;
input rst;
input a, b;
output p;
reg p;
Violations Produced
• FSM does not have a default handling for transitions. – Violation 1
• The state 'ST3' of FSM state variable 'state_0' has no incoming transitions. – Violation 2
• The state 'ST4' of FSM state variable 'state_0' has no outgoing transitions. – Violation 3
Related Topics
Finite State Machines (FSMs) [DesignChecker User Guide]
FSM State Encoding Style
FSM Coding Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Gates Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock Buffers
Clock Buffers
Language support: All
Checks that clock signals have not been explicitly buffered/inverted in the source code. This is a
design-wide check.
Usage
Clock Buffers
Common Parameters
Description
This rule points to only one use of the buffered/inverted signal as a clock, even though the
buffered/inverted clock may be used in multiple different registers through the design hierarchy.
In case of use of multiple buffers/inverters for a clock signal, only the one nearest to the use will
be violated for.
This rule checks for buffers/inverters inserted in the clock tree prior to its use as clock. Please
refer to figure 1 below.
In case the buffering of the clock signal and its use occurs in different design units,
DesignChecker points to the instance whose port is driven by the buffered clock.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock Buffers
For example, in the figure on the left below, since the port driven by the buffer is an input,
hence the buffer would have to be searched in the instantiating design unit. In this case, the
register representing the usage would be present inside the hierarchy of this instance.
Similarly, in the figure on the right, the port driven by the buffer is an output port, and hence the
buffer has to be searched in the master of the instance. In this case, the register representing the
usage would be present inside the hierarchy of the instantiating design unit.
The red arrow represents the clock port referred to in the violation message.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Clock buffering in single design unit.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock Buffers
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity clockbuffer1 is
port (in1 : in std_logic_vector(3 downto 0);
clk, reset : in std_logic;
out1 : out std_logic_vector(3 downto 0));
end;
Violations Produced
• Clock signal 'clk' is buffered/inverted. – Primary Violation 1
• + Clock 'clk_buf' of register 'out1' is buffered/inverted. – Associated Violation 2
Example 2
Design-wide clock buffering.
Analyzed Code
module clockbuffer2 (input [3:0] in1, input clk, reset, output [3:0]
out1);
wire clk_inv;
assign clk_inv = ~clk; // Clock buffer is the driver of the clock port in
violation message
ff inst1 (.clk(clk_inv), .reset(reset), .in1(in1), .out1(out1)); //
Primary violation 1
endmodule
module ff (input [3:0] in1, input clk, reset, output reg [3:0] out1);
always @(posedge clk or posedge reset) // Associated violation 2
begin
if(reset)
out1<= 4'b0000;
else
out1 <= in1;
end
endmodule
Violations Produced
• Clock port 'clockbuffer2.inst1.clk' is buffered/inverted. – Primary Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock Buffers
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Gate Level Instances
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Gate Level Instances
Note
The parameter value “Allow if isolated in separate modules” applies only to gate-
level components and not to Primitives/UDPs. The latter will always be violated for
irrespective of whether they are isolated or not.
Isolation means that one or more gate-level components are instantiated inside a “wrapper”
module. A wrapper module is characterized by the following:
o It is composed of gate-level instances and wrappers only i.e. it does not contain any
non-gate-level instances.
o All outputs of the wrapper are driven by the outputs of wrappers/gate-level instances
i.e. there is no combinational logic at the output of the wrapper. However, logic is
permitted at the inputs of the wrapper and between components of the wrapper.
Examples
Example 1
Checking for non-isolated gate-level instances in the design.
Rule Configuration
• Logic Type — work.gate_comp_pkg.all
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Gate Level Instances
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
package gate_comp_pkg is
component gate_inst is
port (in1 : in std_logic; out1 : out std_logic);
end component;
end package;
library ieee;
use ieee.std_logic_1164.all;
use work.gate_comp_pkg.all;
entity top is
port (in1, in2 : std_logic; out1, out2, out3 : out std_logic);
end;
begin
disallowed_inst : gate_inst port map (in1, out1); -- Violation 1
wrapper_inst : wrapper port map (in2, out2);
out3<= in1 and in2;
end;
library ieee;
use ieee.std_logic_1164.all;
use work.gate_comp_pkg.all;
entity wrapper is
port (in1 : std_logic; out1 : out std_logic);
end;
Violation Produced
Encountered non-isolated gate instance 'disallowed_inst' bound to component 'gate_inst' –
Violation 1
Related Topics
Structural Core
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Hierarchy Base Rules
Feedthrough . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Re-entrant Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Snake Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Feedthrough
Feedthrough
Language support: All (including SystemVerilog)
Check for feedthroughs in the design.
Usage
Feedthrough
Common Parameters
Description
A feedthrough occurs when an output of a module is exactly the same as an input. This is a
design-wide check since input-to-output path may pass through instances. Here the longest
feedthrough path is reported as the primary violation and in the associated violations
intermediate points are reported. For example, in the following design:
There is a feedthrough path from port 'b' to port 'e' in design unit 'Mid' and there is a smaller
feedthrough path from port 'c' to port 'd' in design unit 'Bot'. But the smaller feedthrough is
actually just a part of the longer feedthrough path. Hence in the primary violation feedthrough
path from port 'b' to port 'e' is reported and in associated violations points corresponding to ports
'c' and 'd' are reported.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Checking for feedthrough paths in designs.
Rule Configuration
• Language — Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Feedthrough
Analyzed Code
library IEEE;
use IEEE.std_logic_1164.all;
use work.all;
entity test04 is
port(
inp11 : in BIT; -- Violation 1
op11 : out BIT
);
end test04;
Verilog file
Violations Produced
• Feedthrough detected from input port 'inp11' to output port 'op11' in top design unit
'test04' – Violation 1
• Feedthrough passes through port 'test04.inst1.inp21' – Associated Violation 2
• Feedthrough passes through port 'test04.inst1.inst1.inp41' – Associated Violation 3
• Feedthrough passes through port 'test04.inst1.inst1.op41' – Associated Violation 4
• Feedthrough passes through port 'test04.inst1.op21' – Associated Violation 5
Example 2
Intermediate combinational logic in a feedthrough path.
Rule Configuration
• Language — Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Feedthrough
Analyzed Code
module top (input a, d, output reg b, c); // violation 1
assign b = a;
assign c = ~d;
endmodule;
Violation Produced
Feedthrough detected from input port 'a' to output port 'b' in top design unit 'top' – Violation 1
Note
Since there was an inverter (considered as combinational element) in path from 'c' to 'd' is
not being inferred as feedthrough.
Related Topics
Allowed Implied Logic
Re-entrant Outputs
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Re-entrant Outputs
Re-entrant Outputs
Language support: All (including SystemVerilog)
Checks for the output of an instance being connected to an input of the same instance, either
directly or through the hierarchy. A connection which involves only buffers/inverters is
considered to be direct. If the output is coming back to the same instance as an input,
potentially, the output port and/or the input port may not be required at all.
Usage
Re-entrant Outputs
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for a re-entrant output spanning multiple modules.
Rule Configuration
Default parameter values.
Analyzed Code
module test2 (input a, output f, f1);
middle inst1 (a, f);
middle inst2 (a, f1);
endmodule
Violations Produced
• Output ‘middle.inst.c’ is re-entrant through input ‘middle.inst.d’ – Violation
• + Re-entrant output passes through middle.inst.d. – Associated Violation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Re-entrant Outputs
Example 2
Another example is represented by the figure below:
In this example, the primary violation will point to the instance bottom_module where the
output is coming back as an input (specified by red circles). The associated violations point to
the multiple ports through which the re-entrant path passes through top_module and
middle_module1 (specified by green circles). There is a smaller re-entrant output in
middle_module2, but since it is a subset of the longer re-entrant path, it will not be reported.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Snake Paths
Snake Paths
Language support: All (including SystemVerilog)
Checks for the presence of combinational paths longer than a limit which can be specified by
the user. It is difficult for timing optimizers to optimize the critical path of a design, if it spans
multiple levels of hierarchy. This rule checks for the presence of long combinational paths, also
called snake paths, so that the user may break the path at an appropriate point by inserting
registers.
The user can set the maximum levels of permissible user hierarchy that a path can span. Any
path longer than this will be reported. Note that the effects of synthesis may result in different
violations from those expected from looking purely at the code.
Usage
Snake Paths
Common Parameters
Max. Allowed Hierarchy Levels
Treat Latches as Registers
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Max. Allowed Hierarchy Levels
Specify a positive integer that indicates the levels of combinational hierarchical crossings
which, if exceeded, would result in a snake path violation. The default is 10.
• Treat Latches as Registers
This parameter indicates whether latches should be treated as registers or not. If this
parameter is set to “Yes”, paths will terminate on encountering a latch since it is treated as a
register; if set to “No”, it will go beyond the latch. The default is Yes.
Note
The tool does not detect snake paths through combinational logic which is unused. For the
reporting of snake paths, the tool only considers combinational logic that eventually drives a
top-level design unit output port, register, memory, latch or tri-state. This behavior ensures that
a violation is not reported for combinational logic that is supposed to get optimized out because
it does not impact the design. However, the tool preserves all sequential elements and reports
snake paths through combinational logic that drives them.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Snake Paths
Examples
Example 1
The figure below illustrates an example of snake paths. It should be noted that an increment in
the level implies the following:
A path is defined as a unique set of combinatorial elements and end-points. In the figure above,
there are 8 different paths. The figure illustrates how B > C1 > C3 > C4 > C5 > Y and B > C2 >
C5 > Y constitute 2 different paths even though the end-points of both are the same.
It is important to note that in case the selected policy contains multiple configured snake path
rules with conflicting configurations, DesignChecker selects the lowest level of hierarchy and
considers latches as non-combinational elements (which means that the path terminates on
encountering a latch). The check will be then performed based on this configuration.
Example 2
Check for snake paths longer than or equal to 4 levels.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Snake Paths
Rule Configuration
• Max. Allowed Hierarchy Levels — 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Snake Paths
Analyzed Code
module test7 (input q, r, s, t, u, v, rst, output x, y, z, output reg w);
// Violation 1, 8
wire w2, w4, w5, w6, w7;
reg w1, w3;
always @(posedge r)
begin
if (rst)
begin
w1 <= 0;
w3 <= 0;
w <= 0;
end
else
begin
w1 <= q;
w3 <= w2;
w <= w4;
end
end
Violations Produced
• Snake path with combinational logic in 5 levels detected from 'test7.u' to 'test7.inst2.o'. –
Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Snake Paths
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Instance Base Rules
Cascading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Generic Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Port Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Unconnected Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Cascading
Cascading
Language support: All
Checks for cascaded instances of the same design unit.
For VHDL, the bound entity or component declaration must be visible.
For Verilog, the bound module must be visible.
Usage
Cascading
Common Parameters
Design Unit Name
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Design Unit Name
Specify the names of design units to check for, or choose <any>. Names are case-sensitive
for Verilog and case-insensitive for VHDL. The default is <any>.
Examples
Example 1
Check for cascading of '<any>' design unit.
Rule Configuration
• Design Unit Name — <any>
Analyzed Code
n1 : nor_gate_1 port map (r,s,nq.sop,q.sop);
n2 : nor_gate_1 port map (q.sop,nq.sop,f.sop);
Violations Produced
• Instance 'n1' and instance 'n2' of design unit 'nor_gate_1' are cascaded. –Violation 1
• + The instances 'n1' and 'n2' are connected through net 'q.sop'. – Associated Violation 2
• + The instances 'n1' and 'n2' are connected through net 'nq.sop'. – Associated Violation 3
Example 2
Check for cascading of generated instances in for-generate loops.
Rule Configuration
• Design Unit Name — <any>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Cascading
Analyzed Code
`resetall
`timescale 1ns/10ps
`define N 4
typedef logic [`N:0] dtype_t;
Violations Produced
• Instance 'forloop[1].b1.b2.MyInst' and instance 'forloop[2].b1.b2.MyInst' of design unit
'dff_pos_edge' are cascaded. – Violation
• + The instances 'forloop[1].b1.b2.MyInst' and 'forloop[2].b1.b2.MyInst' are connected
through net 'ena[2]'. – Associated Violation
Restriction
Avoid cascading instances of the same design unit.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Generic Mapping
Generic Mapping
Checks the style of generic/ parameter mapping associations (Named or Positional/Ordered).
Usage
Generic Mapping
Common Parameters
Mapping Style
Threshold
Disallow
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Mapping Style
Specify the required generic/ parameter map association style – Named or Positional/
Ordered. The default is Named.
o Named
o Positional
• Threshold
Specify the minimum number of generic/ parameter associations that trigger the check. The
mapping style check is not done if the number of generic/ parameter associations is below
the threshold. The default is 5.
• Disallow
Specify the disallowed styles in generic usages. The default is <none>.
o Generic Initialization in Component Declaration
o Generic Initialization in Packages
o Generic Initialization in Subprograms
o Multiple Mappings per Line
o <none>
Examples
Example 1
Check for the generic mapping style with threshold.
Rule Configuration
• Mapping Style — Named
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Generic Mapping
• Threshold — 4
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY child IS
PORT(in1 : IN std_logic; in2 : IN std_logic;
out1 : OUT std_logic; out2 : OUT std_logic; out3 : OUT std_logic);
END child;
--
ENTITY top IS
END top;
BEGIN
C1: child GENERIC MAP(in1, in2, out1);
C2: child GENERIC MAP(in1, in2, out1, out2, out3); -- Violation
END arch;
Violation Produced
One or more generic mapping, of "child", has positional association.
Example 2
Check for the parameter mapping style with threshold.
Rule Configuration
• Mapping Style — Named
• Threshold — 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Generic Mapping
Analyzed Code
module child1(in1, in2, out1);
input [0:7] in1;
input [0:7] in2;
input [0:7] out1;
parameter DATA_WIDTH = 8;
parameter ADDRESS_WIDTH = 8;
parameter CONTROL_WIDTH = 8;
// ...
endmodule
parameter DATA_WIDTH = 8;
parameter ADDRESS_WIDTH = 8;
parameter CONTROL_WIDTH = 8;
parameter DELAY = 10;
// ...
endmodule
module top;
wire x, y, z;
child1 #(16, 16, 8) C1();
child2 #(16, 16, 8, 0) C2(); // Violation
// ...
endmodule
Violation Produced
One or more parameter mapping, of "child2", has positional association.
Example 3
Check for generic initialization in component declaration.
Rule Configuration
• Mapping Style — Named
• Threshold — 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Generic Mapping
Analyzed Code
entity test1 is
generic ( n,m: integer );
port(in1,in2: integer;
output : out integer);
end;
begin
inst1 : test1 generic map (10,20) port map(in1,in2,output1);
inst2 : test1 generic map (30,40) port map(in1,in2,output2);
end;
Violation Produced
Generic(s) initialization in component declaration is disallowed.
Related Topics
Port Mapping
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Port Mapping
Port Mapping
Language support: All
Checks the style of port mapping associations (named or positional/ordered). It also checks for
the use of expressions and non-explicit widths in port maps, and checks for signals connected to
more than one input of the same instance.
Usage
Port Mapping
Common Parameters
Mapping Style
Threshold
Disallow
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Mapping Style
Specify the required port map association style. The default is Named.
o Named
o Positional
• Threshold
Specify the minimum number of port associations that trigger the check. This is used to
control the mapping style check only, and has no effect on the disallowed parameter. The
default is 5.
Note
The mapping style check is not done if the number of port associations is below the
threshold.
• Disallow
Specify which constructs are not allowed within Port Maps. The default is <all>.
o Interconnected ports and signals with different names
o Logical Expressions
Aggregates, <Other Logical Expressions>
o Multiple Mappings per Line
o Non-Explicit Width Vectors
o Signals connected to more than one input of the same instance
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Port Mapping
o <all>
o <none>
Examples
Example 1
Check for the mapping style with threshold.
Rule Configuration
• Mapping Style — Named
• Threshold — 5
• Disallow — <none>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Port Mapping
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY mux IS
PORT (
s0, s1 : IN std_logic;
I0 , I1 , I2 , I3 : IN std_logic;
q : OUT std_logic
);
END mux;
BEGIN
inv1 : inverter PORT MAP (s0, s0_inv);
inv2 : inverter PORT MAP (a => s1, b => s1_inv);
and1 : andgate PORT MAP (a => I0, b => s1_inv, c => s0_inv, d => x0);
and2 : andgate PORT MAP (a => I1, b => s1_inv, c => s0 , d => x1);
and3 : andgate PORT MAP (a => I2, b => s1 , c => s0_inv, d => x2);
and4 : andgate PORT MAP (a => I3, b => s1 , c => s0 , d => x3);
or1 : orgate PORT MAP (a, b, c, d, e); -- Violation
END structural;
Violation Produced
One or more port mapping, of "orgate", has positional association.
Example 2
Check for signals connected to more than one input of the same instance.
Rule Configuration
• Mapping Style — Positional
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Port Mapping
• Threshold — 1
• Disallow — Signals connected to more than one input of the same instance
Analyzed Code
module portmap (input in1, output out1);
middle inst (in1, in1, out1); // Violation
endmodule
Violation Produced
Net 'in1' is connected to two inputs, 'in1' and 'in2' of instance 'inst'.
Example 3
Check for non-explicit width vectors.
Rule Configuration
• Mapping Style — Named
• Threshold — 1
ENTITY explicit_width IS
GENERIC ( Width : integer := 8);
PORT (
a : IN std_logic_vector(Width-1 DOWNTO 0);
b : IN std_logic_vector(Width-1 DOWNTO 0);
c : OUT std_logic_vector(Width-1 DOWNTO 0)
);
END explicit_width;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Port Mapping
Violations Produced
• Vector ""a"", used in port mapping of ""xorgate"", should have explicit widths. –
Violation 1
• Vector ""b"", used in port mapping of ""xorgate"", should have explicit widths. –
Violation 2
• Vector ""c"", used in port mapping of ""xorgate"", should have explicit widths. –
Violation 3
Example 4
Check for disallowed logical expressions except aggregates in port mapping.
Rule Configuration
• Mapping Style — Named
• Threshold — 5
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Port Mapping
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity alu is
port(
A : in std_logic_vector (3 downto 0 );
B : in std_logic_vector (3 downto 0 );
clk : in std_logic;
control : in std_logic_vector (1 downto 0 );
reset : in std_logic;
result : out std_logic_vector (7 downto 0 )
);
end alu ;
begin
-- Instance port mappings.
inst_controller : contoller;
Port map (
clk => clk,
reset => reset,
control => (others => '1'),
add => (Reg1 and Reg2), -- Violation 1
mul => (Reg1 or Reg2), -- Violation 2
sub => (Reg1 - Reg2), -- Violation 3
result => output
);
end logical
Violations Produced
• Avoid using expressions in port maps – Violation 1
• Avoid using expressions in port maps – Violation 2
• Avoid using expressions in port maps – Violation 3
Example 5
Check for disallowed Interconnected ports and signals with different names.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Port Mapping
Rule Configuration
• Mapping Style — Named
• Threshold — 5
ENTITY Gate IS
port(a,b: in std_logic_vector(1 downto 0);
output : out integer);
END ENTITY Gate;
--
ARCHITECTURE gateArch OF Gate IS
component andGate is
port(in1,in2: std_logic_vector(1 downto 0);
output : out std_logic);
end component;
signal y : std_logic;
signal in1,in2 : std_logic := '0';
signal out1,result : std_logic := '0';
signal x,s1,s2 : std_logic_vector(2 downto 0) := 000;
BEGIN
RegA1: andGate port map ( in1=>a , in2=>b ,result=>out1); -- Violation
1,2,3
RegA2: andGate port map ( in1=>x , in2=>y , result=>open); -- Violation
4,5
RegA3: andGate port map ( in1=>open , in2=>open , result=>open);
--ignore open
RegA4: andGate port map ( (in1(0),(others => '1')) , in2(1 downto 0) ,
output);
RegA5: andGate port map ( in1=>(in1(0),(others => '1')) , in2=>in2(1
downto 0) , output=>output);
RegA6: andGate port map ( (in1 and in1) , (in2(1 downto 0),y) ,
Transcod_1(output));
RegA7: andGate port map ( in1=>(in1(0),(others => '1')) , in2=>in2(1
downto 0) , output=>output);
END ARCHITECTURE gateArch;
Violations Produced
• Signals on the left and right side of portmapping should be the same – Violation 1
• Signals on the left and right side of portmapping should be the same – Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Port Mapping
• Signals on the left and right side of portmapping should be the same – Violation 3
• Signals on the left and right side of portmapping should be the same – Violation 4
• Signals on the left and right side of portmapping should be the same – Violation 5
Related Topics
Generic Mapping
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unconnected Ports
Unconnected Ports
Language support: All (including SystemVerilog)
Checks port mapping to ensure that ports are connected to other instances or constant values.
Input ports should be driven (i.e. connected to an output or a constant value). Output ports and
bidirectional ports should be connected. It also detects floating connections (a floating
connection is one wherein the port is connected to an undriven/unused net possibly through a
chain of buffers/inverters)
Usage
Unconnected Ports
Common Parameters
Applies To
Detect Floating Connection
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify which Ports must be connected. VHDL Buffers are treated as outputs. The default is
Input Ports, Output Ports and Bidirectional Ports.
o Input Ports
o Output Ports
o Bidirectional Ports
• Detect Floating Connection
Specify whether floating as well as unconnected ports need to be detected. The default is
No.
Examples
Example 1
Check for unconnected input ports.
Rule Configuration
• Applies To — Input Ports
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unconnected Ports
Analyzed Code
module top (d, q);
input d;
output q;
bot B1 (.in1(d), .in2( ), .out1(q)); // violation
endmodule
Violation Produced
Unconnected input port 'in2' in instance 'B1'.
Example 2
Checks for unconnected and floating output ports.
Rule Configuration
• Applies To — Output Ports
Violations Produced
• Floating output port 'out1' in instance 'B1'. - Violation
• + Net 'w2' is floating (unused). – Associated Violation
Related Topics
Unassigned Objects
Unused Declarations
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Label Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Statement Labels
Statement Labels
Language support: All
Checks that specified constructs have labels.
Usage
Statement Labels
Common Parameters
Label
End Label
Minimum Number of Lines
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Label
Specify which constructs require labels. For the option “EXIT Statement in Loop”, the rule
will check that the EXIT statement specifies the label of the loop it is exiting (e.g. EXIT
this_loop) rather than checking that the exit statement itself has a label. Note that unlabelled
VHDL assignments are only checked if they are concurrent assignments – sequential
assignments within processes are not checked. The default is <all>.
o <all>
o <Verilog specific>
Always Blocks, Clocking Blocks, Final Blocks, Fork-Join Blocks, Initial Blocks,
Sequential Begin-End Blocks, Verilog Case Statements, Verilog Generate Blocks
o <VHDL specific>
CASE Statements, EXIT Statement in Loops, Processes, VHDL Concurrent
Statements [Concurrent assignments, Procedural block calls, Assert, VHDL Block,
VHDL Generate]
o IF Statements
o Loops
o <don’t care>
• End Label
Specify which constructs require corresponding labels at the end of the construct. The
default is <all>.
o <all>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Statement Labels
Violations Produced
• Exit Loop Label
Use explicit loop label when exiting loops.
• Concurrent Statement Label
Concurrent statements should be labeled.
Tip
Add labels to those constructs which require them.
Related Topics
Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Logic Optimization Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case instead of if-else-if
However, since the branches of this if-else-if are mutually exclusive, the same functionality can
be achieved by using a case statement, which would get synthesized to a single multiplexer as
shown below. Please note that a case statement represents parallel logic.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case instead of if-else-if
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Threshold
Specify the minimum number of mutually exclusive if-else-if branches (including final else)
which should be considered for case conversion. The minimum value for this parameter is 3
because it represents the smallest if-else-if structure (if-else if-else). The default is 4.
Examples
Example 1
Check for parallel if-else-if branches with threshold 4.
Rule Configuration
• Threshold — 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case instead of if-else-if
Analyzed Code
module top (clk, reset, in1, out2);
input clk;
input reset;
input [1:0] in1;
output [1:0] out2;
reg [1:0] out2;
Violations Produced
• Transformation possible from group of 5 'if' statements into 'case' statement with
expression 'in1'. – Violation 1
• + Choice '00' inferred for case transformation. – Associated Violation 2
• + Choice '01' inferred for case transformation. – Associated Violation 3
• + Choice '10' inferred for case transformation. – Associated Violation 4
• + Choice '11' inferred for case transformation. – Associated Violation 5
• + Choice 'default' inferred for case transformation. – Associated Violation 6
Example 2
Check for parallel if-else-if branches with threshold 4.
Rule Configuration
• Threshold — 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case instead of if-else-if
Analyzed Code
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY top_StateTransition2 IS
PORT(
clk_master : IN std_logic ;
rst_master : IN std_logic
);
END top_StateTransition2 ;
--
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ARCHITECTURE rtl OF top_StateTransition2 IS
TYPE state_type IS (
state1,
state2,
state3,
state4,
state5,
state6,
state7
);
SIGNAL current_state_cs, next_state_ns, ps : state_type ;
BEGIN
----------------------------------------------------------------------
nextstate : PROCESS (
current_state_cs
)
----------------------------------------------------------------------
BEGIN
IF ((current_state_cs = state1) and (ps = state1)) THEN -- Violation
1, Associated Violation 2
next_state_ns <= state3;
ELSIF ((current_state_cs = state3) and (ps = state2))THEN –-
Associated Violation 3
next_state_ns <= state4;
ELSIF ((current_state_cs = state4) and (ps = state3)) THEN –-
Associated Violation 4
next_state_ns <= state5;
ELSIF ((current_state_cs = state5) and (ps = state1)) THEN –-
Associated Violation 5
next_state_ns <= state6;
ELSIF ((current_state_cs = state6) and (ps = state6)) THEN –-
Associated Violation 6
next_state_ns <= state1;
ELSE
next_state_ns <= state1; -- Associated Violation 7
END IF;
END PROCESS nextstate;
END rtl;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Case instead of if-else-if
Violations Produced
• Transformation possible from group of 6 'if' statements into 'case' statement with
expression '{current_state_cs, ps}'. – Violation 1
• + Choice '000000' inferred for case transformation. – Associated Violation 2
• + Choice '010001' inferred for case transformation. – Associated Violation 3
• + Choice '011010' inferred for case transformation. – Associated Violation 4
• + Choice '100000' inferred for case transformation. – Associated Violation 5
• + Choice '101101' inferred for case transformation. – Associated Violation 6
• + Choice 'default' inferred for case transformation. – Associated Violation 7
Related Topics
Case Statement Style
Case Statement Directives
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming Base Rules
Capitalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Classes Naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
File Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Inferred Elements Naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Mixed Case Naming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Name Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Named Object Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Unique Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Capitalization
Capitalization
Language support: All
Checks the capitalization (upper/lower case or initial caps) of literals, attributes, scientific
notations and physical unit names. The rule also checks IEEE references and VHDL reserved
words.
Usage
Capitalization
Common Parameters
Applies To
Case
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify to which identifier/s the convention applies. The default is <all>.
o <all>
o Attributes
o IEEE References
o Literals
o Physical Units
o Scientific Notations
o VHDL Reserved Words
• Case
Specify the required capitalization convention.The default is Lowercase.
o Lowercase
o Uppercase
o Initial Caps
Examples
Violations Produced
• Attribute "event" must be in lowercase
• VHDL reserved word "if" must be in uppercase
• IEEE reference "std_logic" must be in uppercase
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Capitalization
Note
Make attributes, IEEE references, literals, physical unit names, scientific notations, and
VHDL reserved words in the proper capitalization.
Related Topics
Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Classes Naming
Classes Naming
Language support: SystemVerilog
Checks for the naming convention of classes/handles based on their base class. The naming
pattern can be chosen from standard predefined conventions, or specified using simple or
regular expression syntax.
Usage
Classes Naming
Common Parameters
Check
Applies To (base class)
Applies To Exceptions (OVM Base Class)
Pattern
Pattern Type
Match Case
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Check
o Classes:
Classes’ names should comply with naming conventions specified in the "Pattern"
Parameter. This is the default value.
o Handles:
Handles’ names should comply with naming conventions specified in the "Pattern"
Parameter.
• Applies To (base class)
Specify the classes/handles to be checked. Any class which is one of or inherits directly/
indirectly from any of the specified base class names is checked. The default is <any>.
• Applies To Exceptions (OVM Base Class)
Specify the types of classes/object handles to exclude from applying the check. If the object
handle's type is any of the specified types, or inherits directly or indirectly from any of them,
the object handle is excluded from the check. The default is <none>.
• Pattern
Specify the naming pattern. Choose from those supplied or specify using simple or regular
expression syntax. The default is <Initial Caps>.
o <Lowercase>: [All Lower-case characters]
o <Uppercase>: [All Upper-case characters]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Classes Naming
Rule Configuration
• Check — Classes
• Pattern — *_test
• Match Case — No
Analyzed Code
package classes_naming_pkg_1;
import uvm_pkg::*;
virtual class test_base extends uvm_test; // violation 1
endclass
module classes_naming_1();
import classes_naming_pkg_1::*;
// ...
endmodule
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Classes Naming
Violation Produced
Class declaration "test_base" violates naming convention: use "*_test" for class names
Example 2
Check that the names of testbench handles follow the specified naming convention "*_handle"
Rule Configuration
• Check — Handles
• Pattern — *_handle
• Match Case — No
Analyzed Code
package classes_naming_pkg_2;
import uvm_pkg::*;
virtual class test_base extends uvm_test;
endclass
module classes_naming_2();
import classes_naming_pkg_2::*;
// ...
endmodule
Violation Produced
Class handle "handle_oVm2" violates naming convention: use "*_handle" for class handle
names.
Related Topics
Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Name
File Name
Language support: All (including SystemVerilog)
Checks that HDL files follow a consistent naming convention depending on their content. For a
given file type, the required file name can be specified using simple or regular expressions.
System variables can also be used to relate the file name to its contents. For example, a Verilog
file may typically be named after the module contained within it, for example, “%(module).v”.
Usage
File Name
Common Parameters
File Type
File Name Pattern
Pattern Type
Match Case
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• File Type
Specify to which identifier/s the naming pattern/convention applies. The default is Entity or
Module.
o Entity
o Architecture
o Package Header
o Package Body
o Configuration
o Module
o Include Files
o Interface
o Package
o Program Block
o Class
o Any
For a filename to be checked, the contents of the file should exactly match the values
selected in the “File Type” parameter. For example, if the value is set to “Entity” then the
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Name
file must contain only one or more entities. If the file contains any other design objects, for
example an architecture, then that file will not be checked. Similarly, if the values selected
are “Entity” and “Architecture”, then only those files which contain one or more entities and
one or more architectures (of any entities) will be checked. A file with only entities or only
architectures will not be checked.
When the File Type is set to “Any”, then the contents of the files are not checked at all. All
files of the specified language are candidates for this check.
File Type set to “Include Files” means all include files which are included in the source
files. Any Verilog/SystemVerilog specific parameter values selected along with “Include
files” implies – Include files which contain the specified design objects. For example, if
“Package” is selected along with “Include Files”, it means all included files which contain
one or more packages. Please note that included files which contain other design units in
addition to packages will not be considered for this check.
Parameter value “Any” cannot be selected along with any of the design objects. Exception is
“Include Files” which can be selected with “Any”. This combination represents all included
files. Please note that “Any” is redundant in this case, and the same behaviour would be
obtained if only “Include Files” is selected.
A design object in an include file is not considered in the source file context. So for
example, if “File Type” is set to “Package” + “Interface” and a source file contains an
interface and an include file included by this source file contains a package, then the source
file will not be a candidate for this check.
• File Name Pattern
Specify the naming pattern. Choose from those supplied or specify using Simple Expression
or Regular Expression syntax. The default is Lowercase.
o Lowercase
o Uppercase
o Initial Caps
o <user-defined>
An error will be produced if the File Name Pattern contains system variables which are not
related to the values selected in the “File Type” pattern. For example, “Entity” is selected in
the “File Type” parameter and the “File Name Pattern” contains %(package).
• Pattern Type
Specify which expression format is being used in the Pattern string. If you are using full
Regular Expression syntax, set this parameter to “Regular Expression”, otherwise set it to
“Simple Expression”. The default is Regular Expression.
• Match Case
Specify whether the Simple or Regular Expression is case sensitive or not. The default is
Yes.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Name
Examples
Example 1
Check if the name of file contains an entity.
Rule Configuration
• Language — VHDL Any
• Match Case — No
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY abcd IS
END ENTITY abcd;
Violation Produced
File "FileName_1_vhd.vhd" violates naming convention: use "%(entity).vhd" for entity,
architecture file names
Example 2
Check if the name of file contains a configuration.
Rule Configuration
• Language — VHDL Any
• Match Case — No
Analyzed Code
CONFIGURATION abcd_config OF abcd IS
FOR abcd_a
END FOR;
END abcd_config;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Name
Violation Produced
File "FileName_2_vhd.vhd" violates naming convention: use "%(config).vhd (i.e.
abcd_config.vhd)" for configuration file names
Example 3
Check for multiple matching candidates for a system variable.
Rule Configuration
• Language — VHDL Any
• Match Case — No
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY abcd IS
END ENTITY abcd;
ENTITY abcd1 IS
END ENTITY abcd1;
Violation Produced
Expected name for file "FileName_3_vhd.vhd" cannot be uniquely determined due to the use of
"%(entity)" in file name pattern
Example 4
Check if the name of file contains the package body.
Rule Configuration
• Language — VHDL Any
• Match Case — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Name
Analyzed Code
PACKAGE BODY xyz1 IS
END xyz1;
Violation Produced
File "FileName_4_vhd.vhd" violates naming convention: use "%(package).vhd" for package
body file names
Example 5
Check if the name of file contains an entity, architecture, package header and package body.
Rule Configuration
• Language — VHDL Any
• Match Case — No
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY abcd IS
END ENTITY abcd;
--
ARCHITECTURE abcd_a OF abcd IS
BEGIN
END ARCHITECTURE abcd_a;
ENTITY abcd1 IS
END ENTITY abcd1;
PACKAGE xyz2 IS
END xyz2;
PACKAGE xyz3 IS
END xyz3;
Violation Produced
File "FileName_5_vhd.vhd" violates naming convention: use "%(architecture).vhd" for entity,
architecture, package header, package body file names
Example 6
This example shows an Include file scenario in SystemVerilog.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Name
Rule Configuration
• Language — Verilog Any
• Match Case — No
Analyzed Code
Include File
class a;
endclass
Source File
`resetall
`timescale 1ns/10ps
`include "FileName_6_1_v.v"
program abcd;
endprogram
Violation Produced
Source File violates naming convention: use "%(progblk)_src.sv" for program block file names
Note
Since the include file contents are not expanded in the source file, hence the source file in
this case contains only a program block, and hence is a candidate for this check.
Example 7
Check the Include file name.
Rule Configuration
• Language — Verilog Any
• Match Case — No
Analyzed Code
Include File
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File Name
class a;
endclass
interface b;
endinterface
Source File
`resetall
`timescale 1ns/10ps
`include "FileName_7_1_v.v"
program abcd;
endprogram
Violation Produced
Include file violates naming convention: use "%(class)_%(interface).sv" for interface, class file
names.
Related Topics
Partition Design Units
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
o Tristate Enables
Active High Tristate Enables, Active Low Tristate Enables
o Tristate Outputs
o Registers
Positive Edge Triggered Registers, Negative Edge Triggered Registers
o VHDL Output Drivers
Complete Assignments Only, Other Assignments
o Architectures
Behavioral Architecture, Dummy Architecture, RTL Architecture, Structural
Architecture
• Pattern
Specify a naming pattern. The default is <Lowercase>.
o <Lowercase>
o <Uppercase>
o <Initial Caps>
o <user-defined>
• Use Extended Identifiers
Specify whether the check should allow extended/escaped identifiers or not. In case
allowed, then whether the name should be checked as-is or after stripping the leading
backslash and the trailing space (for Verilog) or trailing backslash (for VHDL). The default
is Allow.
o Allow
o Disallow
o Use Pattern As Is
• Pattern Type
Pattern type for user defined pattern. The default is Simple Expression.
o Simple Expression
o Regular Expression
• Match Case
Specify whether the Simple or Regular Expression is case sensitive or not. The default is
Yes.
• Through Hierarchy
Specify whether control signal naming check is to be performed through hierarchy or not.
The default is Yes.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Description
In this case, the signal “res” would serve as an asynchronous reset for out1[1] but as a
preset for out1[0]. Hence, if there are conflicting patterns for asynchronous resets and
presets, this rule will produce at least one violation in this scenario.
• Clock generators and reset generators are detected as per the isolation rules mentioned in
the Internally Generated Clocks rule.
• VHDL forbids the reading of output ports. Hence a common practice followed to
overcome this restriction is to declare an output driver. The logic that is to drive the
output port now drives the output driver. The output port in turn is driven by the output
driver through a buffer. Since the output driver is an internal signal, hence it can
obviously be read. Formally, an output driver is defined as an internal signal which
directly drives an output.
For example
out1 : out std_logic_vector(3 downto 0);
out1 <= in1 and in2;
if (out1 = “1010”) then -- illegal, outputs cannot be read
:::::::::::
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Since var1 is a variable and output drivers are internal signals only.
out1 : out std_logic_vector(3 downto 0);
signal temp : std_logic_vector(3 downto 0);
temp <= in1 and in2;
out1 <= temp;
Since temp is not read anywhere (other than the output port assignment), it is not
considered an output driver.
• Complete Assignments Only/Other Assignments parameterization for Output Drivers –
It is possible to select which types of output drivers have to be checked for. With the
parameter value “Complete Assignments Only” the following constraints have to be
met.
o Direct assignment to the output (no function calls, conversion functions) involved.
o No slices used in the output assignment (even complete slices are not considered)
Thus the following is considered as “Complete Assignments”
out1 <= temp;
While the following are not considered as “Complete Assignments” and are covered
under “Other Assignments”
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Rule Configuration
• Language — Any
• Applies To — Clocks
• Pattern — *_clock
• Match Case — No
• Hierarchy — No
Analyzed Code
module test67 (clk, rst);
input clk, rst; // Violation
reg [3:0] cst, nst;
Violation Produced
Clock signal 'clk' violates naming convention: use '*_clock' for clock signal names.
Example 2
This example checks if the synchronous resets follow the naming pattern rst_0, rst_1 etc.
Rule Configuration
• Language — Any
• Pattern — rst_[0-9]+
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
• Match Case — No
• Hierarchy — No
Analyzed Code
module test67 (clk, rst);
input clk, rst; // Violation
reg [3:0] cst, nst;
always @(posedge clk)
begin
if(rst)
cst<= 0;
else
cst <= nst;
end
endmodule
Violation Produced
Active High synchronous reset 'rst' violates naming convention: use 'rst_[0-9]+' for active high
synchronous reset names.
Example 3
This example checks if the active high preset signals follow the naming pattern *_%(entity)
Rule Configuration
• Language — Any
• Pattern — *_%(entity)
• Match Case — No
• Hierarchy — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY testproc IS
port (clk, pre_1 : in std_logic); -- Violation
END ENTITY testproc;
Violation Produced
Active high preset signal 'pre_1' violates naming convention: use '*_%(entity)' for active high
preset signal names.
Example 4
This example checks if the combinational processes/always blocks are named as '*_Comb'. It
should match case and it should disallow extended identifiers.
Rule Configuration
• Language — Any
• Pattern — *_Comb
• Hierarchy — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Analyzed Code
module test01 (in,out,sel,sel2,sel3);
input [0:2] in;
input sel,sel3,sel2;
output [0:2] out;
reg [0:2] out;
always @* // Violation 1
begin : b1_comb
if(sel3)
out[0] <= 0;
else if (sel)
out[0] <= in[0];
end
always @* // Violation 2
begin : \b2
if(sel3)
out[0]<= 0;
else if (sel2)
out[0] <= in[0];
end
endmodule
Violations Produced
• Combinational process 'b1_comb' violates naming convention: use '*_Comb' for
combinational process names. – Violation 1
• Combinational process '\b2 ' violates naming convention: use 'basic identifier' for
combinational process names. – Violation 2
Example 5
This example checks that the active low tristate enables and connected ports follow the regular
expression '.*_tri_ena_low', and the tristate output follows simple expression '*_TriOut'. Both
should match case and disallow extended identifiers.
Rule Configuration 1
• Language — Any
• Pattern — *_tri_ena_low
• Hierarchy — Yes
Rule Configuration 2
• Language — Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
• Pattern — *_TriOut
• Hierarchy — No
Analyzed Code
module top (input a, b); //Violation3
mid1 inst1(a, b);
endmodule;
module mid1 (
input c, d); // Violation2
reg t; // Violation1
assign t = ~c ? d : 1'bz;
endmodule;
Violations Produced
• Tristate output 't' violates naming convention: use '*_TriOut' for tristate outputs. –
Violation 1
• Port 'c' in design unit 'mid1' which is being used as active low tristate enable at tri-state
buffer 'mid1.t' violates naming convention: use '.*_tri_ena_low' for ports connected to
active low tristate enables. – Violation 2
• Port 'a' in top design unit 'top' which is being used as active low tristate enable at tri-state
buffer 'top.inst1.t' violates naming convention: use '.*_tri_ena_low' for ports connected
to active low tristate enables. – Violation 3
Example 6
This example checks that all the registers in the design follow the simple expression '*_Reg', all
the positive edge triggered registers follow the simple expression '*_HighReg' and all the
negative edge triggered registers follow the regular expression '*_LowReg'.
Rule Configuration 1
• Language — Any
• Applies To — Registers
• Pattern — *_Reg
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
• Hierarchy — No
Rule Configuration 2
• Language — Any
• Pattern — *_HighReg
• Hierarchy — No
Rule Configuration 3
• Language — Any
• Pattern — *_LowReg
• Hierarchy — No
Analyzed Code
module top (input in1,
in2,
clk,
output reg out1, // Violation 1, 2
out2);// Violation 3, 4
always @(posedge clk) out1<= in1;
always @(negedge clk) out2 <= in2;
endmodule
Violations Produced
• Register 'out1' violates naming convention: use '*_Reg' for registers. – Violation 1
• Positive edge triggered register 'out1' violates naming convention: use '*_HighReg' for
positive edge triggered registers. – Violation 2
• Register 'out2' violates naming convention: use '*_Reg' for registers. – Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
• Negative edge triggered register 'out2' violates naming convention: use '*_LowReg' for
negative edge triggered registers. – Violation 4
Example 7
This example checks that the FSM current state variables are named as '*_curr_state' and all the
next state variables are named as '*_next'.
Rule Configuration 1
• Language — Any
• Pattern — *_curr_state
• Hierarchy — No
Rule Configuration 2
• Language — Any
• Pattern — *_next
• Hierarchy — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Analyzed Code
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity test02 is
port (CLOCK, RESET : in STD_LOGIC);
end test02;
Violations Produced
• FSM current state 'CS' violates naming convention: use '*_curr_state' for current state
variables. – Violation 1
• FSM next state 'NS' violates naming convention: use '*_next' for next state variables. –
Violation 2
Example 8
This example checks that the clock generators in the design follow the simple expression
'*_ClkGen'.
Rule Configuration
• Language — Any
• Pattern — *_ClkGen
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
• Hierarchy — No
Analyzed Code
module top (input a, b, output reg c);
wire gen_clk;
mid1 inst1(a, gen_clk);
dummy inst2(gen_clk, b, c);
endmodule
Violation Produced
Clock generator 'mid1' violates naming convention: use '*_ClkGen' for clock generators.
Example 9
This mixed design example checks that all the ports that are connected to clock signals in the
design follow the naming convention '*_clockPort'.
Rule Configuration
• Language — Any
• Applies To — Clocks
• Pattern — *_clockPort
• Hierarchy — No
Analyzed Code
VHDL
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
use work.all;
entity top is
port(
CLOCK : in BIT // Violation2
);
end top;
begin
inst1 : mid1
port map(CLOCK);
inst2 : mid2
port map(CLOCK);
end arch;
Verilog
Violations Produced
• Port 'clk1' in design unit 'mid1' which is being used as clock signal at register
'mid1.temp' violates naming convention: use '*_clockPort' for ports connected to clock
signals. – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
• Port 'CLOCK' in top design unit 'top' which is being used as clock signal at register
'top.inst1.temp' violates naming convention: use '*_clockPort' for ports connected to
clock signals. – Violation 2
• Port 'clk3' in design unit 'bot' which is being used as clock signal at register 'bot.temp'
violates naming convention: use '*_clockPort' for ports connected to clock signals. –
Violation 3
• Port 'clk2' in design unit 'mid2' which is being used as clock signal at register
'mid2.inst3.temp' violates naming convention: use '*_clockPort' for ports connected to
clock signals. – Violation 4
Example 10
This example checks that VHDL output drivers follow the naming convention '*_OpDriver'.
Rule Configuration
• Language — VHDL
• Pattern — *_OpDriver
• Hierarchy — No
Analyzed Code
entity counter is
port (sum : out INTEGER;
overflow4bit : out boolean;
in1, in2 : in INTEGER RANGE 0 to 15);
end;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Violation Produced
Output Driver 'sum_int' violates naming convention: use '*_OpDriver' for output driver names.
Example 11
This example performs naming checks for behavioral architectures.
Rule Configuration
• Language — Any
• Pattern — *_arch_behv
• Hierarchy — No
Analyzed Code
entity bot is
port (
I0 ,I1 : in bit;
O : out bit);
end entity;
begin
process(I1, I0)
begin
if (I1 = '1') then
if (I1'event) then -- violation 1
O<= '1';
end if;
elsif (I0'event and (I0 = '1')) then
O <= '0';
end if;
end process;
end bot_arch;
Violations Produced
• Non-Synthesizable Clocking Style – Violation 1
• Behavioral architecture 'bot_arch' violates naming convention: use '*arch_behv' for
behavioral – Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Example 12
This example performs naming checks for RTL architectures.
Rule Configuration
• Language — Any
• Pattern — *_RTL
• Hierarchy — No
Analyzed Code
package pkg is
type dim1 is array (0 to 2) of bit;
type arr1 is array (0 to 2) of dim1;
end pkg;
library work;
use work.pkg.all;
entity mid1 is
port (
I0 ,I1 : in bit;
O : out bit);
end entity;
Violation Produced
RTL architecture 'rtl' violates naming convention: use '*_RTL' for RTL architecture names.
Example 13
This example performs naming checks for RTL architectures.
Rule Configuration
• Language — Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
• Pattern — *_struct
• Hierarchy — No
Analyzed Code
entity top is
port (
clk , data1 : in bit ;
data : in bit;
out1 : out bit;
out2 : out bit
);
end top;
Violation Produced
Output Driver 'sum_int' violates naming convention: use '*_OpDriver' for output driver names.
Example 14
This example performs naming checks for Dummy architectures.
Rule Configuration
• Language — Any
• Pattern — *_Dummy
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
• Hierarchy — No
Analyzed Code
entity top is
port (
clk , data1 : in bit ;
data : in bit;
out1 : out bit;
out2 : out bit
);
end top;
Violation Produced
Dummy architecture '\Empty 123\' violates naming convention: use '*_Dummy' for dummy
architecture names.
Example 15
This example performs naming checks for architectures.
Rule Configuration
• Language — Any
• Applies To — Architectures
• Pattern — *_Arch
• Hierarchy — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Inferred Elements Naming
Analyzed Code
entity top is
port (
clk , data1 : in bit ;
data : in bit;
out1 : out bit;
out2 : out bit
);
end top;
entity mid1 is
port (
I0 ,I1 : in bit;
O : out bit);
end entity;
Violations Produced
• Architecture 'tl' violates naming convention: use '*_Arch' for architecture names –
Violation 1
• Architecture 'sruct' violates naming convention: use '*_Arch' for architecture names –
Violation 2
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Finite State Machines (FSMs) [DesignChecker User Guide]
Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Mixed Case Naming
Violations Produced
• VHDL Name Case
Do not allow mixing of case for identifier “XY" when used
[+] Associated Messages:
Identifiers "XY" and "xy" are used within same design with mixed case
• Verilog Name Case
Avoid declaring Identifiers that are differentiated by case
[+] Associated Messages:
Identifiers "XY" and "xy" are used within same design with mixed case
Related Topics
Capitalization
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Name Spaces
Name Spaces
Language support: All
Checks that the same name is not used for more than one identifier in a name space. “Name
Space” with respect to this rule refers to packages and architectures in VHDL, and modules in
Verilog.For example, the same name should not be used to identify a signal in one part of the
name space and also used as a process label elsewhere in that name space. Port names having
the same names as connected signals are excluded from the check.
Usage
Name Spaces
Common Parameters
Exclusions
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Exclusions
Specify the items to exclude from the check. The default is Enum Type Values.
o Enum Type Values
o Local Declarations across Subprograms
o Local Declarations across VHDL Generate Blocks
o Functions
o Procedures/ Tasks
o <none>
Note
If "Local Declarations across Subprograms" or "Local Declarations across VHDL
Generate Blocks" is excluded, the check will ignore repeated declarations that are
only located inside different subprograms/generate blocks. However, if a repeated
declaration is located outside the subprograms/generate blocks, this will result in a
violation.
Examples
Example 1
Check for the use of the same name in a single name space.
Rule Configuration
• Exclusions — <none>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Name Spaces
Analyzed Code
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
USE IEEE.numeric_std.ALL;
PACKAGE package_test IS
begin
carry_in := '1';
for index1 in 0 to a'length-1 loop
result(index1) := a(index1) xor carry_in;
carry_in := a(index1) and carry_in;
end loop;
return result;
end; --function
END package_test;
Violations Produced
• Do not use identifier name "one" since it exists in the same namespace – Violation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Name Spaces
• Identifier name "one" already used in the same namespace – Associated Violation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Named Object Name
UVM “uvm_object”
Inherited classes usually accept the object name in the new operator and pass it to the super
(parent) class’s new operator. The check looks for the initial object name since the object can
theoretically have different hierarchal names during the object’s life cycle by setting the
corresponding class data member. The check does not apply to a vector of handles.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To (UVM/OVM Base Class)
Specify the types of object handles to check. The object is checked if the object handle's
type is any of the specified types, or inherits directly or indirectly from any of them. The
default is uvm_object.
o uvm_object
o ovm_object
o <user-defined>
• Applies To Exceptions (UVM/OVM Base Class)
Specify the types of object handles to exclude from the check. The object is excluded from
the check if the object handle's type is any of the specified types, or inherits directly or
indirectly from any of them. The default is <none>.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Named Object Name
o <user-defined>
o <none>
Examples
Example 1
Check that object component name of all uvm_object objects - except uvm_component objects
- is similar to object handle name.
Rule Configuration
• Applies To (UVM/OVM Base Class) — uvm_object
class uvmNamedObjectName;
function init ();
uvm_report_object uvm_report_object_inst = new("wrong_name", this);
// violation 1
uvm_component uvm_component_inst = new("wrong_name", this);
my_uvm_subscriber my_uvm_subscriber_inst = new("wrong_name", this);
endfunction
endclass
endpackage
module uvmNamedObjectNameModule();
import uvmNamedObjectName_pkg::*;
// ...
endmodule
Violation Produced
Object name ‘wrong_name’ must be the same as the object handle name
‘uvm_report_object_inst' – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming
Naming
Language support: All
checks that the names used for particular identifiers adhere to the naming convention specified
for those identifiers. The naming pattern can be chosen from standard predefined conventions,
or specified using simple or regular expression syntax.
It should be noted that this rule only produces violations for the declarations of incorrectly
named identifiers, not for the usages of these identifiers.
To ensure that the naming conventions are followed throughout your design (declaration and
usage), you need to configure both the “Naming” and “Mixed Case Naming” rules.
Usage
Naming
Common Parameters
Applies To
Pattern
Use Extended Identifiers
Pattern Type
Match Case
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify to which identifier/s the naming pattern/convention applies. The default is
<identifiers> which includes <all SystemVerilog Identifiers>, <all Verilog Identifiers> and
<all VHDL Identifiers>.
o <Identifiers>
<SystemVerilog Specific Identifiers> (Class Member Variables, Class Methods,
Classes, Clocking Blocks, Constant Declarartions, Enum Typedefs, Interfaces,
Modports, Modport Instances, Non-Enum Typedefs, Program Blocks), <Verilog
Specific Identifiers> (Always Blocks, Sequential Begin-End Labels, Fork-Join
Labels, Initial Blocks, Internal Nets, Internal Regs, Local Params, Macros,
Modules, Parameters, Tasks), <VHDL Specific Identifiers> (Architectures,
Components, Configurations, Constants, Entities, Exit Labels, Generics, Next
Labels, Null Labels, Ports: Mode BUFFER, Ports: Mode LINKAGE Procedure Call
Labels, Procedures, Processes, Report Labels, Signals, Sub-Program Parameters:
Mode IN, Sub-Program Parameters: Mode INOUT, Sub-Program Parameters:
Mode OUT, User-Defined Types, VHDL Block Labels, Wait Labels), Assert Labels,
Assignment Labels, Case Labels, Enum Literals, Functions, Generate Block labels,
If Labels, Instances, Integers, Loop Labels, Packages, Ports, Return Labels,
Variables
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming
o <Busses>
|VHDL Constant Busses, Other Busses
o Feedthrough Ports
o Internal Signals
o Ports: Mode IN
o Ports: Mode INOUT
o Ports: Mode OUT
o Unconnected Output Port Stubs [Signals attached to dangling ports]
o Vectors
• Pattern
Specify the naming pattern. Choose from those supplied or specify using simple or regular
expression syntax. To specify a list of allowed names (for example to check for particular
architecture names), use a regular expression of the form “^(name1|name2|name3)$”. The
default is <Lowercase>.
o <Lowercase> [All Lower-case characters]
o <Uppercase> [All Upper-case characters]
o <Initial Caps> [First character is uppercase, remainder can be either case]
o <user-defined>
• Use Extended Identifiers
Specify whether the check should also allow extended/escaped identifiers or whether the
specified pattern should be used exactly as specified. The default is Allow.
o Allow
o Disallow
o Use Pattern As Is
• Pattern Type
If you have entered your own Pattern string, you can specify which expression format to
use. If you are using full Regular Expression syntax, set this parameter to “Regular
Expression”, otherwise set it to “Simple Expression”. The default is Regular Expression.
• Match Case
Specify whether the Simple or Regular Expression is case sensitive or not. The default is
Yes.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming
Note
The system variables specified must be applicable for specified 'Applies To' values. For
example, a simple expression containing '%(module)' can never be applied for checking
'VHDL' specific context like 'configuration' naming. In the same way, 'VHDL' specific system
variables are invalid in the context of 'verilog' specific naming checks like 'always block'
naming. These will result in validation error. Apart from language based validations, there can
be cases where a particular system variable is actually meaningless in the context. For example,
'%(instance)' has no meaning in the context of checking 'Port' names. These will result in special
violations denoting which of the system variables are invalid in this particular context.
Examples
Example 1
This example checks if components have the same name as their related entity by referring to
the binding information in the configuration declaration or statement. The system variable
%(explicit_bound_unit) will find the unit the component instance is bound to explicitly. If no
configuration specification or declaration exists, then there is no explicit binding indication, and
the system variable will return empty.
Rule Configuration
• Language — VHDL Any
• Applies To — Components
• Pattern — *_%(explicit_bound_unit)
Violation Produced
Component “inv” violates naming convention: use "*_%(explicit_bound_unit)" for component
names.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming
Example 2
Check for configuration names that have entity and/or architecture names using %(entity) and
%(architecture).
Rule Configuration
• Language — VHDL Any
• Applies To — Configurations
• Pattern — cfg_%(entity)_%(architecture)
• Match Case — No
Analyzed Code
configuration cfg_test of ent isonfiguration cfg_test of ent is --
Violation
for rtl
end for;
end cfg_test; -- for all : inv use entity work.ent(rtl);
Violation Produced
Configuration “cfg_test” violates naming convention: Use “cfg_%(entity)_%(architecture) for
configuration names
Example 3
Check that signal names are written in uppercase.
Rule Configuration
• Language — VHDL Any
• Applies To — Signals
• Pattern — <Uppercase>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming
Analyzed Code
ARCHITECTURE rtl OF top is
SIGNAL i: std_logic; -- Violation
END rtl;
Violation Produced
Signal declaration “i” violates naming convention: use <Uppercase> for signal declarations
Example 4
Check that class member function names adhere to the pattern applied.
Rule Configuration
• Language — Verilog Any
• Pattern — %( class)_myFunc*
Violation Produced
Class Method name "myFunc" violates naming convention: Use "%(class)_myFunc*" for class
method names
Example 5
Check that User Typedefs (enum and non-enums) names comply with naming conventions.
Rule Configuration
• Language — Verilog Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming
Violations Produced
• Declaration "mybyte" violates naming convention: use "<Initial Caps>" for type
declarations
• Enum Typedef name "mydays" violates naming convention: use "<Initial Caps>" for
enum typedef names
• Declaration "op_code" violates naming convention: use "<Initial Caps>" for type
declarations
• Declaration "pkt" violates naming convention: use "<Initial Caps>" for type declarations
Other Violation Messages:
• State Variable Naming
FSM state variable declaration "var_current" violates naming convention: use "cs_*" for
state variable names
• Escape Characters
Avoid using escaped character names such as: "data\*_in"
• Instance Naming
Instance name “inst" violates naming convention: use “U_*" for labeling instances
• Integer Naming
Integer declaration “my.int" violates naming convention: use “*_int" for integer
declarations
• Package Naming
Package “my_pkg" violates naming convention: Use “*_pkg" for package names
• Port Naming
Port declaration “my_port" violates naming convention: use “port_*" for port names
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unique Names
Unique Names
Language support: All (including SystemVerilog)
Checks that state names within FSM descriptions and/or instance names within structural
descriptions are unique within the scope of the entire design. The restriction provided through
this check is due to language differences for scope and visibility. Having unique names inside
designs eases coding for translation without causing problems if changing from one language to
another. This is a design-wide check. Note that the effects of synthesis may result in different
violations from those expected from looking purely at the code.
Usage
Unique Names
Common Parameters
Unique
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Unique
Specify which objects to check. The default is FSM State Names and Instance Names.
Note
Important Notes
• This rule operates in a case-insensitive manner independent of the design language.
Hence, a violation will be produced even if there are two instances in a pure Verilog
design, one named “inst” and the other named “INST”.
• In case of instance names, a violation will be produced even if there are two
instances by the same name in the same design unit but in different scopes. For
example, a violation is produced if an instance named “inst” is present in the
architecture scope and another is present in a concurrent block in the same
architecture.
• Violations will not be produced for the same FSM state names being used in two
independent state machines in the same design unit.
• For FSM state name violations, in case the declaration of the state lies within the
same design unit as its use (for example, a constant declaration in the architecture
scope/parameter/localparam), then violations for that state will point to the
declaration of the state. On the other hand, if the declaration of the state lies in a
different design unit from its use (for example, an enumerated type declared in a
package), then the violation for that state will point to the start of the design unit in
which the FSM is present.
The difference in location is because in the first case, the declaration can only be
used within the design unit scope and, hence, the declaration also indicates the
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unique Names
corresponding design unit in which the FSM is present. However, in the second case,
the declaration does not indicate the design unit in which the FSM is present;
furthermore, multiple design units may refer to the same declaration. Hence, in this
case, the start of the design unit in which the FSM is present is pointed to.
Examples
Example 1
Check for the uniqueness of FSM state names and instances.
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unique Names
Analyzed Code
module test67 (output reg out, input [7:0] inp, input clk, enb, cnd, rst);
parameter [2:0] s0 = 3'h0, s1 = 3'h1, s2 = 3'h2, s3 = 3'h3; // Violation 3,
5, Associated Violation 2, 8
reg [3:0] cst, nst;
genvar i;
generate
for(i=0; i<7; i=i+1)
begin : b1
mid inst1 (clk,rst, enb); // Violation 9
mid #(1,2,3,4,5,6)inst2 (clk,rst, enb); // Violation 11
end
endgenerate
endmodule
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Unique Names
Violations Produced
• FSM State name ‘S0’ inside module ‘mid’ is not unique throughout the design. –
Violation 1
• + FSM State name ‘s0’ inside module ‘test67’ is not unique throughout the design. –
Associated Violation 2
• FSM State name ‘s1’ inside module ‘test67’ is not unique throughout the design. –
Violation 3
• + FSM State name ‘S1’ inside module ‘mid’ is not unique throughout the design. –
Associated Violation 4
• FSM State name ‘s2’ inside module ‘test67’ is not unique throughout the design. –
Violation 5
• + FSM State name ‘S2’ inside module ‘mid’ is not unique throughout the design. –
Associated Violation 6
• FSM State name ‘S3’ inside module ‘mid’ is not unique throughout the design. –
Violation 7
• + FSM State name ‘s3’ inside module ‘test67’ is not unique throughout the design. –
Associated Violation 8
• Instance name ‘inst1’ inside module ‘test67’ is not unique throughout the design. –
Violation 9
• + Instance name ‘INST1’ inside module ‘mid’ is not unique throughout the design. –
Associated Violation 10
• Instance name ‘inst2’ inside module ‘test67’ is not unique throughout the design. –
Violation 11
• + Instance name ‘Inst2’ inside module ‘mid’ is not unique throughout the design. –
Associated Violation 12
Related Topics
Finite State Machines (FSMs) [DesignChecker User Guide]
Mixed Case Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Order Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Operator Order
Operator Order
Language support: All (including SystemVerilog)
Checks for the use of parentheses to ensure that multiple operators within equations are
evaluated in an explicit order. Consecutive occurrences of some operators that result in an
identical value irrespective of order of evaluation are excluded from this check. For example: “
M <= a AND b AND c;” would not cause a violation.
Usage
Operator Order
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check that parentheses are used to enforce the order of operator evaluation.
Rule Configuration
Default parameter values.
Analyzed Code
my_proc: PROCESS (a, b)
VARIABLE tmp : std_logic
BEGIN
if (b = a) then
tmp := tmp*10 + 1; -- Violation
end if;
END PROCESS my_proc;
Violation Produced
Use parentheses to force the order of operations in equations.
Example 2
Check that parentheses are used to enforce the order of operator evaluation.
Rule Configuration
Default parameter values.
Analyzed Code
module opOrder(input d1, d2, clk, rst, output reg q) ;
always@(posedge clk)
q <= rst ? 0 : d1 | d2 ; // Violation
endmodule
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Operator Order
Violation Produced
Use parentheses to force the order of operations in equations.
Example 3
Check that parentheses are used to enforce the order of operator evaluation.
Rule Configuration
Default parameter values.
Analyzed Code
module opOrder2(input int in1, in2, output int out1) ;
always@(in1 or in2)
out1 = -in1-in2 ; // Violation
endmodule
Violation Produced
Use parentheses to force the order of operations in equations.
Related Topics
Allowed Operators
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Vector Order
Vector Order
Language support: All
Checks that vector dimensions consistently use an ascending or descending order. The rule can
also check the minimum starting index.
Usage
Vector Order
Common Parameters
Style
Applies To
Low Index Bound
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Style
Specify the required order for multi-bit buses: Descending or Ascending. For example, (x
downto 0) for VHDL, [x:0] for Verilog. The default is Descending.
o Descending [e.g. (x downto 0) for VHDL, [x:0] for Verilog]
o Ascending [e.g. (0 to x) for VHDL, [0:x] for Verilog]
o <don’t care>
• Applies To
Specify the objects for which vector dimensions are checked. The default is All.
o Vector Bounds:
Will produce violations on the usage of the array.
o Array Bounds:
Will produce violations on the array declaration only not the usage.
o Integer Range Constraints
o Real Range Constraints
o String Vector Bounds
• Low Index Bound
Specify whether the minimum index value for the vector should start at 0 or 1.
o 0
o 1
o <don’t care>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Vector Order
Examples
Example 1
Check Vector Bounds and Low Index Bounds.
Rule Configuration
• Style — Descending
Violations Produced
• Dimension/Range definition "(0 to 7)", for "in1", does not comply to descending order
convention – Violation 1
• Bus dimension "(8 downto 1)", for "in2", does not start at low index zero – Violation 2
Example 2
Check Array Bounds.
Rule Configuration
• Style — Descending
Violations Produced
• Dimension/Range definition "[0:11]", for "x", does not comply to descending order
convention – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Vector Order
• Dimension/Range definition "[0:5]", for "y", does not comply to descending order
convention – Violation 2
Example 3
Check Bounds for Vectors, Arrays and Strings.
Rule Configuration
• Style — Ascending
entity top is
port (
reset_n : in std_logic;
clk : in std_logic;
inp : in std_logic;
string_signal : in string (15 downto 1); -- Violation 1
outp : out std_logic
);
end entity top;
Violations Produced
• Dimension/Range definition "(15 downto 1)", for "string_signal", does not comply to
ascending order convention – Violation 1
• Dimension/Range definition "(31 downto 0)", for "vec_signal", does not comply to
ascending order convention – Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Vector Order
• Dimension/Range definition "(31 downto 0)", for "array_decl", does not comply to
ascending order convention – Violation 3
• Dimension/Range definition "(30 downto 0)", for "array_signal", does not comply to
ascending order convention – Violation 4
• Dimension/Range definition "(30 downto 0)", for "vec_signal", does not comply to
ascending order convention – Violation 5
• Dimension/Range definition "(2 downto 1)", for "string_signal", does not comply to
ascending order convention – Violation 6
Example 4
Check Bounds for Vectors and Arrays.
Rule Configuration
• Style — Descending
ENTITY vectorOrderEnt IS
END ENTITY vectorOrderEnt;
Violations Produced
• Dimension/Range definition "(0 to 4)", for "dataVector", does not comply to descending
order convention --violation 1
• Dimension/Range definition "(0 to 10)", for "dataVector", does not comply to
descending order convention --violation 2
• Dimension/Range definition "(0 to 4)", for "dataSignal", does not comply to descending
order convention --violation 3
• Dimension/Range definition "(1 to 4)", for "dataSignal", does not comply to descending
order convention --violation 4
• Dimension/Range definition "(0 to 3)", for "dataSignal", does not comply to descending
order convention --violation 5
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Vector Order
Example 5
Check Bounds for Vectors.
Rule Configuration
• Style — Descending
ENTITY vectorOrderEnt IS
END ENTITY vectorOrderEnt;
Violations Produced
• Dimension/Range definition "(0 to 10)", for "dataVector", does not comply to
descending order convention --violation 1
• Dimension/Range definition "(0 to 4)", for "dataSignal", does not comply to descending
order convention --violation 2
• Dimension/Range definition "(1 to 4)", for "dataSignal", does not comply to descending
order convention --violation 3
• Dimension/Range definition "(0 to 3)", for "dataSignal", does not comply to descending
order convention --violation 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Partition Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Partition Design Parameters
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Partition Design Parameters
Note
The “File Name” template string or the “Package Name” should be specified. Both
these parameter values cannot be empty simultaneously. Also, both parameter values
cannot be specified simultaneously.
Examples
Example 1
Check that constants are defined only inside file “*_consts.vhd”.
Rule Configuration
• Design Types — Constants
Violation Produced
Constant “CLK_PRD” defined inside design file. Place constant declarations in separate file
“*_consts.vhd”
Example 2
Check that constants are defined only in the package “mypkg”.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Partition Design Parameters
Rule Configuration
• Design Types — Constants
library ieee;
use ieee.std_logic_1164.all;
use work.pkg.all;
entity top1 is
port (
reset_n : in std_logic;
clk : in std_logic;
inp : in std_logic;
outp : out std_logic
);
end entity top1;
Violations Produced
• Constant "const" is not defined inside package(s) "mypkg" – Violation 1
• Constant "const_rtl" is not defined inside package(s) "mypkg" – Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Partition Design Parameters
Tip
Put Constants and Parameters in separate files from the design.
Related Topics
Partition Design Units
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Partition Design Units
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Partition Design Units
Rule Configuration
• Design Objects per File — Single Entity and All Its Architectures
ENTITY top IS
END ENTITY top;
Violation Produced
The package header 'pkg' should be declared in a separate file. – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Partition Design Units
Example 2
Check that each module is placed in a separate file.
Rule Configuration
• Design Objects per File — Single Module
class C; // Violation 1
endclass
Violation Produced
The class 'C' should be declared in a separate file. – Violation 1
Related Topics
Partition Design Parameters
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Related Combinatorial Logic
The diagram below illustrates a scenario in which DesignChecker unites the combinational
drivers driving a set of registers in the same module. So, as shown in the example,
DesignChecker would group the registers F1 and F2 in a single violation, since the
combinational clouds driving these registers have some commonality (combinational cloud C3
in this case). On the other hand, the combinational logic driving the register F5 shares no
commonality with that driving F1 and F2 and hence will not be grouped with the latter.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Related Combinatorial Logic
The diagram below illustrates a different case in which the path between F1 and F3 is not
reported as a violation, simply because there is just one cloud of combinational logic involved
in the path between these registers. For related combinatorial logic violations, at least 2
independent combinational clouds in different modules must be present, as seen in the path
between F2 and F4.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Related Combinatorial Logic
It should also be noted that combinational logic between two registers can be spread across
multiple modules via feedthroughs. To help with debug, the violations report the entire cone of
logic between the driving and the driven registers, including the feedthroughs and registers at
the boundaries. Identifying the registers connected on either side of the combinational logic
helps locate where best to move the combinational logic after merging. In the figure below, C1
and C2 represent a combinational logic cloud spread across multiple modules between two
registers, F1 and F2. C1 and C2 could be combined into a single combinational logic cloud C3
and placed in the module containing register F2. If there is no register after a combinational
logic cloud, the top-level input or output port will be considered as the logic cone boundary and
any reported violations will include the top level port.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Related Combinatorial Logic
Examples
Example 1
Check for related combinatorial logic across the design.
Rule Configuration
• Treat Latches as Combinational Elements — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Related Combinatorial Logic
Analyzed Code
module test16(input a, b, c, m, n, o, output l, u); // Violation 1, 7,
Associated Violation 6, 12
wire w1, w2, w3, w4;
middle1 inst1 (.d(a), .e(b), .f(c), .g(w1), .h(w2), .v(m),
.w(n), .x(o), .p(w3), .q(w4)); // Associated Violation
4, 5, 10, 11
middle2 inst2 (.i(w1), .j(w2), .k(l), .r(w3), .s(w4), .t(u)); //
Associated Violation 2, 3, 8, 9
endmodule
Violations Produced
• Combinational logic that drives output port(s): 'l' in top design unit 'test16' is not
grouped in a single design unit. – Violation 1
• + Related combinational logic either crosses module boundary through or reaches output
port(s): 'k' in instance 'test16.inst2'. – Associated Violation 2
• + Related combinational logic either crosses module boundary through or reaches input
port(s): 'i', 'j' in instance 'test16.inst2'. – Associated Violation 3
• + Related combinational logic either crosses module boundary through or reaches output
port(s): 'g', 'h' in instance 'test16.inst1'. – Associated Violation 4
• + Related combinational logic either crosses module boundary through or reaches input
port(s): 'd', 'e', 'f' in instance 'test16.inst1'. – Associated Violation 5
• + Related combinational logic either crosses module boundary through or reaches input
port(s): 'a', 'b', 'c' in top design unit 'test16'. – Associated Violation 6
• Combinational logic that drives output port(s): 'u' in top design unit 'test16' is not
grouped in a single design unit. – Violation 7
• + Related combinational logic either crosses module boundary through or reaches output
port(s): 't' in instance 'test16.inst2'. – Associated Violation 8
• + Related combinational logic either crosses module boundary through or reaches input
port(s): 'r', 's' in instance 'test16.inst2'. – Associated Violation 9
• + Related combinational logic either crosses module boundary through or reaches output
port(s): 'p', 'q' in instance 'test16.inst1'. – Associated Violation 10
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Related Combinatorial Logic
• + Related combinational logic either crosses module boundary through or reaches input
port(s): 'v', 'w', 'x' in instance 'test16.inst1'. – Associated Violation 11
• + Related combinational logic either crosses module boundary through or reaches input
port(s): 'm', 'n', 'o' in top design unit 'test16' – Associated Violation 12
Related Topics
Miscellaneous [DesignChecker User Guide]
Snake Paths
Register IO
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Structural Core
Structural Core
Language support: All (including SystemVerilog)
Checks that the top-level design unit is purely structural and does not contain any procedural
constructs like always blocks, complex assignments etc. Only instantiations and simple
continuous assignments are considered structural by default. However, additional constructs
like function/procedure calls, concatenations/aggregates can be configured to be considered as
structural constructs.
Usage
Structural Core
Common Parameters
Additional Structural Constructs
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Additional Structural Constructs
Specify any additional constructs which the tool should consider as structural. The default is
<none>.
o Concurrent sub-program calls
o Conditional Operators/Conditional Signal Assignments
o Concats and Aggregates
o Gate Instances
o <none>
Please note that any construct deemed as structural is not traversed and hence the tool would
not violate if a non-structural construct is used inside a structural construct. For example, if
“Concurrent sub-program calls” are considered structural and the function contains complex
assignments, no violation would be produced.
Examples
Example 1
Checks for the presence of procedural constructs in the top-level design unit.
Rule Configuration
• Additional Structural Constructs — <none>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Structural Core
Analyzed Code
module structcore (input in1, in2, output reg out1);
always @(in1 or in2) // Violation
out1<= in1 & in2;
endmodule
Violation Produced
Procedural construct encountered in top-level module 'structcore'.
Related Topics
Gate Level Instances
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Race Condition Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock Used As Data
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Clock Used As Data
Analyzed Code
module test1(clk1,clk2,reset,data_en,d, q1,q2); // Associated Violation
input clk1,clk2,reset,data_en,d;
output q1,q2;
reg q1,q2;
Violations Produced
• Clock used as data at register 'test1.q2'. – Violation
• + Clock signal ‘clk1’ is being used as data. – Associated Violation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Combinatorial Feedback
Combinatorial Feedback
Language support: All (including SystemVerilog)
Checks for the presence of combinatorial feedback paths within a module as well as across a
hierarchy. Combinatorial feedback paths cause race conditions which makes the output
unpredictable. Note that the effects of synthesis may result in different violations from those
expected from looking purely at the code.
Usage
Combinatorial Feedback
Common Parameters
Feedback Type
Treat Latches as Combinational Elements
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Feedback Type
Specify which feedback type should be checked. The default is <all>.
o Cyclic Loops within the Same Structural Element
Checks for the presence of a combinatorial feedback path confined to a single design
unit.
o Cyclic Loops between Different Structural Elements
Checks for the presence of a combinatorial feedback path across multiple design
units.
o <all>
Note
The tool also detects feedback loops in combinational logic which is unused.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Combinatorial Feedback
Rule Configuration
• Feedback Type — Cyclic Loops within the Same Structural Element, Cyclic Loops
between Different Structural Elements
Violations Produced
• Combinational feedback loop detected at 'w3'. – Violation 1
• + Combinational feedback loop passes through 'w4'. – Associated Violation 2
• + Combinational feedback loop passes through 'h'. – Associated Violation 3
• Combinational feedback loop detected at 'testloop.inst.c'. – Violation 4
• + Combinational feedback loop passes through 'testloop.inst.e'. – Associated Violation 5
Related Topics
Miscellaneous [DesignChecker User Guide]
Related Combinatorial Logic
Latch Inference
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Race
Register Race
Language support: Verilog Any (including SystemVerilog)
Checks whether a race condition may be introduced in the circuit due to the presence of
blocking assignments to registers.
Blocking assignments to a register in a sequential block may introduce a race condition, if this
register is read in a different sequential block. This is because both sequential blocks will be
triggered at the same time, and so the order of reading the register and assigning to it, is not
deterministic. So it is not known whether the old or the current value of the register in question
will be read. Usage of non-blocking assignments to registers ensures that a race condition does
not arise, because at the time of triggering itself, the old values are stored, which means that the
old value is always read.
Usage
Register Race
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
This example illustrates a register race that occurred due to the presence of a blocking
assignment and a read value of a register on the same clock.
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Race
Analyzed Code
module regrace3 (input [3:0] in1, in2, input clk, output reg [7:0] out1,
out2);
reg [4:10] x, x1;
Violations Produced
• Blocking assignment made to register 'x[8:10]', which is read in another sequential
block. – Violation 1
• + Reading register 'x[8:10]', which is assigned blockingly in another sequential block,
will lead to a race. – Associated Violation 2
• Blocking assignment made to register 'x[4:7]', which is read in another sequential block.
– Violation 3
• + Reading register 'x[4:7]', which is assigned blockingly in another sequential block,
will lead to a race. – Associated Violation 4
• Blocking assignment made to register 'x1[4:10]', which is read in another sequential
block. – Violation 5
• + Reading register 'x1[8:10]', which is assigned blockingly in another sequential block,
will lead to a race. – Associated Violation 6
• + Reading register 'x1[4:7]', which is assigned blockingly in another sequential block,
will lead to a race. – Associated Violation 7
Example 2
This example illustrates a potential register race due to the presence of a blocking assignment
and a read value of a register on different clocks.
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Race
Analyzed Code
module regrace4 (input [3:0] in1, input clk1, clk2, output reg [3:0]
out1);
reg [3:0] x;
Violations Produced
• Blocking assignment made to register 'x[3:0]', which is read in another sequential block.
– Violation
• + Potential race for register ‘x[3:0]', which is written blockingly and read on different
clocks. – Associated Violation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Range Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Constrained Ranges and Bounds
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Constrained Ranges and Bounds
• Range Type
Optionally check specified range has Positive or Natural range values. The default is <don’t
care>.
o Positive
o Natural
o <don’t care>
Examples
Example 1
Checks that type declarations of base type Integer have ranges.
Rule Configuration
• Language — VHDL
• Applies To — Types
Violation Produced
Integer types must have ranges.
Example 2
Check for any loop integer index ranges that are not positive/natural depending on user input.
Ignore any non-integer ranges.
Rule Configuration
• Language — VHDL Any
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Constrained Ranges and Bounds
Analyzed Code
For I in result ‘RANGE loop
--loop body
end loop;
Violation Produced
For loop index integer range should be positive
Note
Specify the range, bound, or size of a specific type of statement.
Related Topics
Hard Coded Numeric Values
Numeric Width Declarations
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Matching Range
Matching Range
Language support: All (including SystemVerilog)
Checks that bit widths are matching on the left and right hand sides of assignments and
operands of logical and arithmetic operators. Furthermore, this rule checks the bit widths
between the formals and actuals of instances and sub-programs. In addition, out-of-bound
indexes, vector reference to scalars, and the consistency between port and net declarations in
Verilog are also checked. Optionally, the rule can be configured to skip the following:
mismatches in sizes of operands of overloaded operators, increments of a variable/signal which
result in only a single-bit overflow, and size mismatches of signed/unsigned expressions.
It should be noted that VHDL language semantics already cover all mismatching range checks
except out-of-bounds indexes. The effects of synthesis may result in different violations from
those expected from looking purely at the code.
Usage
Matching Range
Common Parameters
Match
Ignore
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Match
Specify the scope for bit-width matching. The default is Explicit Widths in Assignments,
Explicit Widths in Associations, Operands of comparison operators, Port & Net
Declarations (Verilog only) and Disallow Vector Reference to Scalars.
o Explicit Widths in Assignments
o Explicit Widths in Associations
o Operands of comparison operators
o Operands of arithmetic/bitwise operators
o Out of Bounds Indexes
o Port & Net Declarations (Verilog only)
o Disallow Vector Reference to Scalars
• Ignore
Specify the type of bit-width mismatches which can be ignored. The default is <none>.
o Size mismatches of operands of overloaded operators
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Matching Range
Important Notes:
• To be able to set the value “Size mismatches of operands of overloaded operators” for
the Ignore parameter, note the following:
It would not be possible to select this value unless at least one of the values “Operands
of comparison operators” or “Operands of arithmetic/bitwise operators” from the
“Match” parameter is also selected.
• To be able to set the value “Increments to signals/variables resulting in single-bit
overflow” for the Ignore parameter, note the following:
It would not be possible to select this value unless “Explicit Widths in Assignments”
value from the “Match” parameter is also selected.
Increment to a signal/variable is of the form:
<sig> <= <sig> + <constant>
This normally results in a size-mismatch violation because the addition of the constant
can lead to an overflow.
However, when this value is selected, if the potential overflow does not exceed one bit,
no violation is reported.
In other words, when this value is selected, no size mismatch violations are produced if
all of the following conditions are fulfilled:
o The signal/variable on the left and right of the assignment is exactly the same.
o The increment factor is a constant.
o The increment does not result in an overflow of more than one bit.
• The value “Size mismatches of signed/unsigned expressions” is applicable to VHDL
only. When this value is selected, signed/unsigned matches will be ignored for the
following “Match” parameter checks:
o Explicit Widths in Assignments
o Operands of comparison operators
o Operands of arithmetic/bitwise operators
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Matching Range
Rule Configuration
Default parameter values.
Analyzed Code
module match (in1, in2, in3, out1, out2, out3);
input [3:0] in1, in2, in3;
output [3:0] out1, out2, out3;
reg [4:0] out3; // Violation 1
Violations Produced
• Port 'out3' has mismatching vector ranges between its I/O declaration ([3:0]) and its
internal wire declaration ([4:0]). – Violation 1
• Bit widths differ on left (4) and right (3) of assignment. – Violation 2
• Bit widths differ on left (4) and right (2) of assignment. – Violation 3
• Bit widths differ on left (4) and right (3) of relational operator '=='. – Violation 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Matching Range
• Bit widths differ between formal 'in1' (3) and actual 'in2' (4) for call to function 'func'. –
Violation 5
• Bit widths differ on left (1) and right (3) of assignment. – Violation 6
Related Topics
Miscellaneous [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Non-Static Ranges
Non-Static Ranges
Language support: VHDL Any
Checks for the usage of non-static slices in expressions, since they are not synthesizable. It is
applicable to VHDL only, since Verilog does not allow non-static ranges. Any violation of this
rule will result in the synthesizability violation as well.
Usage
Non-Static Ranges
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for the usage of non-static ranges in assignment.
Rule Configuration
Default parameter values.
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity nonStatRange is
port (in1, in2 : in std_logic_vector(31 downto 0);
sel1, sel2 : in integer range 0 to 15;
out1 : out std_logic_vector(31 downto 0));
end;
Violation Produced
Use of non-static part-select.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Asynchronous Block
Asynchronous Block
Language support: Verilog Any
Checks that asynchronous Verilog always blocks are coded in a synthesizable manner. Always
blocks should not contain more than one sequential statement or constructs other than IF-ELSE.
The rule can optionally also detect:
Synchronous always blocks which have asynchronous resets and empty always blocks (block
controls a null statement or a begin-end block containing no statements).
Usage
Asynchronous Block
Common Parameters
Detect
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Detect
Specify which additional check to perform. The default is <all>.
o Multiple sequential statements
o Empty block
o <all>
Examples
Example 1
always @(posedge clk or negedge rst )
begin : proc2
div_data=div_msb_lsb[0] ; // Violation
sample = 1 ;
end
Violation Produced
Asynchronous always block contains more than one sequential statement. This may not be
synthesizable. Use a cascade of if-else-if.
Note
Asynchronous always block contains more than one sequential statement, this may not be
synthesizable.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Asynchronous Load Signals
Analyzed Code
always @(posedge clk or posedge reset or posedge load) // Violation
begin
if(reset)
out1<= 4'b0000;
else if(load)
out1 <= in1;
else
begin
if(sreset)
out1 <= 4'b0000;
else
out1 <= in2;
end
end
Violation Produced
Register 'out1' has an active high asynchronous load, 'load'.
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Blocking Nonblocking Assignments
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify the type of always block that the rule is to be applied to. The default is Sequential
Block.
o Pure Combinational Block
o Combinational Block Inferring Latches
o Sequential Block
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Blocking Nonblocking Assignments
Note
A combinational block inferring latches is one which models one or more latches,
irrespective of the rest of the logic modeled by that block. A pure combinational
block on the other hand, is one which does not model any latches.
• Assignment Type
Specify the type of assignment that is to be checked. The default is Sequential Assignment
and Combinational Assignment.
o Sequential Assignments
o Combinational Assignments
Note
Sequential Assignment represents assignments to both latches and flip-flops.
• Assignment Operator
Specify the assignment operator that is to be checked. The default is Nonblocking.
o Blocking
o Nonblocking
Note
Typically, a given variable can be assigned at multiple points in an always block.
The operator for all these assignments has to be the same (blocking/nonblocking),
otherwise this is non-synthesizable. Hence, it is sufficient to point to one of the
assignments of this variable which violates the rule configuration. The tool points to the
first assignment of that variable.
Examples
Example 1
Check that register and latch assignments in a sequential block are nonblocking.
Rule Configuration
• Applies To — Sequential Block
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Blocking Nonblocking Assignments
Analyzed Code
module blknonblk1 (input [3:0] in1, in2, input clk, reset,
output reg [3:0] out1, out2);
always @(posedge clk or posedge reset)
begin
if(reset)
begin
out1 = 4'b0000; // Violation 1
out2 = in1; // Violation 2
end
else
out1 = in2;
end
endmodule
Violations Produced
• Register assignments in a sequential block should be nonblocking. – Violation 1
• Latch assignments in a sequential block should be nonblocking. – Violation 2
Example 2
Check that all assignments in a combinational block inferring latches are blocking.
Rule Configuration
• Applies To — Combinational Block Inferring Latches
Violations Produced
• Latch assignments in a combinational block inferring latches should be blocking. –
Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Blocking Nonblocking Assignments
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Edge Trigger Control
Rule Configuration
• Allowed Clock Edge — Positive
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Edge Trigger Control
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY EdgeControl IS
PORT(
d1, d2, clk_neg, clk_pos, rst: in std_logic;
q1, q2: out std_logic
);
END ENTITY EdgeControl;
--
ARCHITECTURE arch1 OF EdgeControl IS
begin
PROCESS(clk_neg, clk_pos, rst) -- Violation
BEGIN
if (clk_pos'event and clk_pos='1') then
if(rst = '1') then
q1<= '0';
else
q1 <= d1;
end if;
end if;
if (rst = '0') then
q2 <= '1';
elsif (clk_neg'event and clk_neg='0') then
q2 <= d2;
end if;
end process;
END ARCHITECTURE arch1;
Violation Produced
Clock 'clk_neg' is used at 'negative edge'.
Example 2
Checks that all the FSM registers are using negative clock edges only.
Rule Configuration
• Allowed Clock Edge — Negative
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Edge Trigger Control
Analyzed Code
module fsm (out, inp, clk, enb, cnd, rst);
output out;
reg out;
input [7:0] inp;
input clk, enb, cnd, rst;
Violation Produced
FSM Clock 'clk' is used at 'positive edge'.
Related Topics
Consistent Clocks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Input Synchronizer
Input Synchronizer
Language support: All (including SystemVerilog)
Checks primary inputs driving combinatorial logic before being synchronized. It supports
cascading flip-flops synchronizer style with asynchronous set/reset.
Usage
Input Synchronizer
Common Parameters
Minimum Synchronizer Stages
Description
You can specify the number of required synchronizer stages using the “Minimum Synchronizer
Stages” parameter.
This rule raises a violation if a primary input is found to drive combinatorial logic directly or
after being synchronized with an insufficient number of synchronizer stages.
The rule distinguishes between “not synchronized input ports” and “not sufficiently
synchronized input ports” as follows.
• Any input port synchronized with N-stage synchronizer (minimum value for N = 1), and
N is still below the number of synchronizer stages specified in the configured rule, then
it is considered as “not sufficiently synchronized input port”.
• In some cases, the clock enable signal may be used to synchronize a signal instead of
using N-stage synchronizer, yet, it still requires validation. This is depicted in analysis
results using the following violation: “Some input ports might not be synchronized with
a sufficient number of stages before driving combinatorial logic, Perhaps it is indirectly
synchronized by a clock enable signal.”
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Minimum Synchronizer Stages
Specify the minimum number of flip-flops that will be considered a synchronizer. A signal
that is an output of a number of flip-flops that are equal or greater than the value of this
parameter is considered synchronized. The default is 2.
o <positive integer>
Examples
Example 1
This example detects primary inputs driving combinatorial logic before being synchronized
with a 2-stage synchronizer.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Input Synchronizer
Rule Configuration
• Minimum Synchronizer Stages — 2
Analyzed Code
`resetall
`timescale 1ns/10ps
// combinatorial logic
assign out1 = in_drives_comb&& mid_1stage && mid2_2stages;
Violations Produced
• Input port 'in_drives_comb' is not synchronized before driving combinatorial logic. –
Violation 1
• Input port 'in_1stage' is not synchronized before driving combinatorial logic. – Violation
2
Example 2
This example detects the following:
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Input Synchronizer
• Primary inputs driving combinatorial logic before being synchronized with sufficient
number of stages.
• Primary inputs driving combinatorial logic before being synchronized with sufficient
number of stages but enable signal is used, so perhaps it is indirectly synchronized by a
clock enable signal.
Rule Configuration
• Minimum Synchronizer Stages — 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Input Synchronizer
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY Synchronizer IS
PORT(
input,clk : IN std_logic;
rst : IN std_logic;
syncSig : OUT std_logic
);
END Synchronizer ;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY Top IS
PORT(
input1 : IN std_logic; --Violation 1
input2 : IN std_logic; --Violation 2
input3 : IN std_logic; --Violation 3
clk : IN std_logic;
enable : IN std_logic;
rst : IN std_logic;
sout : OUT std_logic
);
END Top ;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Input Synchronizer
Violations Produced
• Input port 'input1' is not synchronized before driving combinatorial logic. – Violation 1
• Input port 'input1' is not synchronized with a sufficient number of stages before driving
combinatorial logic. – Violation 2
• Input port 'input1' is not synchronized with a sufficient number of stages before driving
combinatorial logic, Perhaps it is indirectly synchronized by a clock enable signal. –
Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Latch Inference
Latch Inference
Language support: All (including SystemVerilog)
Checks for inference of latches resulting from some conditions under which a signal holds its
previous value. The rule detects latches inferred from combinatorial logic (for example, signal
<= signal feedback latch due to a missing else). Registers with an inferred signal <= signal
feedback due to a missing else are not detected by this rule.
Usage
Latch Inference
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
This example detects latches in conditional operators in Verilog.
Rule Configuration
Default parameter values.
Analyzed Code
module verlatch (input in1, sel, output out1); // Violation
assign out1 = sel ? in1 : out1;
endmodule
Violation Produced
Latch(es) inferred for net ‘out1’.
Example 2
This example detects latches in VHDL sequential processes.
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Latch Inference
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity vhdlatch is
port (in1, in2, in3, in4 : in std_logic; out1 : out std_logic;
out2 : out std_logic_vector(3 downto 0));
end;
Violation Produced
Latch(es) inferred for net 'out2(2 downto 1)'.
Related Topics
Combinatorial Feedback
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Control Signals
Rule Configuration
• Detect — Registers with asynchronous preset and clear
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Control Signals
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
entity Reg_rst_prst is
port( CLR, PR, CLK : in std_logic;
D1 : in std_logic;
Q1 : out std_logic
);
end entity Reg_rst_prst;
Violation Produced
The register "Q1" has both asynchronous preset and clear.
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Controllability
Register Controllability
Language support: All (including SystemVerilog)
Checks whether all state bits (registers/latches) can be controlled from the inputs. A state bit
might suffer from a dead-end value, which means that the bit drives a constant unless an
asynchronous reset is applied. A state bit might also suffer from a stuck-at-fault, which means
that the bit always drives a constant value, irrespective of any changes in the inputs, including
resets. Note that the effects of synthesis may result in different violations from those expected
from looking purely at the code.
Usage
Register Controllability
Common Parameters
Check For
Check Partial Buses
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Check For
Specify the type of control violation to be reported. The default is Dead-End Value and
Stuck-at-Fault.
• Check Partial Buses
Specify whether violations are to be produced for partially violating buses (e.g. a bus
wherein only some bits are dead-end/stuck-at). The default is Yes.
Note
Important Notes:
• In case of VHDL records and SV structs, a violation on a field of the record/struct
will be considered a partial bus violation.
• In case a bus is completely stuck-at, but partially stuck-at-0 and partially stuck-at-1,
then no violation will be produced for this bus if “Check Partial Buses” is set to
“No”. See Example 3.
• In case a bus is completely stuck-at a particular value, but is partially driven from
different always blocks/processes, then no violation will be produced for this bus if
“Check Partial Buses” is set to “No”. See Example 3.
Examples
Example 1
This example illustrates a dead-end value scenario.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Controllability
Rule Configuration
• Language — Verilog Any
Violation Produced
State bit(s) ‘out1’ may reach a dead end value of 1.
Example 2
This example illustrates a stuck-at-0 fault scenario.
Rule Configuration
• Language — Verilog Any
Violation Produced
State bit(s) ‘out1[1:0]’ has/have stuck-at-0 fault.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Controllability
Example 3
This example illustrates the rule behavior when the “Check Partial Buses” parameter is set to
“No”.
Rule Configuration
• Language — Verilog Any
Violation Produced
State bit(s) 'out1' may reach a dead end value of 1.
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Register Reset Control
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register IO
Register IO
Language support: All (including SystemVerilog)
Checks if the specified input and output ports have been registered. By default, asynchronous
controls are excluded from this check but the rule can be manually configured to have them
checked. Similarly, non-clocked blocks can be skipped from this check. This is a design wide
check.
Usage
Register IO
Common Parameters
Detect Multiple Registrations
Applies To
Applies To Non-Clocked Blocks
Check Inputs
Check Outputs
Check Asynchronous Controls
Treat Latches as Registers
Description
For output ports, the register needs to be inferred within the module, whereas for input ports, a
register can be inferred either within the module or for the net which is connected to the input
port from outside.
As seen in the figure below, In1 and In2 are input ports. For In2, the register is inferred within
the module, whereas for In1, the register is inferred for the net to which it is externally
connected. Both cases are not considered Register IO violations. On the other hand, O2 which is
an output port, requires the register to be inferred inside the module, and in the absence of this,
a violation will be produced for O2 even though it is externally connected to a register.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register IO
It should be noted that in case of direct paths through hierarchy, the Register IO violation will
not be flagged for intermediate points, even though the conditions mentioned above are
violated. As shown in the figure below, the violation will be populated only for the port
indicated by the red arrow. It will not be populated for the ports indicated by the green arrows.
A necessary condition for producing a Register IO violation is that a port must drive (or be
driven by) combinational logic other than buffers. The mere presence of buffers would not
qualify for Register IO violations because buffers can be removed or added by synthesis tools
without any change of functionality. However, inverters are treated as combinational logic and
their presence would result in Register IO violations. Also, latches are treated as either registers
or combinational logic depending upon the value of the corresponding rule parameter that has
been provided for latches.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Detect Multiple Registrations
Specify whether a violation should be raised if an input is registered more than once. The
default is No.
Note
Setting this parameter to “Yes” affects both the “Check Asynchronous Controls” and
“Treat Latches as Registers” parameters, as they will also be automatically set to
“Yes”.
• Applies To
Specify the type of blocks to which this rule is to be applied. The default is Top-Level Block
and Sub-Blocks.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register IO
It is important to note that if the Top-Level Block parameter is selected and the Sub-Blocks
parameter is not selected, all Register IO violations appear at the top-level IOs only. In such
a case, if a top-level port drives some combinational logic that is not present at the top-level
design unit itself but is present somewhere inside the design hierarchy, then a primary
Register IO violation appears for the top-level port and a corresponding associated violation
appears for the port of the instance in which the combinational logic being driven is actually
present.
Also, if the Sub-Blocks parameter is selected and the Top-Level Block parameter is not
selected, then top-level IOs are not considered for Register IO violations and only sub-block
level (non top-level) IOs are checked. Hence, if a design unit with no instances is selected
for check, then this design unit is treated as a top-level block, and the IOs of this top-level
block will be checked only if the Top-Level Block parameter is selected and not if the Sub-
Blocks parameter is individually selected.
Note that if both the Top-Level Block and Sub-Blocks parameters are selected, violations
will appear for all unregistered ports of the top-level design unit and its instances except
those ports which lie on direct paths through the hierarchy (as illustrated in the Description
section above). So in this case the tool does not violate for any port that is neither driving
nor is being driven by combinational logic and this includes such ports of the top-level
design unit as well. Note that in this case, a violation is not produced for a top-level port that
has only direct hierarchical connections. This is because if the user selects both the
parameters Top-Level Block and Sub-Blocks, they will get a violation anyway for the port
of the instance that is closest to the combinational logic (because Sub-Blocks parameter is
selected) even if no combinational logic is adjacent to the top-level port and there is no
chance of a miss in pointing out the design issue.
However, if the user selects the parameter Top-Level Block only, there is a possibility that
combinational logic lying somewhere deep down the design hierarchy is adjacent to some
port that is in turn connected to a top-level port via direct connections, and the tool does not
violate for either the top-level port (because combinational logic is not adjacent to this port)
or the port inside the design hierarchy (because Sub-Blocks parameter is not selected).
Hence, in such a case, a violation is still produced for the top-level port in question with an
associated violation for the port of the instance that is driving (or is being driven by) the
combinational logic.
• Applies To Non-Clocked Blocks
Specify whether pure combinational blocks should be checked. The default is No.
• Check Inputs
Specify the type of inputs which need to be checked.The default is All Inputs.
o All Inputs
o FSM Inputs
o <none>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register IO
• Check Outputs
Specify the type of outputs which need to be checked.The default is All Outputs.
o All Outputs
o FSM Outputs
o <none>
• Check Asynchronous Controls
Specify whether asynchronous controls should be checked. The default is No.
• Treat Latches as Registers
Specify whether latches should be treated as registers or as combinatorial elements. The
default is Yes.
Examples
Example 1
Check that all outputs and inputs are registered.
Rule Configuration
Default parameter values.
Analyzed Code
module regio (input in1, in2, input clk, reset,
output out1, out2);
reg temp;
always @(posedge clk)
temp <= in1;
bottom inst (temp, in2, clk, reset, out1, out2); // Violation 1
endmodule
Violations Produced
• Input 'inst.in2' is used without being registered. – Violation 1
• Output 'out1' is used without being registered. – Violation 2
Related Topics
Related Combinatorial Logic
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Reset Control
Note
If a register is connected to an internal signal it will not be considered as an input
register (even if an input port is connected to that internal signal).
o Other Registers
• Reset Mode
Specify the reset mode to be used for all registers. The default is Synchronous.
o Synchronous
o Asynchronous
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Reset Control
o <any>
Means that the register must simply have a reset. The exact reset mode
(synchronous/asynchronous) does not matter.
• Reset Polarity
Specify the reset polarity to be used.The default is <don’t care>.
o Active High
o Active Low
o <don’t care>
Means that the polarity is not checked.
• Ignore Non-Required Reset Mode
Specify whether it is valid for a register to have both reset modes (that is, both the required
mode and non-required mode).The default is No. If this parameter is set to “Yes”, the check
would flag missing required mode but ignore any occurrences of non-required reset mode. If
set to “No”, the occurrences of non-required reset modes would also get flagged.
• Skip
Specify if there are certain types of always blocks/processes which should be skipped (not
checked). The default is <none>.
o Clocked Blocks Which Do Not Contain Any Reset
Implies that reset mode violations should not be reported for registers in clocked
blocks which do not contain any resets at all. Refer to Example 2.
o <none>
Additional Information about Pipeline Registers:
Pipeline registers are characterized by the following:
o Chain of registers 2 or more in number wherein the output of one register feeds the
input of the other without any intervening logic.
o Note that if two registers are connected using a buffer (internal signal), it will not be
considered as a pipeline chain.
o These registers need to have the same clock, however, the rest of the controls may
differ.
o The potential start of any pipeline register chain is a register which does not feed a
register directly.
Examples
Example 1
Check whether all registers have a synchronous reset, and report occurrences of non-required
reset styles.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Reset Control
Rule Configuration
• Applies To — FSM State Variable Registers, Pipeline Registers, Input Registers, Other
Registers
• Skip — <none>
Analyzed Code
module syncasyncreset (input clk, arst, srst, input [3:0] in1, in2,
output reg [3:0] out1, out2);
Violations Produced
• Input Register 'out1' must not be initialized using asynchronous reset. – Violation 1
• Input Register 'out2' has not been initialized using synchronous reset. – Violation 2
Example 2
In this example, DesignChecker should skip clocked blocks which do not contain a reset.
Rule Configuration
• Applies To — FSM State Variable Registers, Pipeline Registers, Input Registers, Other
Registers
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Reset Control
Violation Produced
Input Register 'out3' has not been initialized using asynchronous reset.
Example 3
In this example, DesignChecker should violate for all instances of 'active low' reset.
Rule Configuration
• Applies To — FSM State Variable Registers, Pipeline Registers, Input Registers, Other
Registers
• Skip — <none>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Reset Control
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity superMix3 is
port (din, din2, din3, rst, rst1, clk, load, clk_fsm,clk_fsm2 : in
std_logic;
dout,dout_2,dout_3 : out std_logic);
end superMix3;
begin
derive_clks: process (clk)
begin
clk1 <= clk;
clk2 <= clk;
end process;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Reset Control
Violations Produced
• Synchronous Reset 'rst' is used as an 'active low' reset. – Violation 1
• Asynchronous Reset 'rst1' is used as an 'active low' reset. – Violation 2
Related Topics
Register and Control Signal Inference [DesignChecker User Guide]
Initialization Assignments
Edge Trigger Control
Edge Detection
Internally Generated Resets
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Types
Register Types
Language support: VHDL Any
Checks that data is registered using permissible types like signals, variables and shared
variables only.
Usage
Register Types
Common Parameters
Disallowed Types
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Disallowed Types
Specify the types that are not allowed to register data. The default is Variables and Shared
Variables.
o Variables
o Shared Variables
o Signals
Examples
Example 1
Check that only signals are allowed to register data.
Rule Configuration
• Disallowed Types — Variables, Shared Variables
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Register Types
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity regtypes is
port (in1, in2 : in std_logic_vector(3 downto 0);
clk, reset, sel : in std_logic;
out1 : out std_logic_vector(3 downto 0));
end;
Violations Produced
• Do not use variable ‘temp’ as a register. – Primary Violation 1
• + Variable 'temp' is used to register data. – Associated Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
SV Always Blocks
SV Always Blocks
Language support: Verilog Any (including SystemVerilog)
The SystemVerilog language defines new types of always blocks like always_latch and
always_comb to indicate the design intent to simulation, synthesis and formal verification tools.
This rule checks if there is any discrepancy between the type of always block and the logic that
is inferred inside it; for example, an always_comb block for which a latch gets inferred.
Usage
SV Always Blocks
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for combinational logic being inferred inside an always_latch block.
Rule Configuration
Default parameter values.
Analyzed Code
module combinalwayslatch(in1,in2,clk,out1);
input wire [2:0] in1;
output reg [2:0] out1;
input wire clk,in2;
always_latch // Violation
if(in2 == 1'b0)
out1 = in1;
else if (in2 == 1'b1) // out1 is assigned in all possible paths, so no
latch is inferred.
out1 = ~in1;
endmodule
Violation Produced
Combinational Logic inferred for net 'out1' inside always_latch block.
Example 2
Check for latches being inferred inside an always_ff block.
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
SV Always Blocks
Analyzed Code
module latchinalwaysff(in1,rst,clk,en,out1);
input wire [1:0] in1;
output reg [1:0] out1;
input wire clk,en,rst;
always_ff@(posedge clk or posedge rst or posedge en) // Violation
begin
if(rst)
out1[1] = 1'b1;
else if (en)
out1[1] = in1[1]; // Latch inferred for out1[1].
else
out1[0] = in1[0];
end
endmodule
Violation Produced
Latch inferred for net 'out1[1]' inside always_ff block.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Report Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Arithmetic Gate Report
It should be noted that adders and multipliers are not inferred for scalar inputs. Both inputs need
to be vectors greater than 1-bit in size.
Counters
DesignChecker can detect both synchronous (clock-dependent) and combinatorial/
asynchronous counters. Only a case of increment/decrement by 1 is detected as a counter. Also,
counters less than 3-bit in size are not inferred. The pattern for synchronous and combinatorial/
asynchronous counters is as follows:
Synchronous Counters
The code snippet below illustrates the pattern which is inferred as a synchronous counter. The
example below contains all the possible controls for a synchronous counter, but not all of them
are mandatory. Even a synchronous increment/decrement by 1 would be inferred as a counter.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Arithmetic Gate Report
Examples
Example 1
Check the arithmetic elements in the design.
Rule Configuration
• Report — Adders, Multipliers, Counters
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Arithmetic Gate Report
Analyzed Code
module addmultctr (input [3:0] in1, in2, in3, input clk, load, reset,
output reg [3:0] out1, output reg [7:0] out2, out3);
Violations Produced
• Adder detected. – Violation 1
# Adder Size: 4
• Signed multiplier detected. – Violation 2
# Output Size: 8
# Input Sizes: 4, 4
• Counter inferred for net 'out3'. – Violation 3
# Counter Type: Synchronous
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Design Report
Design Report
Language support: All
Reports different items in the design which can be used to measure design complexity,
understandability, etc. It allows you to create customizable reports about the design. The rule’s
parameters accept text embedded with variables. In the report, these variables are substituted
with the corresponding values for the checked design. For each top-level design unit, a violation
is produced, and the variables are substituted differently according to the corresponding top-
level design unit and its underlying design.
Usage
Design Report
Common Parameters
Report Summary
Report Details
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Report Summary
Define the report summary which will be displayed as the violation message (in one line).
The default is Report for design: "%(rpt_top_design_unit)".
This parameter accepts any text which references any of the variables defined in the
“Reported Items” section below. At least rpt_top_design_unit variable must be referenced.
• Report Details
Define the report content (supports multiple lines).The default is:
Design "%(rpt_top_design_unit)" has the following information:
%(rpt_num_top_ports_in) top-level input ports
%(rpt_num_top_ports_out) top-level output ports
%(rpt_num_hier_levels) hierarchical levels
%(rpt_num_design_units) entities/modules
%(rpt_num_processes) process/always blocks
%(rpt_num_includes) included files
%(rpt_num_hdl_lines) HDL lines
%(rpt_num_hdl_statements) HDL statements
This parameter accepts any text which references any of the variables defined in the
“Reported Items (Variables)” section below.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Design Report
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Design Report
Note
A “pin” represents a “bit” so, for example, a port defined as std_logic_vector(7
DOWNTO 0) has 8 pins. In case the number of pins is unknown (because of an
unresolved type size due to the absence of its definition), then the variables are
substituted with the value “unknown” along with an indication to the unresolved type
size. For example: “<unknown – unknown type ‘bus_type’ of port ‘p_bus’>”. The
number of pins for VHDL numeric types (such as integer, positive, etc.) is calculated as
log2 of the maximum value the port can have, and for signed types one bit is added. The
number of pins for enumerated types is calculated as log2 of the number of enumerated
values.
Examples
Example 1
Report the number of input/output pins for the top-level design unit and the number of design
units.
Rule Configuration
• Report Summary — Report for design with top-level unit "%(rpt_top_design_unit)".
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Design Report
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY top IS -- Violation
PORT (in1 : IN std_logic(3 DOWNTO 0);
out1 : OUT std_logic(7 DOWNTO 0));
END ENTITY;
-- ---------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY leaf IS
PORT (in1 : IN std_logic(3 DOWNTO 0);
out1 : OUT std_logic(3 DOWNTO 0));
END ENTITY;
Violation Produced
Report for design with top-level unit "top".
Top-level design unit “top” has 4 input pins and 8 output pins.
The design has 2 design units and 2 hierarchical levels (depth).
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Report
FSM Report
Language support: All (including SystemVerilog)
reports all the finite state machines inferred in the design along with their state variables and
number of states. A tabulated report mentions the state names and the corresponding literals. A
“state” for an FSM is defined as a constant value against which the FSM state variable is
compared, or a constant value which the FSM state variable is assigned.
It should be noted that the valid states for an inferred finite state machine are those states which
are reachable from the reset state. In the absence of an explicit reset state, the FSM will be
reported as not having any externally reachable states. Also, a valid FSM is characterized by the
presence of appropriate state transitions that occur on a clock edge. If no clocked transitions can
be found in the HDL code, the tool will not identify the code as representing an FSM. Note that
the effects of synthesis may result in different violations from those expected from looking
purely at the code.
Usage
FSM Report
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Report the finite state machines inferred in the design.
Rule Configuration
Default parameter values.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Report
Analyzed Code
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity test01 is
port (CLOCK, RESET : in STD_LOGIC;
A, B, C, D, E: in BOOLEAN;
SINGLE, MULTI, CONTIG: out BOOLEAN);
type enum_1 is (S0, S1, S2, S3);
end test01;
Violation Produced
Detected a 4-state FSM with state variable CS[1:0].
# State Encoding Table
# State Name Literal
# S0 00
# S1 01
# S2 10
# S3 11
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
FSM Report
Related Topics
Finite State Machines (FSMs) [DesignChecker User Guide]
FSM Coding Style
FSM State Encoding Style
FSM Transitions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Memory Element Report
Rule Configuration
• Report — Memories, Tri-States
Analyzed Code
module mem (input [7:0] in1, in2, input [2:0] addr,
input rden, wren, clk, sel1, sel2, sel3,
output reg [7:0] out1, output [3:0] out2); // Violation 2, 3
reg [7:0] mem1 [7:0]; //Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Memory Element Report
Violations Produced
• Memory inferred for net 'mem1', depth = 8, width = 8. – Violation 1
# No. of read accesses= 0
# No. of write accesses= 0
# No. of read-write accesses= 1
• Tristate bus detected for net 'out2[1:0]'. – Violation 2
# Enables
# 1. sel2
# 2. not(sel3)
• Tristate bus detected for net 'out2[3:2]'. – Violation 3
# Enables
# 1. sel1
# 2. not(sel3)
Related Topics
Multiple Drivers
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
String Report
String Report
Language support: All (including SystemVerilog)
Reports the occurrence of specific strings in HDL files.
Usage
String Report
Common Parameters
Expression(s)
Match Case
Violation Message
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Expression(s)
Specify a regular expression. Design file contents are matched with the expressions and
each occurrence is reported. The default is <none>.
o <user-defined>
o <none>
• Match Case
Specify whether string matching is case sensitive or not.The default is Yes.
• Violation Message
Specify the information to be reported in the violation message. The default is Expression,
matching string.
o Expression, matching string
o Expression, matching string & full line
Examples
Example 1
Disallow coverage on/off pragmas.
Rule Configuration
• Language — Verilog Any
• Match Case — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
String Report
Analyzed Code
module top;
reg temp;
// coverage off - Violation 1
reg temp1;
//COVERAGE on - Violation 2
endmodule
Violations Produced
• String "// coverage off" matches expression "^[ \t]*//[ \t]*coverage[ \t]+(on|off)". Full
line: // coverage off – Violation 1
• String "//COVERAGE on" matches expression "^[ \t]*//[ \t]*coverage[ \t]+(on|off)".
Full line: //COVERAGE on – Violation 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sensitivity Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Event Controls
Event Controls
Language support: Verilog Any (including SystemVerilog)
Checks for the presence of potentially non-synthesizable event controls.
Usage
Event Controls
Common Parameters
Description
Some of the event controls that this rule checks are actually non-synthesizable. Such event
control specifications produce a synthesizability violation as well. The rest are considered
synthesizable by the tool, however, they are violated for, since all tools may not consider these
as synthesizable. The following event controls are flagged by this rule:
Note
The effects of synthesis may result in different violations from those expected from looking
purely at the code.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for potentially non-synthesizable event controls.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Event Controls
Analyzed Code
module eventctrl (input in1, in2, clk, reset, output reg out1, out2,
out3);
always @(in1 | in2) // Violation 1
out1 <= in1 & in2;
always @(clk)
out2 <= @(clk) in1 | in2; // Violation 2
always @(clk)
begin
repeat (4) @(in1); // Violation 3
out1 = in1;
end
endmodule
Violations Produced
• Complex expression specified in the sensitivity list. – Violation 1
• Event control specification encountered in assignment. – Violation 2
• Repeat event control specification encountered. – Violation 3
Related Topics
Design Correctness and Synthesizability [DesignChecker User Guide]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sensitivity List
Sensitivity List
Language support: All (including SystemVerilog)
Checks that the sensitivity list of a VHDL process or Verilog block includes the required signals
and does not include any unnecessary signals. It also checks for the appearance of duplicate
elements or slices of vector signals in the sensitivity list.
Usage
Sensitivity List
Common Parameters
Check For
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Check For
Specify which group(s) of signals to check for. The default is Missing Signals, Unneeded
Signals, Sliced Signals and Duplicate Signals
o Missing Signals
o Unneeded Signals
o Sliced Signals
o Duplicate Signals
Note
It is important to note the following:
• The “Duplicate Signals” parameter checks for completely duplicate signals only. It
does not check for scenarios like (a[3:0] or a[2:1]) or (a[3:0] or a [6:2]).
• The “Unneeded Signals” parameter checks for completely unneeded signals as well
as partially unneeded signals. If “Sliced Signals” are disallowed, DesignChecker
shows violations only on completely unneeded signals, otherwise it shows violations
on completely and partially unneeded signals.
Examples
Example 1
Check for extra, missing, sliced and duplicate signals.
Rule Configuration
• Check For — Missing Signals, Unneeded Signals, Sliced Signals, Duplicate Signals
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sensitivity List
Analyzed Code
module senslist1 (input [3:0] in1, in2, input sel, output reg [3:0] out1);
always @(in2 or sel or sel) // Violation 1, 2, 3
begin
if(sel)
begin
out1[0]<= in2[0];
out1[3:1] <= 3'b110;
end
else
out1 <= in1;
end
endmodule
Violations Produced
• Duplicate signal(s) 'sel' encountered in the sensitivity list. – Violation 1
• Sensitivity list of process/always statement includes unneeded signal(s) 'in2[3:1]'. –
Violation 2
• Incomplete sensitivity list for process/always statement. Signal(s) 'in1' is/are needed. –
Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Style Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Assignment Alignment
Assignment Alignment
Language support: All
Checks that a group of assignment statements or declaration initializations are aligned together.
A group of assignments/declarations should have all of its statements in consecutive lines. A
new line or a comment line splits the statements into two groups that are checked separately.
Only statements that appear at the beginning of the line and end at the same line are checked.
Statements spanning multiple lines or appearing at the same line after another statement are not
checked.
For two statements to be aligned they should fulfill the following:
- Their assignment operators should be aligned. If the assignment operators have different sizes
(e.g., "=" and "<="), then operator ends should be aligned.
- The beginning of their right hand side should be aligned.
Usage
Assignment Alignment
Common Parameters
Applies To
Tab Width
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify the types of assignment statements to be checked. Declaration initializations can
also be checked. The default is Sequential Assignments.
o Concurrent Assignments
o Continuous Assignments
o Sequential Assignments
o Declaration Initializations
• Tab Width
Specify the equivalent number of spaces of a single tab character. Each tab character found
in the statement is considered equivalent to a number of space characters specified by this
parameter. The default is 3.
o <user-defined> [Integer ranging from 0 to 10]
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Assignment Alignment
Examples
Example 1
Check the alignment of sequential assignment statements.
Rule Configuration
• Applies To — Sequential Assignments
• Tab Width — 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Assignment Alignment
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY address_decode IS
PORT(
addr : IN std_logic_vector (2 DOWNTO 0);
clk_div_en : OUT std_logic;
clr_int_en : OUT std_logic;
ser_if_select : OUT std_logic_vector (1 DOWNTO 0);
xmitdt_en : OUT std_logic
);
END address_decode ;
CASE addr IS
WHEN "000" =>
clk_div_en <= '1';
WHEN "001" =>
clk_div_en <= '1';
WHEN "100" =>
xmitdt_en <= '1'; -- Associated Violation 2.1
ser_if_select <= addr(1 downto 0); -- Violation 2
WHEN "101" =>
ser_if_select <= addr(1 downto 0);
WHEN "110" =>
ser_if_select <= addr(1 downto 0);
WHEN "111" =>
clr_int_en <= '1';
WHEN OTHERS =>
clk_div_en <= '0'; -- Violation 3
xmitdt_en <= '0'; -- Associated Violation 3.1
ser_if_select <= "11";
clr_int_en <= '0'; -- Associated Violation 3.2
END CASE;
END PROCESS decode_proc;
END rtl;
Violations Produced
• All assignments within this group should be aligned to this assignment statement –
Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Assignment Alignment
• + Assignment operator has to be shifted 3 spaces to the right – Associated Violation 1.1
• + Assignment operator has to be shifted 4 spaces to the right – Associated Violation 1.2
• + Assignment operator has to be shifted 3 spaces to the right – Associated Violation 1.3
• All assignments within this group should be aligned to this assignment statement –
Violation 2
• + Assignment operator has to be shifted 4 spaces to the right – Associated Violation 2.1
• All assignments within this group should be aligned to this assignment statement –
Violation 3
• + Assignment right-hand-side has to be shifted 3 spaces to the left – Associated
Violation 3.1
• + Assignment right-hand-side has to be shifted 2 spaces to the left – Associated
Violation 3.2
Example 2
Check the alignment of declaration initializations.
Rule Configuration
• Applies To — Declaration Initializations
• Tab Width — 3
Analyzed Code
`resetall
`timescale 1ns/10ps
module declarations;
parameter WIDTH = 3; -- Associated Violation 1.1
parameter HEIGHT = 7; -- Violation 1
// ...
endmodule
Violations Produced
• All assignments within this group should be aligned to this assignment statement –
Violation 1
• + Assignment operator has to be shifted 1 space to the right – Associated Violation 1.1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Dangling Else
Dangling Else
Language support: Verilog Any (including SystemVerilog)
Detects any dangling Else statements. The dangling Else problem occurs in Verilog when the
Begin/End block statement is not used. As a result, when using nested If statements, it is not
clear which If statement is associated with the dangling Else.
Usage
Dangling Else
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for dangling Else statements.
Rule Configuration
Default parameter values.
Analyzed Code
module Dangling_Else (a, b);
input a, b;
always @ (*)
begin
if (a)
if (b)
$display ("a and b");
else // Violation
$display ("Not a");
end
endmodule
Violation Produced
If/Else association may be ambiguous.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Declaration Style
Declaration Style
Language support: All
Checks the layout style for Declarations. It checks whether declarations are formatted with each
on a separate line or, in the case of Ports, with each group of ports of the same mode (input,
output etc) on a separate line. Code is more readable if each declaration appears on a separate
line.
Usage
Declaration Style
Common Parameters
Apply To
Declaration Format
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Apply To
Specify to which objects the rule applies. The default is <all>
o Ports
o Generics
o Signals
o Variables
o Constants
o Files
o Parameters
o <all>
• Declaration Format
Specify the layout for Interface Declarations. The default is Each Declaration On Separate
Line.
o Each Declaration On Separate Line
o Each Group Starts On Separate Line
Examples
Example 1
Check if signals and files are declared on separate lines.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Declaration Style
Rule Configuration
• Apply To — Signals, Files
Note
Place each declaration on a separate line to improve readability.
Violations Produced
• Multiple signals declared on one line, declarations should be on separate lines. -
Violation 1
• Multiple files declared on one line, declarations should be on separate lines. – Violation
2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Enclosed Block Style
Note
Enclose blocks and/or statements within ‘begin’ - ‘end’ pairs.
Violation Produced
Enclose if statement branch within a 'begin'..'end' pair
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File References
File References
Language support: All
Checks the path style of referenced files. It also checks the length and uniqueness of the file
names.
Usage
File References
Common Parameters
Applies To
Path
Platform
Max. File Name Length
Make Unique
Uniqueness Width
Case Sensitive
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify to which object/s the rule applies.The default is `include Directives and File
Declarations.
• Path
Specify the required style for referenced file paths. The default is File Name Only.
o File Name Only
o Relative Path
o Absolute Path
• Platform
o DOS
o Unix
• Max. File Name Length
Specify the maximum file name length using. The default is <don’t care>.
o 20
o <don’t care>
o Used-Entered
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File References
• Make Unique
Specify if file names are unique. The default is No.
• Uniqueness Width
Specify number of characters considered when checking for file name uniqueness. The
default is <don’t care>.
o 15
o <don’t care>
o Used-Entered
• Case Sensitive
Specify if case sensitivity is considered when checking for file name uniqueness, this is only
applicable on Unix platforms. The default is Yes.
Examples
Example 1
Check that filename references do not use absolute pathnames and filenames are unique within
15 characters.
Rule configuration
• Applies To — File Declarations
• Uniqueness Width — 15
Violations Produced
Referenced file “c:\myfolder\my_input_file_f2.txt" must not be specified by an absolute path.
Referenced file “my_input_file_f2" must have a unique filename within the first 15 characters.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File References
Example 2
Check that filename references do not use absolute pathnames.
Rule configuration
• Language — VHDL any
• Make Unique — No
• Uniqueness Width — 15
Violation Produced
Referenced file “c:\myfolder\my_input_file_f2.txt" must not be specified by an absolute path.
Example 3
Rule configuration
• Language — Verilog
• Make Unique — No
• Case Sensitive — No
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
File References
Analyzed Code
`include "./inc/timescale.v"
Violation Produced
Referenced file "./inc/timescale.v" must be specified by a file name onlyHint:Use the
Note
Use the recommended path style for referenced files.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Indentation
Language support: All (including SystemVerilog)
Checks that statements are indented by the specified number of indentation spaces.
Usage
Indentation
Common Parameters
Applies To
Spaces Number Limit
Spaces Number
Tab Width
Check Comments
Description
Code should be indented by a certain pattern in order to enhance its readability. This rule checks
the indentation of different types of statements. The rule works as follows:
• It checks that each statement is indented relative to its enclosing scope (parent
statement) according to the specified number of indentation spaces.
• It checks the indentation of certain keywords within some statements.
• Moreover, it checks that a comment located above a statement has the same indentation
of the associated statement.
This rule checks that each statement of any of the selected type(s) in the “Applies To” parameter
is indented by a specified number of spaces. This indentation is measured relative to the
enclosing statement (i.e. the parent statement) of the statement. In other words, the rule checks
the difference between the indentation of a statement and the indentation of its enclosing scope.
In general, the indentation of a line is calculated as the number of “spaces” at the beginning of
the line. If the beginning of the line contains a “Tab” or more, then each tab is converted to its
equivalent number of spaces (as specified by the “Tab Width” parameter).
The indentation of a “statement” is calculated as the indentation of the first line of the statement.
For VHDL, the indentation of the “enclosing scope” is calculated as the indentation of the line
containing the “BEGIN” keyword. This applies to PROCESS, ARCHITECTURE, BLOCK,
etc. Similarly, it is measured as the indentation of “THEN” for “IF Statement”, “ELSE” for
ELSE blocks, LOOP for loops, WHEN for CASE Statement and so on. An exception of this
rule is applied for declarative statements; where they appear before the “BEGIN” keyword. In
this case, the indentation of the enclosing scope is measured as the indentation of the first line of
the statement.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
scope” are bounded by a “Sequential Block (begin-end)” or “Parallel Block (fork-join)” then the
indentation of the enclosing scope is calculated as the line containing the “begin” or “fork”
keyword.
As a result of the previous note, when “Sequential Blocks” or “Parallel Blocks” is selected in
the “Applies To” parameter, then all statements of these types are checked. However, such
statements that are considered as block boundaries for other statements as indicated in the
previous note are not checked. On the other hand, they can be checked as “keywords”
associated with their statements.
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify the statements for which the indentation should be checked. This parameter
contains many types of statements grouped into the following groups: VHDL Statements,
VHDL Declarations, Verilog Statements, and Verilog Declarations. The default is <VHDL
Statements>, <VHDL Declarations>, <Verilog Statements> and <Verilog Declarations>.
o <VHDL Statements>: [Contains VHDL non-declaration statements]
• VHDL ASSERTION
• VHDL ASSIGNMENT
• VHDL BLOCK
o First line of VHDL BLOCK
o Keyword BEGIN within VHDL BLOCK
Keyword BEGIN within VHDL BLOCK: Aligned
Keyword BEGIN within VHDL BLOCK: Indented
o Keyword END within VHDL BLOCK
Keyword END within VHDL BLOCK: Aligned
Keyword END within VHDL BLOCK: Indented
• VHDL CASE
o First line of VHDL CASE
o Keyword END within VHDL CASE
Keyword END within VHDL CASE: Aligned
Keyword END within VHDL CASE: Indented
o Keyword WHEN within VHDL CASE
Keyword WHEN within VHDL CASE: Aligned
Keyword WHEN within VHDL CASE: Indented
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
• VHDL EXIT
• VHDL GENERATE
o First line of VHDL GENERATE
o Keyword BEGIN within VHDL GENERATE
Keyword BEGIN within VHDL GENERATE: Aligned
Keyword BEGIN within VHDL GENERATE: Indented
o Keyword END within VHDL GENERATE
Keyword END within VHDL GENERATE: Aligned
Keyword END within VHDL GENERATE: Indented
• VHDL IF
o First line of VHDL IF
o Keyword ELSE within VHDL IF
Keyword ELSE within VHDL IF: Aligned
Keyword ELSE within VHDL IF: Indented
o Keyword END within VHDL IF
Keyword END within VHDL IF: Aligned
Keyword END within VHDL IF: Indented
o Keyword END within VHDL IF
Keyword END within VHDL IF: Aligned
Keyword END within VHDL IF: Indented
• VHDL INSTANCE
• VHDL LOOP
o First line of VHDL LOOP
o Keyword END within VHDL LOOP
Keyword END within VHDL LOOP: Aligned
Keyword END within VHDL LOOP: Indented
o Keyword LOOP within VHDL LOOP
Keyword LOOP within VHDL LOOP: Aligned
Keyword LOOP within VHDL LOOP: Indented
• VHDL NEXT
• VHDL NULL
• VHDL PROCEDURE Call
• VHDL PROCESS
o First line of VHDL PROCESS
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
For some statements, the indentation of lines containing specific keywords is also checked.
For each keyword, it is possible to define the allowed indentation. This can be done by
selecting/unselecting two nodes under the specified keyword node in the “Applies To” tree.
One of them is used to allow the line containing the keyword to be indented while the other
allows the line to be aligned. Accordingly, the following combinations are available:
a. Checking “Aligned” only: This means that the line containing this keyword shall be
aligned to the first line of the statement being checked.
b. Checking “Indented” only: This means that the line containing this keyword shall be
indented relative to the first line of the statement.
c. Checking both “Indented” and “Aligned”: This means that the line containing the
keyword is allowed either to be aligned to or indented from the first line of the
statement.
d. Unchecking both “Aligned” and “Indented”: This means that it is not required to
check the indentation of the line containing the specified keyword.
For all statements, it is possible to check the indentation of the comment above the
statement (See “Check Comments” parameter below).
“Verilog Data Declaration” includes data declarations of the following types: 'bit', 'logic',
'reg', 'byte', 'shortint', 'int', 'longint', 'integer', 'time', 'shortreal', 'real', 'realtime', 'struct',
'union', 'enum', 'string', 'chandle', 'event', ‘virtual interface’, ‘type reference’ and ‘class
object handles’.
“Verilog Parameter Declaration” includes declarations of types ‘parameter’, ‘localparam’ &
‘specparam’.
• Spaces Number Limit
Specify how the indentation of statements should be checked. The default is Equals.
o “Equals” means that the indentation must match the specified number of spaces.
o “At least” means that the indentation must be at least the specified number of spaces
or more. Also, it implies that indentation is consistent.
o “At most” means that the indentation must be at most the specified number of spaces
or less. Also, it implies that indentation is consistent.
o “Range” means that the indentation must be within a certain range. Also, it implies
that indentation is consistent.
The meaning of indentation being consistent is defined as follows: all statements selected in
the “Applies To” parameter must have the same number of spaces for their indentation
level. This is done regardless of the type of indentation character used (see the “Tab Width”
parameter).
When checking the consistency of indentation, the “majority” rule is used. If the indentation
of a statement has the same number as the majority, then it is considered correct (while
others are considered incorrect). The scope used to determine the majority is the “file”. In
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
other words, the indentation of all statements is checked to be consistent within each file
separately. More than one file may have different indentations; in this case, the majority is
also calculated separately per each file.
The indentation values of keywords within statements (for example: "BEGIN" keyword
within VHDL PROCESS) do not contribute to calculating the majority value. Also, the
indentation of comments does not contribute to calculating the majority.
On the other hand, the indentation of keywords within statements is checked for consistency
when they are actually indented (not aligned).
• Spaces Number
Specify the number of allowed indentation spaces. If the indentation contains a “tab”, then
the equivalent number of “spaces” must be specified here, and hence this shall be calculated
according to the “Tab Width” parameter. The default is 3.
o <user-defined>
If the value of the “Spaces Number Limit” parameter is “Range”, then the value of this
parameter should specify the required range. The range is entered as
“<minimum>:<maximum>”. For example, if the required range is from 2 to 4 spaces, then
the value of the parameter shall be “2:4”. Other than that, the value of the parameter should
be a positive integer or zero.
• Tab Width
Specify the equivalent number of spaces of a single tab character. Each tab character found
in the indentation of a statement is considered equivalent to a number of spaces characters
specified by this parameter. This is used to measure the indentation of a statement in spaces.
The default is 3.
o <user-defined> [Integer ranging from 0 to 10]
• Check Comments
Specify whether it is required to check the indentation of comments above the checked
statements or not. The default is No.
The comments checked are those found above the statements that are being checked
(according to the value of the “Applies To” parameter). Each line of comment is checked to
have the same indentation of the statement below it. In other words, a comment is checked
to be aligned with the statement below it.
For each statement, the comment lines that are checked are the continuous set of comment
lines located just above the statement. It is allowed to have a blank line between this set of
lines and the first line of the statement. See the below examples.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Example:
-- These 3 comment lines are not considered as comments of the
-- assignment statement below. This is because there is a blank line
-- separating them from other comment lines above the statement.
-- This line is considered as a comment of the assignment statement.
-- This line is also considered a comment for the assignment
-- statement.
-- This is the continuous set of comment lines above the statement.
x <= ‘1’;
Example:
-- Although there is a single blank line below, this line and the
-- following lines are still considered as comments of the assertion
-- statement below
assert y = ‘0’;
Examples
Example 1
Check that the indentation equals a specified value.
Rule Configuration
• Applies To — <VHDL Statements>, <VHDL Declarations>
• Spaces Number — 2
• Tab Width — 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Analyzed Code
-- VHDL Entity for BCDCounter
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY BCDCounter IS
GENERIC(
prop_delay : time := 10 ns
);
PORT(
cnten : IN std_logic ;
clear : IN std_logic ;
clk : IN std_logic ;
load : IN std_logic ;
dat_in : IN std_logic_vector (3 DOWNTO 0) ;
carry_in : IN std_logic_vector (3 DOWNTO 0) ;
count : OUT std_logic_vector (3 DOWNTO 0) ;
zero : OUT std_logic
);
END BCDCounter ;
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Violations Produced
• 'Comment' is not aligned to 'Process Statement'. – Violation 1
• 'Variable Declaration' is indented by 0 spaces relative to its enclosing scope. It must be
indented by 2 spaces. – Violation 2
• 'Assignment Statement' is indented by 3 spaces relative to its enclosing scope. It must be
indented by 2 spaces. – Violation 3
• Keyword 'END' is neither aligned to 'If Statement' nor indented by 2 spaces relative to it.
– Violation 4
Example 2
Check that the indentation does not fall below a specified value and is consistent.
Rule Configuration
• Applies To — <Verilog Statements>, <Verilog Declarations>
• Spaces Number — 2
• Tab Width — 2
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Analyzed Code
module accumulator(
clock,
clr,
inc,
ip,
ld,
op
);
// Internal Declarations
input clock;
input clr;
input inc;
input [7:0] ip;
input ld;
output [7:0] op;
wire [7:0] ip;
wire ld;
wire clr;
wire inc;
wire clock;
reg [7:0] op;
always @ (posedge clock)
begin
// Asynchronous Reset // Violation 1
if(clr)
begin
// Reset Actions
op = 0; // Violation 2
end
else begin
// Block 1
if ((ld == 1))
op = ip; // Violation 3
else
if ((inc == 1))
op = op+1;
else
op = op;
end
end // Violation 4
endmodule // accumulator
Violations Produced
• 'Comment' is not aligned to 'If Statement'. – Violation 1
• 'Assignment Statement' is indented by 3 spaces relative to its enclosing scope. It must be
consistent with other statements indented by 2 spaces. – Violation 2
• 'Assignment Statement' is indented by 1 space relative to its enclosing scope. It must be
indented by at least 2 spaces. – Violation 3
• Keyword 'end' is neither aligned to 'Always Block' nor indented by at least 2 spaces
relative to it. – Violation 4
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation
Related Topics
Indentation Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation Style
Indentation Style
Language support: All (including SystemVerilog)
Indentation for code should use a specified character. This rule specifies the allowed indentation
character (“space” or “tab”) and violates if the disallowed character is used or if a mix of
“space” and “tab” is used for indenting a line.The rule checks Indented lines, Non-empty lines
which contain code or comments and All source files and included files. Note that if design-unit
level checking is used, the violations are produced only for the lines of the design units involved
in the checked design hierarchy and also the lines which are not related to any design unit (for
example, lines of file headers, etc.).
Usage
Indentation Style
Common Parameters
Allowed Character
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Allowed Character
Specify the allowed character that must be used for indentation. The default is Space.
o Space
o Tab
Examples
Example 1
Check that all non-empty indented lines are indented using a “space” character.
Rule Configuration
• Allowed Character — Space
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Indentation Style
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY indentation_style IS
PORT (in1 : IN std_logic;
in2 : IN std_logic; -- Violation 1
out1 : OUT std_logic);
END ENTITY indentation_style;
Violations Produced
• Indentation mixes the use of 'tab' and 'space' characters which is not allowed. The 'space'
character should be used instead – Violation 1
• Indentation uses 'tab' character which is not allowed. The 'space' character should be
used instead – Violation 2
Related Topics
Indentation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Length
Length
Language support: All
Checks that specified objects do not exceed their maximum permitted lengths.
Usage
Length
Common Parameters
Applies To
Max. Length
Min. Length
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To
Specify to which objects the check applies. The default is HDL Lines.
o Common
• Clock
• File Names
Refers to the entire file name including extension (e.g. my_file.vhd). It also
refers to the actual name of the file rather than the file type in VHDL designs.
• HDL Lines
• Instances
• Ports
• Resets
• Integers
• Labels
Checks the length of the labels of the following objects:
VHDL: Case statement, Exit statement, If statement, Loop statement, Next
statement, Null statement, Return statement, Wait statement, Assert statement
(concurrent & sequential), Report statement, Assignment statement, Procedure
call statement, VHDL block statement, & Generate block statement
Verilog: Fork-join block, Begin-end block
• FSM Current States
• FSM Next States
• Functions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Length
o VHDL
• Architectures
• Configurations
• Constants
• Entities
• Enum Literals
• Generics
• Packages
• Procedures
• Processes
• Signals
• User-Defined Types
• Variables
o Verilog
• Always Blocks
• Initial Blocks
• Modules
• Internal Nets
• Parameters
• Internal Regs
• Tasks
• Max. Length
Specify the maximum allowed length. The default is 72.
o <don’t care>
o <user-defined>
o 72
Note
The value <don’t care> will allow users to disable the checking for maximum length
in case they are interested in checking minimum length only.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Length
• Min. Length
Specify the minimum allowed length. The default is <don’t care>.
o <don’t care>
o <user-defined>
o 3
Examples
Example 1
Analyzed Code
architecture rtl of top is
signal test_signal_length_1_has_a_very_long_name : std_logic;
-- Signal name “test_signal_length_1_has_a_very_long_name” violates
-- maximum length of “32” characters
end rtl;
Violation Produced
Signal name “long_name” violates maximum length of “32” characters
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Mixed Combinational Sequential Code
Rule Configuration
• Ignore — Synchronous control signals
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Mixed Combinational Sequential Code
Analyzed Code
ENTITY example3 IS
port (
clk : in std_logic;
rst_n : in std_logic;
load_a_r : in std_logic;
mux_sel_a_r : in std_logic_vector(2 downto 0);
datapath1_r : in std_logic_vector(7 downto 0);
datapath2_r : in std_logic_vector(7 downto 0);
output_r : out std_logic_vector(7 downto 0)
);
END ENTITY example3;
BEGIN
example3_p : process (clk, rst_n)
begin
if (rst_n = '0') then
output_r <= (others => '0');
elsif rising_edge(clk) then
if (load_a_r = '1') then
output_r <= CONST_A; -- Allow sync reset exceptions
else
case mux_sel_a_r is
when "000" =>
output_r <= datapath1_r;
when "001" =>
output_r <= datapath2_r;
when "010" =>
output_r <= STUFFING_PATTERN; -- Violation 1,
STUFFING_PATTERN is a constant
when "100" =>
output_r <= AIS_FLAG; -- Violation 2, AIS_FLAG is a
constant
when others =>
output_r <= (others => '0'); -- Violation 3
end case;
end if;
end if;
end process example3_p;
END ARCHITECTURE rtl;
Violations Produced
• VHDL sequential process contains conditional constant assignments. This can result in
mismatching simulation vs. synthesis behavior. – Violation 1
• VHDL sequential process contains conditional constant assignments. This can result in
mismatching simulation vs. synthesis behavior. – Violation 2
• VHDL sequential process contains conditional constant assignments. This can result in
mismatching simulation vs. synthesis behavior. – Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Statement Style
Statement Style
Language support: All
Checks that there is no more than one statement on each line. Declarations are excluded unless
there is a declaration on the same line as another statement. “Else” keywords and the Verilog,
“begin” keyword can be excluded from this check.
Usage
Statement Style
Common Parameters
Exceptions
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Exceptions
Specify which keywords should be excluded from the check.The default is begin.
o if
o else
o elsif
o else if
o begin
o <none>
Examples
Example 1
Analyzed Code
module top (clk_master, …..);
...
assign x = inX; assign y = inY; assign z = inZ; // Use a separate line
for each HDL statement
end module
Violation Produced
Use a separate line for each HDL statement.
Related Topics
Declaration Style
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Verilog Statement Order
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Verilog Statement Order
Examples
Example 1
Analyzed Code
1. module top (clk_master, ….., in1);
2.
3. wire in1; // Internal net declaration(s) must lie just after all IO
declarations ending at line: 8
4. input in1;
5. input in2;
6. wire in2;
7. output o2;
8. wire out2;
9. end module
Violations Produced
• Port Order
Declaration of port “in1” does not follow the order: "input, output, inout"
• Internal Net Order
Internal net declaration(s) must lie just after all IO declarations ending at line: 8
Related Topics
Explicit Net Declarations
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Statement Order
Note
Clock and Reset Ports:
• Clock/Reset Port detection will depend upon the synthesizability of the design
unit. If the design unit is non-synthesizable, then clock/reset ports will be treated
as normal input ports.
• This is not a design-wide check and hence for clock/reset port detection, the
corresponding ports have to be used as clocks/resets within the same design unit.
• Reset ports include both asynchronous as well as synchronous resets.
o <don’t care>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Statement Order
• Declaration Order
Specify the required relative order for declarations in concurrent scopes - architecture, block
and generate. The default is Types and Sub-types, Attributes Declarations, Constants,
Signals, Shared Variables, Subprograms, Components, Configurations and Attributes
Specifications.
o Types and Sub-types
o Attributes Declarations
o Constants
o Signals
o Shared Variables
o Subprograms
o Components
o Configurations
o Attributes Specifications
o <don’t care>
• Statement Order
Specify the required relative order for statements in concurrent scopes - architecture, block
and generate. The default is Generate Statements, Processes, Concurrent Assignments and
Block Statements.
o Generate Statements
o Processes
o Concurrent Assignments
Includes simple/selected/conditional signal assignments and concurrent procedure
calls.
o Block Statements
o <don’t care>
• Additional Checks
Check for port order match in entities and their components and “use” clauses in
architecture declarative region. The default is Disallow USE clause in architecture
declarative region.
o Component port order should match Entity port order
o Disallow USE clause in architecture declarative region
o <don’t care>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Statement Order
Tip
Important Notes
• Only those components which have been instantiated would be considered for the
entity-component port match check. If there are unused components in the
architecture declarative region, these will not be candidates for this check.
• This check will not apply to undefined design units, since there is no reference entity
to compare against.
• It is possible that the ports in the component are a sub-set of the ports in the entity.
The ports missing from the component definition will not be considered for this
check. These ports will be assumed to be present in the required order.
Examples
Example 1
Check for the required order of entity ports, declarations and statements.
Rule Configuration
• Entity Port Order — Input Ports, Output Ports, Clock Ports
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Statement Order
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity stmtorder1 is
port (in1, in2 : in std_logic_vector(3 downto 0);
clk : in std_logic; -- Primary Violation 5
out1 : out std_logic_vector(3 downto 0); -- Associated Violation
8
out2 : out std_logic;
enable : in std_logic); -- Associated violation 6,Primary
Violation 7
end;
begin
process(clk) -- Associated Violation 4
begin
if(clk'event and clk = '1') then
if(enable = vcc) then
out1 <= in1 and in2;
end if;
end if;
end process;
Violations Produced
• Constant 'vcc' does not maintain the relative order 'Constant - Signal' – Primary
Violation 1
• [+] Place constant 'vcc' before signal 'temp' – Associated Violation 2
• Concurrent assignment does not maintain the relative order 'Concurrent assignment -
Process' – Primary Violation 3
• +] Place concurrent assignment before process – Associated Violation 4
• Clock 'clk' does not maintain the relative order 'Input port - Clock' – Primary Violation 5
• [+] Place clock 'clk' after input port 'enable' – Associated Violation 6
• Input port 'enable' does not maintain the relative order 'Input port - Output port' –
Primary Violation 7
• [+] Place input port 'enable' before output port 'out1' – Associated Violation 8
Example 2
Check for matching component and entity port order, and for use clause in architecture
declarative region.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Statement Order
Rule Configuration
• Entity Port Order — <don’t care>
• Additional Checks — Component port order should match Entity port order, Disallow
USE clause in architecture declarative region
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Statement Order
Analyzed Code
library ieee;
use ieee.std_logic_1164.all;
entity stmtorder2 is
port (in1, in2 : in std_logic_vector(3 downto 0);
clk : in std_logic;
out1 : out std_logic_vector(3 downto 0);
enable : in std_logic);
end;
component middle is
port (in1, in2 : in std_logic_vector(3 downto 0);
out1 : out std_logic_vector(3 downto 0); -- Violation 2
clk : in std_logic; -- Violation 3
enable : in std_logic);
end component;
begin
inst : middle port map (in1, in2, out1, clk, enable);
end;
library ieee;
use ieee.std_logic_1164.all;
entity middle is
port (in1, in2 : in std_logic_vector(3 downto 0);
clk : in std_logic;
out1 : out std_logic_vector(3 downto 0);
enable : in std_logic);
end;
Violations Produced
• Use clause should not appear in the declarative region of an architecture – Violation 1
• Position of port 'out1' is different in the component (3) than in the entity (4) – Violation
2
• Position of port 'clk' is different in the component (4) than in the entity (3) – Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VHDL Statement Order
Related Topics
Verilog Statement Order
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sub-Program Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Operator Overloading
Operator Overloading
Language support: VHDL Any
Checks that none of the standard operators have been overloaded
Usage
Operator Overloading
Common Parameters
Parameters
• Common Parameters
See Parameters Common to all Base Rules
Examples
Example 1
Check for overloaded operators.
Analyzed Code
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
package pkg is
function "-"(L, R: INTEGER) return INTEGER;
end pkg;
Violation Produced
The standard operator ‘-‘ should not be overloaded – Violation 1
Related Topics
Allowed Operators
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Parameter Association List
Note
The parameter "Ignore If Unique Types" cannot be set to "Yes" while "Association" is set to
"Positional", and vice versa.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Parameter Association List
Examples
Example 1
Check for function call parameter lists that do not use named association, if the number of
associations is at least 3.
Rule configuration
• Applies To — Function call
• Association — Named
• Threshold — 3
Analyzed Code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY param_list_example IS
PORT(din : IN std_logic;
dout1, dout2, dout3 : OUT natural);
END ENTITY param_list_example;
--
ARCHITECTURE arch OF param_list_example IS
FUNCTION big(SIGNAL a, b : IN integer; c, d, e : IN std_logic;
SIGNAL f : IN std_logic_vector(3 DOWNTO 0)) RETURN natural
IS
BEGIN
-- ...
END FUNCTION;
SIGNAL u, v : integer;
SIGNAL w, x, y : std_logic;
SIGNAL z : std_logic_vector(3 DOWNTO 0);
dout1 <= big(u, v, w, x, y, z); -- Violation
dout2<= big(a => u, b => v, c => w, d => x, e => y, f => z);
dout3 <= small(u, v);
-- ...
END ARCHITECTURE arch;
Violation Produced
Use named association in function calls.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sub-Program Body
Sub-Program Body
Language support: All
This rule can check a number of aspects related to sub-programs. Checks include: having at
least one exit point, not having multiple exit points, the return statement being the last
statement, sub-programs not being recursive and not accessing (read or assign to) variables/
signals which are not local to the scope of the sub-program, the return statement not returning
any expression, and code sharing through procedure calls in concurrent statements not being
available.
Usage
Sub-Program Body
Common Parameters
Sub-Program
Allow Assign To
Disallow
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Sub-Program
Specify to which sub-program type(s) the check should apply. The default is Functions and
Procedures / Tasks.
• Allow Assign To
Specify whether assignments are allowed to local and/or non-local variables/signals within
the sub-program. The default is Local Variables.
o Local Variables
o Non-local Variables
o <don’t care>
• Disallow
Specify which aspects are not allowed within a sub-program. The default is Multiple exit
points/return statements, Exit point/return statement not the last statement, Missing exit
point/return statement, Recursion and Referencing non-local variables.
o Multiple exit points/return statements
o Exit point/return statement not the last statement
o Missing exit point/return statement
o Recursion
o Referencing non-local variables
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sub-Program Body
o Code Sharing
o Expression return statements
o Incomplete Outputs Assignments
o Signal Parameters with OUT Mode [VHDL Only]
o <don’t care>
Examples
Example 1
Check for referencing non-local variables in Verilog.
Rule Configuration
• Sub-Program — Functions
Violation Produced
Function 'add' uses signal/variable 'in2' declared outside the scope.
Example 2
Check for the following: multiple return statements, the return statement being the last
statement in the function, the function output being undefined in one of the paths in the VHDL
function, and returned expressions.
Rule Configuration
• Sub-Program — Functions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sub-Program Body
ENTITY subprog2 IS
PORT (in1, in2 : IN std_logic_vector(3 DOWNTO 0);
sel1, sel2 : IN std_logic;
out1 : OUT std_logic_vector(3 DOWNTO 0));
END subprog2;
ARCHITECTURE subprog2 OF subprog2 IS
BEGIN
PROCESS (in1, in2, sel1, sel2)
BEGIN
out1<= logicop(in1, in2, sel1, sel2);
END PROCESS;
END subprog2;
Violations Produced
• Function "logicop" has multiple return statements – Violation 1
• The return statement should be the last statement in function "logicop"" – Violation 2
• Function 'logicop' has its output undefined in one or more paths. – Violation 3
• Function ""logicop"" should not return an expression – Violation 4
• Function ""logicop"" should not return an expression – Violation 5
Example 3
Check for code sharing through procedure calls in concurrent statements.
Rule Configuration
• Sub-Program — Procedures / Tasks
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sub-Program Body
Analyzed Code
ENTITY codesharing IS
END codesharing;
BEGIN
BadChange(internal,1); -- First call
BadChange(internal,2); -- Violation
my_out<= my_in XOR internal;
END rtl;
Violations Produced
• Code sharing disallowed: signal "internal" was already assigned through a previous
concurrent procedure call statement – Violation
• + Do not assign values to signals in procedure ""BadChange"" since it is called as a
concurrent statement – Associated Violation
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sub-Program Logic
Sub-Program Logic
Language support: All (including SystemVerilog)
Checks that a given sub-program type (Functions, Procedure/Task) contains combinatorial or
sequential logic.
A sub-program is said to infer sequential logic if a register or latch is inferred within the sub-
program irrespective of any other logic in the sub-program. On the other hand, if a sub-program
does not infer a register or latch, it is considered to infer combinatorial logic. Further, a register
is considered to be inferred within a sub-program if a clock edge specification is encountered
within the sub-program body.
Usage
Sub-Program Logic
Common Parameters
Sub-Program
Allowed Inference
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Sub-Program
Specify the Sub-Program type/s to which the check applies. The default is Functions and
Procedures/Tasks.
• Allowed Inference
Specify which style of coding is allowed within the specified type/s of Sub-program. The
default is Combinatorial Logic.
o Sequential Logic
o Combinatorial Logic
Examples
Example 1
Check for combinatorial logic inference in Functions.
Rule Configuration
• Sub-Program — Functions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Sub-Program Logic
Analyzed Code
entity dff is
port(d, clk, reset : in bit;
q : out bit);
function func (signal clk,d : in bit) return bit is -- Violation 1
variable q : bit;
begin
if (clk'event and clk = '1') then
q := d;
end if;
return q;
end func;
end dff;
Violation Produced
Function 'func' infers sequential logic
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Verification Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Classes
Allowed Classes
Language support: SystemVerilog
Checks specified allowed or disallowed inherited or instantiated UVM/OVM classes.
Usage
Allowed Classes
Common Parameters
Classes
Action
Check
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Classes
Specify the class name(s) that must not be inherited (i.e. used as base classes). The
parameter has the value <none> which means no base class is disallowed (as if the rule is
disabled). The default is <none>.
o <user-defined>
o <none>
• Action
The parameter has the values Allow, Disallow (default). The Allow value means that the set
of UVM/OVM classes specified in the Classes parameter are the only ones that can be
inherited or instantiated. Conversely, the Disallow value means that the set of UVM/OVM
classes specified in the Classes parameter must not be inherited or instantiated. The default
is Disallow.
o Allow
o Disallow
• Check
The parameter has the values Derived Classes (default), Defined Members. The Derived
Classes value means that any classes inherit from allowed/disallowed classes are checked.
The rule will check for direct or indirect OVM/UVM base class of a user-defined class (not
simply the direct base class). The Defined Members value means that any handles created
directly from the type of the allowed/disallowed classes are checked; other handles created
from classes which inherit from allowed/disallowed classes are not checked. The default is
Derived Classes.
o Derived Classes
o Class Handles
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Classes
Examples
Example 1
Reports UVM classes that are derived from uvm_sequencer.
Rule Configuration
• Classes — uvm_sequencer
• Action — Disallow
Violations Produced
• Class ‘ma_sequencer_base’ inherits from a disallowed class ‘uvm_sequencer’. –
Violation 1
• Class ‘ma_sequencer’ inherits from a disallowed class ‘uvm_sequencer’. – Violation 2
Example 2
Reports UVM classes having data member(s) whose types are other than uvm_analysis_port,
uvm_analysis_export, tlm_fifo or tlm_analysis_fifo.
Rule Configuration
• Classes — uvm_analysis_port, uvm_analysis_export, tlm_fifo, tlm_analysis_fifo
• Action — Allow
module Allowed_Classes_2();
import allowed_classes_pkg_2::*;
// ...
endmodule
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Allowed Classes
Violation Produced
Member ‘m_sequencer’ is defined from a disallowed class ‘uvm_sequencer’. – Violation 1
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Class Methods Call
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Class Methods Call
o Specified called methods must not appear in any of the specified calling methods
Examples
Example 1
Checks that all “new” methods in all classes have a call to dummy_method as its first statement.
Rule Configuration
• Applies To (base class) — <all>
• Check — Specified called method must appear as the first statement in all specified
calling methods
Analyzed Code
class analysis_fifo_bad extends analysis_fifo;
ovm_printer my_ovm_printer_3 = new();
function new(); // violation 1
report_summarize();
run_test();
dummy_method_2();
endfunction: new
function new_1();
report_summarize();
run_test();
dummy_method_2();
endfunction: new_1
endclass
Violation Produced
Class "analysis_fifo_bad" must have "dummy_method" method called from "new" method as
its first statement. – Violation 1
Related Topics
Class Methods Existence
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Factory Registration
Factory Registration
Language support: SystemVerilog
Checks that UVM or OVM components and objects are registered with the factory using any of
the chosen registration styles. [UVM/OVM Designs only]
Usage
Factory Registration
Common Parameters
Applies To (UVM/OVM Base Class)
Applies To Exceptions (UVM/OVM Base Class)
Registry Style
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To (UVM/OVM Base Class)
Specify the types of object handles to check. The object handle is checked if its type is any
of the specified types, or inherits directly or indirectly from any of them. The default is
uvm_object.
o uvm_object
o uvm_component
o ovm_object
o <user-defined>
• Applies To Exceptions (UVM/OVM Base Class)
Specify the types of object handles to exclude from the check. The object handle is excluded
from the check if its type is any of the specified types, or inherits directly or indirectly from
any of them. The default is <none>. Note that the value “<none>” cannot be selected along
with any other value.
o <none>
o <user-defined>
• Registry Style
Specify the required UVM/OVM factory registry style. The default is <UVM Component
Registration Styles>.
o <OVM Object Registration Styles>
`ovm_object_param_utils, `ovm_object_param_utils_begin, `ovm_object_registry,
`ovm_object_registry_internal, `ovm_object_registry_param, `ovm_object_utils,
`ovm_object_utils_begin, `ovm_sequence_param_utils,
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Factory Registration
`ovm_sequence_param_utils_begin, `ovm_sequence_utils,
`ovm_sequence_utils_begin, ovm_object_registry
o <OVM Component Registration Styles>
`ovm_component_param_utils, `ovm_ component_param_utils_begin,
`ovm_component _registry, `ovm_component _registry_internal,
`ovm_component_registry_param, `ovm_component_utils,
`ovm_component_utils_begin, `ovm_sequencer_param_utils,
`ovm_sequencer_param_utils_begin, `ovm_sequencer_utils,
`ovm_sequencer_utils_begin, ovm_component_registry
o <UVM Object Registration Styles>
`uvm_object_param_utils, `uvm_object_param_utils_begin, `uvm_object_registry,
`uvm_object_utils, `uvm_object_utils_begin, `uvm_sequence_param_utils,
`uvm_sequence_param_utils_begin, uvm_object_registry
o <UVM Component Registration Styles>
`uvm_component_param_utils, `uvm_ component_param_utils_begin, `uvm_
component_registry, `uvm_ component_utils, `uvm_component_utils_begin, uvm_
component_registry
Examples
Example 1
Check that all classes that extend uvm_component are registered with the factory using a UVM
component factory registration style.
Rule Configuration
• Applies To (UVM/OVM Base Class) — uvm_component
Violation Produced
UVM Component "stim_gen" is not registered with the factory using any of the allowed UVM
factory registration styles – Violation 1
Related Topics
Named Object Name
Object Construction
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Object Construction
Object Construction
Language support: SystemVerilog
Checks the construction of UVM and OVM object handles whose types are specified by the two
parameters "Applies To (UVM/OVM Base Class)" and "Applies To Exceptions (UVM/OVM
Base Class)". The check requires the UVM/OVM library to be available with the design. The
rule can also check Coverage Group construction. The "Construction Location" parameter
specifies where to search for construction. The rule can also check that handles returned from
OVM build methods (create_component and create_object) are cast using $cast.
Usage
Object Construction
Common Parameters
Applies To (UVM/OVM Base Class)
Applies To Exceptions (UVM/OVM Base Class)
Look In
Look In Exceptions
Construction Location
Cast Build Method Return
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Applies To (UVM/OVM Base Class)
Specify the types of object handles to check. The object is checked if the object handle's
type is any of the specified types, or inherits directly or indirectly from any of them.
<Coverage Groups> value is provided for checking coverage groups. The default is
uvm_object.
o uvm_object
o ovm_object
o <Coverage Groups>
o <user-defined>
• Applies To Exceptions (UVM/OVM Base Class)
Specify the types of object handles to exclude from the check. The object is excluded from
the check if the object handle's type is any of the specified types, or inherits directly or
indirectly from any of them. The default is <none>. Note that the value “<none>” cannot be
selected along with any other value.
o <none>
o <user-defined>
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Object Construction
• Look In
Specify which class types are checked for their defines class handles. The default is
uvm_component.
o uvm_component
o ovm_component
o <All>
• Look In Exceptions
Specify which class types are to be excluded from the check for their defines class handles.
The object is excluded from the check if the object handle's type is in any of the specified
classes, or inherits from any of them. The default is <none>.
• Construction Location
Specify the location in which to look for object construction. The default is inside new() and
inside build().
o inside new()
o inside build()
o inside build_phase()
• Cast Build Method Return
Specify whether to check that handles returned from build methods (create_component and
create_object) are cast using $cast. The default is <don’t care>.
o Yes
o <don’t care>
Examples
Example 1
Check all uvm_object object handles, except uvm_subscriber object handles.
Rule Configuration
• Applies To (UVM/OVM Base Class) — uvm_object
• Look In — uvm_component
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Object Construction
Analyzed Code
package object_construction_pkg;
import uvm_pkg::*;
function build();
uvm_report_object_inst = new();
endfunction
endclass
endpackage
module object_construction();
import object_construction_pkg::*;
// ...
endmodule
Violations Produced
• Object handle "uvm_object_inst" is not constructed inside build() using new – Violation
1
• Object handle "uvm_registered_component_inst" is not constructed inside build() using
create_component or type_id::create – Violation 2
• Object handle 'uvm_report_object_inst' is not constructed inside build() using
create_object or type_id::create – Violation 3
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
Vital Base Rules
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VITAL Ports
VITAL Ports
Language support: VHDL Any
Checks that the VITAL (top-level entity) port declarations use appropriate modes (i.e. they are
not LINKAGE or GUARDED), appropriate names (i.e. do not contain underscore “_”
character) and appropriate types (std_logic, std_logic_vector, std_ulogic etc). Specifically,
scalars type checked are std_ulogic or std_logic (or other subtypes of std_ulogic), vectors type
checked are std_logic_vector or std_ulogic_vector
Usage
VITAL Ports
Common Parameters
Check VITAL Port Names
Disallowed VITAL Port Modes
VITAL Scalar Port Types
VITAL Array Port Types
Additional Checks
Parameters
• Common Parameters
See Parameters Common to all Base Rules
• Check VITAL Port Names
Specify whether the VITAL Port names should adhere to naming convention that they
should not contain underscore character (“_”). The default is Yes.
o Yes
o No
• Disallowed VITAL Port Modes
Specify which Port Modes are not allowed for VITAL ports. The default is Guarded and
Linkage.
o Guarded
o Linkage
o <don’t care>
• VITAL Scalar Port Types
Specify which Scalar Types are allowed for VITAL ports. The default is std_logic ,
std_ulogic and Any other subtype of std_ulogic.
o std_logic
o std_ulogic
o Any other subtype of std_ulogic
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VITAL Ports
o <don’t care>
Note
If a scalar port is of a user-defined subtype of std_ulogic, a violation will be
produced even if the parameter value “Any other subtype of std_ulogic” is selected.
This value only pertains to subtypes of std_ulogic defined in the IEEE package (like
UX01, X01 etc.)
Note
Additional Information
• A validation error is issued if you try to select <don’t care> option along with another
option for the disallowed Vital Port Modes, and disallowed Vital Port Types parameters.
• This rule will run only if a single unambiguous top can be detected.
• Record ports always will cause “Port Types” violations irrespective of the constituent
elements.
Examples
Example 1
Check VITAL port modes, names and types.
Rule Configuration
• Check VITAL Port Names — Yes
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VITAL Ports
package pkg is
type atlantic_t is record
sop : std_logic;
dat : std_logic_vector(63 downto 0);
end record;
end package;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
USE work.pkg.all;
ENTITY Vital_Port_use_pkg_3 IS
port(
a : IN std_logic bus; -- Violation 1
a1: IN atlantic_t; -- Violation 2
a2: in std_logic_vector(1 downto 0); -- Violation 3
b_1: INOUT std_logic; --Violation 4
\c\ : LINKAGE std_ulogic -- Violation 5
);
END ENTITY Vital_Port_use_pkg_3;
Violations Produced
• Vital Top-Level port ‘a’ should not be a GUARDED bus – Violation 1
• Vital Top-Level port ‘a1’ is of type ‘atlantic_t’,which is not an allowed type/subtype
declared in package std_logic_1164 – Violation 2
• Vital Top-Level port ‘a2’ is of type ‘STD_LOGIC_VECTOR’, which is not an allowed
type/subtype declared in package std_logic_1164 – Violation 3
• Vital Top-Level port ‘b_1’ should not have underscore character(_) in its name –
Violation 4
• Vital Top-Level port ‘\c\’ is of type ‘STD_ULOGIC’, which is not an allowed type/
subtype declared in package std_logic_1164 – Violation 5
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Base Rules References
VITAL Ports
Related Topics
Naming
Allowed Types
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Appendix A
Simple Expressions
Simple Expressions support the use of the wildcard “*” to represent any number of upper or
lowercase letters (a-z & A-Z), digits (0-9) and underscores.
Simple Expressions also support the use of built-in system variables and environment variables.
Environment variables are entered as $(ENV_VAR) where ENV_VAR is the name of the
environment Variable. For example: *_$(ENV_VAR).
Built-in system variables are entered as %(SYS_VAR) where SYS_VAR is the name of the
System Variable. For example: %(entity)_ent.
System variables & environment variables can both be used within the same pattern. For
example: %(entity)_*_$(ENV_VAR)
The following system variables can be used in Simple Expressions to refer to object names:
System Description Applicable Rules Examples
Variable Name
%(entity) Refers to the VHDL entity in Naming, Inferred See “Example 1”
which the object is defined. Elements Naming below
(e.g. entity of a port)
Refers to the entity name File Name, Partition
defined in the file. Design Parameters
%(architecture) Refers to the VHDL Naming, Inferred
architecture in which the Elements Naming
object is defined. (e.g.
architecture of a signal)
Refers to the architecture File Name, Partition
name defined in the file. Design Parameters
%(module) Refers to the Verilog module Naming, Inferred See “Example 2”
in which the object is Elements Naming below
defined. (e.g. module of a
reg)
Refers to the module name File Name, Partition
defined in the file. Design Parameters
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
This example is to demonstrate using the %(entity) & %(architecture) variables in configuring a
rule and running it on a VHDL file that contains named procedures and functions.
Base Rule
• Naming
Rule Configuration
• Pattern — %(entity)_%(architecture)_*
Code
entity my_entity is
port( in1: in bit; out1: out bit);
end entity;
architecture behave of my_entity is
procedure FFResetAsyncN (signal clk, values: in std_logic; --VIOLATION
signal xOut: out std_logic) is
begin
end procedure FFResetAsyncN;
begin
end;
Violations Produced
• %(entity) = “my_entity”
• %(architecture) = “behave”
Example 2: Using the Internal Variable %(module)
Below is an example to check running a configured rule on a Verilog file that contains named
tasks and functions using the %(module) variable.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
Base Rule
• Naming
Rule Configuration
• Pattern — *_%(module)
Code
Violations Produced
• %(module) = “Era_3”
Example 3: Using the Internal Variable %(package)
This example is to show using the %( package) variable in configuring a rule and running it on a
VHDL file that contains named procedures and functions.
Base Rule
• Naming
Rule Configuration
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
• Pattern — *_%(package)_*
Code
package mytest IS
constant seven : integer := 7;
subtype byte is std_logic_vector(7 downto 0);
type word is array (0 to 3) of byte;
type stream is array (integer range <>) of word;
type state is (s0, s1, s2, s3, s4);
type bool is (False, True);
function add (a, b : byte) return byte;
end mytest;
package body mytest is
function add (a, b : byte) --VIOLATION
return byte is
begin
return a + b;
end add;
end mytest;
Violations Produced
• Function “add” violates naming convention: Use “*_%(package)_*” for function names.
System Variables Expected Values
• %(package) = “mytest”
Example 4: Using the Internal Variable %(component)
Below is an example to show how you can use the variable %(component) in configuring a rule
and running it on a VHDL file that instantiates components.
Base Rule
• Naming
Rule Configuration
• Applies To — Instances
• Pattern — %(component)_*
Code
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
Violations Produced
• Instance name “u1” violates naming convention: use “%(component)_*” for labeling
instances.
System Variables Expected Values
• %(component) = “ent1”
Example 5: Using the Internal Variable %(bound_unit)
This example is to check running a configured rule on a VHDL file that instantiates components
using the %(bound_unit) variable.
Base Rule
• Naming
Rule Configuration
• Pattern — %(bound_unit)_*
Code
Violations Produced
• Instance name "u2" violates naming convention: use "%(bound_unit)_*" for labeling
instances.
System Variables Expected Values
• %(bound_unit) = “ent2”
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
Base Rule
• Naming
Rule Configuration
• Pattern — %(explicit_bound_unit)_*
Code
Violations Produced
• %(explicit_bound_unit) = “FA”
Example 7: Using the Internal Variables %(port) & %(instances)
This example is to express using the %( port) & %( instance) variables in configuring a rule and
running it on a VHDL file that contains output port stubs.
Base Rule
• Naming
Rule Configuration
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
• Pattern — %(instance)_%(port)_*
Code
ENTITY ent1 IS
port (a, b : in std_logic;
c : out std_logic );
END ENTITY ent1;
ARCHITECTURE arch OF ent1 IS
BEGIN
PROCESS (a,b)
BEGIN
c <= a and b;
end PROCESS;
END ARCHITECTURE arch;
Entity ent4 is
port (a4, b4 : std_logic;
c4 : out std_logic );
END ENTITY ent4;
ARCHITECTURE behave OF ent4 IS
Signal stub1, U2_c_stub2: std_logic;
COMPONENT ent1
port (a, b : in std_logic;
c : out std_logic );
END COMPONENT;
BEGIN
U1: ent1
Port map (a4, b4, stub1); --VIOLATION
U2: ent1
Port map (a4, b4, U2_c_stub2);
END ARCHITECTURE behave;
Violations Produced
• %(instance) = “U1”
• %(port) = “c”
Example 8: Using the Internal Variables %(output_port)
This example allows you to run a configured rule on a VHDL file that contains signals using the
%(output_port) variable.
Base Rule
• Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
Rule Configuration
• Pattern — %(output_port)_*
Code
Entity Sample is
Port (a, b : in std_logic;
C,d : out std_logic);
End entity Sample;
Architecture behave of Sample is
Signal signal1, d_signal2: std_logic;
Begin
signal1 <= a AND b;
d_signal2 <= a OR b;
C <= signal1; --VIOLATION
d <= d_signal2;
end architecture behave;
Violations Produced
• %(output_port) = “C”
Example 9: Using the Internal Variables %(interface)
This example allows you to check running a configuration rule on a Verilog file that contains an
interface using the %(interface) variable.
Base Rule
• File Name
Rule Configuration
• Applies To — Interface
• Pattern — %(interface).sv
Code “interf.sv”
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
interface intf();
reg data;
reg clk;
endinterface
Violations Produced
• File “interf.sv” violates naming convention: Use “%(interface).sv” for interface file
names.
System Variables Expected Values
• %(interface) = “intf”
Example 10: Using the Internal Variables %(progblk)
This example is to check running a configured rule on a Verilog file that contains a program
block using the %(progblk) variable.
Base Rule
• File Name
Rule Configuration
• Pattern — %(progblk).sv
Code “myprog.sv”
Violations Produced
• File “myprog.sv” violates naming convention: Use “%(progblk).sv” for program block
file names.
System Variables Expected Values
• %(progblk) = “test”
Example 11: Using the Internal Variables %(class)
Below is an example to check running a configured rule on a Verilog file that contains a class
using the %(class) variable.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
Base Rule
• File Name
Rule Configuration
• Pattern — %(class).sv
Code
class simple_data;
integer data;
bit isValid;
endclass
`include "myclass.sv"
module top (input in1, en, cmd_in, output out1, out2);
test mytest(.cmd(out2), .enable(en), .cmd_in(cmd_in));
intf myintf();
mastermod master (.a(myintf), .b(out1));
slavemod slave (.a(myintf), .b(in1));
endmodule
module mastermod (intf a, input b);
always @(posedge a.clk)
a.data <= b;
endmodule
module slavemod (intf a, output reg b);
always @(posedge a.clk)
b <= a.data;
endmodule
Violations Produced
• Include File “myclass.sv” violates naming convention: Use “%(class).sv” for class file
names.
System Variables Expected Values
• (class) = “simple_data”
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Simple Expressions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Appendix B
Regular Expressions
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Regular Expressions
Regular Description
Expression
Syntax
* Matches zero or more of the preceding characters or expressions. For
example: ho*p matches hp, hop and hoop.
? Matches zero or one of the preceding characters or expressions. For
example: ho?p matches hp and hop but not hoop.
+ Matches one or more of the preceding characters or expressions. For
example: ho+p matches hop and hoop but not hp.
{count} Matches the specified number of the preceding characters or expressions.
For example: ho{2}p matches hoop but not hop.
{min,} Matches at least the specified number of the preceding characters or
expressions. For example: ho{1}p matches hop and hoop but not hp.
{min,max} Matches between min and max of the preceding characters or expressions.
For example: ho{1,2}p matches hop and hoop but not hp or hooop.
| Matches either the expression to its left or its right. For example: hop|hoop
matches hop or hoop.
\ Escapes the special meaning of the above expressions so that they can be
matched as literal characters. Hence to match a literal \, you must use \\.
For example: \< matches the start of a word but \\< matches \<.
Examples
• To check that a string contains A-Z, a-z or underscores and has at least one character:
^[A-z0-9_]+$
• To check that a string starts with zero or one underscores then a single alphanumeric
followed by any number of alphanumerics or underscores:
^_?[A-z0-9][A-z0-9_]*$
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
Appendix C
System and Environment Variables
System variables and environment variables are used to specify context based values.
Simple Expressions also support the use of built-in system variables and environment variables.
Environment variables are entered as $(ENV_VAR) where ENV_VAR is the name of the
environment Variable. For example: *_$(ENV_VAR).
Built-in system variables are entered as %(SYS_VAR) where SYS_VAR is the name of the
System Variable. For example: %(entity)_ent.
The following system variables can be used in Simple/Regular Expressions to refer to object
names:
System Description Applicable Rules Examples
Variable Name
%(entity) Refers to the VHDL entity in Naming, Inferred See “Example 1”
which the object is defined. Elements Naming below
(e.g. entity of a port)
Refers to the entity name File Name, Partition
defined in the file. Design Parameters
%(architecture) Refers to the VHDL Naming, Inferred
architecture in which the Elements Naming
object is defined. (e.g.
architecture of a signal)
Refers to the architecture File Name, Partition
name defined in the file. Design Parameters
%(module) Refers to the Verilog module Naming, Inferred See “Example 2”
in which the object is Elements Naming below
defined. (e.g. module of a
reg)
Refers to the module name File Name, Partition
defined in the file. Design Parameters
%(package) Refers to the VHDL package Naming See “Example 3”
in which the object is below
defined. (e.g. package of a
function)
Refers to the package name File Name, Partition
defined in the file. Design Parameters
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
System variables used in the simple expressions must be valid in the context and applicable in
scope of the language concerned. For example '%(module)' and '%(entity)' can never be
applicable in any context. These kinds of simple expressions with mixed language system
variable specification will result in validation error. Similarly if the language is set to 'Verilog'
and the simple expression contains 'VHDL' specific system variables, for example
'%(component)', will result in validation error. In the same way combination of language
'VHDL' and 'Verilog' specific system variables will also result in validation error.
For regular expressions, if some invalid system variable is used, DesignChecker will not error
out, and it will substitute whatever part of the pattern that is valid and substitutable. Rationale
behind it being, in regular expression DesignChecker doesn’t know if the invalid part is
intentionally introduced by the user.
This example is to demonstrate using the %(entity) & %(architecture) variables in configuring a
rule and running it on a VHDL file that contains named procedures and functions.
Base Rule
• Naming
Rule Configuration
• Pattern — %(entity)_%(architecture)_*
Code
entity my_entity is
port( in1: in bit; out1: out bit);
end entity;
architecture behave of my_entity is
procedure FFResetAsyncN (signal clk, values: in std_logic; --VIOLATION
signal xOut: out std_logic) is
begin
end procedure FFResetAsyncN;
begin
end;
Violations Produced
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
• %(entity) = “my_entity”
• %(architecture) = “behave”
Example 2: Using the Internal Variable %(module)
Below is an example to check running a configured rule on a Verilog file that contains named
tasks and functions using the %(module) variable.
Base Rule
• Naming
Rule Configuration
• Pattern — *_%(module)
Code
Violations Produced
• %(module) = “Era_3”
Example 3: Using the Internal Variable %(package)
This example is to show using the %( package) variable in configuring a rule and running it on a
VHDL file that contains named procedures and functions.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
Base Rule
• Naming
Rule Configuration
• Pattern — *_%(package)_*
Code
package mytest IS
constant seven : integer := 7;
subtype byte is std_logic_vector(7 downto 0);
type word is array (0 to 3) of byte;
type stream is array (integer range <>) of word;
type state is (s0, s1, s2, s3, s4);
type bool is (False, True);
function add (a, b : byte) return byte;
end mytest;
package body mytest is
function add (a, b : byte) --VIOLATION
return byte is
begin
return a + b;
end add;
end mytest;
Violations Produced
• Function “add” violates naming convention: Use “*_%(package)_*” for function names.
System Variables Expected Values
• %(package) = “mytest”
Example 4: Using the Internal Variable %(component)
Below is an example to show how you can use the variable %(component) in configuring a rule
and running it on a VHDL file that instantiates components.
Base Rule
• Naming
Rule Configuration
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
• Applies To — Instances
• Pattern — %(component)_*
Code
Violations Produced
• Instance name “u1” violates naming convention: use “%(component)_*” for labeling
instances.
System Variables Expected Values
• %(component) = “ent1”
Example 5: Using the Internal Variable %(bound_unit)
This example is to check running a configured rule on a VHDL file that instantiates components
using the %(bound_unit) variable.
Base Rule
• Naming
Rule Configuration
• Pattern — %(bound_unit)_*
Code
Violations Produced
• Instance name "u2" violates naming convention: use "%(bound_unit)_*" for labeling
instances.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
• %(bound_unit) = “ent2”
Example 6: Using the Internal Variable %(explicit_bound_unit)
Base Rule
• Naming
Rule Configuration
• Pattern — %(explicit_bound_unit)_*
Code
Violations Produced
• %(explicit_bound_unit) = “FA”
Example 7: Using the Internal Variables %(port) & %(instances)
This example is to express using the %( port) & %( instance) variables in configuring a rule and
running it on a VHDL file that contains output port stubs.
Base Rule
• Naming
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
Rule Configuration
• Pattern — %(instance)_%(port)_*
Code
ENTITY ent1 IS
port (a, b : in std_logic;
c : out std_logic );
END ENTITY ent1;
ARCHITECTURE arch OF ent1 IS
BEGIN
PROCESS (a,b)
BEGIN
c <= a and b;
end PROCESS;
END ARCHITECTURE arch;
Entity ent4 is
port (a4, b4 : std_logic;
c4 : out std_logic );
END ENTITY ent4;
ARCHITECTURE behave OF ent4 IS
Signal stub1, U2_c_stub2: std_logic;
COMPONENT ent1
port (a, b : in std_logic;
c : out std_logic );
END COMPONENT;
BEGIN
U1: ent1
Port map (a4, b4, stub1); --VIOLATION
U2: ent1
Port map (a4, b4, U2_c_stub2);
END ARCHITECTURE behave;
Violations Produced
• %(instance) = “U1”
• %(port) = “c”
Example 8: Using the Internal Variables %(output_port)
This example allows you to run a configured rule on a VHDL file that contains signals using the
%(output_port) variable.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
Base Rule
• Naming
Rule Configuration
• Pattern — %(output_port)_*
Code
Entity Sample is
Port (a, b : in std_logic;
C,d : out std_logic);
End entity Sample;
Architecture behave of Sample is
Signal signal1, d_signal2: std_logic;
Begin
signal1 <= a AND b;
d_signal2 <= a OR b;
C <= signal1; --VIOLATION
d <= d_signal2;
end architecture behave;
Violations Produced
• %(output_port) = “C”
Example 9: Using the Internal Variables %(interface)
This example allows you to check running a configuration rule on a Verilog file that contains an
interface using the %(interface) variable.
Base Rule
• File Name
Rule Configuration
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
Code
interface intf();
reg data;
reg clk;
endinterface
Violations Produced
• File “interf.sv” violates naming convention: Use “%(interface).sv” for interface file
names.
System Variables Expected Values
• %(interface) = “intf”
Example 10: Using the Internal Variables %(progblk)
This example is to check running a configured rule on a Verilog file that contains a program
block using the %(progblk) variable.
Base Rule
• File Name
Rule Configuration
Violations Produced
• File “myprog.sv” violates naming convention: Use “%(progblk).sv” for program block
file names.
System Variables Expected Values
• %(progblk) = “test”
Example 11: Using the Internal Variables %(class)
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
Below is an example to check running a configured rule on a Verilog file that contains a class
using the %(class) variable.
Base Rule
• File Name
Rule Configuration
class simple_data;
integer data;
bit isValid;
endclass
`include "myclass.sv"
module top (input in1, en, cmd_in, output out1, out2);
test mytest(.cmd(out2), .enable(en), .cmd_in(cmd_in));
intf myintf();
mastermod master (.a(myintf), .b(out1));
slavemod slave (.a(myintf), .b(in1));
endmodule
Violations Produced
• Include File “myclass.sv” violates naming convention: Use “%(class).sv” for class file
names.
System Variables Expected Values
• %(class) = “simple_data”
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
System and Environment Variables
In this example, we check for register naming with pattern that contain system variable
%(clock).
Base Rule
• Language — Any
• Applies To — Registers
• Pattern — *_%(clock)
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity ent is
port (
in1 : in std_logic;
clk : in std_logic;
out1: out std_logic);
end ent;
architecture rtl of ent is
begin
process (clk)
begin
if (clk'event AND clk = '1') then
out1 <= in1;
end if;
end process;
end;
Violations Produced
• Register 'out1' violates naming convention: use '*_%(clock) (i.e. *_clk)' for registers.
Note - Viewing PDF files within a web browser causes some links not to function. Use HTML for full navigation.
End-User License Agreement
The latest version of the End-User License Agreement is available on-line at:
www.mentor.com/eula
IMPORTANT INFORMATION
USE OF ALL SOFTWARE IS SUBJECT TO LICENSE RESTRICTIONS. CAREFULLY READ THIS LICENSE
AGREEMENT BEFORE USING THE PRODUCTS. USE OF SOFTWARE INDICATES CUSTOMER’S COMPLETE
AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH IN THIS AGREEMENT.
ANY ADDITIONAL OR DIFFERENT PURCHASE ORDER TERMS AND CONDITIONS SHALL NOT APPLY.
This is a legal agreement concerning the use of Software (as defined in Section 2) and hardware (collectively “Products”)
between the company acquiring the Products (“Customer”), and the Mentor Graphics entity that issued the corresponding
quotation or, if no quotation was issued, the applicable local Mentor Graphics entity (“Mentor Graphics”). Except for license
agreements related to the subject matter of this license agreement which are physically signed by Customer and an authorized
representative of Mentor Graphics, this Agreement and the applicable quotation contain the parties’ entire understanding
relating to the subject matter and supersede all prior or contemporaneous agreements. If Customer does not agree to these
terms and conditions, promptly return or, in the case of Software received electronically, certify destruction of Software and all
accompanying items within five days after receipt of Software and receive a full refund of any license fee paid.
1.1. To the extent Customer (or if agreed by Mentor Graphics, Customer’s appointed third party buying agent) places and Mentor
Graphics accepts purchase orders pursuant to this Agreement (each an “Order”), each Order will constitute a contract between
Customer and Mentor Graphics, which shall be governed solely and exclusively by the terms and conditions of this Agreement,
any applicable addenda and the applicable quotation, whether or not those documents are referenced on the Order. Any
additional or conflicting terms and conditions appearing on an Order or presented in any electronic portal or automated order
management system, whether or not required to be electronically accepted, will not be effective unless agreed in writing and
physically signed by an authorized representative of Customer and Mentor Graphics.
1.2. Amounts invoiced will be paid, in the currency specified on the applicable invoice, within 30 days from the date of such invoice.
Any past due invoices will be subject to the imposition of interest charges in the amount of one and one-half percent per month
or the applicable legal rate currently in effect, whichever is lower. Prices do not include freight, insurance, customs duties, taxes
or other similar charges, which Mentor Graphics will state separately in the applicable invoice. Unless timely provided with a
valid certificate of exemption or other evidence that items are not taxable, Mentor Graphics will invoice Customer for all
applicable taxes including, but not limited to, VAT, GST, sales tax, consumption tax and service tax. Customer will make all
payments free and clear of, and without reduction for, any withholding or other taxes; any such taxes imposed on payments by
Customer hereunder will be Customer’s sole responsibility. If Customer appoints a third party to place purchase orders and/or
make payments on Customer’s behalf, Customer shall be liable for payment under Orders placed by such third party in the event
of default.
1.3. All Products are delivered FCA factory (Incoterms 2010), freight prepaid and invoiced to Customer, except Software delivered
electronically, which shall be deemed delivered when made available to Customer for download. Mentor Graphics retains a
security interest in all Products delivered under this Agreement, to secure payment of the purchase price of such Products, and
Customer agrees to sign any documents that Mentor Graphics determines to be necessary or convenient for use in filing or
perfecting such security interest. Mentor Graphics’ delivery of Software by electronic means is subject to Customer’s provision
of both a primary and an alternate e-mail address.
2. GRANT OF LICENSE. The software installed, downloaded, or otherwise acquired by Customer under this Agreement, including any
updates, modifications, revisions, copies, documentation, setup files and design data (“Software”) are copyrighted, trade secret and
confidential information of Mentor Graphics or its licensors, who maintain exclusive title to all Software and retain all rights not
expressly granted by this Agreement. Except for Software that is embeddable (“Embedded Software”), which is licensed pursuant to
separate embedded software terms or an embedded software supplement, Mentor Graphics grants to Customer, subject to payment of
applicable license fees, a nontransferable, nonexclusive license to use Software solely: (a) in machine-readable, object-code form
(except as provided in Subsection 4.2); (b) for Customer’s internal business purposes; (c) for the term of the license; and (d) on the
computer hardware and at the site authorized by Mentor Graphics. A site is restricted to a one-half mile (800 meter) radius. Customer
may have Software temporarily used by an employee for telecommuting purposes from locations other than a Customer office, such as
the employee’s residence, an airport or hotel, provided that such employee’s primary place of employment is the site where the
Software is authorized for use. Mentor Graphics’ standard policies and programs, which vary depending on Software, license fees paid
or services purchased, apply to the following: (a) relocation of Software; (b) use of Software, which may be limited, for example, to
execution of a single session by a single user on the authorized hardware or for a restricted period of time (such limitations may be
technically implemented through the use of authorization codes or similar devices); and (c) support services provided, including
eligibility to receive telephone support, updates, modifications, and revisions. For the avoidance of doubt, if Customer provides any
feedback or requests any change or enhancement to Products, whether in the course of receiving support or consulting services,
evaluating Products, performing beta testing or otherwise, any inventions, product improvements, modifications or developments made
by Mentor Graphics (at Mentor Graphics’ sole discretion) will be the exclusive property of Mentor Graphics.
3. BETA CODE.
3.1. Portions or all of certain Software may contain code for experimental testing and evaluation (which may be either alpha or beta,
collectively “Beta Code”), which may not be used without Mentor Graphics’ explicit authorization. Upon Mentor Graphics’
authorization, Mentor Graphics grants to Customer a temporary, nontransferable, nonexclusive license for experimental use to
test and evaluate the Beta Code without charge for a limited period of time specified by Mentor Graphics. Mentor Graphics may
choose, at its sole discretion, not to release Beta Code commercially in any form.
3.2. If Mentor Graphics authorizes Customer to use the Beta Code, Customer agrees to evaluate and test the Beta Code under normal
conditions as directed by Mentor Graphics. Customer will contact Mentor Graphics periodically during Customer’s use of the
Beta Code to discuss any malfunctions or suggested improvements. Upon completion of Customer’s evaluation and testing,
Customer will send to Mentor Graphics a written evaluation of the Beta Code, including its strengths, weaknesses and
recommended improvements.
3.3. Customer agrees to maintain Beta Code in confidence and shall restrict access to the Beta Code, including the methods and
concepts utilized therein, solely to those employees and Customer location(s) authorized by Mentor Graphics to perform beta
testing. Customer agrees that any written evaluations and all inventions, product improvements, modifications or developments
that Mentor Graphics conceived or made during or subsequent to this Agreement, including those based partly or wholly on
Customer’s feedback, will be the exclusive property of Mentor Graphics. Mentor Graphics will have exclusive rights, title and
interest in all such property. The provisions of this Subsection 3.3 shall survive termination of this Agreement.
4. RESTRICTIONS ON USE.
4.1. Customer may copy Software only as reasonably necessary to support the authorized use. Each copy must include all notices
and legends embedded in Software and affixed to its medium and container as received from Mentor Graphics. All copies shall
remain the property of Mentor Graphics or its licensors. Except for Embedded Software that has been embedded in executable
code form in Customer’s product(s), Customer shall maintain a record of the number and primary location of all copies of
Software, including copies merged with other software, and shall make those records available to Mentor Graphics upon
request. Customer shall not make Products available in any form to any person other than Customer’s employees and on-site
contractors, excluding Mentor Graphics competitors, whose job performance requires access and who are under obligations of
confidentiality. Customer shall take appropriate action to protect the confidentiality of Products and ensure that any person
permitted access does not disclose or use Products except as permitted by this Agreement. Customer shall give Mentor Graphics
written notice of any unauthorized disclosure or use of the Products as soon as Customer becomes aware of such unauthorized
disclosure or use. Customer acknowledges that Software provided hereunder may contain source code which is proprietary and
its confidentiality is of the highest importance and value to Mentor Graphics. Customer acknowledges that Mentor Graphics
may be seriously harmed if such source code is disclosed in violation of this Agreement. Except as otherwise permitted for
purposes of interoperability as specified by applicable and mandatory local law, Customer shall not reverse-assemble,
disassemble, reverse-compile, or reverse-engineer any Product, or in any way derive any source code from Software that is not
provided to Customer in source code form. Log files, data files, rule files and script files generated by or for the Software
(collectively “Files”), including without limitation files containing Standard Verification Rule Format (“SVRF”) and Tcl
Verification Format (“TVF”) which are Mentor Graphics’ trade secret and proprietary syntaxes for expressing process rules,
constitute or include confidential information of Mentor Graphics. Customer may share Files with third parties, excluding
Mentor Graphics competitors, provided that the confidentiality of such Files is protected by written agreement at least as well as
Customer protects other information of a similar nature or importance, but in any case with at least reasonable care. Customer
may use Files containing SVRF or TVF only with Mentor Graphics products. Under no circumstances shall Customer use
Products or Files or allow their use for the purpose of developing, enhancing or marketing any product that is in any way
competitive with Products, or disclose to any third party the results of, or information pertaining to, any benchmark.
4.2. If any Software or portions thereof are provided in source code form, Customer will use the source code only to correct software
errors and enhance or modify the Software for the authorized use, or as permitted for Embedded Software under separate
embedded software terms or an embedded software supplement. Customer shall not disclose or permit disclosure of source
code, in whole or in part, including any of its methods or concepts, to anyone except Customer’s employees or on-site
contractors, excluding Mentor Graphics competitors, with a need to know. Customer shall not copy or compile source code in
any manner except to support this authorized use.
4.3. Customer agrees that it will not subject any Product to any open source software (“OSS”) license that conflicts with this
Agreement or that does not otherwise apply to such Product.
4.4. Customer may not assign this Agreement or the rights and duties under it, or relocate, sublicense, or otherwise transfer the
Products, whether by operation of law or otherwise (“Attempted Transfer”), without Mentor Graphics’ prior written consent and
payment of Mentor Graphics’ then-current applicable relocation and/or transfer fees. Any Attempted Transfer without Mentor
Graphics’ prior written consent shall be a material breach of this Agreement and may, at Mentor Graphics’ option, result in the
immediate termination of the Agreement and/or the licenses granted under this Agreement. The terms of this Agreement,
including without limitation the licensing and assignment provisions, shall be binding upon Customer’s permitted successors in
interest and assigns.
4.5. The provisions of this Section 4 shall survive the termination of this Agreement.
5. SUPPORT SERVICES. To the extent Customer purchases support services, Mentor Graphics will provide Customer with updates and
technical support for the Products, at the Customer site(s) for which support is purchased, in accordance with Mentor Graphics’ then
current End-User Support Terms located at http://supportnet.mentor.com/supportterms.
6. OPEN SOURCE SOFTWARE. Products may contain OSS or code distributed under a proprietary third party license agreement, to
which additional rights or obligations (“Third Party Terms”) may apply. Please see the applicable Product documentation (including
license files, header files, read-me files or source code) for details. In the event of conflict between the terms of this Agreement
(including any addenda) and the Third Party Terms, the Third Party Terms will control solely with respect to the OSS or third party
code. The provisions of this Section 6 shall survive the termination of this Agreement.
7. LIMITED WARRANTY.
7.1. Mentor Graphics warrants that during the warranty period its standard, generally supported Products, when properly installed,
will substantially conform to the functional specifications set forth in the applicable user manual. Mentor Graphics does not
warrant that Products will meet Customer’s requirements or that operation of Products will be uninterrupted or error free. The
warranty period is 90 days starting on the 15th day after delivery or upon installation, whichever first occurs. Customer must
notify Mentor Graphics in writing of any nonconformity within the warranty period. For the avoidance of doubt, this warranty
applies only to the initial shipment of Software under an Order and does not renew or reset, for example, with the delivery of (a)
Software updates or (b) authorization codes or alternate Software under a transaction involving Software re-mix. This warranty
shall not be valid if Products have been subject to misuse, unauthorized modification, improper installation or Customer is not in
compliance with this Agreement. MENTOR GRAPHICS’ ENTIRE LIABILITY AND CUSTOMER’S EXCLUSIVE
REMEDY SHALL BE, AT MENTOR GRAPHICS’ OPTION, EITHER (A) REFUND OF THE PRICE PAID UPON
RETURN OF THE PRODUCTS TO MENTOR GRAPHICS OR (B) MODIFICATION OR REPLACEMENT OF THE
PRODUCTS THAT DO NOT MEET THIS LIMITED WARRANTY. MENTOR GRAPHICS MAKES NO WARRANTIES
WITH RESPECT TO: (A) SERVICES; (B) PRODUCTS PROVIDED AT NO CHARGE; OR (C) BETA CODE; ALL OF
WHICH ARE PROVIDED “AS IS.”
7.2. THE WARRANTIES SET FORTH IN THIS SECTION 7 ARE EXCLUSIVE. NEITHER MENTOR GRAPHICS NOR ITS
LICENSORS MAKE ANY OTHER WARRANTIES EXPRESS, IMPLIED OR STATUTORY, WITH RESPECT TO
PRODUCTS PROVIDED UNDER THIS AGREEMENT. MENTOR GRAPHICS AND ITS LICENSORS SPECIFICALLY
DISCLAIM ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT OF INTELLECTUAL PROPERTY.
8. LIMITATION OF LIABILITY. TO THE EXTENT PERMITTED UNDER APPLICABLE LAW, IN NO EVENT SHALL
MENTOR GRAPHICS OR ITS LICENSORS BE LIABLE FOR INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES (INCLUDING LOST PROFITS OR SAVINGS) WHETHER BASED ON CONTRACT, TORT OR ANY OTHER
LEGAL THEORY, EVEN IF MENTOR GRAPHICS OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES. IN NO EVENT SHALL MENTOR GRAPHICS’ OR ITS LICENSORS’ LIABILITY UNDER THIS
AGREEMENT EXCEED THE AMOUNT RECEIVED FROM CUSTOMER FOR THE HARDWARE, SOFTWARE LICENSE OR
SERVICE GIVING RISE TO THE CLAIM. IN THE CASE WHERE NO AMOUNT WAS PAID, MENTOR GRAPHICS AND ITS
LICENSORS SHALL HAVE NO LIABILITY FOR ANY DAMAGES WHATSOEVER. THE PROVISIONS OF THIS SECTION 8
SHALL SURVIVE THE TERMINATION OF THIS AGREEMENT.
9.1. Customer acknowledges that Mentor Graphics has no control over the testing of Customer’s products, or the specific
applications and use of Products. Mentor Graphics and its licensors shall not be liable for any claim or demand made against
Customer by any third party, except to the extent such claim is covered under Section 10.
9.2. In the event that a third party makes a claim against Mentor Graphics arising out of the use of Customer’s products, Mentor
Graphics will give Customer prompt notice of such claim. At Customer’s option and expense, Customer may take sole control
of the defense and any settlement of such claim. Customer WILL reimburse and hold harmless Mentor Graphics for any
LIABILITY, damages, settlement amounts, costs and expenses, including reasonable attorney’s fees, incurred by or awarded
against Mentor Graphics or its licensors in connection with such claims.
9.3. The provisions of this Section 9 shall survive any expiration or termination of this Agreement.
10. INFRINGEMENT.
10.1. Mentor Graphics will defend or settle, at its option and expense, any action brought against Customer in the United States,
Canada, Japan, or member state of the European Union which alleges that any standard, generally supported Product acquired
by Customer hereunder infringes a patent or copyright or misappropriates a trade secret in such jurisdiction. Mentor Graphics
will pay costs and damages finally awarded against Customer that are attributable to such action. Customer understands and
agrees that as conditions to Mentor Graphics’ obligations under this section Customer must: (a) notify Mentor Graphics
promptly in writing of the action; (b) provide Mentor Graphics all reasonable information and assistance to settle or defend the
action; and (c) grant Mentor Graphics sole authority and control of the defense or settlement of the action.
10.2. If a claim is made under Subsection 10.1 Mentor Graphics may, at its option and expense: (a) replace or modify the Product so
that it becomes noninfringing; (b) procure for Customer the right to continue using the Product; or (c) require the return of the
Product and refund to Customer any purchase price or license fee paid, less a reasonable allowance for use.
10.3. Mentor Graphics has no liability to Customer if the action is based upon: (a) the combination of Software or hardware with any
product not furnished by Mentor Graphics; (b) the modification of the Product other than by Mentor Graphics; (c) the use of
other than a current unaltered release of Software; (d) the use of the Product as part of an infringing process; (e) a product that
Customer makes, uses, or sells; (f) any Beta Code or Product provided at no charge; (g) any software provided by Mentor
Graphics’ licensors who do not provide such indemnification to Mentor Graphics’ customers; (h) OSS, except to the extent that
the infringement is directly caused by Mentor Graphics’ modifications to such OSS; or (i) infringement by Customer that is
deemed willful. In the case of (i), Customer shall reimburse Mentor Graphics for its reasonable attorney fees and other costs
related to the action.
10.4. THIS SECTION 10 IS SUBJECT TO SECTION 8 ABOVE AND STATES THE ENTIRE LIABILITY OF MENTOR
GRAPHICS AND ITS LICENSORS, AND CUSTOMER’S SOLE AND EXCLUSIVE REMEDY, FOR DEFENSE,
SETTLEMENT AND DAMAGES, WITH RESPECT TO ANY ALLEGED PATENT OR COPYRIGHT INFRINGEMENT
OR TRADE SECRET MISAPPROPRIATION BY ANY PRODUCT PROVIDED UNDER THIS AGREEMENT.
11.1. If a Software license was provided for limited term use, such license will automatically terminate at the end of the authorized
term. Mentor Graphics may terminate this Agreement and/or any license granted under this Agreement immediately upon
written notice if Customer: (a) exceeds the scope of the license or otherwise fails to comply with the licensing or confidentiality
provisions of this Agreement, or (b) becomes insolvent, files a bankruptcy petition, institutes proceedings for liquidation or
winding up or enters into an agreement to assign its assets for the benefit of creditors. For any other material breach of any
provision of this Agreement, Mentor Graphics may terminate this Agreement and/or any license granted under this Agreement
upon 30 days written notice if Customer fails to cure the breach within the 30 day notice period. Termination of this Agreement
or any license granted hereunder will not affect Customer’s obligation to pay for Products shipped or licenses granted prior to
the termination, which amounts shall be payable immediately upon the date of termination.
11.2. Upon termination of this Agreement, the rights and obligations of the parties shall cease except as expressly set forth in this
Agreement. Upon termination of this Agreement and/or any license granted under this Agreement, Customer shall ensure that
all use of the affected Products ceases, and shall return hardware and either return to Mentor Graphics or destroy Software in
Customer’s possession, including all copies and documentation, and certify in writing to Mentor Graphics within ten business
days of the termination date that Customer no longer possesses any of the affected Products or copies of Software in any form.
12. EXPORT. The Products provided hereunder are subject to regulation by local laws and European Union (“E.U.”) and United States
(“U.S.”) government agencies, which prohibit export, re-export or diversion of certain products, information about the products, and
direct or indirect products thereof, to certain countries and certain persons. Customer agrees that it will not export or re-export Products
in any manner without first obtaining all necessary approval from appropriate local, E.U. and U.S. government agencies. If Customer
wishes to disclose any information to Mentor Graphics that is subject to any E.U., U.S. or other applicable export restrictions, including
without limitation the U.S. International Traffic in Arms Regulations (ITAR) or special controls under the Export Administration
Regulations (EAR), Customer will notify Mentor Graphics personnel, in advance of each instance of disclosure, that such information
is subject to such export restrictions.
13. U.S. GOVERNMENT LICENSE RIGHTS. Software was developed entirely at private expense. The parties agree that all Software is
commercial computer software within the meaning of the applicable acquisition regulations. Accordingly, pursuant to U.S. FAR 48
CFR 12.212 and DFAR 48 CFR 227.7202, use, duplication and disclosure of the Software by or for the U.S. government or a U.S.
government subcontractor is subject solely to the terms and conditions set forth in this Agreement, which shall supersede any
conflicting terms or conditions in any government order document, except for provisions which are contrary to applicable mandatory
federal laws.
14. THIRD PARTY BENEFICIARY. Mentor Graphics Corporation, Mentor Graphics (Ireland) Limited, Microsoft Corporation and
other licensors may be third party beneficiaries of this Agreement with the right to enforce the obligations set forth herein.
15. REVIEW OF LICENSE USAGE. Customer will monitor the access to and use of Software. With prior written notice and during
Customer’s normal business hours, Mentor Graphics may engage an internationally recognized accounting firm to review Customer’s
software monitoring system and records deemed relevant by the internationally recognized accounting firm to confirm Customer’s
compliance with the terms of this Agreement or U.S. or other local export laws. Such review may include FlexNet (or successor
product) report log files that Customer shall capture and provide at Mentor Graphics’ request. Customer shall make records available in
electronic format and shall fully cooperate with data gathering to support the license review. Mentor Graphics shall bear the expense of
any such review unless a material non-compliance is revealed. Mentor Graphics shall treat as confidential information all information
gained as a result of any request or review and shall only use or disclose such information as required by law or to enforce its rights
under this Agreement. The provisions of this Section 15 shall survive the termination of this Agreement.
16. CONTROLLING LAW, JURISDICTION AND DISPUTE RESOLUTION. The owners of certain Mentor Graphics intellectual
property licensed under this Agreement are located in Ireland and the U.S. To promote consistency around the world, disputes shall be
resolved as follows: excluding conflict of laws rules, this Agreement shall be governed by and construed under the laws of the State of
Oregon, U.S., if Customer is located in North or South America, and the laws of Ireland if Customer is located outside of North or
South America or Japan, and the laws of Japan if Customer is located in Japan. All disputes arising out of or in relation to this
Agreement shall be submitted to the exclusive jurisdiction of the courts of Portland, Oregon when the laws of Oregon apply, or Dublin,
Ireland when the laws of Ireland apply, or the Tokyo District Court when the laws of Japan apply. Notwithstanding the foregoing, all
disputes in Asia (excluding Japan) arising out of or in relation to this Agreement shall be resolved by arbitration in Singapore before a
single arbitrator to be appointed by the chairman of the Singapore International Arbitration Centre (“SIAC”) to be conducted in the
English language, in accordance with the Arbitration Rules of the SIAC in effect at the time of the dispute, which rules are deemed to be
incorporated by reference in this section. Nothing in this section shall restrict Mentor Graphics’ right to bring an action (including for
example a motion for injunctive relief) against Customer in the jurisdiction where Customer’s place of business is located. The United
Nations Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
17. SEVERABILITY. If any provision of this Agreement is held by a court of competent jurisdiction to be void, invalid, unenforceable or
illegal, such provision shall be severed from this Agreement and the remaining provisions will remain in full force and effect.
18. MISCELLANEOUS. This Agreement contains the parties’ entire understanding relating to its subject matter and supersedes all prior
or contemporaneous agreements. Any translation of this Agreement is provided to comply with local legal requirements only. In the
event of a dispute between the English and any non-English versions, the English version of this Agreement shall govern to the extent
not prohibited by local law in the applicable jurisdiction. This Agreement may only be modified in writing, signed by an authorized
representative of each party. Waiver of terms or excuse of breach must be in writing and shall not constitute subsequent consent, waiver
or excuse.