Digital System Design Verilog ® HDL Useful Modeling Techniques Maziar Goudarzi.

Slides:



Advertisements
Similar presentations
UNIT 8: Synthesis Basics
Advertisements

Non-synthesizability in Verilog Presented by Pradip Mukhopadhyay ISL-MOD3(E)PR3.
Simulation executable (simv)
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 7 Khurram Kazi.
Supplement on Verilog adder examples
Synchronous Sequential Logic
Verilog Intro: Part 1.
2/9/20031 ECE 551: Digital System Design & Synthesis Lecture Set 4 4.1: Verilog – Procedural Assignments &Scheduling Semantics 4.2: Verilog – More Behavioral.
Digital System Design Verilog ® HDL Behavioral Modeling (3) Maziar Goudarzi.
Introduction to Verilog
Digital System Design Verilog ® HDL Timing and Delays Maziar Goudarzi.
Programming in Verilog CPSC 321 Computer Architecture Andreas Klappenecker.
Digital System Design by Verilog University of Maryland ENEE408C.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
ELEN 468 Lecture 71 ELEN 468 Advanced Logic Design Lecture 7 System Tasks, Functions, Syntax and Behavioral Modeling I.
ENEE 408C Lab Capstone Project: Digital System Design Spring 2006 Class Web Site:
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
Digital System Design Verilog ® HDL Modules and Ports Maziar Goudarzi.
Digital System Design Verilog ® HDL Tasks and Functions Maziar Goudarzi.
Digital System Design Verilog ® HDL Behavioral Modeling (1) Maziar Goudarzi.
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.
Overview Logistics Last lecture Today HW5 due today
RTL Coding tips Lecture 7,8 Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock.
More Examples Dataflow/Behavioral Modeling Section 4.12.
Combinational Logic in Verilog
Tasks and Functions Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar Gudarzi.
Chap. 3 Basic Concepts. 2 Basic Concepts Lexical Conventions Data Types System Tasks and Compiler Directives Summary.
ECE 2372 Modern Digital System Design
Workshop Topics - Outline
MODULE 1.3 VERILOG BASICS UNIT 1 : INTRODUCTION TO VERILOG TOPIC : System Tasks and Compiler directive.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Verilog HDL: A solution for Everybody By, Anil Kumar Ram Rakhyani
Verilog Language Concepts
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
Topics to be covered : How to model memory in Verilog RAM modeling Register Bank.
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.
Digital System Design Verilog ® HDL Parameters, and Generate Blocks Maziar Goudarzi.
System Tasks for File Output & Strobing 1. Introduction There are tasks and functions that are used to generate input and output during simulation. Their.
Digital System Design Verilog ® HDL Behavioral Modeling Maziar Goudarzi.
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.
Digital System Design Verilog ® HDL Introduction to Synthesis: Concepts and Flow Maziar Goudarzi.
1 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
Timing Controls in Behavioral Modeling Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Verilog® HDL Behavioral Modeling (2)
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-1 Chapter 3: Dataflow Modeling.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Introduction to Verilog. Introduction 1)Verilog is one of the hardware description languages (HDL) available in the industry for hardware designing. 2)It.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Supplement on Verilog FF circuit examples
Discussion 2: More to discuss
Verilog Introduction Fall
Supplement on Verilog adder examples
‘if-else’ & ‘case’ Statements
Lecture 2 Supplement Verilog-01
Digital System Design Verilog ® HDL Scheduling Semantics Maziar Goudarzi.
Introduction to Digital System and Microprocessor Design
Useful Modeling Techniques
Supplement on Verilog adder examples
COE 202 Introduction to Verilog
Presentation transcript:

Digital System Design Verilog ® HDL Useful Modeling Techniques Maziar Goudarzi

2005Verilog HDL2 Today Program Procedural Continuous Assignment Overriding Parameters Conditional Compilation and Execution Useful System Tasks

Procedural Continuous Assignment Useful Modeling Techniques

2005Verilog HDL4 Procedural Continuous Assignment Overrides, for a certain time, the effect of regular assignments to a variable. Two types  assign/deassign Works only on register data types  force/release Works on both register and net data types Note:  Not synthesizable. Use only for modeling and simulation

2005Verilog HDL5 Procedural Continuous Assignment (cont’d) assign/deassign  Keywords assign : overrides regular procedural assignments LHS: reg or concatenation of regs. No nets. No arrays. No bit-select or part-select deassign : re-enables regular procedural assignments  After deassign : Last value remains on the register until a new procedural assignment changes it.

2005Verilog HDL6

2005Verilog HDL7 Procedural Continuous Assignment (cont’d) force/release  Keywords: force : overrides all procedural/continuous/ procedural continuous assignments release : re-enables other assignments Hence, assignments in priority order: 1. force 2. assign (procedural continuous) 3. Procedural/continuous assignments

2005Verilog HDL8 force/release on reg variables

2005Verilog HDL9 force/release on nets Net value immediately returns to its normal assign ed value when released

Overriding Parameters Useful Modeling Techniques

2005Verilog HDL11 Overriding Parameters Two methods  defparam statement  Module instance parameter value assignment defparam statement  Keyword: defparam  Syntax: defparam = ;

2005Verilog HDL12

2005Verilog HDL13 Overriding Parameters (cont’d) Module instance parameter values  Parameters are overridden when the module is instantiated  Syntax: #( ) ;

2005Verilog HDL14 Example with multiple parameters

Conditional Compilation and Execution Useful Modeling Techniques

2005Verilog HDL16 Conditional Compilation Usage:  To compile some part of code under certain conditions Keywords:  ‘ifdef, `else, `endif  ‘define to define the flag

2005Verilog HDL17

2005Verilog HDL18 Conditional Execution Usage:  To execute some part of code when a flag is set at runtime  Used only in behavioral modeling Keywords:  $test$plusargs Syntax:  $test$plusargs( )

2005Verilog HDL19

Useful System Tasks Useful Modeling Techniques

2005Verilog HDL21 Useful System Tasks File Output Opening a file  Syntax: = $fopen( “ ” );  is a 32 bit value, called multi-channel descriptor  Only 1 bit is set in each descriptor  Standard output has a descriptor of 1 (Channel 0)

2005Verilog HDL22 Useful System Tasks File Output (cont’d) Writing to files  $fdisplay, $fmonitor, $fstrobe  $strobe, $fstrobe The same as $display, $fdisplay, but executed after all other statements schedule in the same simulation time  Syntax: $fdisplay(, p1, p2,…, pn); Closing files $fclose( );

2005Verilog HDL23 Example: Simultaneously writing to multiple files

2005Verilog HDL24 Useful System Tasks Random Number Generation Syntax: $random; $random( ); Returns a 32 bit random value

2005Verilog HDL25 Useful System Tasks Initializing Memory from File Keywords:  $readmemb, $readmemh Used to initialize memory ( reg [3:0] mem[0:1023] ) Syntax: $readmemb(“ ”, ); $readmemb(“ ”,, ); $readmemb(“ ”,,, ); The same syntax for $readmemh

2005Verilog HDL26

2005Verilog HDL27 Useful System Tasks Value Change Dump (VCD) File ASCII file containing information on  Simulation time  Scope and signal definitions  Signal value changes Keywords  $dumpvars  $dumpfile  $dumpon  $dumpoff  $dumpall

2005Verilog HDL28

2005Verilog HDL29 Today Summary Introduced a number of modeling techniques useful in various applications

2005Verilog HDL30 Other Notes Homework 8  Chapter 9: All exercises with ModelSim, except for 3 and 5 3 and 5 in paper and pencil Due date: Sunday, Day 11th