MODULE 1.3 VERILOG BASICS UNIT 1 : INTRODUCTION TO VERILOG TOPIC : System Tasks and Compiler directive.

Slides:



Advertisements
Similar presentations
Spring Semester 2013 Lecture 5
Advertisements

CHAPTER 11 FILE INPUT & OUTPUT Introduction to Computer Science Using Ruby (c) 2012 Ophir Frieder et al.
Verilog.
Simulation executable (simv)
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Lecture 2 Introduction to C Programming
Introduction to C Programming
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
1 Javascrbipt Intro Javascript (or js) is a programming language. Interpreted, not compiled. Not the same as java, but, similar. Use tags to use. Object-oriented.
Programming in Verilog CPSC 321 Computer Architecture Andreas Klappenecker.
Verilog and VeriWell Bo Cheng.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 - The Preprocessor Outline 13.1Introduction.
Digital System Design Verilog ® HDL Tasks and Functions Maziar Goudarzi.
Digital System Design Verilog ® HDL Useful Modeling Techniques Maziar Goudarzi.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 13 - The Preprocessor Outline 13.1Introduction 13.2The #include Preprocessor Directive 13.3The.
2/3/03ΗΥ220 - Μαυροειδής Ιάκωβος1 Delays in Behavioral Verilog - Interassignment Delay  Key idea: unlike blocking delay, RHS is evaluated before delay.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
Design Synopsys System Verilog API Donations to Accellera João Geada.
Tasks and Functions Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar Gudarzi.
Introduction to C++ - How C++ Evolved Most popular languages currently: COBOL, Fortran, C, C++, Java (script) C was developed in 1970s at AT&T (Richie)
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction.
Chap. 3 Basic Concepts. 2 Basic Concepts Lexical Conventions Data Types System Tasks and Compiler Directives Summary.
Digital System Design Verilog ® HDL Basic Concepts Maziar Goudarzi.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Chapter 9 Formatted Input/Output. Objectives In this chapter, you will learn: –To understand input and output streams. –To be able to use all print formatting.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Chapter 6: User-Defined Functions
Verilog Language Concepts
Introduction to Programming Using C Modularity. 2 Contents Modularity Functions Preprocessor Comments Global variables.
Introduction to Computer Programming Using C Session 23 - Review.
Programming Fundamentals. Today’s Lecture Why do we need Object Oriented Language C++ and C Basics of a typical C++ Environment Basic Program Construction.
1 Programming in C Hello World! Soon I will control the world! Soon I will control the world!
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.
Module 1.3 Verilog Basics UNIT 1 : Introduction to Verilog Data Types.
Digital System Design Verilog ® HDL Parameters, and Generate Blocks Maziar Goudarzi.
C Language: Introduction
PHYS 2020 Basic C An introduction to writing simple but useful programs in C In these lectures I will take you through the basics of C, but you will need.
System Tasks for File Output & Strobing 1. Introduction There are tasks and functions that are used to generate input and output during simulation. Their.
Chapter 2 part #1 C++ Program Structure
Using Simulator With Undertow Suite. Source environment variables For example, envsource has all the environment variables set up. You can change the.
1 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Input and Output.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Computer Programming A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.
Chapter1: Introduction Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 1-1 Chapter 1: Introduction Prof. Ming-Bo.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
1 Lecture 7 Introduction to Shell Scripts COP 3353 Introduction to UNIX.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Structural Description
Programming what is C++
Topic Pre-processor cout To output a message.
Publisher: Prentice Hall PTR Pub Date: February 21, 2003 ISBN:
Verilog® HDL -Parameters -Strings -System tasks
Chapter 7 Text Input/Output Objectives
Chapter 13 - The Preprocessor
Verilog-HDL-3 by Dr. Amin Danial Asham.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
File Handling Programming Guides.
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Introduction to Digital System and Microprocessor Design
Introduction to Digital IC Design
Introduction to C Programming
Presentation transcript:

MODULE 1.3 VERILOG BASICS UNIT 1 : INTRODUCTION TO VERILOG TOPIC : System Tasks and Compiler directive

What are System Tasks? Verilog provides standard system tasks to do certain routine operations. All system tasks appear in the form $. Operations such as displaying on the screen, monitoring values of nets, stopping, and finishing are done by system tasks. We will discuss only the most useful system tasks.

$ Display $display is the main system task for displaying values of variables or strings or expressions. This is one of the most useful tasks in Verilog. Usage: $display(pl, p2, p3,....., pn); pl, p2, p3,..., pn can be quoted strings or variables or expressions. The format of $display is very similar to printf in C. A $display inserts a newline at the end of the string by default.

$Display printing option

$display Example //Display the string in quotes $display("Hello Verilog World"); -- Hello Verilog World //Display value of current simulation time 230 $display ($time) ; //Display value of 41-bit virtual address lfe c and time 200 reg [0:40] virtual-addr; $display("At time %d virtual address is %h”, $time, virtual-addr); -- At time 200 virtual address is lfe c

$monitor Verilog provides a mechanism to monitor a signal when its value changes. This facility is provided by the $monitor task. Usage: $monitor(p 1,p 2,p 3,...., p n ); // The parameters pl, p2,..., pn can be variables, signal names, or quoted strings. A format similar to the $display task is used in the $monitor task. $monitor continuously monitors the values of the variables or signals specified in the parameter list and displays all parameters in the list whenever the value of any one variable or signal changes. Unlike $display, $monitor needs to be invoked only once.

$monitor Only one monitoring list can be active at a time. If there is more than one $monitor statement in your simulation, the last $monitor statement will be the active statement. The earlier $monitor statements will be overridden. Usage : //Monitor time and value of the signals clock and reset //Clock toggles every 5 time units and reset goes down at 10 time units initial begin $monitor($time, “ Value of signals clock = %b reset = %b", clock, reset) ; end Partial output of the monitor statement: -- 0 Value of signals clock = 0 reset = Value of signals clock = 1 reset = Value of signals clock = 0 reset = 0

Stopping and finishing in a simulation The task $stop is provided to stop during a simulation. Usage: $stop; The $stop task puts the simulation in an interactive mode. The $finish task terminates the simulation. Usage: $finish;

Compiler Directives Compiler directives are provided in Verilog. All compiler directives are defined by using the ' construct. We deal with the two most useful compiler directives:  'define  ‘include

‘define The 'define directive is used to define text macros in Verilog. This is similar to the #define construct in C. Usage : //define a text macro that defines default word size //Used as 'WORD-SIZE in the code 'define WORD-SIZE 32

‘include The 'include directive allows you to include entire contents of a Verilog source file in another Verilog file during compilation. This works similarly to the #include in the C programming language. Usage : // Include the file header.v, which contains declarations in the main verilog file design.v. 'include header.v... …