Chapter 7: Advanced Modeling Techniques

Slides:



Advertisements
Similar presentations
//HDL Example 8-2 // //RTL description of design example (Fig.8-9) module Example_RTL (S,CLK,Clr,E,F,A);
Advertisements

Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Supplement on Verilog adder examples
Synchronous Sequential Logic
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.
Table 7.1 Verilog Operators.
Hardware Description Language (HDL)
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
//HDL Example 5-1 // //Description of D latch (See Fig.5-6) module D_latch (Q,D,control); output Q; input.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
//HDL Example 6-1 // //Behavioral description of //Universal shift register // Fig. 6-7 and Table 6-3 module shftreg.
1 Verilog Digital System Design Z. Navabi, 2006 Sequential Circuit Description  This chapter concentrates on:  Using Verilog constructs for description.
Digital System Design Verilog ® HDL Timing and Delays Maziar Goudarzi.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Digital System Design by Verilog University of Maryland ENEE408C.
ELEN 468 Lecture 91 ELEN 468 Advanced Logic Design Lecture 9 Behavioral Descriptions III.
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
ELEN 468 Lecture 161 ELEN 468 Advanced Logic Design Lecture 16 Synthesis of Language Construct II.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
ECE 2372 Modern Digital System Design
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
3/4/20031 ECE 551: Digital System Design * & Synthesis Lecture Set 3 3.1: Verilog - User-Defined Primitives (UDPs) (In separate file) 3.2: Verilog – Operators,
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
M.Mohajjel. Structured Procedures Two basic structured procedure statements always initial All behavioral statements appear only inside these blocks Each.
Types of Delay Models. Delay models Three types of delay models used in Verilog Distributed delay model Lumped Delay model Pin-to-pin (path) Delay model.
Introduction to Verilog
Verilog® HDL Behavioral Modeling (2)
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Constructs for Activity Flow Control  Task & Function  System Tasks for Timing Checks.
Structural Description
Overview Logistics Last lecture Today HW5 due today
Lecture 10 Flip-Flops/Latches
Verilog Tutorial Fall
Supplement on Verilog FF circuit examples
Lecture 11 Registers and Counters
Digital System Clocking
ELEN 468 Advanced Logic Design
Reg and Wire:.
Verilog Introduction Fall
‘if-else’ & ‘case’ Statements
HDL for Sequential Circuits
Behavioral Modeling Structural modeling Behavioral modeling
TODAY’S OUTLINE Procedural Assignments Verilog Coding Guidelines
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Chapter 5: Tasks, Functions, and UDPs
CS Fall 2005 – Lec. #5 – Sequential Logic - 1
Chapter 2a: Structural Modeling
Chapter 3: Dataflow Modeling
Chapter 9: Sequential Logic Modules
Verilog.
101-1 Under-Graduate Project Logic Design with Behavioral Models
332:437 Lecture 8 Verilog and Finite State Machines
Chapter 4: Behavioral Modeling
COE 202 Introduction to Verilog
Chapter 8: Combinational Logic Modules
Chapter 2b: Switch-Level Modeling
6. Registers and Counters
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
The Verilog Hardware Description Language
332:437 Lecture 8 Verilog and Finite State Machines
Introduction to Digital IC Design
COE 202 Introduction to Verilog
Presentation transcript:

Chapter 7: Advanced Modeling Techniques Prof. Ming-Bo Lin Department of Electronic Engineering National Taiwan University of Science and Technology

Syllabus Objectives Blocks Procedural continuous assignments Delay models and timing checks

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

Syllabus Objectives Blocks Procedural continuous assignments Sequential blocks Parallel blocks Special blocks The disable statement Procedural continuous assignments Delay models and timing checks

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

Syllabus Objectives Blocks Procedural continuous assignments Sequential blocks Parallel blocks Special blocks The disable statement Procedural continuous assignments Delay models and timing checks

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

Syllabus Objectives Blocks Procedural continuous assignments Sequential blocks Parallel blocks Special blocks The disable statement Procedural continuous assignments Delay models and timing checks

Types of Special Blocks Nested blocks Named blocks

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

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

Syllabus Objectives Blocks Procedural continuous assignments Sequential blocks Parallel blocks Special blocks The disable statement Procedural continuous assignments Delay models and timing checks

The disable statement initial begin: test while (i < 10) begin if (flag) disable test; i = i + 1; end

Syllabus Objectives Blocks Procedural continuous assignments assign and deassign assignments force and release assignments Delay models and timing checks

assign and deassign Constructs They assign values to variables Their LHS can be a variable or a concatenation of variables They override the effect of regular procedural assignments are normally used for controlling periods of time

assign and deassign Constructs // 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; endmodule

Syllabus Objectives Blocks Procedural continuous assignments assign and deassign assignments force and release assignments Delay models and timing checks

force and release Constructs They assign values to nets or variables Their LHS can be a variable or a net They override the effect of regular procedural assignments the effect of assign and deassign construct are normally used for controlled periods of time

Syllabus Objectives Blocks Procedural continuous assignments Delay models and timing checks Delay models Specify blocks Timing checks

Types of Delay Models Distributed delays Lumped delays Module path (pin-to-pin) delays

Distributed Delay Model 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

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

Module Path Delay Model

Syllabus Objectives Blocks Procedural continuous assignments Delay models and timing checks Delay models Specify blocks Timing checks

Specify Blocks Keywords Are used to specify and endspecify describe various paths across the module assign delays to these paths perform necessary timing checks

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 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

Path Declarations Single-path Edge-sensitive path State-dependent path

Single Path Single path connection methods Parallel connection (source => destination) Full connection (source *> destination)

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);

Level-Sensitive Path clock => (out : in) = (8, 6); At any change in clock, a module path extends from clock to out

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

The specparam Statement 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

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

Syllabus Objectives Blocks Procedural continuous assignments Delay models and timing checks Delay models Specify blocks Timing checks

Timing Checks Must be inside the specify blocks The most commonly used timing checks $setup $hold $setuphold $width $skew $period $recovery

Timing Checks -- $setup Timing Check $setup (data_event, reference_event, limit); Violation when treference_event – tdata_event < limit specify $setup (data, posedge clock, 15); endspecify

Timing Checks -- $hold Timing Check $hold (reference_event, data_event, limit); Violation when tdata_event – treference_event < limit specify $hold (posedge clock, data, 8); endspecify

Timing Checks -- $setuphold Timing Check $setuphold (reference_event, data_event, setup_limit, hold_limit); Violation when: treference_event – tdata_event < setup_limit tdata_event – treference_event < hold_limit specify $setuphold (posedge clock, data, 10, 5); endspecify

Timing Checks -- $width Timing Check $width (reference_event, limit); Violation when tdata_event – treference_event < limit specify $width (posedge reset, 6); endspecify

Timing Checks -- $skew Timing Check $skew (reference_event, data_event, limit); Violation when tdata_event – treference_event > limit specify $skew (posedge clk1, posedge clk2, 5); endspecify

Timing Checks -- $period Timing Check $period (reference_event, limit); Violation when tdata_event – treference_event < limit specify $period (posedge clk, 15); endspecify

Timing Checks -- $recovery Timing Check $recovery (reference_event, data_event, limit); Violation when treference_event <= tdata_event < treference_event + limit specify $recovery (negedge aysyn_input, posedge clk, 5); endspecify