CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.

Slides:



Advertisements
Similar presentations
COE 405 VHDL Basics Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh Computer Engineering.
Advertisements

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.
VHDL Data Types Module F3.1. VHDL Data Types Scalar Integer Enumerated Real (floating point)* Physical* Composite Array Record Access (pointers)* * Not.
Topics of Lecture Structural Model Procedures Functions Overloading.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Lecture #6 Page 1 Lecture #6 Agenda 1.VHDL - Architecture 2.VHDL - Packages Announcements 1.HW #3 assigned ECE 4110– Sequential Logic Design.
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
IAY 0600 Digital Systems Design
Reconfigurable Computing - VHDL - Types John Morris Chung-Ang University The University of Auckland.
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
IAY 0600 Digital Systems Design
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
RTL Hardware Design by P. Chu Chapter Basic VHDL program 2. Lexical elements and program format 3. Objects 4. Data type and operators RTL Hardware.
Basic Overview of VHDL Matthew Murach Slides Available at:
Packages and Use Clauses Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Basic VHDL RASSP Education & Facilitation Module 10 Version 2.02 Copyright  RASSP E&F All rights reserved. This information is copyrighted by.
CPE 626 Advanced VLSI Design Lecture 4: VHDL Recapitulation (Part 2) Aleksandar Milenkovic
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Topics AliasesSubprograms Generics & Configurations.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
VHDL – Part 2 Some of the slides are taken from
DATA TYPES 1.Pre-Defined Data Types 2. User-Defined Data Types.
CEC 220 Digital Circuit Design More VHDL Fri, February 27 CEC 220 Digital Circuit Design Slide 1 of 15.
16/11/2006DSD,USIT,GGSIPU1 Packages The primary purpose of a package is to encapsulate elements that can be shared (globally) among two or more design.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
IAY 0600 Digital Systems Design VHDL discussion Structural style Modular design and hierarchy Part 1 Alexander Sudnitson Tallinn University of Technology.
IAY 0600 Digital Systems Design
IAY 0600 Digital Systems Design
Elements of Structural Models
Structural style Modular design and hierarchy Part 1
Basic Language Concepts
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
Basic VHDL RASSP Education & Facilitation Module 10 Version 2.02
IAY 0600 Digitaalsüsteemide disain
Reconfigurable Computing - VHDL - Types
Module Goals Introduce structural VHDL constructs Use of components
ECE 551: Digital System Design & Synthesis
Timing Model Start Simulation Delay Update Signals Execute Processes
Structural style Modular design and hierarchy Part 1
IAY 0600 Digital Systems Design
ECE 4110–5110 Digital System Design
IAS 0600 Digital Systems Design
ECE 434 Advanced Digital System L17
ECE 434 Advanced Digital System L15
ECE 434 Advanced Digital System L08
CPE/EE 422/522 Advanced Logic Design L15
Some of the slides are taken from
Structural style Modular design and hierarchy Part 1
CPE 528: Lecture #4 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
CPE/EE 422/522 Advanced Logic Design L08
CPE/EE 422/522 Advanced Logic Design L07
CPE/EE 422/522 Advanced Logic Design L14
CPE/EE 422/522 Advanced Logic Design L11
Introduction to Classes and Objects
ECE 434 Advanced Digital System L10
VHDL Discussion Subprograms
IAS 0600 Digital Systems Design
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
IAS 0600 Digital Systems Design
VHDL Data Types Module F3.1.
Data Object By E. Thirumeni Department of Electronics
Design units Lecture 2.
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville

Additional Topics in VHDL Review: Delta delay, Signals vs. Variables Packages and Libraries Attributes Operator Overloading Multivalued Logic and Signal Resolution IEEE 1164 Standard Logic Generics Generate Statements 14/01/2019 UAH-CPE528

Simulation Example 14/01/2019 UAH-CPE528

Variables vs. Signals Process Using Variables Process Using Signals Sum = ? Sum = ? 14/01/2019 UAH-CPE528

