1/20/2007 - L8 Language Overview III Copyright 2006 - Joanne DeGroat, ECE, OSU1 Language Overview III The finish of a grand tour of the language.

Slides:



Advertisements
Similar presentations
1/8/ VerilogCopyright Joanne DeGroat, ECE, OSU1 Verilog Overview An overview of the Verilog HDL.
Advertisements

L23 – Adder Architectures. Adders  Carry Lookahead adder  Carry select adder (staged)  Carry Multiplexed Adder  Ref: text Unit 15 9/2/2012 – ECE 3561.
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
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.
1 Introduction to VHDL (Continued) EE19D. 2 Basic elements of a VHDL Model Package Declaration ENTITY (interface description) ARCHITECTURE (functionality)
VHDL Refresher ECE 437 April 13, 2015 Motivation ECE 337 is a prerequisite But… –You may have taken 337 a few semesters previous –Breaks causes memory.
© 1998, Peter J. AshendenVHDL Quick Start1 Basic VHDL Concepts Interfaces Behavior Structure Test Benches Analysis, elaboration, simulation Synthesis.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
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.
L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
1/8/ L17 Resolved SiganlsCopyright Joanne DeGroat, ECE, OSU1 Resolved Signals What are resolved signals and how do they work. Resolution???
History TTL-logic PAL (Programmable Array Logic)
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Topics of Lecture Structural Model Procedures Functions Overloading.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
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.
9/15/09 - L25 Registers & Load Enable Copyright Joanne DeGroat, ECE, OSU1 Registers & Load Enable.
Introduction to VHDL (part 2)
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
1/8/ L11 Project Step 5Copyright Joanne DeGroat, ECE, OSU1 Project Step 5 Step 2 in behavioral modeling. Use of procedures.
1/8/ L20 Project Step 8 - Data Path Copyright Joanne DeGroat, ECE, OSU1 State Machine Design with an HDL A methodology that works for documenting.
1/8/ L7 Project Step 3Copyright Joanne DeGroat, ECE, OSU1 Project Step 4 Step 1 in transitioning to behavioral modeling. We will wire behavioral.
L16 – VHDL for State Machines with binary encoding.
L12 – VHDL Overview. VHDL Overview  HDL history and background  HDL CAD systems  HDL view of design  Low level HDL examples  Ref: text Unit 10, 17,
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
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.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Topics AliasesSubprograms Generics & Configurations.
1 component OR_3 port (A,B,C: in bit; Z: out bit); end component ; Reserved Words  Declarations of Components and Entities are similar  Components are.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
L13 – VHDL Language Elements. VHDL Language Elements  Elements needed for FPGA design Types  Basic Types  Resolved Types – special attributes of resolved.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
1/8/ L2 VHDL Introcution© Copyright Joanne DeGroat, ECE, OSU1 Introduction to VHDL.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
L19 – Resolved Signals. Resolved Signals  What are resolved signals In systems In VHDL Resolution – Isn’t that for resolving conflicts?  Ref: text Unit.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
8-Jan-16EE5141 Chapter 6 Subprograms & Packages Subprogram declaration Subprogram body Package declaration Package body Resolution function Subprogram.
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.
L20 – Register Set. The 430 Register Set  Not exactly a dual ported register set, but a dual drive register set.  Ref: text Unit 10, 17, 20 9/2/2012.
Digital Design Using VHDL and PLDs ECOM 4311 Digital System Design Chapter 1.
9/15/09 - L19 Sequential CircuitsCopyright Joanne DeGroat, ECE, OSU1 Sequential Cirucits.
Midterm Exam ReviewCopyright Joanne DeGroat, ECE, OSU1 Midterm Exam Notes.
1/8/ L11 Project Step 5Copyright Joanne DeGroat, ECE, OSU1 Project Step 6 Step 3 in behavioral modeling. Use of packages.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
State Machine Design with an HDL
Basic Language Concepts
Some VHDL Details 10/8/08 ECE Lecture 8.
The finish of a grand tour of the language.
Copyright Joanne DeGroat, ECE, OSU
The continuation of a grand tour of the language.
VHDL Discussion Subprograms
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
Step 2 in behavioral modeling. Use of procedures.
Copyright Joanne DeGroat, ECE, OSU
An overview of the Verilog HDL.
Copyright Joanne DeGroat, ECE, OSU
The continuation of a grand tour of the language.
Step 2 in behavioral modeling. Use of procedures.
Step 3 in behavioral modeling. Use of packages.
© Copyright Joanne DeGroat, ECE, OSU
Design units Lecture 2.
L25 – Final Review AU 15 Final Exam – Classroom – Journalism 300
The finish of a grand tour of the language.
Copyright Joanne DeGroat, ECE, OSU
Presentation transcript:

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU1 Language Overview III The finish of a grand tour of the language.

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU2 Elements Covered in III  Reminder from I and II: Language overview lectures do not cover all aspects of the language. But they do cover a large portion of it. Concurrent Statements Sequential Statements  Now ENTITIES, ARCHITECTURES, PACKAGES, PROCEDURES AND FUNCTIONS, OVERLOADING, LIBRARIES and the USE clause.

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU3 The ENTITY  The basic concept of VHDL is that you have and interface and the function of the circuit within that interface.  The interface (ENTITY) tells you what data and control arrives and how it arrives.  The function (ARCHITECTURE) tells you how you operate on the data to produce results or respond to the inputs.

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU4 THE ENTITY entity_declaration::= entity identifier is entity_header entity_declarative_part [begin entity_statement_part] end [identifier]; entity_header::= [formal_generic_clause] [formal_port_clause]

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU5 The ENTITY formal_generic_clause::= generic (generic_list); formal_port_clause::= port (port_list); entity_declarative_part::= {entity_declarative_item} entity_declarative_item::= subprogram_declaration | subprogram_body | type_declaration | subtype_declaration | constant_declaration | signal_declaration | file_declaration | alias_declaration | attribute_declaration | attribute_specification | disconnect_specification | use_clause Items declared in the ENTITY have scope over all architectures of the entity

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU6 The ENTITY entity_statement_part::= entity_statement entity_statement::= concurrent_assertion_statement | passive_concurrent_procedure_call | passive_process_statement  Passive means that the process or procedure call contains no signal assignment statements, nor calls to any other procedure which contains a signal assignment statement.  Thus these passive procedure calls and processes can do monitoring only. They can use assertion statements to report status of the signals they are monitoring.

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU7 The ENTITY  EXAMPLE entity LATCH is port (DIN: in WORD; DOUT: out WORD; LOAD, CLK : in BIT); constant SETUP : TIME := 12 ns; constant PulseWidth : TIME := 50 ns; use WORK.TimingMonitors.all; begin CheckTiming (SETUP,DIN,LOAD,CLK); end LATCH;

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU8 The Architecture  This is the design unit that describes the function of the design Dataflow – using concurrent signal assignments = very, very close to the actual logic – a form of RTL RTL – register transfer level = just above dataflow and similar to RTL for a processor architecture Behavioral – algorithmic description of the functional behavior – very useful for reference models

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU9 The Architecture architecture identifier of entity_name is architecture_declarative_part begin architecture_statement_part end [identifier]; architecture_declarative_part::= {architecture_declarative_item} architecture_statement_part::= {concurrent_statement}

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU10 The Architecture architecture_declarative_item::= subprogram_declaration | subprogram_body | type_declaration | subtype_declaration | constant_declaration | signal_declaration | file_declaration | alias_declaration | component_declaration | attribute_declaration | attribute_specification | configuration_specification | disconnect_specification | use_clause

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU11 Packages  Packages provide a convenient way to declare commonly used declarations, functions, and procedures and make them available to many entities, architectures, and other packages.  Consists of two parts The Package Declaration The Package Body

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU12 Package Declaration package identifier is package_declarative_part end [identifier]; package_declarative_part::={package_declarative_item} package_declarative_item::= subprogram_declaration | type_declaration | subtype_declaration | constant_declaration | signal_declaration | file_declaration | alias_declaration | component_declaration | attribute_declaration | attribute_specification | disconnect_specification | use_clause

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU13 Example of Package Declaration package TriState is type TRI is (‘0’,’1’,’Z’,’E’); function BitVal (value:TRI) return BIT; function TriVal (value:BIT) return TRI; end TriState;

 Stopped here on Wed 1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU14

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU15 Package Body package body identifier is package_body_declarative_part end [identifier]; package_body_declarative_part::= {package_body_declarative_item} package_body_declarative_item::= subprogram_declaration | subprogram_body | type_declaration | subtype_declaration | constant_declaration | file_declaration | alias_declaration | use_clause

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU16 Example package body TriState is function BitVal (value:TRI) return BIT is constant bits : BIT_VECTOR := (“0100”); begin return bits(TRI’POS(value)); end; function TriVal (value:BIT) return Tri is begin return Tri’Val(BIT’POS(value)); end;

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU17 Notes on Packages  Note: Only what is declared in the package declaration is visible outside the package!!!  Items declared inside the package body are only visible inside the package body.

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU18 Functions and Procedures  Sequential statements are used within Functions and Procedures  Declaration procedure designator [(formal_parameter_list)]; function designator [(formal_parameter_list)] return type_mark;

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU19 Functions and Procedures  The Body procedure designator [(formal_parameter_list)] is subprogram_declarative_part begin subprogram_statement_part end [designator]; function designator [(formal_parameter_list)] return type_mark is subprogram_declarative_part begin subprogram_statement_part end [designator];

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU20 Functions and Procedures  Functions must use a return statement as they must return a value function fg1 (w,x,g1 : IN BIT) return BIT; function fg1 (w,x,g1 : IN BIT) return BIT is BEGIN return (w and g1) or (not x and g1) or (w and not x); END;

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU21 Other item of significance - OVERLOADING  Overloading – You can overload any function or procedure in VHDL.  EXAMPLE: procedure WRITE (F: inout TEXT; value:Integer); procedure WRITE (F: inout TEXT; value : String); These are two declarations for an overloaded procedure WRITE (if no mode is given on the arguments to a procedure or function the mode IN is presumed) USAGE DETERMINES WHICH VERSION OF THE PROCEDURE WILL BE USED USAGE  write (MY_FILE, VAR);  WRITE(sys_output, 12); WRITE(sys_error, “Actual output doesn’t match”);

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU22 Overloaded Functions type MVL is (‘0’,’1’,’Z’,’X’); function “and” (L,R : MVL) return MVL; function “or” (L,R : MVL) return MVL; USAGE:  signal Q,R,S : MVL  Q <= ‘X’ or ‘1’;  R <= S and Q;

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU23 Libraries and Use  Libraries provide a place to organize and store the design units – entities – architectures – package declarations – package bodies – that we have written and analyzed.  Then to use those design units we need to make them visible with the current design unit so it can see, and thus use, them.

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU24 The Library clause  Allows the use of design units from other libraries.  When a library is created it has both an actual name and a logical name. The actual name is the file system name within the file system of the host computer system. The logical name if the name used within the VHDL system.  LIBRARIES WORK and STD are visible to all design units.

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU25 Library clause library logical_name_list; logical_name_list::=logical_name{,logical_name}  This will make the logical_name(s) visible to the current design unit  Declared just before the start of the design unit library WORK, MY_LIB; entity and_gate is PORT (A,B : in BIT; X : out BIT); end and_gate;

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU26 Library Clause and Packages  The library clause only makes the entities visible. It does not make any declarations within the package visible.  Need to use a USE clause to make package declarations visible.  USE clause: use library_name.package_name.items  where items may be specific items or the reserved word all

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU27 Example of USE library ls7400; use ls7400.gates.all; entity new_thing is …..  where gates is a package with library ls7400.  The all makes all declarations in package gates visible.  ALL DESIGN UNITS ARE CONSIDERED TO HAVE library WORK, STD; use STD.STANDARD.ALL;

1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU28 A final note  If you write a package and analyze it into library WORK, to use the declarations there you need to have a use clause. use WORK.TriState.TRI,WORK.TriState.BitVal; Or could have use.WORK.TriState.ALL; This makes the type TRI and the function BitVal visible to the current design unit in addition to STD.STANDARD.ALL EXAMPLE SLIDE for type compatability