
- •Preface
- •About This Manual
- •Other Information Sources
- •Syntax Conventions
- •Text Command Syntax
- •About the Graphical User Interface
- •Using Menus
- •Using Forms
- •HDL Synthesis Overview
- •HDL Synthesis Flow
- •Read Technology Libraries
- •Read Design Data
- •Build Generic Design
- •Save Generic Netlist
- •Synthesizing Mixed VHDL/Verilog Designs
- •Querying the HDL Design Pool
- •Using get_hdl_top_level Command
- •Using get_hdl_hierarchy Command
- •Using get_hdl_type Command
- •Building Generic Netlists from HDL
- •Multiple Top-Level Designs
- •Building Parameterized Designs
- •Verilog Modeling Styles
- •Modeling Combinational Logic
- •Register Inferencing
- •Latch Inference
- •Flip-Flop Inference
- •case Statements
- •Incomplete case Statement
- •Complete case Statement
- •Use of casex and casez Statements
- •for Statement
- •Synthesis Directives
- •Code Selection Directives
- •Architecture Selection Directive
- •case Statement Directives
- •Module Template Directive
- •Function and Task Mapping Directives
- •Set and Reset Synthesis Directives
- •Verilog Preprocessor Directives
- •Compiler Directives
- •The ‘for Compiler Directive
- •The ‘if Compiler Directive
- •The ‘eval Compiler Directive
- •The ‘{} Compiler Directive
- •Command Line Options
- •VPP Flag Attribute
- •Verilog-Related Commands and Globals
- •VHDL Modeling Style
- •Modeling Combinational Logic
- •Register Inferencing
- •Latch Inference
- •Flip-Flop Inferencing
- •Specifying Clock Edges
- •case Statement
- •Incomplete case Statement
- •Complete case Statement
- •for loop
- •Synthesis Directives
- •Code Selection Directives
- •Architecture Selection Directive
- •case Statement Directive
- •Enumeration Encoding Directive
- •Entity Template Directive
- •Function and Procedure Mapping Directives
- •Signed Type Directive
- •Resolution Function Directives
- •Type Conversion Directives
- •Set and Reset Synthesis Directives
- •Reading VHDL Designs
- •Using Arithmetic Packages From Other Vendors
- •Switching between VHDL’87 / VHDL’93
- •Reusing Previously Analyzed Entities
- •Modifying Case of VHDL Names
- •Writing VHDL Netlists
- •Selecting Bit-Level Representation
- •Selecting Between VHDL’87 and VHDL’93
- •Referring to VHDL Packages in Netlists
- •Writing Component Declarations
- •Hierarchical VHDL Designs
- •Component Instantiations and Bindings
- •Restrictions on Entities with Multiple Architectures
- •Precedence Rules for Architecture Selection
- •VHDL-Related Commands and Globals
- •Finite State Machine Overview
- •BuildGates Synthesis and Finite State Machines
- •Extracting the State Transition Table for the FSM
- •Viewing the State Transition Table for the FSM
- •FSM Optimization Features
- •Unreachable State Removal
- •State Assignment or Re-Encoding
- •State Minimization
- •Terminal State Check
- •Verilog and VHDL FSM Directives
- •Verilog FSM Directives
- •VHDL FSM Directives
- •FSM Coding Styles
- •Using the -reachable Option
- •Avoiding a Simulation Mismatch
- •EDIF Interface
- •Reading EDIF Designs
- •Writing EDIF Designs
- •Representing Power and Ground in EDIF
- •Net Representation for Power and Ground
- •Port Representation for Power and Ground
- •Instance Representation for Power and Ground
- •Verilog Constructs
- •Fully Supported Constructs
- •Declarations
- •Operators and Expressions
- •Partially Supported Constructs
- •Ignored Constructs
- •Unsupported Constructs
- •Summary of Verilog Constructs
- •VHDL Constructs
- •Notes on Supported Constructs