Packages and Libraries User defined constructs declared inside architectures and entities are not visible to other VHDL components Scope of subprograms, user defined data types, constants, and signals is limited to the VHDL components in which they are declared Packages and libraries provide the ability to reuse constructs in multiple entities and architectures Items declared in packages can be used in other VHDL components – user defined types, subprograms, constants, aliases, etc Libraries – collections of packages, entities, architectures VHDL provides the package mechanism so that user-defined types, subprograms, constants, aliases, etc. can be defined once and reused in the description of multiple VHDL components. VHDL libraries are collections of packages, entities, and architectures. The use of libraries allows the organization of the design task into any logical partition the user chooses (e.g. component libraries, package libraries to house reusable functions and type declarations). 14/01/2019 UAH-CPE528

Packages Packages consist of two parts Package declaration -- contains declarations of objects defined in the package Package body -- contains necessary definitions for certain objects in package declaration e.g. subprogram descriptions Examples of VHDL items included in packages: Basic declarations Types, subtypes Constants Subprograms Use clause Signal declarations Attribute declarations Component declarations A package contains a collection of user-defined declarations and descriptions that a designer makes available to other VHDL entities. Items within a package are made available to other VHDL entities (including other packages) with a use clause. Some examples of possible package contents are shown above. The next two slides will describe the two parts of a VHDL package, the package declaration and the package body. 14/01/2019 UAH-CPE528

Packages: Declaration An example of a package declaration : Note some items only require declaration while others need further detail provided in subsequent package body for type and subtype definitions, declaration is sufficient subprograms require declarations and descriptions PACKAGE my_stuff IS TYPE binary IS ( ON, OFF ); CONSTANT PI : REAL := 3.14; CONSTANT My_ID : INTEGER; PROCEDURE add_bits3(SIGNAL a, b, en : IN BIT; SIGNAL temp_result, temp_carry : OUT BIT); END my_stuff; This is an example of a package declaration. The package declaration lists the contents of the package. The declaration begins with the keyword PACKAGE and the name of the package followed by the keyword IS. VHDL declaration statements are then included, such as type declarations, constant declarations, and subprogram declarations. For many VHDL constructs, such as types, declarations are sufficient to fully define them. For a subprogram, however, the declaration only specifies the parameters required by the function or procedure; the operation of the subprogram appears later in the package body. The package declaration ends with END and the package name. 14/01/2019 UAH-CPE528

Packages: Package Body The package body includes the necessary functional descriptions needed for objects declared in the package declaration e.g. subprogram descriptions, assignments to constants PACKAGE BODY my_stuff IS CONSTANT My_ID : INTEGER := 2; PROCEDURE add_bits3(SIGNAL a, b, en : IN BIT; SIGNAL temp_result, temp_carry : OUT BIT) IS BEGIN -- this function can return a carry temp_result <= (a XOR b) AND en; temp_carry <= a AND b AND en; END add_bits3; END my_stuff; The package body contains the functional descriptions for the subprograms and other items declared in the corresponding package declaration. Once a package is defined, its contents are made visible to VHDL entities and architectures via a USE clause which is analogous to the include statement of some other programming languages. 14/01/2019 UAH-CPE528

Packages must be made visible before their contents can be used Packages: Use Clause Packages must be made visible before their contents can be used The USE clause makes packages visible to entities, architectures, and other packages -- use only the binary and add_bits3 declarations USE my_stuff.binary, my_stuff.add_bits3; ... ENTITY declaration... ... ARCHITECTURE declaration ... -- use all of the declarations in package my_stuff USE my_stuff.ALL; Packages are made visible to a VHDL description through the use of the USE clause. This statement comes at the beginning of the entity or architecture file and makes the contents of a package available within that file. The USE clause can select all or part of a particular package. In the first example above, only the binary data type and add_bits3 procedure are made visible. In the second example, the full contents of the package are made visible by use of the keyword ALL in the use clause. 14/01/2019 UAH-CPE528

