Tvsram Email: Tvsram@sac - Ernet.in: VHDL Basics by
Tvsram Email: Tvsram@sac - Ernet.in: VHDL Basics by
VHDL BASICS
VHDL(VHSIC) It is very high speed integrated circuit hardware descriptive language. What for it is used? Used to model digital system. What are its characterstics? It is case- in sensitive, means Ram,RAM rAM all equal it VHDL. -- is used for comments. language is similar to ADA, If you know C++ or PASCAL it is easy.
VHDL Basics
what it is ? It is a hardware description language that can be used to model a digital system at many levels of abstraction language, ranging from algorithm level to gate level.
VHDL BASICS
What It has?
It has an amalgamation of
.sequential language .concurrent language .net-list language .timing specifications .waveform generation language
VHDL HISTORY
What is its History? DOD of USA had started in 1981. They thought that it could act as medium for information Exchange between chip foundries and CAD tool operations. Because of Defence it was kept classified till 1985.
VHDL HISTORY
Then lot of private industry participated for development of this language In 1985 DOD had granted permission to hand over to spec to IEEE. IEEE released the number as IEEE 1076 /A. standard in dec 1987. IEEE revised in 1993.
VHDL IS CUNNING
Advantage of this language is Same language is used for analysis and synthesis But, Be careful, some are only simulatable and not synthesisable. Pl, Note At the present moment, what can be synthesizable is very vague, and much are tool Dependable.
VHDL IS CUNNING
Still IEEE is worming on a synthesisable subset of VHDL which will be supplied by all the Synthesis vendors.
VHDL CAPABILITIES
It is a language, hence it can be used as an exchange medium between chip vendors and CAD tool users. Means, chip vendors can provide VHDL descriptions of their components to system designers. CAD tool users can use them to capture the behavior of the design at a high level of abstraction for function simulation. .
VHDL CAPABILITIES
It supports hierarchy, A Digital system can be modelled as a set of interconnected components, each components in turn can be modelled as some of interconnection subcomponents. Simillar to other languages this also supports flexible design methrodologies top-down bottom - up or mixed.
VHDL CAPABILITIES
It is a Language hence it can also be used as a common medium between different CAD and CAE tools. Eg:. Schematic capture program may be used to generate a VHDL description for the design, which can be used as an input to a simulation program. It supports hierarchy,
VHDL CAPABILITIES
A Digital system can be modeled as a set of interconnected components, each components in turn can be modeled as some of interconnection sub-components. Similar to other languages this also supports flexible design methodologies top-down bottom - up or mixed. The language is not technology specific
VHDL CAPABILITIES
but is capable of supporting technology specific feature, supports various handware technology. Eg: You may define new logic types and new components. You can also model technology dependent components. By being technology independent the same model can be synthesized in to different vendor libraries.
VHDL CAPABILITIES
Supports both synchronous and asynchronous timing models. You can use, FSMs, state tables, algorithm descriptions, Boolean, wave form entry, etc, Nowadays the new tools like VISUAL HDL are available using them even flowchart, block level, also can be used as design entry. It is similar to English language.
VHDL SUPPORTS
.structural, .data-flow, .behavior A combination of all the three also possible. Wide range of abstraction levels from abstract behavior description to very precise gate level. But, below transistor level not possible.
VHDL SUPPORTS
It has elements, that make large scale design modeling easier. HOW? Using this you can create components, functions, procedures, and packages, test benches, you can model Propagation delay, Minmax delay, setup and hold time etc.,
VHDL SUPPORTS
One can use generics, and attributes which are useful in describing paramaterised model.
control bus add bus data bus int lines, digital system eg: micro processor
external view
archite cture 1
archite cutre 2
VHDL Terminology
Digital system can be as simple as logic gate to complex system. Hardware abstraction of this system called entity ( component) . An entity X when used in entity Y becomes a component for the entity Y.
VHDL Terminology
VHDL provides five different types of primary constructs, called design units 1. Entity declaration 2. Architecture body 3. Configuration Delcaration 4. Package declaration 5. Package body
VHDL Terminology
Entity E1 Entity E2
N BI
N DI
Entity E3
E3_A1
E3_A2
E3_A3
VHDL Analyzer
Once an entity is modeled,it needs to be analyzed and finally it has to be simulated. Then we can say a component is created. So Next step is analyzer and simulator analyzer reads in one or more design units contained in a single file and compiles them into a design library after validating syntax
VHDL Analyzer
and performing some static semantic checks. This design library is your library, means your project library. design library is a place in the host environment where compiled design units are stored.
VHDL Simulator
The simulator simulates entity we know that each entity is represented by an entity-architecture pair or by a configuration, by reading in its compiled description from the design library and then performing the following steps.
VHDL Simulator
Elaboration initialization simulation
Entity
Entity declaration specifies the name of the design ( component) being modeled and the set of interface ports. Ports are signals through which entity communicates with the other models in its external environment.
Entity Example
A
x1
sum carry
B
A1
VHDL process
We can use case, loop etc within process. Normally they are similar as C or pascal. An explicit wait statement can also be used to suspend a process. It can be used to wait for a certain amount of time, until a certain condition becomes true, or until an event occurs on one or more signals.
Eg: process begin clk <= 0;wait for 20 ns; clk <= 1;wait for 12 ns; end process;
clk 0 20 32 52 64 84 96
VHDL process
This process does not sensitivity list pl. observe the code. Because explicit wait statements are present inside the process. It is important to remember that a process never terminates. It is always either being executed or in suspended state. All processes are executed once during the initialization phase of simulation until they get suspended.
VHDL process
A process with no sensitivity list and no explicit wait statement will never suspend itself. Eg: of DFF. Entity DFF IS Port (Q:out BIT; D,clk: in BIT); End DFF;
VHDL process
Architecture DFF_beh of DFF is Begin Process ( D,clk) Begin If clk = '1' then Q <= D; End if; End process; End Dff_beh;
VHDL process
This process executes whever there is an even on signal D or CLK. If the value of CLK is '1' , the value of D is assigned to Q. If CLK is '0', then no assignment to Q takes place. Thus, as long as CLK is '1' any change on D will appear on Q. Once clk becomes '0', the value in Q is retained.
CIN B
x1
SUM
CARRY
BEHAVIOR
This FA is done with one component instantiation one process statement , one concurrent signal assignment. Note all these statements are concurrent statements. Therefore their order of appearance within the architecture body is not important.
This is done using one component instantiation one process statement and ond concurrent signal assignment. Note all these statements are concurrent statements. Therefore their order of appearance within the architecture body is not important.
eg:
Package declaration
A package declaration is used to store a set of common declarations such as components,types, procedures, and functions. These declarations can then be imported into other design units using a "use" clause.
Package ex_traffic_light is ---- name of package it has type, component, function see that int2bit_Vec does not appear in the package -- only interface appears, Type color is (red,green,yello); Component D_myFF Port (D,CK: in bit; Q :out BIT); End component; Constant pin2pin_delay :time := 125ns; Function int2bit_vec ( int_value:integer) Return bit_vector; End ex_traffic_light;
Package declaration
Used to store the definitions of functions and procedures that were declared in the corresponding package declaration, and also the complete constant declarations for any declarations of any deferred constants that appear in the package declaration. Package body is always associated with package declaration. Package declaration can have at most one package body associated with it. Contrast this with an architecture body and an entity declaration, where multiple architecture bodies may be associated wit a single entity declaration
Package declaration
Package body exam_pack is - - name of the package is same as package declarations Function int2bit_vec ( int_value:integer) Return bit_vector is Begin - -behavior of function described here. End int2bit_vec; End exam_pack;
Wish you