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.

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 Introduction to VHDL (Continued) EE19D. 2 Basic elements of a VHDL Model Package Declaration ENTITY (interface description) ARCHITECTURE (functionality)
© 1998, Peter J. AshendenVHDL Quick Start1 Basic VHDL Concepts Interfaces Behavior Structure Test Benches Analysis, elaboration, simulation Synthesis.
Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
(1) Programming Mechanics © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
1 H ardware D escription L anguages Basic Language Concepts.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
IAY 0600 Digital Systems Design
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
Introduction to VHDL Arab Academy for Science, Technology & Maritime Transport Computer Engineering Department Magdy Saeb, Ph.D.
DSD,USIT,GGSIPU1 Entity declaration –describes the input/output ports of a module entity reg4 is port ( d0, d1, d2, d3, en, clk : in std_logic; q0, q1,
ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 6: Configurations.
Tutorial 1 Combinational Logic Synthesis. Introduction to VHDL VHDL = Very high speed Hardware Description Language VHDL and Verilog are the industry.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
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.
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
Introduction to VLSI Design – Lec01. Chapter 1 Introduction to VLSI Systems Lecture # 6 Computer-Aided Design Technology for VLSI.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
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.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics VHDL register-transfer modeling: –basics using traffic light controller; –synthesis.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
Introduction to VLSI Design – Lec01. Chapter 1 Introduction to VLSI Design Lecture # 11 High Desecration Language- Based Design.
Topics AliasesSubprograms Generics & Configurations.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
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.
Digital System Projects
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.
Digital Design Using VHDL and PLDs ECOM 4311 Digital System Design Chapter 1.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
Signals & Data-typesVer 1.1, Copyright 1997, TS, Inc. VHDL S i g n a l s & D a t a T y p e s Page 1.
(1) Modeling Structure © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
IAY 0600 Digital Systems Design VHDL discussion Structural style Modular design and hierarchy Part 1 Alexander Sudnitson Tallinn University of Technology.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
An Introduction to V.H.D.L.. Need of a Compiler… main( ) { int x=10,y=20,z; z = x + y ; printf ( “ %d “, z ); getch( ) ; } What’s That ? Give me only.
IAY 0600 Digital Systems Design
Combinational logic circuit
Elements of Structural Models
Structural style Modular design and hierarchy Part 1
Basic Language Concepts
IAY 0600 Digitaalsüsteemide disain
B e h a v i o r a l to R T L Coding
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Part IV: VHDL CODING.
Structural style Modular design and hierarchy Part 1
IAY 0600 Digital Systems Design
Peter J. Ashenden The University of Adelaide
Structural style Modular design and hierarchy Part 1
VHDL Discussion Subprograms
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
ECE 545 Lecture 5 Simple Testbenches.
Digital Systems Design 2
Presentation transcript:

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

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Objectives  Introduction to VHDL Language Topics include Design Units Structure Concurrent Statements Sequential Statements Syntax Rules Page 2

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL VHDL Design Units VHDL is composed of design units. These consist of primary, and any dependent secondary units. Design Units Entity Architecture Process Configuration Package Library Page 3

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Entity  The entity describes the external interface to the design unit, along with attributes relating to the interface. entity Half_Add is port ( A, B : in std_logic ; Carry, Sum : out std_logic) ; end Half_Add ; A Carry Sum B Page 4

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL  The architecture describes the internal operation of its associated entity. Multiple architectures can exist for each entity, each describing one possible implementation. architecture My_Arch of Half_Add is begin Sum <= A xor B; Carry <= A and B; end architecture My_Arch ; Note: VHDL’93 Allows for the optional reserved “entity” or “architecture” after the reserved word “end” in their respective declarations. Architecture Page 5

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL entity DFF is port ( D, Clock : in std_logic ; Reset : in std_logic ; Q : out std_logic) ; end entity DFF ; DFF Architecture architecture Behave of DFF is begin process (Clock, Reset) begin If Reset = ‘1’ then Q <= ‘0’ ; elsif ( Clock’event and Clock = ‘1’ ) then Q <= D ; end if ; end process ; end architecture Behave ; Clock Reset DQ Page 6

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Hierarchical Representation entity REG_4 is port ( D_in : in std_logic_vector (3 downto 0); Clock, Reset : in std_logic; Q_out : out std_logic_vector (3 downto 0)): end REG_4; architecture Structural of REG_4 is component DFF is port ( D, Clock : in std_logic ; Reset : in std_logic; Q : out std_logic ) ; end component DFF ; begin U0 : DFF port map ( D_in(0), Clock, Reset, Q_out(0)); U1 : DFF port map ( D_in(1), Clock, Reset, Q_out(1)); U2 : DFF port map ( D_in(2), Clock, Reset, Q_out(2)); U3 : DFF port map ( D_in(3), Clock, Reset, Q_out(3)); end Structural; Clock Reset D_in(0) D_in(1) D_in(2) D_in(3) Q_out(0) Q_out(1) Q_out(2) Q_out(3) Page 7 DFF U0 U3 U2 U1

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Signal Association  There are two methods of associating signals with their respective ports. Positional Association, Signals are listed in strict corresponding order of port listing. U1: DFF port map (D_in, Clk, Rst, Q_out) ; entity DFF is port ( D, Clock : in std_logic ; Reset : in std_logic ; Q : out std_logic ) ; end DFF ; Named Association, Ports and Signals names are listed explicitly, order independent. U1: DFF port map (D =>D_in, Clock =>Clk, Reset =>Rst, Q =>Q_out) ; Page 8

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Signal Declaration  If internal signals are required in the hierarchical description, they must be explicitly declared. Sub_A Sub_B Top I1 I2 O1 O2 architecture Structural of Top is component Sub_A port ( A1,A2,A3 : in std_logic ; A4 : out std_logic_vector (3 downto 0 ) ; end component ; component Sub_B port ( B1: in std_logic_vector (3 downto 0 ) ; B2,B3,B4 : out std_logic ; end component ; signal Bus_1 : std_logic_vector (3 downto 0 ) ; signal Sig_1: std_logic ; begin U0 : Sub_A port map ( I1, I2, Sig_1, Bus_1 ) ; U1 : Sub_B port map ( Bus_1, Sig_1, O1, O2 ) ; end Structural ; Sig_1 Bus_1 A1 A2 A4 A3B4 B3 B2 B1 entity Top is port ( I1, I2 : in std_logic; 01, 02 : out std_logic) ; end Top ; Page 9

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Macro Instantiation architecture Xilinx_Struct of REG_4 is component FDC port ( D : in std_logic ; Clock, Reset : in std_logic ; Q : out std_logic ) ; end component ; begin U0 : FDC port map (D_in(0), Clock, Reset, Q_out(0)) ; U1 : FDC port map (D_in(1), Clock, Reset, Q_out(1)) ; U2 : FDC port map (D_in(2), Clock, Reset, Q_out(2)) ; U3 : FDC port map (D_in(3), Clock, Reset, Q_out(3)) ; end Xilinx_Struct ; Macro / component instantiation from target library, may be helpful for chip level optimization ! i.e. Xilinx XC4000E\XL Page 10 entity REG_4 is port ( D_in : std_logic_vector (3 downto 0) ; Clock, Reset : in std_logic ; Q_out : out std_logic_vector (3 downto 0)) : end REG_4 ; Clock Reset D_in(0) D_in(1) D_in(2) D_in(3) Q_out(0) Q_out(1) Q_out(2) Q_out(3) FDC U0 U1 U2 U3

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Direct Entity Instantiation In VHDL’93, it is possible to instantiate an entity from the working library directly-- that is, without an explicit component declaration. entity DFF is port ( D, Clock : in std_logic; Reset : in std_logic; Q : out std_logic); end DFF; architecture Behave of DFF is begin..... end Behave ; architecture Struct of Reg_4 is... begin U1: entity work.DFF (Behave) port map (D_in, Clk, Rst, Q_out ); Page 11 This direct instantiation identifies both the entity and architecture pair.

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Process  The process contains sequential statements, that is, actions to be executed in sequence. Each process has a means of being triggered, either by changes on signals into the process, or specific conditions defined in the “wait” statement. architecture Behave of DFF is begin... process (Clock, Reset) begin if Reset = ‘1’ then Q <= ‘0’; elsif (Clock’event and Clock = ‘1’ ) then Q <= D; end if; end process ;... end Behave; Page 12

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Processes are Concurrent Z<=A and B... Process 1 process (Z,..) begin Process 3 If Z = ‘1’ then... Process 2 G1 G2 G3 B A Z Z Z  In Hardware modeling, the concept of concurrency is essential, i.e. a logic change on signal Z, the output of the gate G1 is seen at the input of G2 and G3 in an concurrent and independent manner. Page 13

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Configuration  The VHDL design unit “configuration” is used to bind specific pairs of entities and architecture bodies together for a particular instance. configuration CFG_Reg4 of REG_4 is for Structural... end for; end CFG_Reg4; Identifier Architecture Entity Page 14

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Package  The VHDL design unit “package” is used to store data that will be accessed by multiple modules. This usually includes constants, data_types, declarations, Etc. package My_Pack is constant function component subtype... end package My_pack ; library IEEE; use std_logic_1164.all ;... use work.My_Pack.all ; entity... Page 15

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Package Body  The “package body” is an dependent unit of the package. It is used to store details of the objects declared in the package. This includes sub-programs and algorithms, Etc. package My_Pack is constant function (bv_to_integer..... component subtype... package body My_Pack is function.. bv_to_integer (BV: bit_v.. return integer ; process (BV) begin for index in bv'range component subtype... end package body My_Pack ; Page 16 declaration details

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Library  Usually referred to as the “work” library. This is an actual sub-directory or physical location used to store all analyzed design units. Each simulator or synthesis tool will create such a structure. Design Unit Identifier entity Half_Add entity DFF entity REG4 Configuration CFG_REG4... Architecture Xilinx Architecture Structural Example “work” Library Contents Page 17

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Compilation There are four levels of processing that may take place for a VHDL hardware model. –Analyzation The design unit is checked for syntactic errors, once finalized, it is stored in the “work” library or directory. –Elaboration The design hierarchy is fleshed out, starting from the top. A unique copy of each sub-module instance is created. –Execution The model is simulated in discrete time steps. This is driven primarily by events on signals and wait statements, which then triggers processes. –Synthesis A netlist description of the logic is generated, in either an industry standard or vendor specific format. Page 18

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Compilation Path Entity DFF is port (D, Clk : in Reset:: in Q: out std_logic... architecture.. Analyze Elaborate Execute Synthesize Page 19

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Compilation Order  Because of the primary and secondary design unit relationship, and the ability to instantiate other modules, the compilation process is governed by a strict dependency order.  Entities must be analyzed before corresponding Architectures.  Configurations should be last as they reference other units.  Packages must be analyzed before corresponding Package Bodies.  Any module before it is referenced by another…! Page 20

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Comments  Comments are necessary and helpful to provide documentation and greater understanding of the written code. - - Comments begin with two dash characters - - They continue only till the end of the line. - - A comment on multiple lines will require the double - - dash on each line as shown here. - - Comments can begin anywhere on a line. Page 21

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Summary  VHDL is composed of primary and secondary design units.  Different architectural implementations of the same entity are possible.  There is a strict dependency order for compilation.  VHDL contains concurrent and sequential statements.  All analyzed design units are stored in the design or “work” library. Page 22

Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL Quiz  Where are sequential statements placed ?  What must be done to make the contents of a package visible within a given declaration ?  What is the purpose of a configuration ?  What are the necessary levels of processing for a VHDL model for simulation ? for synthesis ?  How do you enter a multi-line comment ? Page 23