Libraries Analogous to directories of files VHDL libraries contain analyzed (i.e. compiled) VHDL entities, architectures, and packages Facilitate administration of configuration and revision control E.g. libraries of previous designs Libraries accessed via an assigned logical name Current design unit is compiled into the Work library Both Work and STD libraries are always available Many other libraries usually supplied by VHDL simulator vendor E.g. proprietary libraries and IEEE standard libraries Increasingly complex VLSI technology requires configuration and revision control management. Additionally, efficient design calls for reuse of components when applicable and revision of library components when necessary. VHDL uses a library system to maintain designs for modification and shared use. VHDL refers to a library by an assigned logical name; the host operating system must translate this logical name into a real directory name and locate it. The current design unit is compiled into the Work library by default; Work is implicitly available to the user with no need to declare it. Similarly, the predefined library STD does not need to be declared before its packages can be accessed via use clauses. The STD library contains the VHDL predefined language environment, including the package STANDARD which contains a set of basic data types and functions and the package TEXTIO which contains some text handling procedures. 14/01/2019 UAH-CPE528

Attributes associated with signals that return a value Signal Attributes Attributes associated with signals that return a value A’event – true if a change in S has just occurred A’active – true if A has just been reevaluated, even if A does not change 14/01/2019 UAH-CPE528

Signal Attributes (cont’d) Attributes that create a signal 14/01/2019 UAH-CPE528

Array Attributes A can be either an array name or an array type. Array attributes work with signals, variables, and constants. 14/01/2019 UAH-CPE528

Operator Overloading Operators +, - operate on integers Write procedures for bit vector addition/subtraction addvec, subvec Operator overloading allows using + operator to implicitly call an appropriate addition function How does it work? When compiler encounters a function declaration in which the function name is an operator enclosed in double quotes, the compiler treats the function as an operator overloading (“+”) when a “+” operator is encountered, the compiler automatically checks the types of operands and calls appropriate functions 14/01/2019 UAH-CPE528

VHDL Package with Overloaded Operators 14/01/2019 UAH-CPE528

Multivalued Logic Bit (0, 1) Tristate buffers and buses => high impedance state ‘Z’ Unknown state ‘X’ e. g., a gate is driven by ‘Z’, output is unknown a signal is simultaneously driven by ‘0’ and ‘1’ 14/01/2019 UAH-CPE528

Tristate Buffers Resolution function to determine the actual value of f since it is driven from two different sources 14/01/2019 UAH-CPE528

VHDL signals may either be resolved or unresolved Signal Resolution VHDL signals may either be resolved or unresolved Resolved signals have an associated resolution function Bit type is unresolved – there is no resolution function if you drive a bit signal to two different values in two concurrent statements, the compiler will generate an error 14/01/2019 UAH-CPE528

Signal Resolution (cont’d) signal R : X01Z := ‘Z’; ... R <= transport ‘0’ after 2 ns, ‘Z’ after 6 ns; R <= transport ‘1’ after 4 ns; R <= transport ‘1’ after 8 ns, ‘0’ after 10 ns; 14/01/2019 UAH-CPE528

Resolution Function for X01Z Define AND and OR for 4-valued inputs? 14/01/2019 UAH-CPE528

AND and OR Functions Using X01Z ‘0’ ‘1’ ‘Z’ OR ‘X’ ‘0’ ‘1’ ‘Z’ 14/01/2019 UAH-CPE528

IEEE 1164 Standard Logic 9-valued logic system ‘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 If forcing and weak signal are tied together, the forcing signal dominates. Useful in modeling the internal operation of certain types of ICs. 14/01/2019 UAH-CPE528

Resolution Function for IEEE 9-valued 14/01/2019 UAH-CPE528

AND Table for IEEE 9-valued 14/01/2019 UAH-CPE528

AND Function for std_logic_vectors 14/01/2019 UAH-CPE528

Example: rise/fall time modeling Generics Used to specify parameters for a component in such a way that the parameter values must be specified when the component is instantiated Example: rise/fall time modeling 14/01/2019 UAH-CPE528

Rise/Fall Time Modeling Using Generics 14/01/2019 UAH-CPE528

Generate Statements Provides an easy way of instantiating components when we have an iterative array of identical components Example: 4-bit RCA 14/01/2019 UAH-CPE528

4-bit Adder 14/01/2019 UAH-CPE528

4-bit Adder using Generate 14/01/2019 UAH-CPE528