EE295 - ASIC Design With VHDL Class - Fall 1998
Basic Modeling Constructs
Assignment:
-
Read Ch 5
-
Exercise 7, 9, 11, 12, 13, 16
In Describing Complex Designs we Divide our Descriptions into 2 Basic Categories:
External View and Internal View. We discuss a Few Key Constructs.
The External View is Described in the Entity - The Internal View in the
Architecture. We discuss the VHDL Design Process.
Outline
Entity Declaration
VHDL's External View of an Object
-
Entities Must Have a Name. Not Much More.. an Empty Declarative Region.
-
In it's Most Diminutive Form:
-
Entity name is
-
Entity ADDER is
-
end |entity ADDER| ;
-
The External View Must Declare All Possible Ways In To and Out Of The Design.
-
Ports Provide ELectrical Connections
-
Entity ADDER is
-
--this design has 2 inputs and 1 output
-
Port ( A : in bit; B : in; Z : out );
-
--an alternative to first example
-
Port ( A, B : in; Z : out );
-
end |entity ADDER| ;
-
Generics Provide Information Inside the Model
-
Entity HALF_ADDER is
-
--A Value to Refer to in the Model
-
generic ( delay : time | := 2.5 nS |; );
-
--
-
Port ( A : in bit; B : in; Z : out );
-
--additional declarative region discussed later
-
end |entity ADDER| ;
-
Ports form Implicit Signals Visible to the Architecture
Architectures
VHDL's Internal View(s) of an Object
-
Architectures Require a Name Too..
-
Architecture name of entity's name is
-
Architecture GATES of ADDER is
-
--declarative region
-
--signal, constant, component...
-
begin
-
--..
-
--..description of design
-
--..
-
end;
-
Some Suggested Names:
-
structural
-
signal assignments and component instances
-
behavioral
-
signal assignments and process statements
-
dataflow
-
signal assignments and expressions
-
Appropriate
-
Avoid Reusing Entity Name
-
Hierarchical Processing and Translation may Pose Naming Conflicts
Concurrent Statements
"--..description of design"
-
A Broad Class of Constructs
-
Author Focuses on Elemental Concurrent Statement
-
The Process
-
| label:|process | sensitivity list | is
-
| L1:|process | ( A, B ) | is
-
begin
-
--
-
--sequential statements
-
--
-
end;
-
Duality in the Constructs of the Language
-
Concurrent
-
Models Real ELectrical Circuits - Wires
-
Sequential
-
Executes in Order - A Traditional Computer Programming Language
-
Both
-
Possess Powerful Mechanisms for Expression
Signal Declarations
-
Defines an Object for Electrical Interconnect in an Architecture
-
Signal name : type |:= initial value |;
-
Signal A_int, B_int : bit |:= '1'|;
Behavioral Descriptions
Signal Assignment
-
signal name <= |inertial|transport| waveform
Two Basic Delay Models
-
Inertial
-
The Default Mechanism
-
Signal values must be present longer then the inherent delay or they 'disappear'.
-
Economical Choice for Simulator Resources
-
Glitches are not Propogated Throughout the Design
-
-BUT-
-
fundamentally inaccurate.
Pop Quiz
If our NAND2 cell takes 3 nS to switch..
begin
A <= '0';
A <= '1' after 2 nS;
A <= '0' after 2.5 nS;
tie_me <= '1';
U1:NAND2 port map ( A, tie_me, Z ); --..what value does Z get??
end;
A _______--_____
Z --------------
_______________
| | | | | | | (time)
0 1 2 3
-
Transport
-
Must be Explicitly Activated
-
All transactions propogate through an assignment
-
Accurate modeling of many devices but the overhead can be prohibitive.
-
Use sparingly.
A _______--_____
Z -------------------__---
__________________________
| | | | | | | | | | | | | (time)
0 1 2 3 4 5 6
Z Will now 'Follow' the A Input, Propogating a 0.5 nS Glitch
-
w/ waveform is a value expression |after time expression ;
-
Put it All Together and..
-
Simplest Form of Concurrent Assignment
-
A <= B; -- value of B gets put onto A's Sensitivity List
-
| something that evaluates to a value in the target's type.
-
| target of the assignment
The Declaration of signals A and B have triggered the construction
of data structures - lists of driving values.
time(nS): 2 3 5 a list of all the possible transactions
_________ is always maintained
value: A|0|0|1|1
transaction = change in one of the signals in a signal's sensitivity list
event = transaction that results in a signal's change of value
The 'Works':
-
--Assignment With Delay
-
D_out <= A and B after 10 nS;
-
--
-
--Conditional Assignment
-
data_out <= data_in when enable = '1' else 'Z';
-- A tri-state buffer
-
--
-
--Selective Assignment
-
with sel select --Signal 'sel' Determines Which one of
-
a <= sig1 after 2 nS when 0, --Several Possible
Signals Drives a
-
sig2 after ( 2 * rise_delay ) nS when 1, -- Value Onto Signal
'a'
-
sig3 after 7 nS when 2;
Signal Attributes
-
signal'DELAYED[(time)]
-
my_sig'DELAYED(n)
-
Creates a Delayed Version of Signal
-
Delayed by n - a Value of Type Time
-
Defaults to 0
-
Delayed by a Delta Time
-
Use:
-
Hold Test on a Latch Cell Model, RAM, etc
-
Insure Data has Held Constant Value for Minimum Time
-
signal'STABLE[(time)]
-
Signal of Type Boolean
-
Evaluates to 'True' or 'False' ( not 0 or 1 )
-
True if No Events Occurred for the Time Specified
-
signal'QUIET[(time)]
-
Signal of Type Boolean
-
Indicates a Transaction has Occurred
-
True if No Transactions Occurred for the Specified Time
-
signal'EVENT
-
Boolean
-
True if Event Occured on signal in Current Simulation Cycle; False
Otherwise
-
signal'ACTIVE
-
Boolean
-
True if a Transaction Occured on signal in Current Cycle; False
Otherwise
-
signal'LAST_EVENT
-
time
-
Interval Since last Event on signal
-
signal'LAST_ACTIVE
-
time
-
Interval Since Last Transaction on signal
-
signal'LAST_VALUE
signal type
-
The Value of signal Just Before Last Event
Delta Time
-
A mechanism to allow concurrent assignments to be evaluated correctly before
'real' or simulation time increments.
-
As a designer simulating a design you will select a time base for the purposes
of displaying signal values. Between 'ticks' of the 'real' clock delta
time advances to permit signal evaluation.
A <= B;
B <= D;
C <= A; -- what's going on here? What Value Does 'C' Get?
D <= '1';
Process
-
Actually a Concurrent Statement! Appears in the Body of an Architecture.
-
Delimits a Section of Sequential Code
-
Optional Sensitivity List Indicates Which Signals 'Wake Up' a Process.
Alternatively a wait statement must Suspend Execution
-
Self-Contained Declarative Region
-
Important Time Does Not Increment in a Process - Not Even Delta Time!!
Signal Assignments Don't 'Take Place' Until The ( all ) Process(es) Suspends
and Concurrent Execution Resumes.
-
example:
-
architecture behavioral of mux
-
begin
-
|label:|process |( sensitivity list )|
-
m1:process ( select ) -- this process wakes up with events on signal
select
-
begin
-
if ( select = '1' ) then data_out <= a; else data_out
<= b; end if;
-
end process m1;
-
end architecture behavioral;
-
Process Labels are a Good Idea - Simulators Allow Lookup by Label
Concurrent Signal Assignment Problem
-
Signal Assignments May Appear in a Process
-
However the Results May be Confusing
-
Because Time Does Not Increment
-
Values are Placed on the Driver List
-
But Never Take Place Until the Process Halts and Time Moves On
-
But You Legally May have Referred to that Signal in the Process.
What did you get? Uninitialized Garbage?
Wait Statements
-
A Process Must be Sensitive to Signals
-
or
-
Contain an Explicit Wait Condition
-
Wait is a Sequential Statement
-
|label:| WAIT - Halts Process Execution
-
wait on signal name;
-
wait until boolean expression;
-
wait for time expression;
Structural Descriptions
-
Design Hierarchy Subsystems ( Represented by Components ) Interconnected
with Signals
-
Subsystems Decompose into Other Subsystems
-
or
-
Purely Behavioral Structures eg. Processes and Signals
Component Instances and Port Maps
IEEE-87
-
-- Component Declaration
-
-- Appears in Declarative Region
-
Component comp_name is
-
Generic ( gen_name : gen_type |:= init_value );
-
Port ( port_name : mode port_type );
End Component;
-
Signal portcon : Bit;
-
--Component Usage
-
--Appears in Architecture Body
-
Label_1: Component comp_name
-
--Ports May Be Connected Using Two Schemes: Positional or Named
-
--Positional:
-
Port Map ( |portcon|Open|, ... );
-
--Ports are Connected in Order Declared
-
Efficient, But Ambiguous
-
If Ports on Component Declaration are Rearranged ..
-
So are the Interconnections
-
As Long as Modes are Consistant No Errors are Detected
-
--Named:
-
Port Map ( port_name => |portcon|open|... );
-
--formal => actual
-
--ports assigned in any order
-
or a Mix of the Two Schemes
-
Port Assignments Start Out Positional and Switch to Named
-
Component Must be Bound or Configured to Underlying Entity/Architecture
-
Ports may only Connect to Signals
-
Ports may be Composite Objects ( Records, Arrays, Unconstrained Arrays
)
-
Assigned as Single Object or Decomposed ( Subelemental Association )
-
IEEE-93
-
-- Component Declaration
-
Component comp_name is
-
Generic ( gen_name : gen_type |:= init_value );
-
Port ( port_name : mode port_type );
End Component comp_name;
-
--However
-
--Direct Instantiation of Entity is Permitted
-
Label_1: Entity |library_name.|entity_name|(architecture_name)|
-
Port Map ( port_name => |portcon|Open|... );
-
--formal => actual
-
Port Association with Expressions Permitted
-
eg. '1', constant, any static expression
Analysis, Elaboration and Execution
The IEEE Language Reference Manual Goes Beyond Syntax and Precisely
Defines the Execution Model to Guarantee Consistant Results.
-
Analysis
-
Insures Adherence to the Language Specification
-
Produces Intermediate File for Subsequent CAD Activity
-
Output of Analysis is Library WORK by Default
-
Usually Needs Means to Override to Build Other Libraries
-
Model Tech's V-system Analyzer vcomhas a Command Option ( -l lib_name
)
-
CLSI's VTIP Analyzer Uses 2 Variables for Every Library
-
lib_name = dls_lib_name; dls_lib_name = directory_name
-
Design Libraries, Library Clauses and Use Clauses
-
An Entity/Architecture and Packages Form Design Units
-
Libraries are Repositories for Design Units
-
All Design Units in Library Work are Always Visible
-
Design Units that Depend on Other Design Units Stored in Other Libraries
Declare That Dependence..
-
Library lib_name, ...;
-
Use lib_name.package_name.object_name|All;
-
Use lib_name.entity_name|All;
-
Elaboration
-
Design Reults in Processes Interconnected with Signals
-
Everything Else Disappears
-
Collapsing Hierarchy
-
Insures Consistant 'Usage'
-
Specification of Defered Generics
-
Sometimes Conceptually Merged into Analysis/Execution for Simplicity
-
Execution
-
Initialization Phase
-
Signals Assume Initial Value
-
Processes Wake Up and Execute to First Wait
-
time = 0
-
Changes to Signal Drivers are Stacked Up
-
Simulation Cycle
-
Time is Incremented to the Next Pending Transaction on a Signal
-
Pending Signal Transactions Performed - Possible Causing an Event
-
Processes Sensitive to Those Events Wake Up -> New Pending Transactions
-
Repeat
-
For Simulation but not Synthesis
How was the class? Send your comments to jswift@us.ibm.com
Return to Class Home Page
© Copyright 1998, James Swift
Copying this document without the permission of the author is prohibited
and a violation of international copyright laws.