L12 – VHDL Overview. VHDL Overview  HDL history and background  HDL CAD systems  HDL view of design  Low level HDL examples  Ref: text Unit 10, 17,

Slides:



Advertisements
Similar presentations
1/8/ VerilogCopyright Joanne DeGroat, ECE, OSU1 Verilog Overview An overview of the Verilog HDL.
Advertisements

L23 – Adder Architectures. Adders  Carry Lookahead adder  Carry select adder (staged)  Carry Multiplexed Adder  Ref: text Unit 15 9/2/2012 – ECE 3561.
The Verilog Hardware Description Language
Verilog Intro: Part 1.
Combinational Logic with Verilog Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer.
LECTURE 4: The VHDL N-bit Adder
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
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.
L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
ECE 331 – Digital System Design
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
L23 – Arithmetic Logic Units. Arithmetic Logic Units (ALU)  Modern ALU design  ALU is heart of datapath  Ref: text Unit 15 9/2/2012 – ECE 3561 Lect.
1 H ardware D escription L anguages Basic Language Concepts.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
ECE 2372 Modern Digital System Design
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
L16 – Testbenches for state machines. VHDL Language Elements  More examples HDL coding of class examples Testbench for example  Testing of examples.
1/8/ L3 Data Path DesignCopyright Joanne DeGroat, ECE, OSU1 ALUs and Data Paths Subtitle: How to design the data path of a processor.
1/8/ L7 Project Step 3Copyright Joanne DeGroat, ECE, OSU1 Project Step 4 Step 1 in transitioning to behavioral modeling. We will wire behavioral.
L26 – Datapath ALU implementation
L16 – VHDL for State Machines with binary encoding.
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
Basic Overview of VHDL Matthew Murach Slides Available at:
Copyright 2009 Joanne DeGroat, ECE, OSU 1 ECE 762 Theory and Design of Digital Computers, II (A real course title: Design and Specification of Digital.
Module 1.2 Introduction to Verilog
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.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
HARDWARE DESCRIPTION LANGUAGE (HDL). What is HDL? A type of programming language for sampling and modeling of electronic & logic circuit designs It can.
1 component OR_3 port (A,B,C: in bit; Z: out bit); end component ; Reserved Words  Declarations of Components and Entities are similar  Components are.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
1/8/ L2 VHDL Introcution© Copyright Joanne DeGroat, ECE, OSU1 Introduction to VHDL.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
L19 – Resolved Signals. Resolved Signals  What are resolved signals In systems In VHDL Resolution – Isn’t that for resolving conflicts?  Ref: text Unit.
CEC 220 Digital Circuit Design More VHDL Fri, February 27 CEC 220 Digital Circuit Design Slide 1 of 15.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19.
Digital System Projects
Lecture 1 – Overview (rSp06) ©2008 Joanne DeGroat, ECE, OSU -1- Functional Verification of Hardware Designs EE764 – Functional Verification of Hardware.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Data Flow Modeling in VHDL
Introduction to VHDL Coding Wenchao Cao, Teaching Assistant Department of EECS University of Tennessee.
CEC 220 Digital Circuit Design Introduction to VHDL Friday, February 21 CEC 220 Digital Circuit Design Slide 1 of 10.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, Oct 14 CEC 220 Digital Circuit Design Slide 1 of 19.
George Mason University Data Flow Modeling of Combinational Logic ECE 545 Lecture 5.
Structural style Modular design and hierarchy Part 1
Basic Language Concepts
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Hardware Descriptive Languages these notes are taken from Mano’s book
Combinatorial Logic Design Practices
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
CHAPTER 10 Introduction to VHDL
VHDL VHSIC Hardware Description Language VHSIC
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Modeling of Combinational Logic
Hardware Descriptive Languages these notes are taken from Mano’s book
Copyright Joanne DeGroat, ECE, OSU
Project Step 1 Due – see webpage
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
An overview of the Verilog HDL.
© Copyright Joanne DeGroat, ECE, OSU
L25 – Final Review AU 15 Final Exam – Classroom – Journalism 300
Presentation transcript:

L12 – VHDL Overview

VHDL Overview  HDL history and background  HDL CAD systems  HDL view of design  Low level HDL examples  Ref: text Unit 10, 17, 20 9/2/2012 – ECE 3561 Lect 9 Copyright Joanne DeGroat, ECE, OSU2

Overview  HDL – Hardware Description Language A language that allows description of hardware for documentation, simulation, synthesis, verification, …  To use an HDL you need a CAD system that supports it.  Major CAD systems support VHDL, Verilog, System C, System Verilog  CAD systems (just some of them) Cadence – Incisive Mentor Graphics (Model Sim) – ModelSim, Questa Altera, XILINX (have arrangement to use ModelSim) Synopsis – Mainly toward synthesis and ASIC production from HDL descriptions 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU3

A brief history of HDLs  The development of today’s HDL began in State of CAD – generators and proprietary HDLs VHDL requirements set in 1981 VHDL IEEE 1 st standard in 1987 – New versions in 1993, 1997, 2000, 2002, And a new version is being worked on.  Verilog 1 st standard was in 1995  System C 1 st standard was in 2005  System Verilog merged with Verilog in New version in /2/2012 – ECE 3561 Lect 9 Copyright Joanne DeGroat, ECE, OSU4

Common to all systems  Have source HDL file  Structure of generated files is common  Library files are  for design units 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU5

A First Example  Desire to do a VHDL description of a full adder.  A device consists of An Interface An operational part  Interface – The INPUTS AND OUTPUTS  Operational Part – The FUNCTIONAL BEHAVIOR 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU6

VHDL Entity Design Unit  Format ENTITY unit_name IS [port_clause] END unit_name;  For a full adder would have: ENTITY full_adder IS PORT(a,b,cin : IN bit; sum : OUT bit; cout : OUT bit); END full_adder;  The PORT portion is termed a Port Clause When specified in the port clause these signals have scope over all architectures of this entity 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU7

Signals/Port Modes/Types  PORT(a,b,cin:IN bit; sum:OUT bit; cout: OUT bit);  Signals: Names referenced in the Port Clause are signals. A,b,cin,sum,cout represent wires of the physical unit. SIGNALS are objects that have both a value and a time component.  Port Modes: In this example you have inputs and outputs. The Port Mode specifies the direction of the signal transfer and a couple of other properties of the port. 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU8

Signals/Port Modes/Types  Modes: IN – signal can only be used (i.e., can only be read or can only be used on the right-hand-side of an equation). CANNOT BE ASSIGNED TO!! OUT – signal value can only be written. Cannot be seen or used in the design as it is an output and therefore external. INOUT – signal can be both written to (assigned to) and read (used). However, signals of thie type are connected to busses and therefore this signal mode requires the signal to be resolved. BUFFER – signal value can be written to and used internally in the design. 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU9

Basic Types  Built in – part of the standard and the language proper.  TYPE BIT – your typical binary type with values of ‘0’ and ‘1’. Declaration that established this type  TYPE BIT is (‘0’, ‘1’); Use of SIGNALS of TYPE bit a <= ‘0’; b <= x AND y OR z;  Note that the value is either ‘0’ or ‘1’ 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU10

Architectural Design Unit  Specifies the operational part ARCHITECTURE identifier OF entity_id IS [declarations] BEGIN [architecture_statement_part] END [identifier]; [architecture_statement_part] – Any concurrent statement of the language 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU11

Example of Architecture  For a full adder ARCHITECTURE one OF full_adder IS BEGIN sum <= a XOR b XOR cin; cout <= (a AND b) OR (a AND cin) OR (b AND cin); END one;  This style of description is referred to as a dataflow description. It is excellent for the combinational logic leaf units of a design. 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU12

Consider a 4 bit Adder  This hardware is to modeled in VHDL  First will do a dataflow model for the unit as a whole. Will create two alternative dataflow models.  Then will create a structural model where the leaf units are basic gates. 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU13

A Multibit Adder Example  Will model using a dataflow style Bit Vectors for ports and individual signals internally Bit Vectors for ports and bit vectors internally  The Entity Design Unit (same for both) ENTITY mb_adder IS PORT(a,b : IN bit_vector(3 downto 0); cin : IN bit; cout : OUT bit; sum : OUT bit_vector(3 downto 0)); END mb_adder; 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU14

The first dataflow Architecture  ARCHITECTURE one OF mb_adder IS  SIGNAL c : BIT_VECTOR (4 downto 0);  BEGIN  c(0) <= cin;  sum(0) <= a(0) XOR b(0) XOR c(0);  sum(1) <= a(1) XOR b(1) XOR c(1);  sum(2) <= a(2) XOR b(2) XOR c(2);  sum(3) <= a(3) XOR b(3) XOR c(3);  c(1) <= (a(0) AND b(0)) OR (a(0) AND c(0)) OR  (b(0) AND c(0));  c(2) <= (a(1) AND b(1)) OR (a(1) AND c(1)) OR  (b(1) AND c(1));  c(3) <= (a(2) AND b(2)) OR (a(2) AND c(2)) OR  (b(2) AND c(2));  c(4) <= (a(3) AND b(3)) OR (a(3) AND c(3)) OR  (b(3) AND c(3));  Cout <= c(4);  END one; 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU15

Dataflow Architectures  Dataflow architectures should be limited to leaf units.  The level of complexity should be limited.  The 4 bit adder is not overbearing but much more than this should be avoided.  Probably want to limit dataflow descriptions to 30 or so lines.  Dataflow architectures synthesize extremely well across most synthesis tools (Altera, Xilinx, Synopsis, Mentor Graphics) 9/2/2012 – ECE 3561 Lect 9 Copyright Joanne DeGroat, ECE, OSU16

The Second Dataflow Architecture ARCHITECTURE two OF mb_adder IS SIGNAL c : BIT_VECTOR (4 downto 0); BEGIN c(0) <= cin; sum <= a XOR b XOR c(3 downto 0); c(4 downto 1) <= (a(3 downto 0) AND b(3 downto 0)) OR (a(3 downto 0) AND c(3 downto 0)) OR (b(3 downto 0) AND c(3 downto 0)); Cout <= c(4); END two;  Note the power of this HDL specification  The Carry ripples through repeated evaluations of the equation as whenever a signal on the right-hand-side changes, the equation is re-evaluated and a new value scheduled for assignment to the signal.  Also synthesizes well. 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU17

Operations on Type BIT  Consider the following declaration SIGNAL x,y : bit;  Logical Operations x AND y Also have shift operations x OR y arithmetic shifts ASR ASL x NAND y x NOR y logical shifts LSR LSL x XOR y x XNOR y these work on vectors NOT y  NOTE: For logical expressions the equation is only evaluated until the result is determined. 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU18

Assignment and Relational Operators  Assignment Operators For signal <= For variables :=  Relational Operators (x=y) (x/=y) (x =y) Example of use (x=‘1’) AND (y=‘0’) 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU19

VHDL Structural Example  Again consider the full adder  Before doing a structural description must have the components that are going to be wired together. These must first be written and compiled into the library.  Only the ENTITIES are given. Each would have an architecture. ENTITY and2 IS PORT (A,B : IN BIT; Z : OUT BIT); END and2;  ENTITY xor2 IS PORT (A,B : IN BIT; Z : OUT BIT); END xor;  ENTITY or3 IS PORT (A,B,C : IN BIT; Z : OUT BIT); END or3 ; 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU20

The AND and OR gates  AND 2 ENTITY and2 IS PORT (A,B : IN BIT; Z : OUT BIT); END and2; ARCHITECTURE one OF and2 IS BEGIN Z <= A and B AFTER 2 ns; END one;  OR3 ENTITY or3 IS PORT (A,B,C : IN BIT; Z ; OUT BIT); END or3; ARCHITECTURE one OF or3 IS BEGIN Z <= A or B or C AFTER 2 ns; END one; 9/2/2012 – ECE 3561 Lect 9 Copyright Joanne DeGroat, ECE, OSU21

Structural Example for a full adder  The first part ARCHITECTURE structural OF full_adder IS -- Must declare the components that are to be used COMPONENT and2 PORT (A,B : IN BIT; Z : OUT BIT); END COMPONENT ; COMPONENT xor2 PORT (A,B : IN BIT; Z : OUT BIT); END COMPONENT ; COMPONENT or3 PORT (A,B,C : IN BIT; Z : OUT BIT); END COMPONENT ; -- State which library to find them in and which architecture to use. FOR ALL : and2 USE ENTITY WORK.and2(behavioral); FOR ALL : xor2 USE ENTITY WORK.xor2(behavioral); FOR ALL : or3 USE ENTITY WORK.or3(behavioral); -- Declare local signals required. SIGNAL addt. ct1, ct2, ct3 : BIT; 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU22

The second part of the Architecture  From the BEGIN BEGIN -- Wire up XOR gates for a XOR b XOR cin G1:xor2 PORT MAP(a,b,addt); G2:xor2 PORT MAP(addt, cin, sum); -- Wire up the cout function. G3:and2 PORT MAP(a,b,ct1); G4:and2 PORT MAP(a,cin,ct2); G5:and2 PORT MAP(b,cin,ct3); G6:or3 PORT MAP(ct1,ct2,ct3,cout); END Structural; 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU23

Multibit adder  Can use the structural full adder to wire up a multibit adder  The ENTITY Design Unit ENTITY mb_adder IS PORT (a,b : IN BIT_VECTOR(3 downto 0); cin : IN BIT; cout : OUT BIT; sum: OUT BIT_VECTOR(3 downto 0)); END mb_adder;  Entity is the same as before 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU24

The multibit Architecture  ARCHITECTURE structural OF mb_adder IS  -- Must declare the components that are to be used  COMPONENT full_adder  PORT( a,b,cin : IN BIT;  sum : OUT BIT;  cout : OUT BIT);  END COMPONENT;  FOR ALL : full_adder USE ENTITY work.full_adder(structural);  SIGNAL ic1,ic2,ic3 BIT;  BEGIN  U0: full_adder(a(0),b(0),cin,sum(0),ic1):  U1: full_adder(a(1),b(1),ic1,sum(1),ic2):  U2: full_adder(a(2),b(2),ic2,sum(2),ic3):  U3: full_adder(a(3),b(3),ic3,sum(3),cout):  END structural; 1/8/ L2 VHDL Introcution © Copyright Joanne DeGroat, ECE, OSU25

Lecture summary  A note on VHDL styles: The dataflow style synthesizes well. The structural style synthesizes well.  Have seen several initial examples of VHDL code.  Will now focus on that part of the language for small dataflow and state machine designs.  Pick a problem 9/2/2012 – ECE 3561 Lect 9 Copyright Joanne DeGroat, ECE, OSU26