Chapter 7: Advanced Modeling Techniques



Similar documents
Registers & Counters

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

A New Paradigm for Synchronous State Machine Design in Verilog

Understanding Verilog Blocking and Non-blocking Assignments

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

ECE 451 Verilog Exercises. Sept 14, James Barnes

Modeling Registers and Counters

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Chapter 13: Verification

Master/Slave Flip Flops

Asynchronous & Synchronous Reset Design Techniques - Part Deux

A Verilog HDL Test Bench Primer Application Note

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 16 Timing and Clock Issues

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Life Cycle of a Memory Request. Ring Example: 2 requests for lock 17

Lesson 12 Sequential Circuits: Flip-Flops

Timing Methodologies (cont d) Registers. Typical timing specifications. Synchronous System Model. Short Paths. System Clock Frequency

Finite State Machine Design and VHDL Coding Techniques

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset.

Modeling Latches and Flip-flops

Getting the Most Out of Synthesis

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Digital Circuit Design Using Xilinx ISE Tools

Set-Reset (SR) Latch

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Digital Design Verification

Chapter 8. Sequential Circuits for Registers and Counters

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Cascaded Counters. Page 1 BYU

Traffic Light Controller. Digital Systems Design. Dr. Ted Shaneyfelt

SystemVerilog Is Getting Even Better!

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

Combinational Logic Design Process

Chapter 9 Latches, Flip-Flops, and Timers

University of Toronto Faculty of Applied Science and Engineering

Memory Elements. Combinational logic cannot remember

E158 Intro to CMOS VLSI Design. Alarm Clock

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

VHDL GUIDELINES FOR SYNTHESIS

CHAPTER 11 LATCHES AND FLIP-FLOPS

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

Module 3: Floyd, Digital Fundamental

CHAPTER 11: Flip Flops

Verilog: Blocks

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

Digital Logic Design Sequential circuits

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Lecture 10: Multiple Clock Domains

CSE140: Components and Design Techniques for Digital Systems

Chapter 2 Clocks and Resets

Verilog for Behavioral Modeling

Chapter 5 :: Memory and Logic Arrays

ECE124 Digital Circuits and Systems Page 1

Design and Implementation of Vending Machine using Verilog HDL

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

3. VERILOG HARDWARE DESCRIPTION LANGUAGE

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Counters & Shift Registers Chapter 8 of R.P Jain

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Asynchronous Counters. Asynchronous Counters

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Sequential Logic: Clocks, Registers, etc.

An Integer Square Root Algorithm

7. Latches and Flip-Flops

Design of Digital Circuits (SS16)

Review: MIPS Addressing Modes/Instruction Formats

Clock Domain Crossing (CDC) Design & Verification Techniques Using SystemVerilog

System Verilog Testbench Tutorial Using Synopsys EDA Tools

DEPARTMENT OF INFORMATION TECHNLOGY

High Fanout Without High Stress: Synthesis and Optimization of High-fanout Nets Using Design Compiler

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Engr354: Digital Logic Circuits

Counters and Decoders

Chapter 2 Verilog HDL for Design and Test

Hardware Implementation of Improved Adaptive NoC Router with Flit Flow History based Load Balancing Selection Strategy

Prototyping ARM Cortex -A Processors using FPGA platforms

Multiplexers Two Types + Verilog

Hunting Asynchronous CDC Violations in the Wild

VHDL Test Bench Tutorial

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Using SystemVerilog Assertions for Creating Property-Based Checkers

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Latch Timing Parameters. Flip-flop Timing Parameters. Typical Clock System. Clocking Overhead

ASYNCHRONOUS COUNTERS

Wiki Lab Book. This week is practice for wiki usage during the project.

Measuring Metastability

Chapter 5. Sequential Logic

Lecture 7: Clocking of VLSI Systems

16-bit ALU, Register File and Memory Write Interface

Chapter 2 Ensuring RTL Intent

Transcription:

Chapter 7: Advanced Modeling Techniques Prof. Ming-Bo Lin Department of Electronic Engineering National Taiwan University of Science and Technology Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-1

Syllabus Objectives Blocks Procedural continuous assignments Delay models and timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-2

