ELEN468 Lecture 31 ELEN 468 Advanced Logic Design Lecture 3 Simulation and Testbench.

Slides:



Advertisements
Similar presentations
Chapter 15:Introduction to Verilog Testbenches Objectives In this section,you will learn about designing a testbench: Creating clocks Including files Strategic.
Advertisements

1/8/ VerilogCopyright Joanne DeGroat, ECE, OSU1 Verilog Overview An overview of the Verilog HDL.
Verilog.
Simulation executable (simv)
Supplement on Verilog adder examples
ELEN 468 Lecture 61 ELEN 468 Advanced Logic Design Lecture 6 Delay Models.
Combinational Logic.
ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Verilog Modules for Common Digital Functions
CPEN Digital System Design
16/04/20151 Hardware Descriptive Languages these notes are taken from Mano’s book It can represent: Truth Table Boolean Expression Diagrams of gates and.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Originally designed to model and verify a design.
1 Verilog Digital Computer Logic Kashif Bashir WWW: http//:
Lecture 12 Latches Section Schedule 3/10MondayLatches (1) /12WednesdayFlip-flops5.4 3/13ThursdayFlip-flops, D-latch 3/17MondaySpring.
Lecture 12 Latches Section , Block Diagram of Sequential Circuit gates New output is dependent on the inputs and the preceding values.
ELEN468 Lecture 101 ELEN 468 Advanced Logic Design Lecture 10 Behavioral Descriptions IV.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 3 - Verilog Delay.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
ELEN 468 Lecture 121 ELEN 468 Advanced Logic Design Lecture 12 Synthesis of Combinational Logic I.
ELEN 468 Lecture 81 ELEN 468 Advanced Logic Design Lecture 8 Behavioral Descriptions II.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
ECE 353 Computer Systems Lab I Verilog Hardware Description Language.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
ELEN 468 Lecture 71 ELEN 468 Advanced Logic Design Lecture 7 System Tasks, Functions, Syntax and Behavioral Modeling I.
Logic Simulation 2 Outline –Timing Models –Simulation Algorithms Goal –Understand timing models –Understand simulation algorithms Reading –Gate-Level Simulation.
Hardware Description Language HDL. 2 Hardware Description Language HDL  Describes circuits and systems in text. −As a software program.  Can be processed.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 6 - Behavioral Modeling.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Overview Logistics Last lecture Today HW5 due today
 Delay values control the time between the change in a right-hand-side operand and when the new value is assigned to the left- hand side.  Three ways.
Week Four Design & Simulation Example slides. Agenda Review the tiny example (Minako “logic”)from last week – look at the detailed static timing report.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
FPGA-Based System Design Copyright  2004 Prentice Hall PTR Logic Design Process n Functional/ Non-functional requirements n Mapping into an FPGA n Hardware.
Module 1.2 Introduction to Verilog
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Chap. 4 Modules and Ports. 2 Modules and Ports Modules Ports Hierarchical Names Summary.
Timing Model VHDL uses the following simulation cycle to model the stimulus and response nature of digital hardware Start Simulation Update Signals Execute.
3/4/20031 ECE 551: Digital System * Design & Synthesis Lecture Set 2 2.1: Verilog – The Basics 2.2: Verilog – Simulation and Testbenches.
Switch Level Modeling Part II 26 September Contents 1.Clarifications: a)nMOS and pMOS instantiations b)Testbenches for NOR gate example c)Use of.
ELEN 468 Lecture 131 ELEN 468 Advanced Logic Design Lecture 13 Synthesis of Combinational Logic II.
Digital System Design Verilog ® HDL Design at Structural Level Maziar Goudarzi.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
 A test bench is an HDL program used for applying stimulus to an HDL design in order to test it and observe its response during simulation.  In addition.
Introduction to Verilog Section Outline Set Up the Environment Your First Verilog File Set Up the Test Bench Running the Simulation.
Multiplexers Section Topics Multiplexers – Definition – Examples – Verilog Modeling.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
ELEN 468 Lecture 171 ELEN 468 Advanced Logic Design Lecture 17 Midterm1 Review.
LECTURE V TEST BENCHES. As your projects become more complex and multiple modules are employed, it will no longer be possible to simulate them as we did.
Structural Description
Reg and Wire:.
Verilog Introduction Fall
Behavioral Modeling Structural modeling Behavioral modeling
Hardware Description Languages
D Flip-Flop.
Topics The logic design process..
332:437 Lecture 8 Verilog and Finite State Machines
Lecture 3 Simulation and Testbench
Test Fixture (Testbench)
332:437 Lecture 5 Verilog Tutorial
The Verilog Hardware Description Language
332:437 Lecture 5 Verilog Tutorial
332:437 Lecture 5 Verilog Tutorial
332:437 Lecture 8 Verilog and Finite State Machines
COE 202 Introduction to Verilog
Presentation transcript:

