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

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

Lecture 4. VHDL Fundamentals. George Mason University

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

Lecture 4. VHDL Basics. Simple Testbenches

Introduction to VHDL #1

Lecture 3. HDL Basics. George Mason University

Constructing VHDL Models with CSA

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

Sub-programs in VHDL

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

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

Mridula Allani Fall Fall

Design units can NOT be split across different files

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

Menu. Introduction to VHDL EEL3701 EEL3701. Intro to VHDL

Entity, Architecture, Ports

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

Lecture 3 Introduction to VHDL

VHDL is a hardware description language. The code describes the behavior or structure of an electronic circuit.

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Very High Speed Integrated Circuit Har dware Description Language

Lattice VHDL Training

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

Basic Language Concepts

VHDL for FPGA Design. by : Mohamed Samy

EEL 4783: Hardware/Software Co-design with FPGAs

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

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

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

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

Hardware Description Language VHDL (1) Introduction

VHDL Structural Modeling II

Introduction to VHDL

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

Contents. Appendix D VHDL Summary Page 1 of 23

Concurrent Signal Assignment Statements (CSAs)

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

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

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

ENGIN 241 Digital Systems with Lab

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

Review of Digital Design with VHDL

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

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

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

Department of Technical Education DIPLOMA COURSE IN ELECTRONICS AND COMMUNICATION ENGINEERING. Fifth Semester. Subject: VHDL Programming

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

Basic Language Constructs of VHDL

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

ELCT 501: Digital System Design

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

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

CMPT 250: Computer Architecture. Using LogicWorks 5. Tutorial Part 1. Somsubhra Sharangi

Introduction to VHDL #3

Programmable Logic Design Grzegorz Budzyń Lecture. 4: Introduction to VHDL

Experiment 0 OR3 Gate ECE 332 Section 000 Dr. Ron Hayne June 8, 2003

EEL 4783: Hardware/Software Co-design with FPGAs

C-Based Hardware Design

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

1. Defining and capturing the design of a system. 2. Cost Limitations (low profit margin must sell millions)

FPGA BASED SYSTEM DESIGN. Dr. Tayab Din Memon Lecture 9 & 10 : Combinational and Sequential Logic

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

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

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A

INTRODUCTION TO VHDL. K. Siozios

CS232 VHDL Lecture. Types

Computer Aided Design Basic Syntax Gate Level Modeling Behavioral Modeling. Verilog

Verilog Design Principles

Essential VHDL for ASICs

Discrete Event Models

VHDL: skaitmeninių įtaisų projektavimo kalba. 2 paskaita Pradmenys

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

Discrete Event Models

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

Verilog. Verilog for Synthesis

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

VHDL. Chapter 7. Behavioral Modeling. Outline. Behavioral Modeling. Process Statement

Embedded Systems CS - ES

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

Introduction to VHDL. Main language concepts

Digital Systems Design

VHDL: A Crash Course

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

Chapter 6 Combinational-Circuit Building Blocks

VHDL for Complex Designs

Computer-Aided Digital System Design VHDL

Synthesis of Digital Systems CS 411N / CSL 719. Part 3: Hardware Description Languages - VHDL

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

ECE4401 / CSE3350 ECE280 / CSE280 Digital Design Laboratory

Introduction to Verilog HDL

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

Hardware Modeling. VHDL Basics. ECS Group, TU Wien

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

ECE Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers

In our case Dr. Johnson is setting the best practices

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

Lecture 38 VHDL Description: Addition of Two [5 5] Matrices

Specifications Part 3

Introduction to VHDL. Prof. Vanderlei Bonato - 10/10/16 1

Tutorial on Simulation using Aldec Active-HDL Ver 1.0

Transcription:

ECE381(CAD), Lecture 4: VHDL Basics Mehdi Modarressi Department of Electrical and Computer Engineering, University of Tehran Some slides are taken (with modifications) from ECE-448 of GMU

Outline An introduction to VHDL Basic structure and syntax Basic modeling techniques 2

HDL Hardware description language: a language that ease hardware description Several famous HDLs: VHDL Verilog AHDL... Major requirements: Concurrency Time notion Hardware-specific data types 3

HDL - Concurrency Software : Statements are executed sequentially The von Neumann model of computation The sequence of statements is significant, since they are executed in that order Java, C++, C, Ada, Pascal, Fortran, Hardware : No sequence, events happen concurrently No Sequence: a software language cannot be used for describing and simulating hardware There is an explicit notion of time 4

Concurrency What does happen if a changes from 1 to 0, when all gates have a delay of 12 ns? 5

VHDL VHDL: VHSIC Hardware Description Language VHSIC is an acronym of Very High Speed Integrated Circuits A Formal Language for Specifying the Behavior and Structure of a Digital Circuit Allows Top-Down design Allows description at different levels 6

VHDL history VHDL originated in the early 1980s The American Department of Defense initiated the development of VHDL in the early 1980s Based on the Ada programming language VHDL was standardized in 1987 by the IEEE (IEEE std-1076-1987) Easy to move VHDL code between different commercial platforms (tools) The standard was revised version in several times including revisions in 1993, 2000, 2002, and 2008 See Chapter 2 of Dr Navabi s book for a comprehensive survey on the HDL background 7

