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

Similar documents
Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

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

Field Programmable Gate Array

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

Lecture 12 VHDL Synthesis

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

VHDL And Synthesis Review

Hardware Description Language VHDL (1) Introduction

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

VHDL for FPGA Design. by : Mohamed Samy

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

C-Based Hardware Design

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

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

Lecture 4. VHDL Fundamentals. George Mason University

ECE4401 / CSE3350 ECE280 / CSE280 Digital Design Laboratory

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

Hardware Synthesis. References

SEQUENTIAL STATEMENTS

Computer-Aided Digital System Design VHDL

Sequential Statement

FPGA for Complex System Implementation. National Chiao Tung University Chun-Jen Tsai 04/14/2011

VHDL: RTL Synthesis Basics. 1 of 59

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

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

Introduction to VHDL

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

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

Topics. Midterm Finish Chapter 7

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

EEL 4783: Hardware/Software Co-design with FPGAs

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

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

VHDL: A Crash Course

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

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

ECE 331 Digital System Design

Very High Speed Integrated Circuit Har dware Description Language

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Lattice VHDL Training

Control and Datapath 8

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

FPGAs in a Nutshell - Introduction to Embedded Systems-

VHDL simulation and synthesis

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

Introduction to VHDL #3

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

Introduction to VHDL #1

HDL. Hardware Description Languages extensively used for:

Contents. Appendix D VHDL Summary Page 1 of 23

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

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

Sequential Logic - Module 5

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

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

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

CprE 583 Reconfigurable Computing

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

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

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

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

ECE 545 Lecture 12. FPGA Resources. George Mason University

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

Digital Systems Design

Chapter 2 Basic Logic Circuits and VHDL Description

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

[VARIABLE declaration] BEGIN. sequential statements

Luleå University of Technology Kurskod SMD098 Datum Skrivtid

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1 Solutions

Today. Comments about assignment Max 1/T (skew = 0) Max clock skew? Comments about assignment 3 ASICs and Programmable logic Others courses

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used.

Synthesizable Verilog

VHDL VS VERILOG.

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

VHDL Synthesis Reference

Lecture 2 Hardware Description Language (HDL): VHSIC HDL (VHDL)

Digital Design with FPGAs. By Neeraj Kulkarni

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

Department of Electronics & Communication Engineering Lab Manual E-CAD Lab

8 Register, Multiplexer and

Speaker: Kayting Adviser: Prof. An-Yeu Wu Date: 2009/11/23

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

Verilog introduction. Embedded and Ambient Systems Lab

RTL Coding General Concepts

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

Hardware Description Languages. Modeling Complex Systems

DIGITAL CIRCUIT LOGIC UNIT 9: MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

Introduction to Verilog HDL. Verilog 1

Timing in synchronous systems

A Brief Introduction to Verilog Hardware Definition Language (HDL)

INTRODUCTION TO FPGA ARCHITECTURE

A bird s eye view on VHDL!

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

VHDL for Logic Synthesis

ELCT 501: Digital System Design

PINE TRAINING ACADEMY

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

Getting Started with VHDL

Transcription:

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

Programmable Logic Device (PLD) 2/32 An electronic component used to build reconfigurable digital circuits Before used in a circuit, it must be programmed SPLD (Simple Programmable Logic Device) CPLD (Complex Programmable Logic Device) FPGA (Field-Programmable Gate Array) SPLD CPLD FPGA

Simple PLD (SPLD) 3/32 Programmable Array Logic (PAL) Programmable Logic Array (PLA)

Complex PLD (CPLD) 4/32 Multiple PAL-like blocks on a single chip with programmable interconnect between blocks

Field-Programmable Gate Array (FPGA) 5/32 An array of programmable basic logic cells surrounded by programmable interconnect Xilinx XC4000 Configurable Logic Block (CLB).

Hardware Description Lang. (HDL) 6/32 Hardware Description Language (HDL) A software programming language used to model a piece of hardware Verilog-HDL, VHDL, SystemC, ABEL VHDL(VHSIC HDL) 1980 USA Department of Defence 1987 IEEE Standard 1076 Verilog HDL 1981 Gateway Design Automation 1995 IEEE Standard 1364

