Peter J. Ashenden The University of Adelaide

Slides:



Advertisements
Similar presentations
Digital System Design Subject Name : Digital System Design Course Code : IT-314.
Advertisements

VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
CMSC 611: Advanced Computer Architecture
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.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
Adv. Digital Circuit Design
Introduction to VHDL Dr. Adnan Shaout The University of Michigan-Dearborn.
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
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.
Why Behavioral Wait statement Signal Timing Examples of Behavioral Descriptions –ROM.
Topics of Lecture Structural Model Procedures Functions Overloading.
VHDL Intro What does VHDL stand for? VHSIC Hardware Description Language VHSIC = Very High Speed Integrated Circuit Developed in 1982 by Govt. to standardize.
Topics Entity DeclarationsEntity Declarations Port ClausePort Clause Component DeclarationComponent Declaration Configuration DeclarationConfiguration.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
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.
Design methodology.
VHDL Structured Logic Design School of Electrical Engineering University of Belgrade Department of Computer Engineering Ivan Dugic Veljko.
1 VERILOG Fundamentals Workshop סמסטר א ' תשע " ה מרצה : משה דורון הפקולטה להנדסה Workshop Objectives: Gain basic understanding of the essential concepts.
IAY 0600 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
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,
1 H ardware D escription L anguages Modeling Digital Systems.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
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.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
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.
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.
M. Balakrishnan Dept of Computer Science & Engg. I.I.T. Delhi
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
Assignment write a short notes on 1.Manufacturing Testing. 2.Functional Testing. 3.Files and Text I/O. 4.Differentiate the cpld and fpga architecture.
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)
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.
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
IAY 0600 Digital Systems Design Timing and Post-Synthesis Verifications Hazards in Combinational Circuits Alexander Sudnitson Tallinn University of Technology.
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
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 יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
SUBJECT : DIGITAL ELECTRONICS CLASS : SEM 3(B) TOPIC : INTRODUCTION OF VHDL.
IAY 0600 Digital Systems Design
Introduction to design with VHDL
IAY 0600 Digitaalsüsteemide disain
HDL simulation and Synthesis (Marks16)
Behavioral Style Combinational Design with VHDL
Structural style Modular design and hierarchy Part 1
Behavioral Style Combinational Design with VHDL
IAY 0600 Digital Systems Design
Hardware Description Languages
IAS 0600 Digital Systems Design
Structural style Modular design and hierarchy Part 1
Developing More Advanced Testbenches
VHDL Discussion Subprograms
CMSC 611: Advanced Computer Architecture
VHDL Discussion Subprograms
Digital Designs – What does it take
Sequntial-Circuit Building Blocks
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Peter J. Ashenden The University of Adelaide VHDL Quick Start Peter J. Ashenden The University of Adelaide

Objective Quick introduction to VHDL basic language concepts basic design methodology Use The Student’s Guide to VHDL or The Designer’s Guide to VHDL self-learning for more depth reference for project work © 1998, Peter J. Ashenden VHDL Quick Start

Modeling Digital Systems VHDL is for writing models of a system Reasons for modeling requirements specification documentation testing using simulation formal verification synthesis Goal most reliable design process, with minimum cost and time avoid design errors! © 1998, Peter J. Ashenden VHDL Quick Start

Domains and Levels of Modeling Structural Functional high level of abstraction low level of abstraction Geometric “Y-chart” due to Gajski & Kahn © 1998, Peter J. Ashenden VHDL Quick Start

Domains and Levels of Modeling Structural Functional Algorithm (behavioral) Register-Transfer Language Boolean Equation Differential Equation Geometric “Y-chart” due to Gajski & Kahn © 1998, Peter J. Ashenden VHDL Quick Start

Domains and Levels of Modeling Structural Functional Processor-Memory Switch Register-Transfer Gate Transistor Geometric “Y-chart” due to Gajski & Kahn © 1998, Peter J. Ashenden VHDL Quick Start

Domains and Levels of Modeling Structural Functional Polygons Sticks Standard Cells Floor Plan Geometric “Y-chart” due to Gajski & Kahn © 1998, Peter J. Ashenden VHDL Quick Start

Basic VHDL Concepts Interfaces Behavior Structure Test Benches Analysis, elaboration, simulation Synthesis © 1998, Peter J. Ashenden VHDL Quick Start

Modeling Interfaces Entity declaration describes the input/output ports of a module entity name port names port mode (direction) entity reg4 is port ( d0, d1, d2, d3, en, clk : in bit; q0, q1, q2, q3 : out bit ); end entity reg4; punctuation reserved words port type © 1998, Peter J. Ashenden VHDL Quick Start

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; © 1998, Peter J. Ashenden VHDL Quick Start

Modeling Behavior Architecture body Behavioral architecture 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 © 1998, Peter J. Ashenden VHDL Quick Start

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; © 1998, Peter J. Ashenden VHDL Quick Start

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; © 1998, Peter J. Ashenden VHDL Quick Start

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 © 1998, Peter J. Ashenden VHDL Quick Start

Structure Example © 1998, Peter J. Ashenden VHDL Quick Start

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; © 1998, Peter J. Ashenden VHDL Quick Start

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; © 1998, Peter J. Ashenden VHDL Quick Start

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 © 1998, Peter J. Ashenden VHDL Quick Start

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; © 1998, Peter J. Ashenden VHDL Quick Start

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; ... © 1998, Peter J. Ashenden VHDL Quick Start

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; © 1998, Peter J. Ashenden VHDL Quick Start

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; © 1998, Peter J. Ashenden VHDL Quick Start

