VHDL Asutosh Kar Asst. Prof. in IIIT, Bhubaneswar.

Slides:



Advertisements
Similar presentations
Verilog Intro: Part 1.
Advertisements

Hardware Description Language (HDL)
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
Sistemas Digitais I LESI - 2º ano Lesson 5 - VHDL U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes Dept.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Introduction to VHDL (part 2)
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
1 H ardware D escription L anguages Basic Language Concepts.
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
ECE 2372 Modern Digital System Design
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
Module 1.2 Introduction to Verilog
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Introduction to VLSI Design – Lec01. Chapter 1 Introduction to VLSI Design Lecture # 11 High Desecration Language- Based Design.
HARDWARE DESCRIPTION LANGUAGE (HDL). What is HDL? A type of programming language for sampling and modeling of electronic & logic circuit designs It can.
Timing Model VHDL uses the following simulation cycle to model the stimulus and response nature of digital hardware Start Simulation Update Signals Execute.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19.
16/11/2006DSD,USIT,GGSIPU1 Packages The primary purpose of a package is to encapsulate elements that can be shared (globally) among two or more design.
Introduction to ASIC flow and Verilog HDL
© 조준동 2008 ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
VHDL Tutorial.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
CEC 220 Digital Circuit Design Introduction to VHDL Wed, Oct 14 CEC 220 Digital Circuit Design Slide 1 of 19.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 A hardware description language is a computer language that is used to describe hardware. Two HDLs are widely used Verilog HDL VHDL (Very High Speed.
Hardware Description Languages: Verilog
Introduction To VHDL 홍 원 의.
Basic Language Concepts
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
Design Entry: Schematic Capture and VHDL
Hardware Description Languages: Verilog
ECE 434 Advanced Digital System L08
VHDL Discussion Subprograms
VHDL Tutorial.
VHDL Discussion Subprograms
Data Object By E. Thirumeni Department of Electronics
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

VHDL Asutosh Kar Asst. Prof. in IIIT, Bhubaneswar

What does HDL stand for? HDL is short for Hardware Description Language (VHDL – VHSIC Hardware Description Language) (Very High Speed Integrated Circuit)

Why use an HDL? Question: How do we know that we have not made a mistake when we manually draw a schematic and connect components to implement a function? Answer: By describing the design in a high-level (=easy to understand) language, we can simulate our design before we manufacture it. This allows us to catch design errors, i.e., that the design does not work as we thought it would. Simulation guarantees that the design behaves as it should.

Adnan ShaoutIntro to VHDL4 VHDL is a programming language that allows one to model and develop complex digital systems in a dynamic environment. Object Oriented methodology for those who know C ;modules can be used and reused. Allows you to designate in/out ports (bits) and specify behavior or response of the system.

5 Modeling Digital Systems VHDL is for coding models of a digital system... Reasons for modeling ◦requirements specification ◦documentation ◦testing using simulation ◦formal verification ◦synthesis ◦class assignments Goal ◦most ‘reliable’ design process, with minimum cost and time avoid design errors!

6 Basic VHDL Concepts Interfaces -- i.e. ports Behavior Structure Test Benches Analysis, simulation Synthesis

7 VHDL -- VHDL is a programming language that allows one to model and develop complex digital systems in a dynamic environment. Object Oriented methodology for you C people can be observed -- modules can be used and reused. Allows you to designate in/out ports (bits) and specify behavior or response of the system.

How does the simulation work?

What is the output of C?

The two-phase simulation cycle 1)Go through all functions. Compute the next value to appear on the output using current input values and store it in a local data area (a value table inside the function). 2) Go through all functions. Transfer the new value from the local table inside to the data area holding the values of the outputs (=inputs to the next circuit)

Cycle-based simulators Go through all functions using current inputs and compute next output Update outputs & increase time with 1 delay unit

Event-based Simulators Go through all functions whose inputs has changed and compute next output Update outputs & increase time with 1 delay unit

Event-based simulators with event queues Go through all functions whose inputs has changed and compute value and time for next output change Increase time to first scheduled event & update signals

VHDL Simulation Cycle VHDL uses a simulation cycle to model the stimulus and response nature of digital hardware.

VHDL Delay Models Delay is created by scheduling a signal assignment for a future time. Delay in a VHDL cycle can be of several types Inertial Transport Delta

Inertial Delay Default delay type Allows for user specified delay Absorbs pulses of shorter duration than the specified delay

