1 Introduction to VHDL Part 2 Fall 08. 2 We will use Std_logic And, Or have same precedence See slide 8 of part 1.

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

CMSC 611: Advanced Computer Architecture
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)
ECE C03 Lecture 131 Lecture 13 VHDL Structural Modeling Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Fundamental Concepts 大同大學 資訊工程系 副教授
© 1998, Peter J. AshendenVHDL Quick Start1 Basic VHDL Concepts Interfaces Behavior Structure Test Benches Analysis, elaboration, simulation Synthesis.
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.
Adv. Digital Circuit Design
Introduction to VHDL Dr. Adnan Shaout The University of Michigan-Dearborn.
ECE C03 Lecture 17ECE C03 Lecture 61 Lecture 17 VHDL Structural Modeling Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
VHDL Quick Start Peter J. Ashenden The University of Adelaide.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
331 W05.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 5: VHDL Programming [Adapted from Dave Patterson’s UCB CS152.
Introduction to VHDL By Mr. Fazrul Faiz Zakaria School of Computer and Communication Engineering UniMAP.
(1) Programming Mechanics © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
An Introduction to VHDL Using Altera’s Quartus II IDE Dr. William M. Jones Coastal Carolina University Numbers and Bytes Meeting 20 OCT 2008.
1 Digital System Design Subject Name : Digital System Design Course Code : IT- 308 Instructor : Amit Prakash Singh Home page :
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,
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
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.
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.
1/26 VHDL VHDL Structural Modeling Digital Logic.
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
1 Introduction to VHDL Spring What is VHDL? VHDL can be uses to model and synthesise digital systems. VHDL = VHSIC Hardware Description Language.
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.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
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.
(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.
CMSC 611: Advanced Computer Architecture Design & Simulation Languages Practically everything adapted from slides by Peter J. Ashenden, VHDL Quick Start.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
5-1 Logic System Design I VHDL Design Principles ECGR2181 Reading: Chapter 5.0, 5.1, 5.3 port ( I: in STD_LOGIC_VECTOR (1 to 9); EVEN, ODD: out STD_LOGIC.
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.
(1) Modeling Structure © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
CMSC 611: Advanced Computer Architecture Hardware Design Languages Some material adapted from slides by Peter J. Ashenden, VHDL Quick Start Some material.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
Hardware Description Languages: Verilog
Basic Language Concepts
IAY 0600 Digitaalsüsteemide disain
Hardware Description Languages
Module Goals Introduce structural VHDL constructs Use of components
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Structural style Modular design and hierarchy Part 1
Hardware Description Languages: Verilog
IAY 0600 Digital Systems Design
Peter J. Ashenden The University of Adelaide
Structural style Modular design and hierarchy Part 1
VHDL Discussion Subprograms
VHDL Structural Architecture
Module Goals Introduce structural VHDL constructs Use of components
CMSC 611: Advanced Computer Architecture
VHDL Discussion Subprograms
Design units Lecture 2.
Sequntial-Circuit Building Blocks
4-Input Gates VHDL for Loops
Digital Systems Design 2
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

1 Introduction to VHDL Part 2 Fall 08

2 We will use Std_logic And, Or have same precedence See slide 8 of part 1.

3 library IEEE; use IEEE.std_logic_1164.all; ENTITY and2 is GENERIC(trise : time := 10 ns; tfall : time := 5 ns); PORT(a : IN std_logic; b : IN std_logic; c : OUT std_logic); END and2;

4 ARCHITECTURE behav OF and2 IS BEGIN one : PROCESS (a,b) BEGIN IF (a = '1' AND b = '1') THEN c <= '1' AFTER trise ; ELSIF (a = '0' OR b = '0') THEN c <= '0' AFTER tfall ; ELSE c <= 'X' AFTER ( trise+tfall )/2; END IF; END PROCESS one; END behav;

5 library IEEE; use IEEE.std_logic_1164.all; ENTITY tb IS END tb; ARCHITECTURE test OF tb IS SIGNAL a, b, y, z: std_logic; BEGIN and_y: entity work.and2(behav) GENERIC MAP(tfall => 15 ns) PORT MAP(a, b, y); and_z: entity work.and2(behav) PORT MAP(a, b, z); PROCESS CONSTANT period: time := 40 ns; BEGIN a <= '1'; b <= '0'; WAIT FOR period; a <= '1'; b <= '1'; WAIT FOR period; a <= '0'; b <= '1'; WAIT FOR period; a <= '0'; b <= '0'; WAIT; END PROCESS; END TEST; -- Same as -- a <= '1', '0' after 2*period; -- b <= '0', '1' after period, '0' after 3*period;

6

7 Development steps Typical programming language –Compilation –Link and Load –Execute VHDL –Analysis Check design unit for errors –Elaboration Check design hierarchy –Simulation –Synthesis

8 Analysis Check for syntax and semantic errors –syntax: grammar of the language –semantics: the meaning of the model Analyze each design unit separately –entity declaration –architecture body –… –Usually each design unit consisting of an entity and its architecture is in a separate file, but multiple design units can be combined in the same file. Analyzed design units are placed in a library –in an implementation dependent internal form –current library is called work

9 Elaboration “Flattening” the design hierarchy –create ports –create signals and processes within architecture body –for each component instance, copy instantiated entity and architecture body –repeat recursively bottom out at purely behavioral architecture bodies Final result of elaboration –flat collection of signal nets and processes

10 Modeling Interfaces Entity declaration (see Fig 1-7 p 9) –describes the input/output ports of a module entity reg4 is port ( d0, d1, d2, d3, en, clk : in bit; q0, q1, q2, q3 : out bit ); end entity reg4; entity nameport namesport mode (direction) port typereserved words punctuation

11 VHDL-87 Omit entity at end of entity declaration entity reg4 is port ( d0, d1, d2, d3, en, clk : in bit; q0, q1, q2, q3 : out bit ); end reg4;

12 Architecture Styles Behavioral – High level architecture defiend in terms of its operation over time. Data flow or RTL – Register transfers. Structural – A collection of components.

13 Modeling Behavior Architecture body –describes an implementation of an entity –may be several per entity Behavioral architecture –describes the algorithm performed by the module –contains process statements, each containing sequential statements, including signal assignment statements and wait statements

14 Behavior Example architecture behav of reg4 is begin storage : process is variable stored_d0, stored_d1, stored_d2, stored_d3 : bit; begin if en = '1' and clk = '1' then stored_d0 := d0; stored_d1 := d1; stored_d2 := d2; stored_d3 := d3; end if; q0 <= stored_d0 after 5 ns; q1 <= stored_d1 after 5 ns; q2 <= stored_d2 after 5 ns; q3 <= stored_d3 after 5 ns; wait on d0, d1, d2, d3, en, clk; end process storage; end architecture behav;

15 VHDL-87 Omit architecture at end of architecture body Omit is in process statement header architecture behav of reg4 is begin storage : process... begin... end process storage; end behav;

16 Modeling Structure Structural architecture –implements the module as a composition of subsystems –contains signal declarations, for internal interconnections –the entity ports are also treated as signals component instances –instances of previously declared entity/architecture pairs port maps in component instances –connect signals to component ports wait statements

17 Structure Example

18 Structure Example First declare D-latch and and-gate entities and architectures entity d_latch is port ( d, clk : in bit; q : out bit ); end entity d_latch; architecture basic of d_latch is begin latch_behavior : process is begin if clk = ‘1’ then q <= d after 2 ns; end if; wait on clk, d; end process latch_behavior; end architecture basic; entity and2 is port ( a, b : in bit; y : out bit ); end entity and2; architecture basic of and2 is begin and2_behavior : process is begin y <= a and b after 2 ns; wait on a, b; end process and2_behavior; end architecture basic;

19 Structure Example Now use them to implement a register architecture struct of reg4 is signal int_clk : bit; begin bit0 : entity work.d_latch(basic) port map ( d0, int_clk, q0 ); bit1 : entity work.d_latch(basic) port map ( d1, int_clk, q1 ); bit2 : entity work.d_latch(basic) port map ( d2, int_clk, q2 ); bit3 : entity work.d_latch(basic) port map ( d3, int_clk, q3 ); gate : entity work.and2(basic) port map ( en, clk, int_clk ); end architecture struct;

20 VHDL-87 Can’t directly instantiate entity/architecture pair Instead –include component declarations in structural architecture body templates for entity declarations –instantiate components –write a configuration declaration binds entity/architecture pair to each instantiated component

21 Structure Example in VHDL-87 First declare D-latch and and-gate entities and architectures entity d_latch is port ( d, clk : in bit; q : out bit ); end d_latch; architecture basic of d_latch is begin latch_behavior : process begin if clk = ‘1’ then q <= d after 2 ns; end if; wait on clk, d; end process latch_behavior; end basic; entity and2 is port ( a, b : in bit; y : out bit ); end and2; architecture basic of and2 is begin and2_behavior : process begin y <= a and b after 2 ns; wait on a, b; end process and2_behavior; end basic;

22 Structure Example in VHDL-87 Declare corresponding components in register architecture body architecture struct of reg4 is component d_latch port ( d, clk : in bit; q : out bit ); end component; component and2 port ( a, b : in bit; y : out bit ); end component; signal int_clk : bit;...

23 Structure Example in VHDL-87 Now use them to implement the register... begin bit0 : d_latch port map ( d0, int_clk, q0 ); bit1 : d_latch port map ( d1, int_clk, q1 ); bit2 : d_latch port map ( d2, int_clk, q2 ); bit3 : d_latch port map ( d3, int_clk, q3 ); gate : and2 port map ( en, clk, int_clk ); end struct;

24 Structure Example in VHDL-87 Configure the register model configuration basic_level of reg4 is for struct for all : d_latch use entity work.d_latch(basic); end for; for all : and2 use entity work.and2(basic) end for; end for; end basic_level;

25 VHDL Reserved Words

26