Module 2.1 Gate-Level/Structural Modeling. UNIT 2: Modeling in Verilog

Similar documents
P-1/26. Samir Palnitkar. Prentice-Hall, Inc. INSTRUCTOR : CHING-LUNG SU.

Chap 6 Introduction to HDL (d)

Hardware Description Languages (HDLs) Verilog

Mridula Allani Fall Fall

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Chap 3. Modeling structure & basic concept of Verilog HDL

Tutorial on Verilog HDL

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages

Verilog Tutorial (Structure, Test)

VeriLogger Tutorial: Basic Verilog Simulation

FPGA Design Challenge Techkriti Digital Logic Design using Verilog Part 2 By Neeraj Kulkarni

ECEN 468 Advanced Digital System Design

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed.

DIGITAL SYSTEM DESIGN

Course Topics - Outline

Introduction to Verilog

Nikhil Gupta. FPGA Challenge Takneek 2012

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

Lab #1. Topics. 3. Introduction to Verilog 2/8/ Programmable logic. 2. Design Flow. 3. Verilog --- A Hardware Description Language

HDL for Combinational Circuits. ENEL211 Digital Technology

Digital Design with FPGAs. By Neeraj Kulkarni

ECE 4514 Digital Design II. Spring Lecture 3: Verilog Bread and Butter

Chapter 6: Hierarchical Structural Modeling

Introduction to Verilog

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

Design Using Verilog

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016

ENGN1640: Design of Computing Systems Topic 02: Design/Lab Foundations

EECS150 - Digital Design Lecture 10 Logic Synthesis

Verilog HDL. Gate-Level Modeling

EECS150 - Digital Design Lecture 10 Logic Synthesis

Verilog HDL [As per Choice Based Credit System (CBCS) scheme]

Concurrent Signal Assignment Statements (CSAs)

CSE140L: Components and Design Techniques for Digital Systems Lab

CSE140L: Components and Design

Digital Circuits and Systems NOC, Spring 2015 Quiz 6 Solutions

Speaker: Shao-Wei Feng Adviser: Prof. An-Yeu Wu Date: 2010/09/28

Chapter 5: Tasks, Functions, and UDPs

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Instructions on creating CTL files for PAL pin placement

EE261: Intro to Digital Design

ECE 152A LABORATORY 2

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification

ECE 4514 Digital Design II. Spring Lecture 2: Hierarchical Design

101-1 Under-Graduate Project Digital IC Design Flow

Digital System Design Verilog-Part III. Amir Masoud Gharehbaghi

VHDL Structural Modeling II

ENGN1640: Design of Computing Systems Topic 02: Design/Lab Foundations

ECE 353 Lab 3 (Verilog Design Approach)

EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE

Hardware description languages

ENGN1640: Design of Computing Systems Topic 02: Lab Foundations

EEL 4783: HDL in Digital System Design

Combinational Logic Design with Verilog. ECE 152A Winter 2012

Computer Aided Design Basic Syntax Gate Level Modeling Behavioral Modeling. Verilog

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

2/14/2016. Hardware Synthesis. Midia Reshadi. CE Department. Entities, Architectures, and Coding.

ECE UMass, Amherst. Verilog tutorial

תכן חומרה בשפת VERILOG הפקולטה להנדסה

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

AN INTRODUCTION TO VERILOG HDL

DIGITAL SYSTEM DESIGN

A Verilog Primer. An Overview of Verilog for Digital Design and Simulation

Verilog Design Principles

Last Lecture: Adder Examples

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

EECS 427 Lecture 14: Verilog HDL Reading: Many handouts/references. EECS 427 W07 Lecture 14 1

Hardware Description Language VHDL (1) Introduction

N-input EX-NOR gate. N-output inverter. N-input NOR gate

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb UMass Amherst Fall 2017

Introduction to Verilog HDL

MODELING LANGUAGES AND ABSTRACT MODELS. Giovanni De Micheli Stanford University. Chapter 3 in book, please read it.

Chapter 2 Using Hardware Description Language Verilog. Overview

Introduction to Digital Design with Verilog HDL

VHDL VS VERILOG.

Verilog Behavioral Modeling

CAD for VLSI Design - I. Lecture 21 V. Kamakoti and Shankar Balachandran

Modules, ports, instantiation

Verilog Design Principles

Declarations of Components and Entities are similar Components are virtual design entities entity OR_3 is