Mixed Behavior and Structure An architecture can contain both behavioral and structural parts process statements and component instances collectively called concurrent statements processes can read and assign to signals Example: register-transfer-level model data path described structurally control section described behaviorally © 1998, Peter J. Ashenden VHDL Quick Start

Mixed Example © 1998, Peter J. Ashenden VHDL Quick Start

Mixed Example entity multiplier is port ( clk, reset : in bit; multiplicand, multiplier : in integer; product : out integer ); end entity multiplier; architecture mixed of mulitplier is signal partial_product, full_product : integer; signal arith_control, result_en, mult_bit, mult_load : bit; begin arith_unit : entity work.shift_adder(behavior) port map ( addend => multiplicand, augend => full_product, sum => partial_product, add_control => arith_control ); result : entity work.reg(behavior) port map ( d => partial_product, q => full_product, en => result_en, reset => reset ); ... © 1998, Peter J. Ashenden VHDL Quick Start

Mixed Example … multiplier_sr : entity work.shift_reg(behavior) port map ( d => multiplier, q => mult_bit, load => mult_load, clk => clk ); product <= full_product; control_section : process is -- variable declarations for control_section -- … begin -- sequential statements to assign values to control signals -- … wait on clk, reset; end process control_section; end architecture mixed; © 1998, Peter J. Ashenden VHDL Quick Start

Test Benches Testing a design by simulation Use a test bench model an architecture body that includes an instance of the design under test applies sequences of test values to inputs monitors values on output signals either using simulator or with a process that verifies correct operation © 1998, Peter J. Ashenden VHDL Quick Start

Test Bench Example entity test_bench is end entity test_bench; architecture test_reg4 of test_bench is signal d0, d1, d2, d3, en, clk, q0, q1, q2, q3 : bit; begin dut : entity work.reg4(behav) port map ( d0, d1, d2, d3, en, clk, q0, q1, q2, q3 ); stimulus : process is begin d0 <= ’1’; d1 <= ’1’; d2 <= ’1’; d3 <= ’1’; wait for 20 ns; en <= ’0’; clk <= ’0’; wait for 20 ns; en <= ’1’; wait for 20 ns; clk <= ’1’; wait for 20 ns; d0 <= ’0’; d1 <= ’0’; d2 <= ’0’; d3 <= ’0’; wait for 20 ns; en <= ’0’; wait for 20 ns; … wait; end process stimulus; end architecture test_reg4; © 1998, Peter J. Ashenden VHDL Quick Start

Regression Testing Test that a refinement of a design is correct that lower-level structural model does the same as a behavioral model Test bench includes two instances of design under test behavioral and lower-level structural stimulates both with same inputs compares outputs for equality Need to take account of timing differences © 1998, Peter J. Ashenden VHDL Quick Start

Regression Test Example architecture regression of test_bench is signal d0, d1, d2, d3, en, clk : bit; signal q0a, q1a, q2a, q3a, q0b, q1b, q2b, q3b : bit; begin dut_a : entity work.reg4(struct) port map ( d0, d1, d2, d3, en, clk, q0a, q1a, q2a, q3a ); dut_b : entity work.reg4(behav) port map ( d0, d1, d2, d3, en, clk, q0b, q1b, q2b, q3b ); stimulus : process is begin d0 <= ’1’; d1 <= ’1’; d2 <= ’1’; d3 <= ’1’; wait for 20 ns; en <= ’0’; clk <= ’0’; wait for 20 ns; en <= ’1’; wait for 20 ns; clk <= ’1’; wait for 20 ns; … wait; end process stimulus; ... © 1998, Peter J. Ashenden VHDL Quick Start

Regression Test Example … verify : process is begin wait for 10 ns; assert q0a = q0b and q1a = q1b and q2a = q2b and q3a = q3b report ”implementations have different outputs” severity error; wait on d0, d1, d2, d3, en, clk; end process verify; end architecture regression; © 1998, Peter J. Ashenden VHDL Quick Start

Design Processing Analysis Elaboration Simulation Synthesis © 1998, Peter J. Ashenden VHDL Quick Start

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 … best if each design unit is in a separate file Analyzed design units are placed in a library in an implementation dependent internal form current library is called work © 1998, Peter J. Ashenden VHDL Quick Start

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 © 1998, Peter J. Ashenden VHDL Quick Start

Elaboration Example © 1998, Peter J. Ashenden VHDL Quick Start

Elaboration Example © 1998, Peter J. Ashenden VHDL Quick Start

Simulation Execution of the processes in the elaborated model Discrete event simulation time advances in discrete steps when signal values change—events A processes is sensitive to events on input signals specified in wait statements resumes and schedules new values on output signals schedules transactions event on a signal if new value different from old value © 1998, Peter J. Ashenden VHDL Quick Start

Simulation Algorithm Initialization phase each signal is given its initial value simulation time set to 0 for each process activate execute until a wait statement, then suspend execution usually involves scheduling transactions on signals for later times © 1998, Peter J. Ashenden VHDL Quick Start

Simulation Algorithm Simulation cycle advance simulation time to time of next transaction for each transaction at this time update signal value event if new value is different from old value for each process sensitive to any of these events, or whose “wait for …” time-out has expired resume execute until a wait statement, then suspend Simulation finishes when there are no further scheduled transactions © 1998, Peter J. Ashenden VHDL Quick Start

Synthesis Translates register-transfer-level (RTL) design into gate-level netlist Restrictions on coding style for RTL model Tool dependent see lab notes © 1998, Peter J. Ashenden VHDL Quick Start

Basic Design Methodology Requirements Simulate RTL Model Gate-level Model Synthesize Test Bench ASIC or FPGA Place & Route Timing Model © 1998, Peter J. Ashenden VHDL Quick Start