1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.

Slides:



Advertisements
Similar presentations
Simulation executable (simv)
Advertisements

The Verilog Hardware Description Language
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Synchronous Sequential Logic
Verilog Modules for Common Digital Functions
Verilog Intro: Part 1.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Originally designed to model and verify a design.
How to get a Circuit in verilog converted to hspice, connected to the micron package models, and simulating in hspice and hsimplus.
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.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
ECEN ECEN475 Introduction to VLSI System Design Verilog HDL.
Digital System Design Verilog ® HDL Modules and Ports Maziar Goudarzi.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
RTL Coding tips Lecture 7,8 Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock.
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
1 VERILOG Fundamentals Workshop סמסטר א ' תשע " ה מרצה : משה דורון הפקולטה להנדסה Workshop Objectives: Gain basic understanding of the essential concepts.
ECE 2372 Modern Digital System Design
Week Four Design & Simulation Example slides. Agenda Review the tiny example (Minako “logic”)from last week – look at the detailed static timing report.
Workshop Topics - Outline
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Verilog Language Concepts
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
CS 61C L4.2.2 Verilog II (1) K. Meinz, Summer 2004 © UCB CS61C : Machine Structures Lecture Verilog II Kurt Meinz inst.eecs.berkeley.edu/~cs61c.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
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.
Slide 1 6. VHDL/Verilog Behavioral Description. Slide 2 Verilog for Synthesis: Behavioral description Instead of instantiating components, describe them.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
Workshop Topics - Outline
Final Project. System Overview Description of Inputs reset: When LOW, a power on reset is performed. mode: When LOW, NORMal mode selected When HIGH,
Chap. 4 Modules and Ports. 2 Modules and Ports Modules Ports Hierarchical Names Summary.
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.
The Verilog Hardware Description Language. GUIDELINES How to write HDL code: How to write HDL code:
Digital System Design Verilog ® HDL Design at Structural Level Maziar Goudarzi.
Introduction to ASIC flow and Verilog HDL
 A test bench is an HDL program used for applying stimulus to an HDL design in order to test it and observe its response during simulation.  In addition.
Introduction to Verilog. Data Types A wire specifies a combinational signal. – Think of it as an actual wire. A reg (register) holds a value. – A reg.
Introduction to Verilog
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Slide 1 3.VHDL/Verilog Description Elements. Slide 2 To create a digital component, we start with…? The component’s interface signals Defined in MODULE.
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
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 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Structural Description
Hardware Description Languages: Verilog
An Introduction to Verilog: Transitioning from VHDL
Supplement on Verilog FF circuit examples
Discussion 2: More to discuss
Verilog Introduction Fall
Lecture 2 Supplement Verilog-01
Hardware Description Languages: Verilog
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Introduction to Verilog
The Verilog Hardware Description Language
Supplement on Verilog adder examples
The Verilog Hardware Description Language
The Verilog Hardware Description Language
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System Workshop 5 - Data types A Workshop 6 - Data types B Workshop 7 - Operators Workshop 8 - Signed arithmetic Workshop 9 - Behavioral modeling A Workshop 10 - Behavioral modeling B Workshop 11 - Behavioral modeling C Workshop 12 - Data flow modeling Workshop 13 - Coding Styles

2 Structural Hierarchy Description Style Module Port/Variable/Data Declarations Direct instantiation and connections of modules from a separate calling module - From the structural hierarchy of the design A module may be declared anywhere in a design relative to where it is called Signals in the higher “calling” module, are connected to signals in the lower “called” module by either: - Named association - Positional association

3 Module Port/Variable/Data Declarations Combined Variable Declaration and Initialization - Variables can be initialized when they are declared: reg clock = 0 ; // Replaces reg clock ; initial clock = 0 ; Combined Port/Data Declaration and Initialization: output reg [7:0] sum = 0 ; // can be written as sum = 8’b0 ; output reg co = 0 ; // can be written as co = 1’b0 ; Combined ANSI C Style Port Declaration and Initialization: module adder(output reg [7:0] sum = 0, output reg co = 0, input [7:0] a, b, input ci) ;

4 Module interconnections: Ports Within a Verilog system model, module interconnections occur at two levels:  Peer to peer: modules interconnect with each other: Module B Module A  Hierarchical: one module incorporates the other: Module A Module B