SYSTEM SPECIFICATIONS USING VERILOG HDL. Dr. Mohammed M. Farag

Topics. Midterm Finish Chapter 7

Verilog for Combinational Circuits

Under-Graduate Project Logic Design with Behavioral Models

14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages

Lab. Course Goals. Topics. What is VLSI design? What is an integrated circuit? VLSI Design Cycle. VLSI Design Automation

Course Topics - Outline

Chapter 2a: Structural Modeling

C-Based Hardware Design

Lecture 38 VHDL Description: Addition of Two [5 5] Matrices

Hardware Description Language (HDL)

Building hierarchical designs in Verilog

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

VLSI Design 13. Introduction to Verilog

6.111 Lecture # 5. Entity section describes input and output. VHDL: Very High speed integrated circuit Description Language:

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

Tutorial 4 HDL. Outline VHDL PROCESS. Modeling Combinational Logic. Structural Description Instantiation and Interconnection Hierarchy

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis

Transcription:

Module 2.1 Gate-Level/Structural Modeling UNIT 2: Modeling in Verilog

Module in Verilog A module definition always begins with the keyword module. The module name, port list, port declarations, and optional parameters must come first in a module definition. Port list and port declarations are present only if the module has any ports to interact with the external environment. The five components within a module are variable declarations, dataflow statements, instantiation of lower modules, behavioral blocks, and tasks or functions. These components can be in any order and at any place in the module definition. The endmodule statement must always come last in a module definition. All components except module, module name, and endmodule are optional and can be mixed and matched as per design needs. Verilog allows multiple modules to be defined in a single file. The modules can be defined in any order in the file.

PORTS A module definition contains an optional list of ports. (If the module does not exchange any signals with the environment, there are no ports in the list). Consider a 4-bit full adder that is instantiated inside a top-level module Top. The module fulladd4 takes input on ports a, b, and c_in and produces an output on ports sum and c_out. I/O Ports for Top and Full Adder module fulladd4(sum, c_out, a, b, c_in); //module with a list of ports module Top; / / No list of ports, top-level module in simulation

Port Declaration Each port in the port list is defined as input, output, or inout, based on the direction of the port signal. module fulladd4(sum, c_out, a, b, c_in); //Begin port declarations section output [3 : 0] sum; output c_out; input [3:0] a, b; input c_in; //End port declarations section <module internals> endmodule

Wire and Reg Note that all port declarations are implicitly declared as wire in Verilog. If a port is intended to be a wire, it is sufficient to declare it as output, input, or inout. Input or inout ports are normally declared as wires. However, if output ports hold their value, they must be declared as reg as shown below: module DFF(q, d, clk, reset) ; output q; reg q; // Output port q holds value; therefore it is declared as reg input d, clk, reset; endmodule NOTE : Ports of the type input and inout cannot be declared as reg

Port Connection Rules There are two methods of making connections between signals specified in the module instantiation and the ports in a module definition. Connecting by ordered list : It is the most intuitive method for most beginners. The signals to be connected must appear in the module instantiation in the same order as the ports in the port list in the module definition.

Connecting by ordered list module Top; //Declare connection variables reg [3:O]A,B; reg C-IN; wire [3:0] SUM; wire C_OUT; //Instantiate fulladd4, call it fa_ordered. //Signals are connected to ports in order (by position) fulladd4 fa-ordered(sum, C_OUT, A, B, C_IN); <stimulus> endmodule module fulladd4 (sum, c_out, a, b, c_in) ; output [3 : 0] sum; output c_cout; input [ 3 : 0 ] a, b; input c_in; <module internals> endmodule

Connecting ports by name For large designs where modules have, say, 50 ports, remembering the order of the ports in the module definition is impractical and error prone. Verilog provides the capability to connect external signals to ports by the port names, rather than by position.

Connecting ports by name Another advantage of connecting ports by name is that as long as the port name is not changed, the order of ports in the port list of a module can be rearranged without changing the port connections in module instantiations. / / Instantiate module fa-byname and connect signals to ports by name fulladd4 fa-byname(.c_out(c_out),.sum(sum),.b(b),.c-in(c_in),.a(a), ) ; If the port c-out were to be kept unconnected, the instantiation of filladd4 would look as follows: / / Instantiate module fa-byname and connect signals to ports by name fulladd4 fa-byname(. sum(sum),. b (B),.c_in (C_IN),.a (A), ) ;