Transport Delay Must be explicitly specified by user Allows for user specified delay Passes all input transitions with delay

Delta Delay Delta delay needed to provide support for concurrent operations with zero delay – The order of execution for components with zero delay is not clear Scheduling of zero delay devices requires the delta delay – A delta delay is necessary if no other delay is specified – A delta delay does not advance simulator time – One delta delay is an infinitesimal amount of time – The delta is a scheduling device to ensure repeatability

Example – Delta Delay

Basic Form of VHDL Code Every VHDL design description consists of at least one entity / architecture pair, or one entity with multiple architectures. The entity section is used to declare I/O ports of the circuit. The architecture portion describes the circuit’s behavior. A behavioral model is similar to a “black box”. Standardized design libraries are included before entity declaration.

Entity Declaration An entity declaration describes the interface of the component. PORT clause indicates input and output ports. An entity can be thought of as a symbol for a component.

Port Declaration PORT declaration establishes the interface of the object to the outside world. Three parts of the PORT declaration Name Any identifier that is not a reserved word. Mode In, Out, Inout, Buffer Data type Any declared or predefined datatype. Sample PORT declaration syntax:

Architecture Declaration Architecture declarations describe the operation of the component. Many architectures may exist for one entity, but only one may be active at a time. An architecture is similar to a schematic of the component.

Modeling Styles There are three modeling styles: Behavioral (Sequential) Data flow Structural

VHDL Hierarchy

Sequential vs Concurrent Statements VHDL provides two different types of execution: sequential and concurrent. Different types of execution are useful for modeling of real hardware. Supports various levels of abstraction. Sequential statements view hardware from a “programmer” approach. Concurrent statements are order-independent and asynchronous.

Lexical Conventions Comments // Single line comment /* Another single line comment */ /* Begins multi-line (block) comment All text within is ignored Line below ends multi-line comment */ Number decimal, hex, octal, binary unsigned decimal form size base form include underlines, +,- String " Enclose between quotes on a single line"

Lexical Conventions (cont.) Identifier A... Z a... z Underscore Strings are limited to 1024 chars First char of identifier must not be a digit Keywords: See text. Operators: See text. Verilog is case sensitive

Description Styles Structural: Logic is described in terms of Verilog gate primitives Example: not n1(sel_n, sel); and a1(sel_b, b, sel_b); and a2(sel_a, a, sel); or o1(out, sel_b, sel_a); sel b a out sel_n sel_b sel_a n1 a1 a2 o1

Description Styles (cont.) Dataflow: Specify output signals in terms of input signals Example: assign out = (sel & a) | (~sel & b); sel b a out sel_n sel_b sel_a

Description Styles (cont.) Behavioral: Algorithmically specify the behavior of the design Example: if (select == 0) begin out = b; end else if (select == 1) begin out = a; end a b sel out Black Box 2x1 MUX

Sequential Style

Data flow Style

Structural Style

Sequential Style Syntax Assignments are executed sequentially inside processes.

Sequential Statements {Signal, Variable} assignments Flow control if then [elsif then ] else end if; for loop end loop; while loop end loop; case is when => ; when others => ; Wait on until for ;

Data Objects There are three types of data objects: Signals Can be considered as wires in a schematic. Can have current value and future values. Variables and Constants Used to model the behavior of a circuit. Used in processes, procedures and functions.

Constant Declaration A constant can have a single value of a given type. A constant’s value cannot be changed during the simulation. Constants declared at the start of an architecture can be used anywhere in the architecture. Constants declared in a process can only be used inside the specific process. CONSTANT constant_name : type_name [ : = value]; CONSTANT rise_fall_time : TIME : = 2 ns; CONSTANT data_bus : INTEGER : = 16;

Variable Declaration Variables are used for local storage of data. Variables are generally not available to multiple components or processes. All variable assignments take place immediately. Variables are more convenient than signals for the storage of (temporary) data.

Signal Declaration Signals are used for communication between components. Signals are declared outside the process. Signals can be seen as real, physical signals. Some delay must be incurred in a signal assignment.

Signal Assignment A key difference between variables and signals is the assignment delay.

Variable Assignment

IF – vs CASE – statement Syntax

FOR – vs. WHILE – statement Syntax For is considered to be a combinational circuit by some synthesis tools. Thus, it cannot have a wait statement to be synthesized. Thus, it needs a wait statement to be synthesized.