VHDL basics Some points about the VHDL semantics An introduction to ENTITY and ARCHITECTURE in VHDL 8

Naming and labeling VHDL is case insensitive General rules of thumb 1. All names should start with an alphabet character (a-z or A-Z) 2. Use only alphabet characters (a-z or A-Z) digits (0-9) and underscore (_) 3. Do not use any punctuation or reserved characters within a name (!,?,., &, +, -, etc.) 4. Do not use two or more consecutive underscore characters ( ) within a name (e.g., Sel A is invalid) 5. All names and labels in a given entity and architecture must be unique 9

Free format VHDL is a free format language No formatting conventions, such as spacing or indentation imposed by VHDL compilers. Space and carriage return treated the same way. Example: if (a=b) then or if (a=b) then or if (a = b) then are all equivalent 10

Comments Comments in VHDL are indicated with a double dash, i.e., -- Comment indicator can be placed anywhere in the line Any text that follows in the same line is treated as a comment Carriage return terminates a comment No method for commenting a block extending over a couple of lines Examples: -- main sub_circuit Data_in <= Data_bus; -- reading data from the input FIFO 11

VHDL basics- ENTITY a z b Example: NAND Gate a b z 0 0 1 0 1 1 1 0 1 1 1 0 12

VHDL basics- ENTITY 3 sections of a VHDL code ENTITY: most basic building block of a design LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY nand_gate IS PORT( a : IN STD_LOGIC; b : IN STD_LOGIC; z : OUT STD_LOGIC); END nand_gate; ARCHITECTURE model OF nand_gate IS BEGIN z <= a NAND b; END model; LIBRARY DECLARATION ENTITY ARCHITECTURE 13

Entity simplified syntax ENTITY entity_name IS PORT ( port_name : port_mode signal_type; port_name : port_mode signal_type;. port_name : port_mode signal_type); END entity_name; 14

Entity declaration Entity Declaration describes the interface of the component Input and output ports. Entity name Port names Port type Semicolon ENTITY nand_gate IS PORT( a : IN STD_LOGIC; b : IN STD_LOGIC; z : OUT STD_LOGIC ); END nand_gate; No Semicolon after last port Reserved words Port modes (data flow directions) 15

Entity and Architecture design entity entity declaration One ENTITY can have many different ARCHITECTUREs architecture 1 architecture 2 architecture 3 16

Objects in VHDL four object classes: Signal: represent hardware wires and have timing Variable: storage of temp. data, no timing Constant: constant value of a given type File: external storage The difference between variables and signals will be introduced in due course! Entity Ports behave as a signal 17

Port mode: IN Port signal Entity a Driver resides outside the entity 18

Port mode: OUT Entity Port signal z c Output cannot be read within the entity Driver resides inside the entity c <= z 19

Port mode: BUFFER Entity Port signal x z Driver resides inside the entity c Signal x can be read inside the entity z <= x c <= x Is output but can be read inside the entity 20

Port mode: INOUT Port signal Entity a Signal can be read inside the entity Driver may reside both inside and outside of the entity 21

Port modes - summary Port Mode: describes the direction in which data travels with respect to the component In: Data comes in this port and can only be read within the entity. It can appear only on the right side of a signal or variable assignment. Out: The value of an output port can only be updated within the entity. It cannot be read. It can only appear on the left side of a signal assignment. InOut: The value of a bi-directional port can be read and updated within the entity model. It can appear on both sides of a signal assignment. Buffer: Used for a signal that is an output from an entity. The value of the signal can be used inside the entity, which means that in an assignment statement the signal can appear on the left and right sides of the <= operator 22

ARCHITECTURE Describes an implementation of a design entity Architecture example: ARCHITECTURE model OF nand_gate IS BEGIN z <= a NAND b; END model; 23

ARCHITECTURE simplified syntax ARCHITECTURE architecture_name OF entity_name IS [ declarations ] BEGIN code END architecture_name; 24

ENTITY & ARCHITECTURE nand_gate.vhd LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY nand_gate IS PORT( a : IN STD_LOGIC; b : IN STD_LOGIC; z : OUT STD_LOGIC); END nand_gate; ARCHITECTURE dataflow OF nand_gate IS BEGIN z <= a NAND b; END dataflow; 25

Library declarations LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY nand_gate IS PORT( a : IN STD_LOGIC; b : IN STD_LOGIC; z : OUT STD_LOGIC); END nand_gate; ARCHITECTURE model OF nand_gate IS BEGIN z <= a NAND b; END model; Library declaration Use all definitions from the package std_logic_1164 26

Library declarations - syntax LIBRARY library_name; USE library_name.package_name.package_parts; 27

Fundamental parts of a library LIBRARY PACKAGE 1 PACKAGE 2 TYPES CONSTANTS FUNCTIONS PROCEDURES COMPONENTS TYPES CONSTANTS FUNCTIONS PROCEDURES COMPONENTS 28

Libraries ieee Specifies multi-level logic system, including STD_LOGIC, and STD_LOGIC_VECTOR data types Need to be explicitly declared std Specifies pre-defined data types (BIT, BOOLEAN, INTEGER, REAL, SIGNED, UNSIGNED, etc.), arithmetic operations, basic type conversion functions, basic text i/o functions, etc. Visible by default work Current designs after compilation 29