VHDL vs. Verilog 7/32 On the surface, not much Both can be used for designing ASICs and simulating systems Both are IEEE standards and are supported by all the major EDA vendors VHDL requires longer to learn and is not so amenable to quick-and-dirty dirty coding Many engineers will one day be bi-lingual in both HDLs

Introduction to VHDL 8/32 Designed to describe the behavior of digital systems Used as an input to commercial synthesis tools (only subsets of VHDL are synthesizable) VHDL is concurrent HDL which provides a wide range of levels of abstraction Architectural, Algorithmic, RTL, Gate, Switch VHDL has hierarchical design units

VHDL Structure 9/32 Circuit module Entity declaration + architecture body Circuit Module Ports Entity Declaration Architecture (Body) Sequential, Combinational Subprograms An entity is a simple declaration of a module s inputs and outputs. An architecture is a detailed description of module s internal structure or behavior.

Syntax of a VHDL entity declaration 10/32 entity example1 is port t( x1, x2, x3 : in std_logic ; --input signals in1 : in integer ; val1 : out std_logic ; -- output signals Signal Name val2 : out std_logic_vector(3 down to 0) ; end example1 ; Mode Type architecture sample1 of example1 is begin -- hello world ; end sample1 ; Entity-name User-defined identifier to name the entity Signal-names User-defined identifiers to name external-interface signal

Syntax of a VHDL entity declaration 11/32 Mode : specifying the signal direction In : the signal is an input to the entity. Out : the signal is an output of the entity. Inout: the signal can be read as an input or an output of the entity. This mode is typically used for three-state input/output pins. Buffer: the signal is an output of the entity, and its value can also be read and written inside the entity s architecture. In or Inout Out or Inout Upper Module In Lower Module Inout Inout Out Buffer Buffer

Syntax of a VHDL entity declaration 12/32 Signal types library IEEE ; use IEEE.std_logic_1164.all ; std_logic(bit) : 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) std_logic_vector(bit vector) for 8bit data type : std_logic_vector(7 downto 0) integer, real, character, boolean, etc.

Predefined Operators 13/32 Integer Operators: + addition - Subtraction * Multiplication / division mod modulo division rem modulo remainder Abs absolute value ** exponentiation Boolean Operators: and AND or OR nand NAND nor NOR xor exclusive OR xnor exclusive nor not complementation & concatenation

Sequential Statement 14/32 [LABEL:] if expr then {sequential_statement} [{elsif expr then {sequential_statement}}] [else {sequential_statement}] statement}] end if [LABEL]; [LABEL:] [while expr] loop {sequential_statement} end loop [LABEL]; [LABEL:] for ID in range loop {sequential_statement} statement} end loop [LABEL]; [LABEL:]] case expr is {when choice [{ choice}] => {sequential_statement}} end case [LABEL];

Process Statement 15/32 Logic circuit description in architecture body process sequential statement sequential statement concurrent statement concurrent statement Consists of concurrent statement and sequential statement Process contains several sequential statement Process itself is a sort of concurrent statement Process have three different state : suspended, active, running

Process Statement 16/32 What s the difference? architecture con of drv is begin A <= B; A <= C; end con; architecture seq of drv is begin Process(B, C) begin A <= B A<=C end process; end con2; Multiple l driver Several signal assignment to a single signal driver Signal driver A source which determines a value of each signal A signal is updated by the driver at every source update

Delta Delays (1/2) 17/32 Delta time is the time between two sequential events. The time to take from assigning g a value till updated The following VHDL code makes infinite delta delay and generates a synthesis error architecture con of some is begin A_Sig <= B_Sig ; B_Sig <= A_Sig ; end con;

Delta Delays (2/2) 18/32 Delta delays are used to order events.

Architecture Style (1/4) 19/32 Behavioral Style Describes a system in terms of what it does(or how it behaves)] IF, CASE, FOR, mainly within Process statement architecture BEHAVE of COMPARE is begin process (A, B) begin if (A = B) then C <= '1' ; else C <= '0' ; end if ; end process ; end BEHAVE ; architecture BEHAVE of MUX41 is begin case sel is when "00" => Z <= i0 ; when "01" => Z <= i1 ; when "10" => Z <= i2 ; when "11" => Z <= i3 ; end case ; end BEHAVE ;