5 Module Ports Ports provide interface for the module to communicate with its environment. Declaration: ; Port direction can be input, output or inout (bi-directional). Example: // Traditional Verilog Syntax module my_module (in_port, inout_port, output_port) ; input [4:0] in_port ; // 5bits input port inout inout_port ; // single bit bi-directional port output wire (or reg) [14:0] out_port ; // 15bits output port endmodule // ANSI C Style Port Declarations Syntax module my_ module(input [4:0] in_port, inout inout_port, output wire (or reg) [14:0] out_port) ; endmodule

6 Port Specifications An input port specifies an internal name for a vector or scalar, driven by external entity. An output port specifies an internal name for a vector or scalar, driven by internal entity, available external to the module. An inout bi-directional port specifies an internal name for a vector or scalar driven either by an internal or external entity. Input or inout port cannot be declared as of type register. Port is always considered as net, unless declared elsewhere as reg (only for output port)

7 Correct Port Connection input inout output module net reg or net net

8 Module Instantiation - Port connections Ports of the instances could be connected by name or by order list. For small # of ports, connect by order list, else, by name. module fa_tb ; module FA4 (sum, cout, a, b, cin) ; reg [3:0] A, B ; output wire [3:0] sum ; reg CIN ; output wire cout ; wire [3:0] SUM ; input [3:0] a, b ; wire COUT ; input cin ; // Instantiate/connect by Positional association (order list): FA4 fa_byorder (SUM, COUT, A, B, CIN) ; // Instantiate/connect by Named association (port name): FA4 fa_byname (.cout(COUT),.sum(SUM),.b(B),.cin(CIN),.a(A)); endmodule | endmodule

9 Test Bench and UUT Instantiation Module Test Bench incorporates, hierarchically, the Unit Under Test (UUT) module Stimuli registers Monitor wires Unit Under Test inputs outputs wires wires, regs

10 D_FF Test Bench `include “D_FF.v" // include the UUT Verilog file for simulator parsing `timescale 1ns / 100ps /* compiler directive. sets simulation’s time unit and precision */ module D_FF_tb () ; reg Clk, Nrst, D ; // Stimuli signals wire Q ; // Monitor signal D_FF UUT(Clk, Nrst, D, Q) ; // instantiation of the D_FF (UUT) initial begin Clk = 1'b0 ; Nrst = 1'b0 ; D = 1'b0 ; // System monitoring function $monitor($time,"Clk=%b, Nrst=%b, D=%b, Q=%b",Clk, Nrst, D, Q) ; end always #1 Clk = ~Clk ; // Clock declaration, t oggle clock every half-cycle initial begin #2 Nrst = 1'b1 ; // Out of reset #2 D = 1'b1 ; #2 $finish ; // System function - end simulation run end endmodule

11 D_FF Simulation results

12 4bit Counter `timescale 1ns / 100ps // result evaluated every 1ns, 100ps resolution module cntr_4b (clk, nrst, dout) ; // module name and ports list input clk, nrst ; // input ports - clock and active-low reset output reg [3 : 0] dout ; // counter output port (posedge clk or negedge nrst) // if "or negedge nrst" deleted - synchronous reset begin if (!nrst) // Asynchronous reset dout = 4'b0 ; else // Out of reset - normal operation dout = dout + 1 ; // if -1, down counter end endmodule

13 4bit Counter Test Bench `include “cntr_4b.v“ // include the UUT Verilog file for simulator parsing `timescale 1ns / 100ps module cntr_4b_tb ; reg Clk, Nrst ; // System Clock and active-low Reset Stimuli signals wire [3:0] Dout ; // Counter Output Monitor cntr_4b UUT (Clk, Nrst, Dout) ; // instantiation of the 4bits Counter initial begin Clk = 1'b0 ; Nrst = 1'b0 ; // System monitoring function $monitor($time, "Clk=%b, Nrst=%b, Dout=%h", Clk, Nrst, Dout) ; end always #1 Clk = ~Clk ; // Clock declaration. Clock cycle time = 2nSec initial begin #2 Nrst = 1'b1 ;// Out of reset #35 $finish ;// System function - end simulation run end endmodule

14 4bit Counter Simulation results