VHDL Sample Slides Rev Sample Slides from the 2-day and 4-day VHDL Training Courses

Similar documents
Hardware Modeling. VHDL Architectures. Vienna University of Technology Department of Computer Engineering ECS Group

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

CMSC 611: Advanced Computer Architecture

Designing with VHDL and FPGA

Introduction to VHDL #3

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

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

Verilog Module 1 Introduction and Combinational Logic

ECE 3401 Lecture 10. More on VHDL

Chapter 6 Combinational-Circuit Building Blocks

VHDL simulation and synthesis

VHDL for Complex Designs

ENGIN 241 Digital Systems with Lab

VHDL: RTL Synthesis Basics. 1 of 59

Chapter 2 Basic Logic Circuits and VHDL Description

Sequential VHDL. Katarzyna Radecka. DSD COEN 313

Synthesis of Combinational and Sequential Circuits with Verilog

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

EECS150 - Digital Design Lecture 10 Logic Synthesis

ECE U530 Digital Hardware Synthesis. Programming Assignments

Verilog. Verilog for Synthesis

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

PART I BASIC DIGITAL CIRCUITS

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

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

EITF35: Introduction to Structured VLSI Design

CSE370 TUTORIAL 3 - INTRODUCTION TO USING VERILOG IN ACTIVE-HDL

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

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

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

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

Control and Datapath 8

EECS150 - Digital Design Lecture 10 Logic Synthesis

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis

Introduction to VHDL

Lecture 12 VHDL Synthesis

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

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

EEL 4783: HDL in Digital System Design

Topics. Verilog. Verilog vs. VHDL (2) Verilog vs. VHDL (1)

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

Lecture #12 Structural VHDL Modeling

RTL Coding General Concepts

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog.

Hardware Description Languages: Verilog

Lattice VHDL Training

Verilog Tutorial. Verilog Fundamentals. Originally designers used manual translation + bread boards for verification

Verilog Tutorial 9/28/2015. Verilog Fundamentals. Originally designers used manual translation + bread boards for verification

Programming with HDLs

Digital Systems Design

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

Introduction to VHDL #1

Synthesizable Verilog

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

HIERARCHICAL DESIGN. RTL Hardware Design by P. Chu. Chapter 13 1

Introduction to VHDL. Main language concepts

Outline HIERARCHICAL DESIGN. 1. Introduction. Benefits of hierarchical design

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

Lecture 3 Introduction to VHDL

ECE4401 / CSE3350 ECE280 / CSE280 Digital Design Laboratory

In our case Dr. Johnson is setting the best practices

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

CSE140L: Components and Design Techniques for Digital Systems Lab

VHDL for FPGA Design. by : Mohamed Samy

! ISP (circa 1977) - research project at CMU " Simulation, but no synthesis

A Brief Introduction to Verilog Hardware Definition Language (HDL)

Outline. EECS150 - Digital Design Lecture 5 - Verilog 2. Structural Model: 2-to1 mux. Structural Model - XOR. Verilog Basics Lots of Examples

VHDL And Synthesis Review

Sunburst Design - Comprehensive SystemVerilog Design & Synthesis by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

C-Based Hardware Design

CSE140L: Components and Design

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

Hardware Description Language VHDL (1) Introduction

Topics. Midterm Finish Chapter 7

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

Introduction to Verilog/System Verilog

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

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

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

PROGRAMMABLE LOGIC DESIGN WITH VHDL

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

Sunburst Design - Verilog-2001 Design & Best Coding Practices by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

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

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

Hardware Description Languages. Modeling Complex Systems

Chapter 2 Using Hardware Description Language Verilog. Overview

The process. Sensitivity lists

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

Verilog Overview. Verilog Overview. Simple Example. Simple Example. Simple Example. Simple Example

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

ECEN 468 Advanced Logic Design

VHDL Structural Modeling II

Verilog 1 - Fundamentals

Transcription:

