- •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
A latch is inferred because not all of the possible case expressions are covered in the case statement (not full); the case expression 4’b0000 is not covered in the case statement
(see Assigning a Default Value for Incomplete case Statements on page 28 to avoid latches).
Furthermore one or more case items overlap (not parallel) and a priority encoder is required to implement the equivalent hardware.
In the following model, a casex statement is used with don’t care conditions in the same manner as the casez statement (above). The main difference between the two models is that the casex statement below masks three bits of the select line that would match x, z, or ?, but the casez statement above will not mask x in the select line.
module casex_example( sel, out); input [3:0] sel;
output [1:0] out; reg [1:0] out; always @(sel) begin
casex (sel)
4’bxxx1 : out = 2’b00; 4’bxx1x : out = 2’b01; 4’bx1xx : out = 2’b10; 4’b1xxx : out = 2’b11; default : out = 2’bxx;
endcase
end
endmodule
When you run read_verilog and do_build_generic, you get a report of the casez statement as shown below.
ac_shell[4]> read_verilog casex.v
ac_shell[5]> do_build_generic
Info: |
Processing design ’casex_example’ <CDFG-303>. |
|||||||
|
Statistics for case statements in module ’casex_example’ (File casex.v) <CDFG-800>. |
|||||||
|
+---------------------------------------- |
|
|
|
|
|
|
+ |
|
| |
Case Statistics Table |
|
| |
||||
|
|---------------------------------------- |
|
|
|
|
|
|
| |
|
| Line |
| |
Type |
| |
Full |
| Parallel | |
||
|
|--------- |
+ |
--------- |
+ |
--------- |
+ |
---------- |
| |
|
| |
6 | |
casex |
| |
AUTO |
| |
NO |
| |
|
+---------------------------------------- |
|
|
|
|
|
|
+ |
for Statement
The for statement is used for describing repetitive operations. For example, all the bits of a vector (in) can be stored in reverse order using a for statement.
September 2000 |
30 |
Product Version 4.0 |