COE 405 Basic Concepts in VHDL Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.

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

9/18/08 Lab 2 - Solution TA: Jorge. 9/18/08 Half-adder.
ECE C03 Lecture 161 Lecture 16 Introduction to VHDL Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Sistemas Digitais I LESI - 2º ano Lesson 5 - VHDL U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes Dept.
Why Behavioral Wait statement Signal Timing Examples of Behavioral Descriptions –ROM.
ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Topics of Lecture Structural Model Procedures Functions Overloading.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
7-1 © Dr. Alaaeldin Amin. 7-2 © Dr. Alaaeldin Amin.
Transport and inertial delay Assignment statements
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Package with 4-valued logic Signal Attributes Assertion Data Flow description.
Introduction to VHDL (part 2)
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
1 H ardware D escription L anguages Basic Language Concepts.
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 Digitaalsüsteemide disain Event-Driven Simulation Alexander Sudnitson Tallinn University of Technology.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
George Mason University ECE 545 – Introduction to VHDL Timing Event-driven simulation ECE 545 Lecture 8.
The Xilinx Spartan-3E FPGA family. Field Programmable Gate Array (FPGA) Configurable Logic Block (CLB) –Look-up table (LUT) –Register –Logic circuit Adder.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
Basic Concepts in VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Basic VHDL RASSP Education & Facilitation Module 10 Version 2.02 Copyright  RASSP E&F All rights reserved. This information is copyrighted by.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Digital Logic Design.
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.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
Topics AliasesSubprograms Generics & Configurations.
Timing Model VHDL uses the following simulation cycle to model the stimulus and response nature of digital hardware Start Simulation Update Signals Execute.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Behavioural modelling Lecture 3. Outline 3.1. Processes. Sequential statements. WAIT statement Simulation mechanism Sequential signal assignment.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
1/8/ L16 Timing & Concurrency III Copyright Joanne DeGroat, ECE, OSU1 Timing & Concurrency III Delay Model foundations for simulation and.
© 조준동 2008 ECE C03 Lecture 121 Lecture 12 Introduction to VHDL Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Subprograms Lecture 6. Subprograms A subprogram defines a sequential algorithm that performs some computations. Subprograms can be: –1. functions –2.
Relational Operators Result is boolean: greater than (>) less than (=) less than or equal to (
IAY 0600 Digital Systems Design Event-Driven Simulation VHDL Discussion Alexander Sudnitson Tallinn University of Technology.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Sequential Logic Design.
VHDL Tutorial.
Lecture #10 Page 1 Lecture #10 Agenda 1.VHDL : Concurrent Signal Assignments 2.Decoders using Structural VHDL Announcements 1.HW #4 due 2.HW #5 assigned.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
1/8/ L10 AttributesCopyright Joanne DeGroat, ECE, OSU1 Language Attributes and Package Standard A very useful aspect of the language.
Dataflow modelling Lecture 4. Dataflow modelling Specifies the functioning of a circuit without explicitly refer to its structure Functioning is described.
Lecture #12 Page 1 ECE 4110– Digital Logic Design Lecture #12 Agenda 1.VHDL : Behavioral Design (Processes) Announcements 1.n/a.
ECE 4110–5110 Digital System Design
Introduction To VHDL 홍 원 의.
Basic Language Concepts
IAY 0600 Digitaalsüsteemide disain
HDL simulation and Synthesis (Marks16)
Operators Assignment Operators Logical Operators Relational Operators
Timing Model Start Simulation Delay Update Signals Execute Processes
IAY 0600 Digital Systems Design
ECE 434 Advanced Digital System L15
CPE/EE 422/522 Advanced Logic Design L06
ECE 434 Advanced Digital System L08
ECE 434 Advanced Digital System L9
Instructions to get MAX PLUS running
CPE/EE 422/522 Advanced Logic Design L11
ECE 434 Advanced Digital System L10
How do you achieve deterministic concurrent simulation.
Timing & Concurrency II
Timing & Concurrency II
Behavioural modelling
Timing & Concurrency II
Data Object By E. Thirumeni Department of Electronics
Presentation transcript:

COE 405 Basic Concepts in VHDL Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals

2-2 OutlineOutline n VHDL Objects n Variables vs. Signals n Signal Assignment n Signal Transaction & Event n Delta Delay n Transport and Inertial Delay n Sequential Placement of Transactions n Signal Attributes n VHDL Objects n Variables vs. Signals n Signal Assignment n Signal Transaction & Event n Delta Delay n Transport and Inertial Delay n Sequential Placement of Transactions n Signal Attributes

2-3 VHDL Objects … n VHDL OBJECT : Something that can hold a value of a given Data Type. n VHDL has 3 classes of objects CONSTANTS VARIABLES SIGNALS n Every object & expression must unambiguously belong to one named Data Type n Every object must be Declared. n VHDL OBJECT : Something that can hold a value of a given Data Type. n VHDL has 3 classes of objects CONSTANTS VARIABLES SIGNALS n Every object & expression must unambiguously belong to one named Data Type n Every object must be Declared.

2-4 … VHDL Object … Obj_Class : Type/SubType [signal_kind] [:= expression];  1 identifier (, ) ConstantConstant VariableVariable SignalSignal BUSRegister Only for Signals Default Initial Value (not Optional for Constant Declarations) Syntax FileFile

2-5 … VHDL Object … n Value of Constants must be specified when declared n Initial values of Variables or Signals may be specified when declared n If not explicitly specified, Initial values of Variables or Signals default to the value of the Left Element in the type range specified in the declaration. n Examples: Constant Rom_Size : Integer := 2**16; Constant Address_Field : Integer := 7; Constant Ovfl_Msg : String (1 To 20) := ``Accumulator OverFlow``; Variable Busy, Active : Boolean := False; Variable Address : Bit_Vector (0 To Address_Field) := `` ``; Signal Reset: Bit := `0`; n Value of Constants must be specified when declared n Initial values of Variables or Signals may be specified when declared n If not explicitly specified, Initial values of Variables or Signals default to the value of the Left Element in the type range specified in the declaration. n Examples: Constant Rom_Size : Integer := 2**16; Constant Address_Field : Integer := 7; Constant Ovfl_Msg : String (1 To 20) := ``Accumulator OverFlow``; Variable Busy, Active : Boolean := False; Variable Address : Bit_Vector (0 To Address_Field) := `` ``; Signal Reset: Bit := `0`;

2-6 Variables vs. Signals

2-7 Signal Assignments … n Syntax: Target Signal <= [ Transport ] Waveform ; Waveform := Waveform_element {, Waveform_element } Waveform_element := Value_Expression [ After Time_Expression ] n Examples: X <= ‘0’ ; -- Assignment executed After  delay S <= ‘1’ After 10 ns; Q <= Transport ‘1’ After 10 ns; S <= ‘1’ After 5 ns, ‘0’ After 10 ns, ‘1’ After 15 ns; n Signal assignment statement mostly concurrent (within architecture bodies) can be sequential (within process body) n Syntax: Target Signal <= [ Transport ] Waveform ; Waveform := Waveform_element {, Waveform_element } Waveform_element := Value_Expression [ After Time_Expression ] n Examples: X <= ‘0’ ; -- Assignment executed After  delay S <= ‘1’ After 10 ns; Q <= Transport ‘1’ After 10 ns; S <= ‘1’ After 5 ns, ‘0’ After 10 ns, ‘1’ After 15 ns; n Signal assignment statement mostly concurrent (within architecture bodies) can be sequential (within process body)

2-8 … Signal Assignments n Concurrent signal assignments are order independent n Sequential signal assignments are order dependent n Concurrent signal assignments are executed Once at the beginning of simulation Any time a signal on the right hand side changes n Concurrent signal assignments are order independent n Sequential signal assignments are order dependent n Concurrent signal assignments are executed Once at the beginning of simulation Any time a signal on the right hand side changes Time Increases

2-9 Signal Transaction n When the time element of a signal transaction expires (t=0) Its associated value is made the current value (CV) of a signal The transaction is deleted from the list of transactions forming the Projected Waveform (P_Wfm) of the signal n When the time element of a signal transaction expires (t=0) Its associated value is made the current value (CV) of a signal The transaction is deleted from the list of transactions forming the Projected Waveform (P_Wfm) of the signal

2-10 Signal Transaction & Event … n When a new value is assigned to a signal, it is said that a Transaction has been Scheduled for this signal or a Transaction has been placed on this Signal Driver n A Transaction which does not cause a signal transition (Event) is still a Transaction n A Transaction May/May not cause a signal transition (Event) on the target signal n When a new value is assigned to a signal, it is said that a Transaction has been Scheduled for this signal or a Transaction has been placed on this Signal Driver n A Transaction which does not cause a signal transition (Event) is still a Transaction n A Transaction May/May not cause a signal transition (Event) on the target signal

2-11 … Signal Transaction & Event … n A <= ‘1’ After 10 ns, ‘0’ After 20 ns, ‘1’ After 30 ns; t=0t=5 nst=10 nst=20 nst=30 ns A (CV)‘0’ ‘1’‘0’‘1’ A (P_Wfm) (‘1’, 10ns) (‘0’, 20ns) (‘1’, 30ns) (‘1’, 5ns) (‘0’, 15ns) (‘1’, 25ns) (‘0’, 10ns) (‘1’, 20ns) (‘1’, 10ns)

2-12 … Signal Transaction & Event ARCHITECTURE demo OF example IS SIGNAL a, b, c : BIT := '0'; BEGIN a <= '1' AFTER 15 NS; b <= NOT a AFTER 5 NS; c <= a AFTER 10 NS; END demo; c b

2-13 Scope of Signal Declarations n Signals declared within a Package are Global usable by all Entities using this package n Signals declared within an Entity are usable by all architectural bodies of this entity n Signals declared within an Architectural body are only usable within this Architectural body n Signals declared within a Package are Global usable by all Entities using this package n Signals declared within an Entity are usable by all architectural bodies of this entity n Signals declared within an Architectural body are only usable within this Architectural body

2-14 Delta Delay … If no Time Delay is explicitly specified, Signal assignment is executed after an infinitesimally small  - delay Delta is a simulation cycle, and not a real time Delta is used for scheduling A million deltas do not add to a femto second If no Time Delay is explicitly specified, Signal assignment is executed after an infinitesimally small  - delay Delta is a simulation cycle, and not a real time Delta is used for scheduling A million deltas do not add to a femto second ARCHITECTURE concurrent OF timing_demo IS SIGNAL a, b, c : BIT := '0'; BEGIN a <= '1'; b <= NOT a; c <= NOT b; END concurrent;

2-15 … Delta Delay … Entity example is Port (a, b, c: IN bit; Z: OUT Bit); End; ARCHITECTURE properly_timed OF example IS SIGNAL w, x, y : BIT := '0'; BEGIN y <= c AND w AFTER 12 ns; w <= NOT a AFTER 12 ns; x <= a AND b AFTER 12 ns; z <= x OR y AFTER 12 NS; END properly_timed;

2-16 … Delta Delay …

2-17 … Delta Delay … ARCHITECTURE not_properly_timed OF example IS SIGNAL w, x, y : BIT := '0'; BEGIN y <= c AND w; w <= NOT a; x <= a AND b; z <= x OR y AFTER 36 NS; END not_properly_timed; a changes from 1 to 0 at time 0.

2-18 Delta Delay in Sequential Signal Assignments … Effect of  -delay should be carefully considered when signal assignments are embedded within a process Entity BUFF2 IS Port (X: IN BIT; Z: OUT BIT); END BUFF2; Architecture Wrong of BUFF2 IS Signal y: BIT; Begin Process(x) Begin y <= x; z <= y; End Process; End Wrong; Process activated on x-events only y  x(  ) z  y(0) z gets OLD value of y and not new value of x

2-19 … Delta Delay in Sequential Signal Assignments Architecture OK of BUFF2 IS Signal y: BIT; Begin Process(x,y) Begin y <= x; z <= y; End Process; End OK; Process activated on both x and y events x changes and process activated y  x; -- y gets x value after  z  y; -- z gets y(0) value after  Process terminated After , y changes and process activated z gets new y (=x) after  Process terminated

2-20 Oscillation in Zero Real Time Architecture forever of oscillating IS Signal x: BIT :=‘0’; Signal y: BIT :=‘1’; Begin x <= y; y <= NOT x; End forever; Deltaxy

2-21 Signal Assignment & Delay Types n Two types of signal delay: Inertial and Transport n Transport Delay Exact delayed version of input signal no matter how short the input stimulus Transport keyword must be used Example: S<= TRANSPORT waveform after 5 ns; Models delays through transmission lines and networks with virtually infinite frequency response n Inertial Delay A delayed version of the input waveform Signal changes (Glitches) that do not persist for a specified duration are missed Default delay type Example: S<= waveform after 5 ns; Models capacitive networks and represents hardware inertial delay Can have additional Reject specification Example: S<= REJECT 3 ns INERTIAL waveform after 5 ns; n Two types of signal delay: Inertial and Transport n Transport Delay Exact delayed version of input signal no matter how short the input stimulus Transport keyword must be used Example: S<= TRANSPORT waveform after 5 ns; Models delays through transmission lines and networks with virtually infinite frequency response n Inertial Delay A delayed version of the input waveform Signal changes (Glitches) that do not persist for a specified duration are missed Default delay type Example: S<= waveform after 5 ns; Models capacitive networks and represents hardware inertial delay Can have additional Reject specification Example: S<= REJECT 3 ns INERTIAL waveform after 5 ns;

2-22 Transport & Inertial Delay ARCHITECTURE delay OF example IS SIGNAL target1, target2, waveform : BIT; -- this is a comment BEGIN -- the following illustrates inertial delay target1 <= waveform AFTER 5 NS; -- the following illustrates transport delay target2 <= TRANSPORT waveform AFTER 5 NS; END delay;

2-23 …Transport & Inertial Delay… Entity example Is End example; Architecture ex1 of example is SIGNAL a, b, c, wave : BIT; BEGIN a <= wave after 5 ns; b <= REJECT 2 ns INERTIAL wave after 5 ns; c <= transport wave after 5 ns; wave <= '1' after 5 ns, '0' after 8 ns, '1' after 15 ns, '0' after 17 ns, '1' after 25 ns; END ex1;

2-24 …Transport & Inertial Delay

2-25 Sequential Placement of Transactions

2-26 Sequential Placement of Transactions TransportInertial New Transaction is Before Already Existing Overwrite existing transaction New Transaction is After Already Existing Append new transaction V new /= V old T new -T old > Reject Append new transaction V new /= V old T new -T old <= Reject Overwrite existing transaction V new = V old Append new transaction V new /= V old Overwrite existing transaction

2-27 Example: Transport, New Transaction Before Already Existing ARCHITECTURE sequential OF overwriting_old IS Type tit is (‘0’, ‘1’, ‘Z’); SIGNAL x : tit := 'Z'; BEGIN PROCESS BEGIN x <= '1' AFTER 5 NS; x <= Transport '0' AFTER 3 NS; WAIT; END PROCESS; END sequential; Discards previous transaction

2-28 Example: Transport, New Transaction After Already Existing ARCHITECTURE sequential OF saving_all IS Type tit is (‘0’, ‘1’, ‘Z’); SIGNAL x : tit := 'Z'; BEGIN PROCESS BEGIN x <= '1' AFTER 5 NS; x <= Transport '0' AFTER 8 NS; WAIT; END PROCESS; END sequential; Appends transaction

2-29 Example: Inertial, New Transaction Before Already Existing ARCHITECTURE sequential OF overwriting_old IS Type tit is (‘0’, ‘1’, ‘Z’); SIGNAL x : tit := 'Z'; BEGIN PROCESS BEGIN x <= '1' AFTER 5 NS; x <= '0' AFTER 3 NS; WAIT; END PROCESS; END sequential; Discards previous transaction

2-30 Example: Inertial, New Transaction After Already Existing (Same Value) ARCHITECTURE sequential OF saving_all IS Type tit is (‘0’, ‘1’, ‘Z’); SIGNAL x : tit := 'Z'; BEGIN PROCESS BEGIN x <= ‘0' AFTER 5 NS; x <= '0' AFTER 8 NS; WAIT; END PROCESS; END sequential; Saves previous Transaction with Same value Z x 0

2-31 Example: Inertial, New Transaction After Already Existing (Different Value) ARCHITECTURE sequential OF discarding_old IS Type tit is (‘0’, ‘1’, ‘Z’); SIGNAL x : tit := 'Z'; BEGIN PROCESS BEGIN x <= ‘1' AFTER 5 NS; x <= ‘0' AFTER 8 NS; WAIT; END PROCESS; END sequential; Discards old value

2-32 Example: Inertial, New Transaction After Already Existing (Diff. Value with Reject) ARCHITECTURE sequential OF appending IS Type tit is (‘0’, ‘1’, ‘Z’); SIGNAL x : tit := 'Z'; BEGIN PROCESS BEGIN x <= ‘1' AFTER 5 NS; x <= Reject 2 ns Inertial ‘0' AFTER 8 NS; WAIT; END PROCESS; END sequential; Time difference between new and existing transaction is greater than reject value Appends transaction Z x 0 1

2-33 Example: Inertial, New Transaction After Already Existing (Diff. Value with Reject) ARCHITECTURE sequential OF appending IS Type tit is (‘0’, ‘1’, ‘Z’); SIGNAL x : tit := 'Z'; BEGIN PROCESS BEGIN x <= ‘1' AFTER 5 NS; x <= Reject 4 ns Inertial ‘0' AFTER 8 NS; WAIT; END PROCESS; END sequential; Time difference between new and existing transaction is less than reject value Discards old value Z x 0

2-34 Sequential Placement of Transactions

2-35 Sequential Placement of Transactions

2-36 Sequential Placement of Transactions C(‘0’,5)

2-37 Sequential Placement of Transactions

2-38 Signal Attributes… n Attributes are named characteristics of an Object (or Type) which has a value that can be referenced. n Signal Attributes S`Event -- Is TRUE if Signal S has changed. S`Stable(t) -- Is TRUE if Signal S has not changed for the last ``t`` period. If t=0; it is written as S`Stable S`Last_Value -- Returns the previous value of S before the last change. S`Active Is TRUE if Signal S has had a transaction in the current simulation cycle. S`Quiet(t) Is TRUE if no transaction has been placed on Signal S for the last ``t`` period. If t=0; it is written as S`Quiet S`Last_Event -- Returns the amount of time since the last value change on S. n Attributes are named characteristics of an Object (or Type) which has a value that can be referenced. n Signal Attributes S`Event -- Is TRUE if Signal S has changed. S`Stable(t) -- Is TRUE if Signal S has not changed for the last ``t`` period. If t=0; it is written as S`Stable S`Last_Value -- Returns the previous value of S before the last change. S`Active Is TRUE if Signal S has had a transaction in the current simulation cycle. S`Quiet(t) Is TRUE if no transaction has been placed on Signal S for the last ``t`` period. If t=0; it is written as S`Quiet S`Last_Event -- Returns the amount of time since the last value change on S.

2-39 …Signal Attributes architecture ex of example is signal a, a4: bit; signal a1, a2, a3 : Boolean; begin a <= '0' after 5 ns, '1' after 10 ns, '1' after 15 ns, '0' after 20 ns; a1 <= a'event; a2 <= a'stable(2 ns); a3 <= a'quiet; a4 <= a'last_value; end ex;