Objectives After completing this chapter, you will be able to: Describe the features of sequential blocks Describe the features of parallel blocks Describe the features of nested blocks Describe the features of procedural continuous assignments Describe how to model a module delay Describe the features of specify blocks Describe the features of timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-3

Syllabus Objectives Blocks Sequential blocks Parallel blocks Special blocks The disable statement Procedural continuous assignments Delay models and timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-4

Sequential Blocks initial begin x = 1 b1; // at time 0 #12 y = 1 b1; // at time 12 #20 z = 1 b0; // at time 32 end initial begin x = 1'b0; // at time 0 #20 w = 1'b1; // at time 20 #12 y <= 1'b1; // at time 32 #10 z <= 1'b0; // at time 42 #25 x = 1'b1; w = 1'b0; // at time 67 end Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-5

Syllabus Objectives Blocks Sequential blocks Parallel blocks Special blocks The disable statement Procedural continuous assignments Delay models and timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-6

Parallel Blocks initial fork x = 1 b0; // at time 0 #12 y = 1 b1; // at time 12 #20 z = 1 b1; // at time 20 join initial fork x <= 1 b0; // at time 0 #12 y <= 1 b1; // at time 12 #20 z <= 1 b1; // at time 20 join Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-7

Syllabus Objectives Blocks Sequential blocks Parallel blocks Special blocks The disable statement Procedural continuous assignments Delay models and timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-8

Types of Special Blocks Nested blocks Named blocks Chapter 7: Advanced Modeling Techniques Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-9

Nested Blocks initial begin x = 1'b0; // at time 0 fork // parallel block -- enter at time 0 #12 y <= 1'b1; // at time 12 #20 z <= 1'b0; // at time 20 join // leave at time 20 #25 x = 1'b1; // at time 45 end Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-10

Named Blocks initial begin: test // test is the block name reg x, y, z; // local variables x = 1 b0; #12 y = 1 b1; // at time 12 #10 z = 1 b1; // at time 22 end Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-11

Syllabus Objectives Blocks Sequential blocks Parallel blocks Special blocks The disable statement Procedural continuous assignments Delay models and timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-12

The disable statement initial begin: test while (i < 10) begin if (flag) disable test; i = i + 1; end end Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-13

Syllabus Objectives Blocks Procedural continuous assignments assign and deassign assignments force and release assignments Delay models and timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-14

assign and deassign Constructs They assign values to variables Their LHS Chapter 7: Advanced Modeling Techniques can be a variable or a concatenation of variables They override the effect of regular procedural assignments They are normally used for controlling periods of time Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-15

assign and deassign Constructs Chapter 7: Advanced Modeling Techniques // negative edge triggered D flip flop with asynchronous reset module edge_dff(input clk, reset, d, output reg q, qbar); always @(negedge clk) begin q <= d; qbar <= ~d; end always @(reset) // override the regular assignments if (reset) begin assign q = 1'b0; assign qbar = 1'b1; end else begin // release q and qbar deassign q; deassign qbar; end endmodule Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-16

Syllabus Objectives Blocks Procedural continuous assignments assign and deassign assignments force and release assignments Delay models and timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-17

force and release Constructs They assign values to nets or variables Their LHS can be a variable or a net They override Chapter 7: Advanced Modeling Techniques the effect of regular procedural assignments the effect of assign and deassign construct They are normally used for controlled periods of time Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-18

Syllabus Objectives Blocks Procedural continuous assignments Delay models and timing checks Delay models Specify blocks Timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-19

Types of Delay Models Distributed delays Lumped delays Module path (pin-to-pin) delays Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-20

Distributed Delay Model Chapter 7: Advanced Modeling Techniques module M (input x, y, z, output f); wire a, b, c; and #5 a1 (a, x, y); not #2 n1 (c, x); and #5 a2 (b, c, z); or #3 o1 (f, a, b); endmodule module M (input x, y, z, output f); wire a, b, c; assign #5 a = x & y; assign #2 c = ~x assign #5 b = c & z assign #3 f = a b; endmodule Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-21

Lumped Delay Model module M (input x, y, z, output f); wire a, b, c; and a1 (a, x, y); not n1 (c, x); and a2 (b, c, z); or #10 o1 (f, a, b); endmodule module M (input x, y, z, output f); wire a, b, c; assign a = x & y; assign c = ~x assign b = c & z assign #10 f = a b; endmodule Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-22