Architecture Style (2/4) 20/32 Dataflow Style Specifies the relationship between the input and output signals AND, OR, NOT, XOR, etc. architecture of DATAFLOW of COMPARE is begin C<=not(Axor B) ; D <= A and not B ; end DATAFLOW ;

Architecture Style (3/4) 21/32 Structural Style Describes a system as interconnection of predefined components, hierarchical design consists of modules and interconnections ti Component, Port Map architecture STRUCTURE of COMPARE is signal I : BIT ; component XOR2 port (X, Y: in BIT; Z: out BIT) ; end component ; component INV port (X: in BIT; Z: out BIT) ; end component ; begin U0: XOR2 port map (A, B, I) ; U1: INV port map (I, C) ; end STRUCTURE ;

Architecture Style (4/4) 22/32 Example of Structural Style U1 I3 architecture structure of MUX41 is I2 component MUX21 port (D1, D0, S : in std_logic; Y : out std_logic); I1 end component; I0 signal A, B : std_logic; U0 begin U0 :MUX21portmap (D0 => I0, D1 => I1, S=>sel(0), Y=>A); U1 : MUX21 port map (D0 => I2, D1 => I3, S=>sel(0), Y=>B); U2 : MUX21 port map (D0 => A, D1=>B, S=>sel(1), Y=>Z); end structure; D1 Y D0 D1 Y D0 S sel(0) B D1 D0 A sel(1) U2 Y S Z

VHDL Source Code: Latch 23/32 VHDL Code for Latch Library IEEE; Use IEEE.std_logic_1164.all; Entity Latch is Port(LE, Din : in std_logic; Dout :outstd std_logic); End Latch; Architecture Latch_arch of Latch is Begin Process (Din, LE) Begin If (LE= 1 ) then Dout <= Din; End if; End process; End Latch_arch;

VHDL Source Code : D-Flip Flop 24/32 D-flip flop triggered by rising edge library IEEE; use IEEE.std_logic_1164.all; entity d-ff is port(clk, d: in std_logic; q : out std_logic); end d-ff; architecture d-ff_arch of d-ff is begin process(clk) Rising_edge(clk) begin if(clk'event and clk = '1') then q <= d; end if; end if end process; end d-ff_arch

VHDL Source Code : Register 25/32 8-bit register Library IEEE; use IEEE.std_logic_1164.all; entity Reg is port(clk : in std_logic; rst : in std_logic; ld : in std_logic; d : in std_logic_vector(7 t downto 0); q : out std_logic_vector(7 downto 0)); end Reg; architecture Reg_arch of Reg is begin process(clk, rst) begin if(rst = '1') then q <= (others => '0'); elsif(clk'event and clk ='1') then if(ld = '1') then q <= d; end if; end if; end process; end Reg_arch;

Typical Design Flow 26/32 HDL design : behavioral or structural description of design RTL Simulation verifies logic model & data flow. The simulation is typically performed to confirm that the code is functioning as intended. At this step, no timing information is provided. Post-Synthesis Simulation : SDF(standard delay format)- timing info. of each cell in the design. The place and route tools are used for layout generation. HDL Timing Simulation(Post- Layout Sim) : after the design has completed the PnR, simulation with backannotated information.

Synthesis 27/32 Synthesis = Translation+Optimization+Mapping pp

Mapping (1/2) 28/32 Original Netlist Possible Covering LUT Mapping from Covering

Mapping (2/2) 29/32 LUT0 LUT4 LUT1 LUT2 LUT5 FF1 LUT3 FF2

Typical Design Flow 30/32 HDL design : behavioral or structural description of design RTL Simulation verifies logic model & data flow. The simulation is typically performed to confirm that the code is functioning as intended. At this step, no timing information is provided. Post-Synthesis Simulation : SDF(standard delay format)- timing info. of each cell in the design. The place and route tools are used for layout generation. HDL Timing Simulation(Post- Layout Sim) : after the design has completed the PnR, simulation with backannotated information.

Placing 31/32 FPGA CLB SLICES

Routing 32/32 Programmable Connections FPGA