Beruflich Dokumente
Kultur Dokumente
Once the VHDL model is made, next step is to test it. VHDL provides some special statements such as assert, report, and severity for testing process.
The assert statement checks to see if a certain condition is true and if not, it causes an error message to be displayed assert boolean-expression report string-expression [severity severity-level;] There are four possible severity levels: Note Warning Error Failure The severity level is optional. Assert and Report statements are very useful for creation of test benches.
Entity DFF is port (D,CLK:in bit; Q,NOTQ:out bit); End DFF; Architecture CHECK_TIME of DFF is constant HOLD_TIME:TIME:= 5ns; constant SETUP_TIME:TIME:= 3ns; Begin process(D,CLK) variable lasteventonD, lasteventonCLK: TIME; Begin ---check for hold time If DEVENT then assert now=0 ns or (now-lastevevntonclk)>= HOLD_TIME Report Hold time too short! Severity FAILURE; lasteventonD:=now; End if;
Design Entry
---The first step in the design of a digital system: Describing the design in VHDL in a top-down hierarchical fashion. Register Transfer Level (RTL): High-level VHDL designs usually described at this level.
Waveform Output
RTL Synthesis:
Synthesis is the process for automatic design generation from a design description. for ex. We have to specify a target hardware (ASIC, FPGA, CUSTOM IC) --sysnthesis will specifiy the timing and functional specification for compilation process.
-- Compiler converts various parts of the design to in intermediate format(analysis phase), links all parts together, generate the corresponding logic (synthesis phase), place and route components according to the target hardware and generate timing specification.
Timing Analysis:
This phase generate : worst-case delay, clocking speed, delay from one gate to another, Setup time hold time Designer used this information to decide the speed of the circuit.
VHDL Requirement
--Some specific requirements of VHDL are as follows: --As per DoD (department of defense requirement for hardware description language) General Features Support for Design Hierarchy Library Support Sequential Statement Generic Design Type Declaration and Usage Use of Subprograms Timing Control Structural Specification
A VHDL design entity is defined as: An entity declaration Its associated architecture body
Groups subprograms or design entities by use of packages. Configurations for customizing generic descriptions of design entities. Supports libraries and contains constructs for accessing packages, design entities, or configurations from various libraries.
Simulation in VHDL
a) Entity and Architecture : A single entity contain multiple architecture. b) Entity-architecture pair: In case of entity-architecture pair we define the term module and that module can be described in a hierarchical manner
c) Entity port: It includes input, output, bidirectional input/output lines. IN : input port OUT: output port INOUT: bidirectional input-output ports BUFFER: for buffered output
TO for ascending range DOWNTO for descending range Vectors are declared by the vector type (BIT_VECTOR)
d) Signals and Variables: e) Logic value System: Standard VHDL define BIT(0 and 1) for basic logic values type. Similarly std_logic standard package define a nine values logic system.
NOTE: TheU logic value is considered as the default value for objects that do not specify an initial value.
Resolved Function
2) Combinational Circuits:
a) XOR example
b) Adder example
c) Multiplexer example
d) Decoder example
A combinational circuit may be described by the use of Boolean, logical and arithmetic operations. for this description VHDL can use a set of operators as follows:
VHDL can also use sequential statements (process) for combinational networks.
3) Sequential Circuits:
A sequential circuit can be described in VHDL by use of gates, Boolean expressions, or behavioral constructs( process statement) .
We can take any example of sequential circuits as: a) Latches b) Flip flop c) Registers d) Shifters and Counters e) State Machines f) Memories
1) Crete waveform and apply stimulus at certain discrete time intervals. 2) Generate stimulus based on the state of entity, that is, based on the output
Library
Work Library STD Library
IEEE Library
Standard Packages Elaboration
Sequential Bodies VHDL Objects (signals, variables and constants) Real Time Delta Delay Scheduling Resolution Code Formal
entity inv is port (i1: in bit; y: out bit); end entity; architecture structure of inv is Y<= not i1 after 3 ns; end structure;