VHDL Sample Slides from the 2-day and 4-day VHDL Training Courses Rev. 4.7 VHDL 2011 TM Associates, Inc. 1-1 These sample slides are taken from the 4-day basic VHDL training course. They are from a variety of topics covered in the training. The first two days of the 4-day course cover the same material as the 2-day course. Either the 2-day or 4-day course is a prerequisite for the 3-day Advanced VHDL Coding Styles for Synthesis & Verification course. The training material was developed by a team of VHDL designers with a combined 50+ years of experience. The lead developer was Peter Ashenden, the author of The Designer s Guide to VHDL, 3 rd Edition which is the most popular book on the VHDL language. Comprehensive notes are included with each slide. This means the student will Be able to spend more time listening to the instructor instead of taking notes, and Be able to use the training manual as a valuable reference guide after the training. For complete information on all of our courses visit our website www.tm-associates.com 2011 TM Associates, Inc. 1-1

Entity Declarations An entity declaration specifies the external interface of a system or subsystem Does not describe behavior entity name port names a z b select entity is port ( a, b, select: in bit; z : out bit ); end entity ; port mode (direction) port type Rev. 4.7 VHDL 2011 TM Associates, Inc. 1-2 We introduce the basic concepts using a 2:1 multiplexer design as an example. Here is a schematic symbol representing the mux pins and a corresponding VHDL description of that symbol. An entity declaration specifies: The name of a system or subsystem. We can repeat the name at the end of the entity declaration. Names for the ports. Ports are the connection points for the entity. Modes for the ports, specifying the direction of information flow. Types for the ports. In this example, the types are bit, so values on the ports are 0 or 1. We will see other types later. We can list a number of ports of the same mode and type together, as we have done in this example. Or we can write them out separately. Notice in the port declaration for the output z, there is a lot of white space in the line. White space is ignored in VHDL, allowing the author to put as much or little white space as needed to make the code most readable. 2011 TM Associates, Inc. 1-2

RTL Architecture Example architecture name entity name architecture _rtl of is z <= (a and select) or (b and not select); end architecture _rtl; RTL description of behavior Equivalent Circuit Rev. 4.7 VHDL 2011 TM Associates, Inc. 1-3 Here is an example of a simple RTL architecture body for the 2:1 mux example. This architecture body contains one process statement that describes the algorithm performed by the mux. The statement contains boolean operators (and, or, not) to describe a synthesizable description of a mux. A single entity can have multiple architectures, but an architecture must be associated with a specific entity, as is described by the first line of the architecture statement. 2011 TM Associates, Inc. 1-3

Structural Architecture Hierarchy is represented through structural modeling entity mux84 is port (a3,a2,a1,a0,b3,b2,b1,b0,select : in bit; z3,z2,z1,z0 : out bit); end entity mux84; architecture structural of mux84 is -- Component Declarations component is port (a, b, select : in bit; z : out bit); end component ; u0: port map (a0, b0, select, z0); u1: port map (a1, b1, select, z1); u2: port map (a2, b2, select, z2); u3: port map (a3, b3, select, z3); end architecture structural; Component Declaration Mapping component to ports select a3 b3 a2 b2 a1 b1 a0 b0 a b z sel u3 a b z sel u2 a b z sel u1 a b z sel u0 z3 z2 z1 z0 Rev. 4.7 VHDL 2011 TM Associates, Inc. 1-4 Here we see an entity/architecture pair that creates a 2:1 mux of two 4-bit busses using structural VHDL code to wire four of the previously designed 2:1 mux components. Components must be declared in the declaration section of the architecture before being instantiated in the body of the architecture. The components are wired as shown, using a mapping scheme to map the component ports to the intended targets. These statements start with a unique name for each individual instantiation, followed by the name of the previously declared component that provides a socket to wire to. Finally, the port map defines how the socket is wired. Looking at the port map for the instantiation of u0, we see: port a0 is wired to the u0 socket pin a, port b0 is wired to u0 socket pin b, port select is wired to u0 socket pin select, and output port z0 is wired to u0 socket pin z. This type of mapping is known as positional association, in that the signals in the list will be wired to the ports in the order defined in the component entity. This style of mapping, while legal, can cause miswiring errors. A better way will be seen in later slides. 2011 TM Associates, Inc. 1-4