WAIT – statement Syntax The wait statement causes the suspension of a process statement or a procedure. wait [sensitivity_clause] [condition_clause] [timeout_clause]; Sensitivity_clause ::= on signal_name wait on CLOCK; Condition_clause ::= until boolean_expression wait until Clock = ‘1’; Timeout_clause ::= for time_expression wait for 150 ns;

Loop Statements ◦Repeat ◦While ◦For Repeat Loop ◦Example: repeat (Count) sum = sum + 5; ◦If condition is a x or z it is treated as 0

Loop Statements (cont.) While Loop ◦Example: while (Count < 10) begin sum = sum + 5; Count = Count +1; end ◦If condition is a x or z it is treated as 0 For Loop ◦Example: for (Count = 0; Count < 10; Count = Count + 1) begin sum = sum + 5; end

Conditional Statements if Statement Format: if (condition) procedural_statement else if (condition) procedural_statement else procedural_statement Example: if (Clk) Q = 0; else Q = D;

Sensitivity-lists vs Wait-on - statement

Behavioral Modeling Example: module mux_2x1(a, b, sel, out); input a, a, sel; output out; or b or sel) begin if (sel == 1) out = a; else out = b; end endmodule Sensitivity List

Concurrent Process Equivalents All concurrent statements correspond to a process equivalent. U0: q <= a xor b after 5 ns; is short hand notation for U0: process begin q <= a xor b after 5 ns; wait on a, b; end process;

Structural Style Circuits can be described like a netlist. Components can be customized. Large, regular circuits can be created.

Structural Statements Structural VHDL describes the arrangement and interconnection of components. Behavioral descriptions, on the other hand, define responses to signals. Structural descriptions can show a more concrete relation between code and physical hardware. Structural descriptions show interconnects at any level of abstraction.

Structural Statements The component instantiation is one of the building blocks of structural descriptions. The component instantiation process requires component declarations and component instantiation statements. Component instantiation declares the interface of the components used in the architecture. At instantiation, only the interface is visible. The internals of the component are hidden.

Component Declaration The component declaration declares the interface of the component to the architecture. Necessary if the component interface is not declared elsewhere (package, library).

Component Instantiation The instantiation statement maps the interface of the component to other objects in the architecture.

Component Instantiation Syntax The instantiation has 3 key parts Name Component type Port map

Component Libraries Component declarations may be made inside packages. Components do not have to be declared in the architecture body

Example: Array of AND-gates

VHDL Data Types

Array Array Used to collect one or more elements of a similar type in a single construct. Elements can be any VHDL data type.

Char and String type Char is (NUL, SOH, …, DEL); 128 chars in VHDL’ chars in VHDL’93 type String is array (positive range <>) of Char;

IEEE Predefined data types type Std_ulogic is (‘U’, ‘X’, ‘0’, ‘1’, ‘Z’, ‘W’, ‘L’, ‘H’, ‘-’); ‘U’ -- Uninitialized ‘X’ -- Forcing unknown ‘0’ -- Forcing zero ‘1’ -- Forcing one ‘Z’ -- High impedance ‘W’ -- Weak Unknown ‘L’ -- Weak Low ‘H’ -- Weak High ‘-’ -- Don’t care type std_logic is resolved std_ulogic; type std_logic_vector is array (integer range <>) of std_logic;

Type Conversion (Similar Base) Similar but not the same base type: signal i: integer; signal r: real; i <= integer(r); r <= real(i);

Type Conversion (Same Base) Same base type: type a_type is array(0 to 4) of bit; signal a:a_type; signal s:bit_vector(0 to 4); a<=“00101” -- Error, is RHS a bit_vector or an a_type? a<=a_type’(“00101”); -- type qualifier a<=a_type(s); -- type conversion

Type Conversion (Different Base) Different base types: Function int2bits(value:integer;ret_size:integer) return bit_vector; Function bits2int(value:bit_vector) return integer: signal i:integer; signal b:bit_vector(3 downto 0) i<=bits2int(b); b<=int2bits(i,4);

Built-In Operators Logic operators AND, OR, NAND, NOR, XOR, XNOR (XNOR in VHDL’93 only!!) Relational operators =, /=,, >= Addition operators +, -, & Multiplication operators *, /, mod, rem Miscellaneous operators **, abs, not

Thank You Regards A.Kar