DSD Unit 1
DSD Unit 1
DSD Unit 1
UNIT 1:
INTRODUCTION To VHDL
Simulation : It allows us to verify the functionality of the circuits virtually using the
tools of the software we can verify the function .
Design units:
GENERICs
The most obvious, and probably most used, information passed to an entity is
delay times for rising and falling delays of the device being modeled. Generics
can also be used to pass any user-defined data types, including information such
as load capacitance, resistance, and so on. For synthesis parameters such as
datapath widths, signal widths, and so on, can be passed in as generics.
The data passed to an instance is static data. After the model has been
elaborated (linked into the simulator), the data does not change during
simulation. Generics cannot be assigned information as part of a simulation run.
The information contained in generics passed into a component instance or a
block can be used to alter the simulation results, but results cannot modify the
generics
The following is an example of an entity for an AND gate that has three generics
associated with it:
ENTITY and2 IS
GENERIC(rise, fall : TIME; load : INTEGER);
PORT( a, b : IN BIT; PORT( c : OUT BIT);
END AND2;
Architectures:
The entity describes the interface to the VHDL model. The architecture describes
the underlying functionality of the entity and contains the statements that model
the behavior of the entity. An architecture is always related to an entity and
describes the behavior of that entity.
A data object is created by an object declaration and has a value and type associated
with it. An object can be a Constant, Variable, Signal or a File.
1.Signal
Signals can be considered wires in a schematic that can have a current value and future
values.
Signals are used for communication between components.
Signals are declared outside the process .
Some delay must be incurred in a signal assignment
Signals are updated when their signal assignment statement is executed, after a certain
delay, as illustrated below,
Variable_name := expression;
3.Constants:
A constant can have a single value of a given type and cannot be changed during the
simulation.
Constants declared at the start of an architecture can be used
anywhere in the architecture.
Constants declared at the start of an architecture can be used
anywhere in the architecture.
A constant is declared as follows,
Data Types :
ACCESS TYPES Most hardware design engineers using VHDL probably never
use access types directly but access types provide very powerful programming
language type operations. An access type in VHDL is very similar to a pointer in
a language like Pascal or C.
Access types allow the designer to model objects of a dynamic nature.For
instance, dynamic queues, fifos, and so on can be modeled easily using access
types.
File Types
A file type allows declarations of objects that have a type FILE. A file object can
be read from,written to,and checked for the end of file only with special
procedures and functions.
A file type declaration specifies the name of the file type and the base type of
the file.Following is an example of a file type declaration:
TYPE integer_file IS FILE OF INTEGER;
Composite Types
It consists of array and record types.
1.Record Types:
Record types group objects of many types together as a single object.
Each element of the record can be accessed by its field name.
Record elements can include elements of any type,including arrays and
records.The elements of a record can be of the same type or different types.
TYPE instruction IS
RECORD
opcode : optype;
src : INTEGER;
dst : INTEGER;
END RECORD;
2.Array Types:
Array types group one or more elements of the same type together as a single
object.Each element of the array can be accessed by one or more array indices.
Delays:
1.Inertial Delay:
Inertial delay is the default in VHDL. If no delay type is specified, inertial delay is
used. Inertial delay is the default because, in most cases, it behaves similarly to
the actual device.
In an inertial delay model, the output signal of the device has inertia, which must
be overcome for the signal to change value.
The inertia value is equal to the delay through the device.
The buffer has a single input A and a single output B. The waveforms are shown
for input A and the output B. Signal A changes from a ‘0’ to a ‘1’ at 10
nanoseconds and from a ‘1’ to a ‘0’ at 20 nanoseconds. This creates a pulse or
spike that is 10 nanoseconds in duration. The buffer has a 20- nanosecond delay
through the device.
2.Transport delay:
Transport delay is not the default in VHDL and must be specified. It represents a
wire delay in which any pulse, no matter how small, is propagated to the output
signal delayed by the delay value specified.
Transport delay must be explicitly specified . i.e keyword “TRANSPORT” must be
used .
3.Delta delay:
Signals Drivers
Every signal assignment in a process creates a driver for that signal. The driver
of a signal holds its current value and all its future values as a sequence of one
or more transactions, where each transaction identifies the value to appear on
the signal along with the time at which the value is to appear.
Concurrent statements:
Component Declaration
The component-label can be any legal identifier and can be considered as the
name of the instance. The component-name must be the name of a component
declared earlier using a component declaration. The association-list associates
signals in the entity, called actuals, with the ports of a component, called locals.
A configuration
Configuration specifications:
Configuration declaration
Configuration specifications have to appear in an architecture body. Therefore, to
change a binding, it is necessary to change the architecture body and re-analyze
it. This may sometimes be cumbersome and time consuming. To avoid this, a
configuration declaration may be used to specify a binding.
Generate statement
Wait statement
suspends process/subprogram execution until a signal changes, a condition
becomes true, or a defined time period has elapsed. Combinations of these can
also be used.
Syntax:
wait [on signal_name {,signal_name}]
[until condition]
[for time expression]
Ex:
wait until clock = '1' or enable /='1' for 25ns;
Example
A <= B after 10ns;
C <= A after 10ns; -- value of C is current A value
Example
A := B and C;
D := A; -- value of D is new A value
Conditional Statements
Standard if..then and case constructs can be used for selective operations.
Loop statements
Sequences of statements can be repeated some number of times under the
control of while or for constructs.
label: while condition loop
... sequence of statements ...
end loop label;
label: for loop_variable in range loop
... sequence of statements...
end loop label;
http://vlsi-design-engineers.blogspot.com/2015/07/vhdl-functions-and-proc
edures.html
Packages
A package provides a convenient mechanism to store and share declarations
that are common across many design units. A package is represented by
1. a package declaration, and optionally,
2. a package body.
Package std_logic_1164 is defined in the library IEEE. This package is not part of the VHDL LRM.
Description:
The Std_logic_1164 package is the IEEE standard for describing digital logic values in VHDL (IEEE
STD 1164). It contains definitions for std_logic (single bit) and for std_logic_vector (array). It also
contains VHDL functions for these types to resolve tri-state conflicts, functions to define logical
operators and conversion functions to and from other standard types.
VHDL LIBRARIES
VHDL libraries allow you to store commonly used packages and entities that you can use in
your VHDL files. A VHDL package file contains common design elements that you can use in
the VHDL file source files that make up your design.
VHDL library is a container, which holds files that define entities, architectures, or packages.
VHDL Operators:
The predefined operators in the VHDL language are classified into the following
five categories:
1. Logical operators
2. Relational operators
3. Adding operators
4. Multiplying operators
5. Miscellaneous operators
Test Benches
To simulate your design, you need both the design under test (DUT) or unit under test
(UUT) and the stimulus provided by the test bench.
A test bench is HDL code that allows you to provide a documented, repeatable set of stimuli
that is portable across different simulators.
A test bench can be as simple as a file with clock and input data or a more complicated file
that includes error checking, file input and output, and conditional testing.