Module Path Delay Model Chapter 7: Advanced Modeling Techniques Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-23

Syllabus Objectives Blocks Procedural continuous assignments Delay models and timing checks Delay models Specify blocks Timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-24

Specify Blocks Keywords specify and endspecify Are used to describe various paths across the module assign delays to these paths perform necessary timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-25

Path Delay Modeling The specify Block module M (input x, y, z, output f); wire a, b, c; // specify block with path delay statements specify (x => f) = 10; (y => f) = 8; (z => f) = 8; endspecify // gate instantiations and a1 (a, x, y); not n1 (c, x); and a2 (b, c, z); or o1 (f, a, b); endmodule x y z c Path x-a-f, delay = 8 Path x-c-b-f, delay = 10 Path y-a-f, delay = 8 Path z-b-f, delay = 8 a b f Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-26

Path Declarations Single-path Edge-sensitive path State-dependent path Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-27

Single Path Single path connection methods Parallel connection (source => destination) Full connection (source *> destination) Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-28

Edge-Sensitive Path posedge clock => (out +: in) = (8, 6); module path: from clock to out rise time = 8 and fall delay = 6 data path: from in to out negedge clock => (out -: in) = (8, 6); module path: from clock to out rise time = 8 and fall delay = 6 data path: from in to out Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-29

Level-Sensitive Path clock => (out : in) = (8, 6); At any change in clock, a module path extends from clock to out Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-30

State-Dependent Path Syntax if (cond_expr) simple_path_declaration if (cond_expr) edge_sensitive_path_declaration ifnone simple_path_declaration specify if (x) (x => f) = 10; if (~x) (y => f) = 8; endspecify specify if (!reset &&!clear) (positive clock => (out +: in) = (8, 6); endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-31

The specparam Statement Chapter 7: Advanced Modeling Techniques specify // define parameters inside the specify block specparam d_to_q = (10, 12); specparam clk_to_q = (15, 18); ( d => q) = d_to_q; (clk => q) = clk_to_q; endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-32

An Example --- An NOR Gate module my_nor (a, b, out); output out; nor nor1 (out, a, b); specify specparam trise = 1, tfall = 2 specparam trise_n = 2, tfall_n = 3; if (a) (b => out) = (trise, tfall); if (b) (a => out) = (trise, tfall); if (~a)(b => out) = (trise_n, tfall_n); if (~b)(a => out) = (trise_n, tfall_n); endspecify Chapter 7: Advanced Modeling Techniques Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-33

Syllabus Objectives Blocks Procedural continuous assignments Delay models and timing checks Delay models Specify blocks Timing checks Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-34

Timing Checks Must be inside the specify blocks The most commonly used timing checks $setup $hold $setuphold $width $skew $period $recovery Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-35

Timing Checks -- $setup Timing Check $setup (data_event, reference_event, limit); Violation when t reference_event t data_event < limit specify $setup (data, posedge clock, 15); endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-36

Timing Checks -- $hold Timing Check Chapter 7: Advanced Modeling Techniques $hold (reference_event, data_event, limit); Violation when t data_event t reference_event < limit specify $hold (posedge clock, data, 8); endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-37

Timing Checks -- $setuphold Timing Check $setuphold (reference_event, data_event, setup_limit, hold_limit); Violation when: t reference_event t data_event < setup_limit t data_event t reference_event < hold_limit specify $setuphold (posedge clock, data, 10, 5); endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-38

Timing Checks -- $width Timing Check $width (reference_event, limit); Violation when t data_event t reference_event < limit specify $width (posedge reset, 6); endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-39

Timing Checks -- $skew Timing Check $skew (reference_event, data_event, limit); Violation when t data_event t reference_event > limit specify $skew (posedge clk1, posedge clk2, 5); endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-40

Timing Checks -- $period Timing Check $period (reference_event, limit); Violation when t data_event t reference_event < limit specify $period (posedge clk, 15); endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-41

Timing Checks -- $recovery Timing Check $recovery (reference_event, data_event, limit); Violation when t reference_event <= t data_event < t reference_event + limit specify $recovery (negedge aysyn_input, posedge clk, 5); endspecify Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008~2010, John Wiley 7-42