Lecture 3 Introduction to VHDL

Similar documents
Introduction to VHDL #1

CDA 4253 FPGA System Design Introduction to VHDL. Hao Zheng Dept of Comp Sci & Eng USF

EEL 4783: Hardware/Software Co-design with FPGAs

Lecture 12 VHDL Synthesis

Lecture 4. VHDL Fundamentals. George Mason University

Basic Language Concepts

C-Based Hardware Design

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

Concurrent Signal Assignment Statements (CSAs)

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

ENGIN 241 Digital Systems with Lab

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

Lecture 4. VHDL Fundamentals. Required reading. Example: NAND Gate. Design Entity. Example VHDL Code. Design Entity

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

Introduction to VHDL. Main language concepts

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

Lecture 10 Subprograms & Overloading

14:332:331. Computer Architecture and Assembly Language Fall Week 5

Introduction to VHDL

Multi-valued Logic. Standard Logic IEEE 1164 Type std_ulogic is ( U, uninitialized

What Is VHDL? VHSIC (Very High Speed Integrated Circuit) Hardware Description Language IEEE 1076 standard (1987, 1993)

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

Hardware Description Language VHDL (1) Introduction

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

Chapter 6 Combinational-Circuit Building Blocks

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Inthis lecture we will cover the following material:

OUTLINE SYSTEM-ON-CHIP DESIGN. GETTING STARTED WITH VHDL September 3, 2018 GAJSKI S Y-CHART (1983) TOP-DOWN DESIGN (1)

Subprograms, Packages, and Libraries

Digital Systems Design

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

Computer-Aided Digital System Design VHDL

VHDL. Chapter 1 Introduction to VHDL. Course Objectives Affected. Outline

Review of Digital Design with VHDL

VHDL for Complex Designs

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Combinational Logic COMB. LOGIC BLOCK. A Combinational Logic Block is one where the outputs depend only on the current inputs

ECE4401 / CSE3350 ECE280 / CSE280 Digital Design Laboratory

5. VHDL - Introduction - 5. VHDL - Design flow - 5. VHDL - Entities and Architectures (1) - 5. VHDL - Entities and Architectures (2) -

INTRODUCTION TO VHDL. Lecture 5 & 6 Dr. Tayab Din Memon Assistant Professor Department of Electronic Engineering, MUET

Lecture 3. HDL Basics. George Mason University

VHDL Basics. Mehdi Modarressi. Department of Electrical and Computer Engineering, University of Tehran. ECE381(CAD), Lecture 4:

Contents. Appendix D VHDL Summary Page 1 of 23

Lecture 14 Test Bench Design

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Elementos de Lógica Digital II

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

Spiral 1 / Unit 4 Verilog HDL. Digital Circuit Design Steps. Digital Circuit Design OVERVIEW. Mark Redekopp. Description. Verification.

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 4 Introduction to VHDL

VHDL: A Crash Course

EITF35: Introduction to Structured VLSI Design

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

EE595. Part VIII Overall Concept on VHDL. EE 595 EDA / ASIC Design Lab

Digital Systems Design

1 Design Process HOME CONTENTS INDEX. For further assistance, or call your local support center

IT T35 Digital system desigm y - ii /s - iii

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

COE 561 Digital System Design & Synthesis Introduction

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

Synthesis of Combinational and Sequential Circuits with Verilog

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006

Digital System Design

Boolean Logic CS.352.F12

Design units can NOT be split across different files

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009

VHDL Structural Modeling II

VHDL Part 2. What is on the agenda? Basic VHDL Constructs. Examples. Data types Objects Packages and libraries Attributes Predefined operators

VHDL for FPGA Design. by : Mohamed Samy

ECE 459/559 Secure & Trustworthy Computer Hardware Design

Hardware Modeling. VHDL Basics. ECS Group, TU Wien

EEL 4783: Hardware/Software Co-design with FPGAs

VHDL 3 BASIC OPERATORS AND ARCHITECTURE BODY. Design descriptions & design constructions examples are taken from foundation series examples

Tutorial on VHDL and Verilog Applications

Design Entry: Schematic Capture and VHDL ENG241: Digital Design Week #4

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification

VHDL VS VERILOG.

RTL Coding General Concepts

Chapter 2 Basic Logic Circuits and VHDL Description

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

For a long time, programming languages such as FORTRAN, PASCAL, and C Were being used to describe computer programs that were

Hardware description languages

Fundamental Design Concepts. Fundamental Concepts. Modeling Domains. Basic Definitions. New terminology and overloaded use of common words

Introduction to VHDL. Yvonne Avilés Colaboration: Irvin Ortiz Flores Rapid System Prototyping Laboratory (RASP) University of Puerto Rico at Mayaguez

Verilog HDL is one of the two most common Hardware Description Languages (HDL) used by integrated circuit (IC) designers. The other one is VHDL.

Lecture 4. VHDL Basics. Simple Testbenches

Hardware Modeling. VHDL Syntax. Vienna University of Technology Department of Computer Engineering ECS Group

Control and Datapath 8

Software Engineering 2DA4. Slides 2: Introduction to Logic Circuits

Revision: August 30, Overview

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

ECE U530 Digital Hardware Synthesis. Programming Assignments

Transcription:

CPE 487: Digital System Design Spring 2018 Lecture 3 Introduction to VHDL Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1

Managing Design Complexity To be successful, designer (or design team) must manage placement and interconnect of up to 10 8 components That meet the original design specification i.e. function + performance while Minimizing chip area (die cost) Maximizing yield (die cost) Minimizing power dissipation (battery life) Maximizing reliability (design margin) Minimizing test time (product cost) Minimizing design cost (Non Recurring Expense) Minimizing time to market (market share) 2

Abstraction of Design Space BEHAVIORAL STRUCTURAL algorithms register transfers Boolean expressions transfer functions processors registers gates transistors cells modules chips boards PHYSICAL Three fundamentally different ways (views) of representing a design Each view can be formed at many different levels of abstraction (amount of detail) Design process is one of moving from highest behavioral level (specification) to lowest (most detailed) physical level Source: D. Gajski and R. H. Kuhn 3

Managing Design Process Taking a complex design from high level behavioral description (spec.) to detailed physical implementation is accomplished using: Hierarchy, Modularity & Regularity Break design into manageable pieces Pieces that have well defined functionality and simple interface Pieces that can be re-used elsewhere in the hierarchy Gradually refine design to greater levels of detail Set of computer aided design (CAD) tools that 1. Capture design data (e.g., hardware description languages, text editors, schematic & layout editors) 2. Translate from one representation to another (e.g., synthesis, component mapping, place & route) 3. Verify correctness of translation (simulation, timing analysis, design rule check) Design Methodology Recipe (or plan) of how to move from one design representation to 4 another, which tools to use and how to rigorously verify each design step

Examples of Computer Aided Design Tools synthesis BEHAVIORAL algorithms register transfers Boolean expressions transfer functions simulation gates transistors STRUCTURAL processors registers cells modules chips LVS: Layout vs. Schematic boards PHYSICAL 5

Digital Design Specification Boolean Equations Function represented by truth tables & logic equations A B Z A B Z Z = A.B 0 0 0 0 1 0 1 0 0 1 1 1 Function simplified using boolean arithmetic ZZ = BB. (AA. BB + CC + (AA + BB. CC)) = BB. (AA. BB + CC + AA.( BB + CC) = BB. ( AA + AA. BB + CC ) = BB. BB + CC = BB Captures behavior but impractical for more than few hundred gates 6

Digital Design Specification Schematic Capture Graphical entry supporting hierarchy, regularity, higher level functions (register, multiplexer, ALU) Only captures structure behavior must be inferred Limited to few thousand primitives (gates, registers etc.) 7

Digital Design Hardware Description Languages Hardware Description Language (HDL) captures behavior and/or structure that can be compiled into simulation or physical implementation (e.g. gate array, FPGA) Early Hardware Description languages targeted at Register Transfer or Gate Level behavior Evita Tutorial Different languages used at different levels of abstraction and with different tool vendors leads to lost productivity 8

Digital Design Specification VHDL VHSIC Hardware Description Language (VHSIC = Very High Speed Integrated Circuit) Standardized language that can represent behavior and structure at many levels of abstraction Evita Tutorial 9

Features of VHDL VHDL can represent: behavior (what the system does) or structure (how the components are connected) or a combination of these. VHDL can be used at different levels of abstraction: Switch level (switching behavior of transistors) Gate level Register transfer level (registers, multiplexers, alu s etc.) High level architecture (e.g. functional behavior of microprocessor) Technology independent (ASIC, FPGA, PCB) IEEE Standard (Interoperability across tool vendors) Provides executable design documentation 10

Simulation & Synthesis VHDL program can be used to drive: simulation (functional verification, performance) synthesis (translating behavior into physical structure) or a combination of these. VHDL simulation synthesis PLD FPGA CMOS ASIC 11

VHDL vs. Regular Programming Language Procedural programming languages implement an algorithm or recipe for computation & data manipulation essentially single sequential thread (Program Counter) order of statements determines execution sequence no intrinsic concept of time program operates on variables VHDL describes a hardware system from different points of view: behavior, structure, dataflow can model highly concurrent operation intrinsic concept of time timed events determines execution sequence program operates on variables and signals

History of VHDL Launched in 1980 by Defense Advanced Research Projects Agency (DARPA) July 1983 Intermetrics, IBM and Texas Instruments were awarded a contract to develop VHDL August 1985 Release of final version of the language under government contract, VHDL Version 7.2 December 1987 IEEE Standard 1076-1987 1988 VHDL became an American National Standards Institute (ANSI ) standard September 1993 IEEE VHDL standard revised 13

Nature of Digital Systems At all levels of abstraction, electronic systems are composed of sub-systems interconnected by signals*: * Signals include wires, optical links & wireless links 14

VHDL Model of Digital Systems At all levels of abstraction: VHDL names and declares the interface to each (sub-)system using a programming abstraction known as an entity. VHDL models the operation (i.e. the behavior or the internal structure) of a (sub-)system using an abstraction known as an architecture. VHDL describes the (timed) information flow between (sub-)systems using an abstraction known as a signal. 15

VHDL Entity An entity describes the external view of a system An entity specifies: Name of the system Parameters of the system (get to this later) Connections to the system (external signals) Each of these could be an entity 16

Entity Example 2-input NAND gate A B Z name external connections entity nand2 is port(a,b: in bit; z: out bit); end entity nand2; Note: words in bold are reserved keywords 17

Entity Example 8bit comparator x y 8 8 =? eq name external connections entity compare is port(x,y: in bit_vector(7 downto 0); eq: out bit); end entity compare; 18

VHDL Architecture An architecture describes an internal view of a system An architecture describes the behavior or internal structure of a declared entity There may be many architectures associated with each entity e.g: structure vs behavior, different levels of abstraction (gate vs RTL) different timing constraints There is exactly one entity for each architecture 19

Architecture Example 2-input NAND gate A B Z entity nand2 is port(a,b: in bit; z: out bit); end entity nand2; architecture name behavior architecture ngate of nand2 is begin z <= not(a and b) after 5 ns; end architecture ngate; 20

Architecture Example 2 bit comparator x y 2 2 =? eq entity compare is port(x,y: in bit_vector(1 downto 0); eq: out bit); end entity compare; architecture cmp2 of compare is begin eq <= 1 after 3 ns when (x=y) else 0 after 3ns; end architecture cmp2; 21

Alternative Architecture 2 bit comparator x y 2 2 =? hints at implementation eq entity compare is port(x,y: in bit_vector(1 downto 0); eq: out bit); end entity compare; architecture cmp_alt of compare is signal a1, a0: bit; begin a1 <= x(1) xor y(1) after 2 ns; a0 <= x(0) xor y(0) after 2 ns; eq <= a0 nor a1 after 3 ns; end architecture cmp_alt; 22

One Entity Multiple Architectures entity abc architecture struct of abc architecture xyz of abc architecture RTL of abc Different architectures may describe different representations (behavior, structure) of entity at different levels of abstraction 23

VHDL - Signal Like conventional programming languages VHDL manipulates basic objects such as constants and variables. VHDL introduces a new class of object: signal Signal is a sequence of value-time pairs A signal will be assigned a value at a specific time It will retain that value until a new value is assigned at a future point in time. signal mode: bit; mode<= 0, 1 after 10ns, 0 after 30ns, 1 after 40ns, 0 after 70ns; mode 0 10 20 30 40 50 60 70 80 (ns) 24

External & Internal Signals Ports are external signals, visible inside & outside the system Signals declared in an architecture are internal signals manipulated by programming constructs within the architecture not visible outside the system x(0) y(0) x(1) y(1) internal signals a0 a1 external signals eq entity compare is port(x,y: in bit_vector(1 downto 0); eq: out bit); end entity compare; architecture cmp_alt of compare is signal a1, a0: bit; begin a1 <= x(1) xor y(1) after 2 ns; a0 <= x(0) xor y(0) after 2 ns; eq <= a0 nor a1 after 3 ns; end architecture cmp_alt; 25

Signals Assignment Statement Signal assignment statement assigns a new value to a signal at a specified (future) time abc <= y2 and mode after 2 ns; signal to be updated signal assignment operator new value to be assigned when new value should be assigned Signal assignment statements can be concurrent or sequential describes when they are executed (more on this later) If assignment time is not specified, defaults to after 0 ns 26

Signal Types Like variables, all signals are typed e.g.: boolean (false, true) integer (,-3,-2,-1,0,1,2,3, ) character (, A, B, C, ) bit ( 0, 1 ) In digital circuits, often much more convenient to represent a signal as a bus, rather then individual bits. Type bit_vector is an array of type bit bit positions are numbered left (msb) to right (lsb) signal abus: bit_vector (0 to 7); -- 8-bit bus, abus(0) is msb signal instr: bit_vector (15 downto 0); -- 16-bit bus, instr(15) is msb signal opcode: bit_vector (6 downto 3); -- 4-bit bus, opcode(6) is msb opcode <= instr(12 downto 9); -- bit_vector used in assignment statement 27

Sidebar: VHDL - Packages Standard VHDL has limited set of types, operators, functions. This set can be expanded through the use of packages. Packages contain definitions of types, functions & procedures that can be shared by multiple designers. A very popular package is IEEE std_logic_1164 library IEEE; use IEEE.std_logic_1164.all; entity half_adder is -- IEEE is a library of packages -- load this package from IEEE library -- half_adder can use std_logic_1164 28

Std_logic type Standard bit type can only take on values 0 or 1 In logic simulation, we often require a richer set of values IEEE std_logic type can take on 9 different values: U Uninitialized X Forcing unknown 0 Forcing 0 1 Forcing 1 Z High impedance W Weak unknown L Weak 0 H Weak 1 - Don t care 29

Using std_logic type library IEEE; use IEEE.std_logic_1164.all; entity half_adder is port( a,b: in std_logic; sum, cout: out std_logic); end entity half_adder; Like bit, std_logic has vector extension e.g.: signal addr: std_logic_vector (0 to 7); signal dataout: std_logic_vector (31 downto 16); 30

More on Types VHDL is a strongly typed language Every object (signal, variable, constant) has a type The type determines which operations can be applied to the object In assignment statements, LHS target must be of same type as the RHS expression Type conversion functions (often defined in packages) allow explicit casting from type to another: signal addr: std_logic_vector (0 to 7); signal index: integer; begin addr <= conv_std_logic_vector(index,8); 31

Some Scalar Types Numeric types: type integer is range -2147483647 to +21474843647; subtype Positive is integer range 1 to +21474843647; type real_voltage is range 0.0 to 3.3; Enumerated types - explicitly listed set of allowable values type BOOLEAN is (FALSE, TRUE); type BIT is ( 0, 1 ); type COLOR is (red, orange, yellow, green, blue, indigo, violet); type STD_ULOGIC is ( U, X, 0, 1, Z, W, L, H, - ); Default value is left-hand-side of range of object s type Uninitialized objects take on default value at start (t=0) of simulation 32

Array Types An array is a collection of one or more objects of the same type For example, std_logic_vector is an array of objects of type std_logic More examples: type data_16 is array (15 downto 0) of std_logic; type reg_file is array (31 downto 0) of data_16; signal abc: reg_file; note that: abc (30) is of type data_16 whereas: abc (30) (5) is of type std_logic type row_4 is array (1 to 4) of integer; type matrix_4x4 is array (1 to 4) of row_4; Note: If an array is indexed by signal (or variable), the index must be of type integer 33

Assignments to Arrays VHDL provides many different ways to assign values to array objects: signal abc: std_logic_vector (1 to 5); signal xx, yy: std_logic; abc <= 01001 ; abc <= ( 0, 1, 0, 0, 1 ); abc <= (2=> 1, 5=> 1, others => 0 ) -- string literal -- positional -- named abc <= (others => 0 ) ; -- sets all bits to 0 abc <= (1=> xx, 4=> 0, others => yy); -- other signals 34