ELEN468 Lecture 31 ELEN 468 Advanced Logic Design Lecture 3 Simulation and Testbench

ELEN468 Lecture 32 Overview Analog simulation Event-driven logic simulation Signal levels in logic simulation Propagation delay Inertial delay Testbench

ELEN468 Lecture 33 Analog Simulation Simulate waveforms Trace every signal at every time point at certain sampling rate Precise Long simulation time v t

ELEN468 Lecture 34 Logic Simulation At any moment, most signals are quiescent Very few signal levels At any simulation time, trace only signals with transitions (event) Propagate events from inputs toward outputs In a logic simulator An ordered list of “event-times” At each even time, an event queue is maintained

ELEN468 Lecture 35 Set of Logic Values Sometimes, {0, 1} is not enough a b 0 1 c If a = b = 0, c = ? If a = b = 1, c = ?

ELEN468 Lecture 36 Logic Values in Verilog 0: Logical 0 1: Logical 1 x: unknown z: high impedance and01ZX XX Z0XXX X0XXX

ELEN468 Lecture 37 X and Z a = b = 0: c = Z a = b = 1: c = X Initially, every line is X X is used in simulation. In real circuit, the value is determined by the circuit a b 0 1 c

ELEN468 Lecture 38 Simulation without Delay A = x B = x C = x D = x A = 1 B = 0 C = 0 D = 1 B = 1 C = 1 D = 0 A = 0 C = 0 D = 1 B = 0 t sim B A C D B A CD X X X XY

ELEN468 Lecture 39 Simulation with Delay A = x B = x C = x D = x A = 1 B = 0 C = 0 D = 1 B = 1 C = 1 D = 0 A = 0 C = 0 D = 1 B = 0 t sim B A C D B A C D X X X X

ELEN468 Lecture 310 Inertial Delay Delay is caused by charging and discharging node capacitors in circuit Gate delay and wire delay Pulse rejection If pulse with is less than delay, the pulse is ignored B A CD

ELEN468 Lecture 311 Example of De-scheduling A=x B=x C=x D=x A=1 B=0 C=1D=0 B=1 A=0 C=0 C=1 D=1 A B C D B A C D 32 T_sim

ELEN468 Lecture 312 Testbench Unit_Under_Test Stimulus generator Response monitor Design_Unit_Test_Bench

ELEN468 Lecture 313 Some New Keywords initial declares one-shot behaviors $monitor task is used to observe events $time returns simulation time $stop task stops execution and wait for interactive input $finish returns control to operating system

ELEN468 Lecture 314 Example of NAND Latch module Nand_Latch_1 (q, qbar, preset, clear); output q, qbar; input preset, clear; nand G1 (q, preset, qbar), G2 (qbar, clear, q); endmodule module Nand_Latch_1 (q, qbar, preset, clear); output q, qbar; input preset, clear; nand G1 (q, preset, qbar), G2 (qbar, clear, q); endmodule 1 1 G1 G2 q qbar preset clear PresetClearqqbar q_preqbar_pre

ELEN468 Lecture 315 Example of Testbench module test_Nand_Latch_1; reg preset, clear; wire q, qbar; Nand_Latch_1 M1 (q, qbar, preset, clear); // Instantiate UUT initial// Create response monitor $monitor ($time, "preset=%b clear=%b q=%b qbar=%b", preset, clear, q, qbar); initial begin// Create DUTB stimulus generator #10preset = 0; clear = 1; #10preset = 1; $stop;// Enter. to proceed #10clear = 0; #10clear = 1; #10preset = 0; end initial #60 $finish;// Finish simulation endmodule module test_Nand_Latch_1; reg preset, clear; wire q, qbar; Nand_Latch_1 M1 (q, qbar, preset, clear); // Instantiate UUT initial// Create response monitor $monitor ($time, "preset=%b clear=%b q=%b qbar=%b", preset, clear, q, qbar); initial begin// Create DUTB stimulus generator #10preset = 0; clear = 1; #10preset = 1; $stop;// Enter. to proceed #10clear = 0; #10clear = 1; #10preset = 0; end initial #60 $finish;// Finish simulation endmodule 1 1 G1 G2 q qbar preset clear

ELEN468 Lecture 316 Simulation Results t sim preset clear q qbar 0 preset = x clear = x q = x qbar = x 10 preset = 0 clear = 1 q = x qbar = x 11 preset = 0 clear = 1 q = 1 qbar = x 12 preset = 0 clear = 1 q = 1 qbar = 0 20 preset = 1 clear = 1 q = 1 qbar = 0 30 preset = 1 clear = 0 q = 1 qbar = 0 31 preset = 1 clear = 0 q = 1 qbar = 1 32 preset = 1 clear = 0 q = 0 qbar = 1 40 preset = 1 clear = 1 q = 0 qbar = G1 G2 q qbar preset clear