Process Each concurrent statement is a process that is evaluated concurrently. A process block provides a means to evaluate statements sequentially within an architecture. Each process block interacts concurrently with other process blocks and concurrent statements. entity compare is port (a,b,c,d : in bit; aeqb,cxord : out bit); end entity compare; architecture rtl of compare is cmpr : process(a, b) is if(a = b) then aeqb <= 1 ; else aeqb <= 0 ; end if; end process cmpr; cxord <= c xor d; end architecture rtl; Rev. 4.7 VHDL 2011 TM Associates, Inc. 1-5 A process block allows the statements within to execute in a sequential fashion. An architecture may contain a combination of process blocks, concurrent statements, and instantiated components. A process will contain either a sensitivity list (as shown in the example) or a wait statement. A process is a continuous loop that never ends. The sensitivity list (or wait statement) defines the signals that start a process evaluation, after which the process becomes idle until one of the sensitive signals has another event. Events resulting from the evaluation of statements within a process block are not scheduled until the entire block has been evaluated. The entire process block, therefore, is treated as a single concurrent statement, and functions concurrently with other process blocks and concurrent statements. In the example given, the output aeqb is evaluated within a process block, while the output cxord is evaluated in a concurrent statement. Both the process block and the concurrent statement are evaluated at the same time, with results scheduled at the end of the current simulation cycle (not synonymous with a clock cycle but rather a zero time cycle called a delta) 2011 TM Associates, Inc. 1-5

Signals and Types Signals are the wires between components within an architecture Each signal has a type. - bit, integer, boolean, etc. Signals used in an expression must be of the same type. VHDL allows the user to define new types. entity and_or_invert is port (a, b, c : in bit; z : out bit); end entity and_or_invert; architecture rtl of and_or_invert is signal andor : bit; signal orinv : bit; andor <= a and b; orinv <= c or andor; z <= not orinv; end architecture rtl; signal declaration Rev. 4.7 VHDL 2011 TM Associates, Inc. 1-6 An object in VHDL is defined as an item that holds a value. The three classes of objects are Signals, Variables, and Constants. Objects must have a type that describes the kind of value the object can hold. VHDL provides some predefined types, including bit, integer, boolean, and bit_vector. Our examples so far have all used type bit for ports, which are a type of signal. VHDL allows new types to be developed by the user to make code more readable and improve error checking. VHDL is known as a strongly typed language, and requires all expressions to use objects with the same type attribute. This provides one means for built in error checking. An object is synthesizable if it is statically computable at compilation time. For example, a type will have a range of values, and the value assigned to an object must be contained within that range. 2011 TM Associates, Inc. 1-6

Structural Example library reference containing d_latch and and2 components component instantiation statements library cells; architecture struct of reg4 is signal int_clk : bit; signal declaration bit0 : entity cells.d_latch(basic) port map (d => d0, clk => int_clk, q => q0); bit1 : entity cells.d_latch(basic) port map (d => d1, clk => int_clk, q => q1); bit2 : entity cells.d_latch(basic) port map (d => d2, clk => int_clk, q => q2); bit3 : entity cells.d_latch(basic) port map (d => d3, clk => int_clk, q => q3); gate : entity cells.and2(basic) port map (a => en, b => clk, y => int_clk); end architecture struct; port map Rev. 4.7 VHDL 2011 TM Associates, Inc. 1-7 This structural architecture body for the register describes the same connectivity as the schematic. The library clause at the top specifies that the architecture makes use of units that reside in the library named cells, which includes the latch and and gate used in the architecture. The architecture contains a signal declaration for the internal connection, int_clk four instances of the d_latch entity, with distinct labels bit0, bit1, bit2 and bit3 an instance of the and2 entity labeled gate The instances of the entities all are prefixed with cells., indicating that the entities are to be found in the cells library. The part in parentheses (basic) selects the particular architecture to be used with that entity. This is optional, but is a good design practice, as it makes the code readable, and ensures the correct architecture is selected for synthesis. In the absence of any guidance (by configuration or explicitly identifying an architecture in an instantiation), the last analyzed architecture will be used as a default. In the earlier example of a structural architecture, we mentioned the danger of implicit port mapping. The best design practice is to use explicit port mapping at all times, as shown in the example above. The name to the left of each => symbol is a component port name, and the name to the right is an external port or architecture signal name. This avoids confusion, and makes the design more readable, as you can see exactly how the ports are connected without having to refer to the entity or component declaration. 2011 TM Associates, Inc. 1-7

VHDL Sample Slides Rev. 4.7 Summary For more information on our VHDL, Verilog or SystemVerilog courses please contact Tom Wille tw@tm-associates.com 503-656-4457 www.tm-associates.com 2011 TM Associates, Inc. 1-8