Package with 4-valued logic Signal Attributes Assertion Data Flow description.

Slides:



Advertisements
Similar presentations
Verilog Intro: Part 1.
Advertisements

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.
ECE C03 Lecture 18ECE C03 Lecture 61 Lecture 18 VHDL Modeling of Sequential Machines 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.
SubprogramsSubprograms. SubprogramsSubprograms ä Similar to subprograms found in other languages ä Allow repeatedly used code to be referenced multiple.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Topics of Lecture Structural Model Procedures Functions Overloading.
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.
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.
ECE 368 Basic VHDL Shantanu Dutt UIC
Introduction to VHDL (part 2)
1 H ardware D escription L anguages Basic Language Concepts.
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
ECE 2372 Modern Digital System Design
1 H ardware D escription L anguages Modeling Complex Systems.
RASSP E&F SCRA GT UVA Raytheon UCinc EIT ADL Copyright  RASSP E&F Structural VHDL RASSP Education & Facilitation Module 11 Version 2.01 Copyright.
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.
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.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
DLD Lecture 26 Finite State Machine Design Procedure.
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.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
VHDL Discussion Finite State Machines IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
CEC 220 Digital Circuit Design Latches and Flip-Flops Monday, March 03 CEC 220 Digital Circuit Design Slide 1 of 19.
1/8/ L16 Timing & Concurrency III Copyright Joanne DeGroat, ECE, OSU1 Timing & Concurrency III Delay Model foundations for simulation and.
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.
ECOM 4311—Digital System Design with VHDL
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 Timing and Post-Synthesis Verifications Hazards in Combinational Circuits Alexander Sudnitson Tallinn University of Technology.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
Dataflow modelling Lecture 4. Dataflow modelling Specifies the functioning of a circuit without explicitly refer to its structure Functioning is described.
Joal 2006 HT:1 Em3 Digital Electronics Design 1 Lecture 3-4 Sequential VHDLChap 4.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Computer Science 210 Computer Organization
Basic Language Concepts
HDL simulation and Synthesis (Marks16)
B e h a v i o r a l to R T L Coding
Basic VHDL RASSP Education & Facilitation Module 10 Version 2.02
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Module Goals Introduce structural VHDL constructs Use of components
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Timing Model Start Simulation Delay Update Signals Execute Processes
Computer Science 210 Computer Organization
ECE Digital logic Lecture 16: Synchronous Sequential Logic
IAS 0600 Digital Systems Design
ECE 434 Advanced Digital System L15
Computer Science 210 Computer Organization
ECE 434 Advanced Digital System L08
CPE/EE 422/522 Advanced Logic Design L11
VHDL Discussion Subprograms
Module Goals Introduce structural VHDL constructs Use of components
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
Modeling Complex Behavior
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Package with 4-valued logic Signal Attributes Assertion Data Flow description

Few more Examples of Simulation Build a library of logic gates –AND, OR, NAND, NOR, INV, etc. Include sequential elements –DFF, Register, etc. Include tri-state devices Use 4-valued logic –‘X’, ‘0’, ‘1’, ‘Z’ –Encapsulate global declarations in a package Our goal is to Explain 4-valued logic

Global Package PACKAGE resources IS TYPE level IS ('X', '0', '1', 'Z'); -- enumerated type TYPE level_vector IS ARRAY (NATURAL RANGE <>) OF level; -- type for vectors (buses) SUBTYPE delay IS TIME; -- subtype for gate delays -- Function and procedure declarations go here END resources; Build a library of logic gates – –AND, OR, NAND, NOR, INV, etc. Include sequential elements – –DFF, Register, etc. Include tri-state devices Use 4-valued logic – –‘X’, ‘0’, ‘1’, ‘Z’ – –Encapsulate global declarations in a package Next we build gates

Two Input AND Gate Example USE work.resources.all; ENTITY and2 IS GENERIC(trise : delay := 10 ns; tfall : delay := 8 ns); PORT(a, b : IN level; c : OUT level); END and2; 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; a b c 1 and X = X Observe that we use here three-valued algebra {0,1,X}

And Gate Simulation Results

