TOPIC : SEQUENTIAL AND PARALLEL BLOCKS Module 2.3 : Behavioral modeling in verilog.

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

CS 3850 Lecture 6 Tasks and Functions. 6.1 Tasks and Functions Tasks are like procedures in other programming languages. e. g., tasks may have zero or.
Simulation executable (simv)
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 7 Khurram Kazi.
Synchronization and Deadlocks
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 07: Verilog (3/3) Prof. Sherief Reda Division of.
Exception Handling Chapter 15 2 What You Will Learn Use try, throw, catch to watch for indicate exceptions handle How to process exceptions and failures.
1 Lecture 11 Interfaces and Exception Handling from Chapters 9 and 10.
7-Segment LED Display DD: Section Mano: Section 3.10.
Jack Ou, Ph.D. CES522 Engineering Science Sonoma State University
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
VBA Modules, Functions, Variables, and Constants
CS 106 Introduction to Computer Science I 02 / 12 / 2007 Instructor: Michael Eckmann.
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
CSE241 R1 Verilog.1Kahng & Cichy, UCSD ©2003 CSE241 VLSI Digital Circuits Winter 2003 Recitation 1: Verilog Introduction.
Digital System Design Verilog ® HDL Behavioral Modeling (1) Maziar Goudarzi.
2/3/03ΗΥ220 - Μαυροειδής Ιάκωβος1 Delays in Behavioral Verilog - Interassignment Delay  Key idea: unlike blocking delay, RHS is evaluated before delay.
Digital System Design EEE344 Lecture 3 Introduction to Verilog HDL Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock1.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
CS0007: Introduction to Computer Programming Introduction to Arrays.
Overview Logistics Last lecture Today HW5 due today
Object Oriented Programming
ECE 2372 Modern Digital System Design
Operator Precedence First the contents of all parentheses are evaluated beginning with the innermost set of parenthesis. Second all multiplications, divisions,
Chapter 5 Control Structures: Loops 5.1 The while Loop The while loop is probably the most frequently used loop construct. The while loop is a conditional.
Chapter 4: Behavioral Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 4-1 Ders – 4: Davranışsal Modelleme.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Module 2.1 Gate-Level/Structural Modeling UNIT 2: Modeling in Verilog.
COMPUTER PROGRAMMING. Iteration structures (loops) There may be a situation when you need to execute a block of code several number of times. In general,
Bordoloi and Bock Control Structures: Iterative Control.
Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Lecture 9 & 10 Repetition Statements.
Digital System Design Verilog ® HDL Behavioral Modeling Maziar Goudarzi.
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
ELEN 468 Lecture 131 ELEN 468 Advanced Logic Design Lecture 13 Synthesis of Combinational Logic II.
M.Mohajjel. Structured Procedures Two basic structured procedure statements always initial All behavioral statements appear only inside these blocks Each.
Verilog® HDL Behavioral Modeling (2)
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
COP 2220 Computer Science I Topics –Breaking Problems Down –Functions –User-defined Functions –Calling Functions –Variable Scope Lecture 4.
Learning Javascript From Mr Saem
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Full Adder Verilog(HO: wires/regs, always) Section 4.5 (Full adder)
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Structural Description
Overview Logistics Last lecture Today HW5 due today
Adapted from Krste Asanovic
Reg and Wire:.
Discussion 2: More to discuss
Verilog Introduction Fall
‘if-else’ & ‘case’ Statements
Computer Engg, IIT(BHU)
Section 11.1 Class Variables and Methods
TODAY’S OUTLINE Procedural Assignments Verilog Coding Guidelines
Topics Introduction to File Input and Output
Chapter 4: Behavioral Modeling
Test Fixture (Testbench)
Topics Introduction to Functions Defining and Calling a Function
Supplement on Verilog adder examples
Using Decision Structures
Topics Introduction to File Input and Output
CS561 Computer Architecture Hye Yeon Kim
CMSC 202 Exceptions.
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

TOPIC : SEQUENTIAL AND PARALLEL BLOCKS Module 2.3 : Behavioral modeling in verilog

What are blocks?  Block statements are used to group multiple statements to act together as one.  In previous examples we used keywords begin and end to group multiple statements.  Thus, we used sequential blocks where the statements in the block execute one after another.  In this section we discuss the block types:  sequential blocks and  parallel blocks

Sequential blocks  The keywords begin and end are used to group statements into sequential blocks.  Sequential blocks have the following characteristics:  The statements in a sequential block are processed in the order they are specified. A statement is executed only after its preceding statement completes execution (except for nonblocking assignments with intra- assignment timing control).  If delay or event control is specified, it is relative to the simulation time when the previous statement in the block completed execution.

Sequential blocks example In illustration 1, the final values are x = 0, y= 1, z = 1, w = 2 at simulation time 0. //Illustration 1: Sequential block without delay reg x, y; reg [1:0] z, w; initial begin x = 1'b0; y = 1'b1; z = {x, y}; w = {y, x}; end

Sequential blocks example II //Illustration 2: Sequential blocks with delay. reg x, Y; reg [1:0] z, w; initial begin x = l'bO; //completes at simulation time 0 #5 y = l'bl; //completes at simulation time 5 #10 z = {x, y}; //completes at simulation time 15 #20 w = {y, x); //completes at simulation time 35 end

Parallel blocks  Parallel blocks, specified by keywords fork and join, provide interesting simulation features.  Parallel blocks have the following characteristics.  Statements in a parallel block are executed concurrently.  Ordering of statements is controlled by the delay or event control assigned to each statement.  If delay or event control is specified, it is relative to the time the block was entered.

Parallel blocks Example //Example 1: Parallel blocks with delay. reg x, Y; reg [1:0] z, w; initial fork x = 1'b0; //completes at simulation time 0 #5 y = 1'b1; //completes at simulation time 5 #10 z = {x, y}; //completes at simulation time 10 #20 w = {y, x}; //completes at simulation time 20 Join NOTE : The result of simulation remains the same except that all statements start in parallel at time 0. Hence, the block finishes at time 20 instead of time 35.

Parallel block limitation  Parallel blocks provide a mechanism to execute statements in parallel.  However, it is important to be careful with parallel blocks because of implicit race conditions that might arise if two statements that affect the same variable complete at the same time.

nested blocks, named blocks, and disabling of named blocks. Special Features of Blocks

Nested blocks  Nested blocks Blocks can be nested. Sequential and parallel blocks can be mixed. //Nested blocks initial begin x = 1'bO; fork #5 y = 1'b1; #10 z = {x, y}; join #20 w = {y, X}; end

Named blocks  Blocks can be given names:  Local variables can be declared for the named block.  Named blocks are a part of the design hierarchy. Variables in a named block can be accessed by using hierarchical name referencing.  Named blocks can be disabled, i.e., their execution can be stopped.

Named block Example //Named blocks module top; initial begin: blockl1//sequential block named block1 integer i; //integer i is static and local to block1 // can be accessed by hierarchical name, top.block1.i... End initial fork: block2 //parallel block named block2 reg i; / / register i is static and local to block2 // can be accessed by hierarchical name, top.block2.i... join

Disabling a block  The keyword disable provides a way to terminate the execution of a block.  disable can be used to get out of loops, handle error conditions, or control execution of pieces of code, based on a control signal.  Disabling a block causes the execution control to be passed to the statement immediately succeeding the block.  For C programmers, this is very similar to the break statement used to exit a loop. The difference is that a break statement can break the current loop only, whereas the keyword disable allows disabling of any named block in the design.