
- •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
VHDL Modeling Style
falling_edge(clk)
clk'event and clk = '0'
not clk'stable and clk = '0'
All of these clock edge expressions can be used in if, wait, and conditional signal assignment statements.
In addition, the following expressions can be used in wait statements to specify rising and falling edges respectively:
wait |
until |
(clk |
= |
'1'); |
-- |
rising clock edge |
wait |
until |
(clk |
= |
'0'); |
-- |
falling clock edge |
case Statement
Using a case statement allows for multi-way branching in a functional description. When a case statement is used as a decoder to assign one of several different values to a variable, the logic can be implemented as combinational or sequential logic based on whether the signal or variable is assigned a value in branches of the case statement.
You can use the case statement in one of two ways when inferring a register.
■Incomplete case Statement on page 56
■Complete case Statement on page 57
Incomplete case Statement
When a case statement specifies only some of the values that the case expression can possibly have, a latch is inferred. For example, a state transition table may be modeled as follows:
signal curr_state, next_state, modifier:std_logic_vector(2 downto 0); process(curr_state, modifier)
begin
case curr_state is
when "000" => next_state <= "100" or modifier; when "001" => next_state <= "110" or modifier; when "010" => next_state <= "001" and modifier; when "100" => next_state <= "101" and modifier; when "101" => next_state <= "010" or modifier; when "110" => next_state <= "000" and modifier; when others => null;
September 2000 |
56 |
Product Version 4.0 |

Envisia HDL Modeling Reference
VHDL Modeling Style
end case;
end process;
The next_state signal is assigned a new value if curr_state is any one of the six values specified. For the other two possible states, the next_state signal retains its previous value. This behavior causes the software to infer a 3-bit latch for next_state.
Complete case Statement
If you do not want the software to infer a latch, the next_state signal must be assigned a value under all situations; next_state must have a default value.
Assigning a Default Value to next_state
There are two possible ways we can assign a default value to next_state.
■The first approach:
process(curr_state, modifier) begin
next_state <= "000"; case curr_state is
when "000" => next_state <= "100" or modifier; when "001" => next_state <= "110" or modifier; when "010" => next_state <= "001" and modifier; when "100" => next_state <= "101" and modifier; when "101" => next_state <= "010" or modifier; when "110" => next_state <= "000" and modifier; when others => null;
end case; end process;
The next_state signal is assigned a value unconditionally, then it is modified appropriately by the case statement. This approach prevents the software from inferring a latch.
■The second approach:
signal curr_state,next_state,modifier: std_logic_vector(2 downto 0);
process(curr_state, modifier) begin
case curr_state is
when "000" => next_state <= "100" or modifier; when "001" => next_state <= "110" or modifier;
September 2000 |
57 |
Product Version 4.0 |