Tri-State Buffer Example USE work.resources.all; ENTITY tri_state IS GENERIC(trise : delay := 6 ns; tfall : delay := 5 ns; thiz : delay := 8 ns); PORT(a : IN level; e : IN level; b : OUT level); END tri_state; ARCHITECTURE behav OF tri_state IS BEGIN one : PROCESS (a,e) BEGIN IF (e = '1' AND a = '1') THEN -- enabled and valid data b <= '1' AFTER trise; ELSIF (e = '1' AND a = '0') THEN b <= '0' AFTER tfall; ELSIF (e = '0') THEN -- disabled b <= 'Z' AFTER thiz; ELSE -- invalid data or enable b <= 'X' AFTER (trise+tfall)/2; END IF; END PROCESS one; END behav; Observe that we use here four-valued algebra {0,1,X,Z} a e b

Tri-State Buffer Simulation Results USE work.resources.all; ENTITY tri_state IS GENERIC(trise : delay := 6 ns; tfall : delay := 5 ns; thiz : delay := 8 ns); PORT(a : IN level; e : IN level; b : OUT level); END tri_state; ARCHITECTURE behav OF tri_state IS BEGIN one : PROCESS (a,e) BEGIN IF (e = '1' AND a = '1') THEN -- enabled and valid data b <= '1' AFTER trise; ELSIF (e = '1' AND a = '0') THEN b <= '0' AFTER tfall; ELSIF (e = '0') THEN -- disabled b <= 'Z' AFTER thiz; ELSE -- invalid data or enable b <= 'X' AFTER (trise+tfall)/2; END IF; END PROCESS one; END behav;