Envisia HDL Modeling Reference
Verilog Modeling Styles
When you run read_verilog and do_build_generic, you get a report as shown below.
Info: |
Processing |
design |
’sync_block_sig_dff’ <CDFG-303>. |
|
|
|
|
|||||
|
Finished processing module: ’sync_block_sig_dff’ <ALLOC-110>. |
|||||||||||
+------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
+ |
| |
|
|
Table for sequential elements |
|
|
|
|
|
| |
|||
|------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
| |
| |
File Name |
| |
| |
Register | Type | Width | AS | AR |
| SS | SR | |
|||||||
| |
|
| |
| |
Name | |
| |
|
| |
| |
|
| |
| |
| |
|-------------------- |
|
+ |
+ |
----------+------ |
+ |
------- |
+ |
----+ |
---- |
+ |
----+ |
----| |
|sync_block_sig_dff.v| |
| |
out1 _ reg | D_FF | |
1 |
| |
N | |
N |
| |
N | |
Y | |
|||
|-------------------- |
|
+------ |
+---------- |
+------ |
+------- |
|
+---- |
+---- |
|
+---- |
+---- |
| |
|sync_block_sig_dff.v| |
| |
out2 _ reg | D_FF | |
1 |
| |
N | |
N |
| |
N | |
N | |
|||
+------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
+ |
Verilog Preprocessor Directives
The following compiler directives are added through the Verilog Pre-Processor (VPP):
■`for
■`if
■`eval
■`{}
VPP also supports and interprets the following Verilog HDL compiler directives.
■`define
■`ifdef,
■`else,
■`endif
■`include
The remaining Verilog HDL compiler directives, when encountered in the source code, are passed on to the Verilog HDL parser as is, without any interpretation by VPP.
Compiler Directives
This section describes the compiler directives:
September 2000 |
44 |
Product Version 4.0 |

Envisia HDL Modeling Reference
Verilog Modeling Styles
The ‘for Compiler Directive
The `for compiler directive is a loop to define complex repetitive expressions and statements. The syntax of this directive is as follows:
‘for var = constant1 to constant2 step ?up | down? constant3
Verilog description
‘end
where var is the name of a variable; constant1, constant2, and constant3 are integer constants; and Verilog description is any legal Verilog syntax.
The variable var is visible only within the scope of this directive (between ‘for and ‘end). It can be referenced using ‘var. It can not be modified within the Verilog description. The initial value of var is set to constant1 for the first iteration and incremented (or decremented, if the keyword down is used) by constant3 on every iteration.
The iterations are terminated when the value of var is greater (less) than constant2. The Verilog description embedded within this directive is repeated for each iteration, substituting the current iteration value for the variable var if it is referenced within the
Verilog description.
In combination with the `if and `eval compiler directives (described below), this compiler directive can be very useful. It allows for VHDL type if-generate and for-generate capability to be supported in Verilog HDL. Refer to the model below.
`define BITS 5
`for i = `eval(`BITS-1) to 0 step down 1 `if (`i == 0)
halfadder U`i (a[`i],b[`i],s[`i],c[`i]); `else
fulladder U`i (a[`i],b[`i],c[`eval(`i-1)],s[`i],c[`i]); `endif
`end produces
fulladder U4 (a[4], b[4], c[3], s[4], c[4]); fulladder U3 (a[3], b[3], c[2], s[3], c[3]); fulladder U2 (a[2], b[2], c[1], s[2], c[2]); fulladder U1 (a[1], b[1], c[0], s[1], c[1]); halfadder U0 (a[0], b[0], s[0], c[0]);
The ‘for compiler directive may be nested in other compiler directives, including other ‘for compiler directives.
September 2000 |
45 |
Product Version 4.0 |

Envisia HDL Modeling Reference
Verilog Modeling Styles
The ‘if Compiler Directive
VPP expands the syntax of the `if compiler directive (Verilog HDL) to allow constant expressions using the following operators:
||
&&
==
!=
The syntax of this compiler directive is as follows:
‘if (expression)
verilog description
?‘else
verilog description?
‘endif
where expression is a constant expression composed of the legal operators listed above. For example,
`if ((`i == 0) || (`j == 1))
example i`i (a[`i], b[`j], c);
`else
example2 i`i (a[`eval(`i-1), b[`j], c);
`endif
The ‘eval Compiler Directive
VPP uses the `eval compiler directive to evaluate expressions involving defined macros and constants. The syntax for the `eval compiler directive is as follows:
‘eval(expression)
where expression is an expression with constant operands.
The operand can be either a constant number or a reference to a macro with a constant value.
The ‘{} Compiler Directive
Since Verilog gives no particular way to handle the building of complex macros using a combination of macros, VPP provides ‘{ABC} to evaluate a previously defined macro ABC.
For example, the following is not supported in Verilog HDL:
`define XYZ AND
September 2000 |
46 |
Product Version 4.0 |