D Flip Flop Example USE work.resources.all; ENTITY dff IS GENERIC(tprop : delay := 8 ns; tsu : delay := 2 ns); PORT(d : IN level; clk : IN level; enable : IN level; q : OUT level; qn : OUT level); END dff; ARCHITECTURE behav OF dff IS BEGIN one : PROCESS (clk) BEGIN -- check for rising clock edge IF ((clk = '1' AND clk'LAST_VALUE = '0') AND enable = '1') THEN -- ff enabled -- first, check setup time requirement IF (d'STABLE(tsu)) THEN -- check valid input data IF (d = '0') THEN q <= '0' AFTER tprop; qn <= '1' AFTER tprop; ELSIF (d = '1') THEN q <= '1' AFTER tprop; qn <= '0' AFTER tprop; ELSE -- else invalid data q <= 'X'; qn <= 'X'; END IF; ELSE -- else violated setup time requirement q <= 'X'; qn <= 'X'; END IF; END PROCESS one; END behav;

USE work.resources.all; ENTITY dff IS GENERIC(tprop : delay := 8 ns; tsu : delay := 2 ns); PORT(d : IN level; clk : IN level; enable : IN level; q : OUT level; qn : OUT level); END dff; ARCHITECTURE behav OF dff IS BEGIN one : PROCESS (clk) BEGIN -- check for rising clock edge IF ((clk = '1' AND clk'LAST_VALUE = '0') AND enable = '1') THEN -- ff enabled -- first, check setup time requirement IF (d'STABLE(tsu)) THEN -- check valid input data IF (d = '0') THEN q <= '0' AFTER tprop; qn <= '1' AFTER tprop; ELSIF (d = '1') THEN q <= '1' AFTER tprop; qn <= '0' AFTER tprop; ELSE -- else invalid data q <= 'X'; qn <= 'X'; END IF; ELSE -- else violated setup time requirement q <= 'X'; qn <= 'X'; END IF; END PROCESS one; END behav; D Flip Flop Simulation Results

Assertion Statements assert condition report message severity level; Ex. assert not (S = '1' and R = '1') report “S and R are equal to '1'” severity Error; An assertion statement specifies a boolean condition to check, an error message and a severity indication.

Assertion Statements When the condition is false, the error message is sent to the system output with an indication of the severity and the name of the design unit in which the assertion occurred. – (Default message: “Assertion violation”). The severity is of the type Severity_Level which has the values of: –Note, –Warning, –Error, –and Failure. (Default se-verity level: Error) In some VHDL system, unsatisfied conditions of severity Error or Failure cause the simulation to terminate.

Using Assertions to Specify Timing Requirements Assertion statements can be used to specify timing requirements, such as set- up time and hold time. Example If this condition is false report is printed If data is NOT stable and clock=1 then check if clock is stable in hold time When data changes during clock=1 it cannot change during hold time from clock change, this is OK because it changed after hold_time

Signal related attributes

Pre-defined Signal Attributes

Signal Attributes event and last_value

Short definitions of these and others Signal Attributes SIGNAL’event -SIGNAL’event - returns True if an event occurred on this signal during this delta SIGNAL’activeSIGNAL’active - returns True if a transaction occurred this delta SIGNAL’last_eventSIGNAL’last_event - returns the elapsed time since previous event SIGNAL’last_valueSIGNAL’last_value - returns previous value of signal before last event SIGNAL’last_activeSIGNAL’last_active - returns time elapsed since previous transaction

Signal Attributes that return Signals Delayed(t), Stable, Quiet and transactionDelayed(t), Stable, Quiet and transaction

Stable Attribute Signal’stable(time) creates a signal that is True when the reference signal has no events for time value

Derived signal attribute

Signal -Related Attributes VHDL contains a number of predefined attributes which are related to signals. They can be divided into two classes: –attributes which define signals themselves –attributes which are functions to provide information about signals. These attributes are signals themselves

Examples of Using Attributes: Detecting Edges We use attribute event

Measuring Pulse Width

Measuring Pulse Width (cont)

Measuring Setup Time

Delay Parameterization

Entities can be made parameterized by the use of GENERIC CONSTANTS They are passed to an instantiated component by its environment A generic constant can be used in computation, but remains fixed during simulation.

Delay Parameterization - Structured Example

Data Flow Descriptions in VHDL A data flow description consists of a set of concurrent signal assignment statements. A signal assignment statement executes in response to change on its input signals.

Data Flow Descriptions in VHDL Each value in the waveform will be scheduled to appear on the target after the specified delay. If the assignment statement executes again, previously scheduled values may be overridden. A delay of zero represents an infinitesimally small delay - -signal assignment never takes effect immediately. Data flow descriptions are similar to register-transfer level expressions. They may imply hardware implementation structure.

Simple data-flow example:

More examples of Concurrent Signal Assignment Guarded will be discussed in a separate lecture

More examples: Concurrent Signal Assignment This describes a decoder, or translator from binary to one-hot code We discussed it but now we add timing

Conditional Signal Assignment

Selected Signal Assignment concatenation

For students to use and think about What is the basic timing model for simulation in VHDL. Types of delay in VHDL: –transport, –inertial –delay. Detailed explanation of delta model. Why previous models were inconvenient? The student should be able to assume delta delay draw the timing diagram and next go with delta to zero and illustrate graphically the results of simulation.

For students to use and think about General assignment statements with bit selections, concatenations, timing delays and expressions. Variables versus signals in assignment statements. Some selected signal-related attributes. Conditional signal assignment with when. Concurrent signal assignment with when Explain simulation with four-valued simulator. Assertion statements. Detailed D FF with timing. Tri-state buffer and its simulation.

Questions for students Example: MUX This example highlights the difference between signals and variables ARCHITECTURE test1 OF mux IS SIGNAL x : BIT := '1'; SIGNAL y : BIT := '0'; BEGIN PROCESS (in_sig, x, y) BEGIN x <= in_sig XOR y; y <= in_sig XOR x; END PROCESS; END test1; ARCHITECTURE test1 OF mux IS SIGNAL x : BIT := '1'; SIGNAL y : BIT := '0'; BEGIN PROCESS (in_sig, x, y) BEGIN x <= in_sig XOR y; y <= in_sig XOR x; END PROCESS; END test1; ARCHITECTURE test2 OF mux IS SIGNAL y : BIT := '0'; BEGIN PROCESS (in_sig, y) VARIABLE x : BIT := '1'; BEGIN x := in_sig XOR y; y <= in_sig XOR x; END PROCESS; END test2; ARCHITECTURE test2 OF mux IS SIGNAL y : BIT := '0'; BEGIN PROCESS (in_sig, y) VARIABLE x : BIT := '1'; BEGIN x := in_sig XOR y; y <= in_sig XOR x; END PROCESS; END test2; l l Assuming a 1 to 0 transition on in_sig, what are the resulting values for y in the both cases?

Sources Krzysztof Kuchcinski Yingtao Jiang Hai Zhou Prof. K. J. Hintz VLSI. Ohio University, Starzyk