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

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

Verilog HDL. Lecture #6. Madhu Mutyam Dept. of Computer Science and Engineering Indian Institute of Technology, Madras

Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm. Lecture 3

Verilog HDL. Gate-Level Modeling

VERILOG. Deepjyoti Borah, Diwahar Jawahar

Blocking(=) vs Nonblocking (<=) Assignment. Lecture 3: Modeling Sequential Logic in Verilog HDL. Procedural assignments

Chap 3. Modeling structure & basic concept of Verilog HDL

Digital System Design Verilog-Part III. Amir Masoud Gharehbaghi

ARM 64-bit Register File

ECE 4514 Digital Design II. Spring Lecture 9: Review of Key Ideas, System Commands and Testbenches

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

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

Synthesizable Verilog

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 11. Introduction to Verilog II Sequential Circuits

ECE 4514 Digital Design II. Spring Lecture 13: Logic Synthesis

Sequential Logic Blocks

register:a group of binary cells suitable for holding binary information flip-flops + gates

Post-Synthesis Simulation. VITAL Models, SDF Files, Timing Simulation

EN164: Design of Computing Systems Lecture 06: Lab Foundations / Verilog 2

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

Modeling Sequential Circuits in Verilog

Introduction. Purpose. Intended Audience. Conventions. Close

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

Don t expect to be able to write and debug your code during the lab session.

Introduction. Why Use HDL? Simulation output. Explanation

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

Hardware Description Languages (HDLs) Verilog

Synthesis of Combinational and Sequential Circuits with Verilog

ECE 4514 Digital Design II. Spring Lecture 20: Timing Analysis and Timed Simulation

EN164: Design of Computing Systems Lecture 07: Lab Foundations / Verilog 3

Lecture 15: System Modeling and Verilog

Why Should I Learn This Language? VLSI HDL. Verilog-2

yamin/

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8

EECS150 - Digital Design Lecture 8 - Hardware Description Languages

VLSI Design 13. Introduction to Verilog

Online Verilog Resources

Spring 2017 EE 3613: Computer Organization Chapter 5: Processor: Datapath & Control - 2 Verilog Tutorial

Lab 7 (All Sections) Prelab: Introduction to Verilog

Quick Introduction to SystemVerilog: Sequental Logic

The University of Alabama in Huntsville ECE Department CPE Final Exam April 28, 2016

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

RTL Design (Using ASM/SM Chart)

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

Chapter 5: Tasks, Functions, and UDPs

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

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

ENGN1640: Design of Computing Systems Topic 02: Lab Foundations

Introduction To HDL. Verilog HDL. Debdeep Mukhopadhyay Dept of CSE, IIT Madras 1

Schematic design. Gate level design. 0 EDA (Electronic Design Assistance) 0 Classical design. 0 Computer based language

Lecture 3. Behavioral Modeling Sequential Circuits. Registers Counters Finite State Machines

Lab 7 (Sections 300, 301 and 302) Prelab: Introduction to Verilog

Nikhil Gupta. FPGA Challenge Takneek 2012

CSE 2021 Computer Organization. The Basics of Logic Design

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

ECE UMass, Amherst. Verilog tutorial

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages

Register Transfer Level in Verilog: Part I

Last Lecture: Divide by 3 FSM

Amrita Vishwa Vidyapeetham. EC429 VLSI System Design Answer Key

Two hours - online EXAM PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

EECS150 - Digital Design Lecture 10 Logic Synthesis

Digital Design with FPGAs. By Neeraj Kulkarni

Verilog Tutorial (Structure, Test)

EECS 151/251A: SRPING 2017 MIDTERM 1

CSE 591: Advanced Hardware Design and Verification (2012 Spring) LAB #0

VHDL VS VERILOG.


Lecture #2: Verilog HDL

Introduction to Digital Design with Verilog HDL

Verilog Hardware Description Language ROOM: B405

L5: Simple Sequential Circuits and Verilog

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

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Chap 6 Introduction to HDL (d)

Digital Design with SystemVerilog

DIGITAL SYSTEM DESIGN

Introduction to Verilog HDL. Verilog 1

Problem Set 2 Solutions

EECS150, Fall 2004, Midterm 1, Prof. Culler. Problem 1 (15 points) 1.a. Circle the gate-level circuits that DO NOT implement a Boolean AND function.

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

14. Introducton to Verilog

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

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2016

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

EEL 4783: HDL in Digital System Design

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

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

Behavioral Modeling and Timing Constraints

EECS 3201: Digital Logic Design Lecture 4. Ihab Amer, PhD, SMIEEE, P.Eng.

Verilog Tutorial. Introduction. T. A.: Hsueh-Yi Lin. 2008/3/12 VLSI Digital Signal Processing 2

14. Introducton to Verilog

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

Module 4. Design of Embedded Processors. Version 2 EE IIT, Kharagpur 1

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

Sequential Logic Design

Transcription:

ECE 4514 Digital Design II Spring 2007

Abstraction in Hardware Design Remember from last lecture that HDLs offer a textual description of a netlist. Through abstraction in the HDL, we can capture more than a single transistor or gate at a time. Similar to a function call in C that abstracts a large collection of expressions Similar to a Lego castle that abstracts a large collection of Lego bricks Verilog offers three types of abstraction Structural Dataflow Behavioral These two are related, we call both of them just 'behavioral' for now

Structural Modeling Describe a module in terms of components R QB S Q Netlist two modules: NAND_1 and NAND_2 net 1: Rbar to NAND_1, input_1 net 2: Sbar to NAND_2, input_2 net 3: NAND_1, output_1 to NAND_2, input_1 etc..

Behavioral Modeling Describe a module in terms of input-output behavior input S, R; output Q, QB; if ( S == 1 ) and (R == 0 ) then Set Q to 1, set QB to 0 else if ( S == 1 ) and (R == 1 ) then Set Q to 1, set QB to 1 else if ( S == 0 ) and (R == 0 ) then *Hold current state* else if ( S == 0 ) and (R == 1 ) then Set Q to 0, set QB to 1

Behavioral and Structural are dual mechanisms Rbar Sbar my_flop Q Qbar Structural Description explains what happens to Q and Qbar in terms of a netlist of lower-level components Behavioral Description explains what happens to Q and Qbar in terms of Rbar and Sbar

Structural and Behavioral are related A model can be expressed as behavior or structure (of lower-level models) Level 1 Rbar Sbar my_flop Q Qbar Level 2 Rbar Sbar NAND NAND Q Qbar

Top-down design my_pc motherboard Start here, rewrite behavior into structure until you reach primitive behavior harddisk controller cpu memory io controller integer unit cache regfile ALU shifter NAND NOR Leaf Cells of Primitive Behavior

Bottom-up design my_pc motherboard Equivalent Top-level Behavior harddisk controller cpu memory io controller integer unit cache regfile ALU shifter NAND NOR Start here, compose structure into larger modules until you reach equivalent top-level behavior

Bottom-up, Top-down are both useful When re-using modules from one design to the next: bottom-up When developing new modules from scratch: top-down In practice, top-down and bottom-up techniques are combined. In Verilog, a given module can be expressed as structure or else as behavior. There are two flavors of 'behavior' in Verilog Behavioral: similar to a sequential description in C Dataflow: a collection of concurrent expressions

Example of a hierarchical model 4-bit counter q0 q1 q2 q3 T-ff T-ff T-ff T-ff q q q q reset Top-level structure contains 4 interconnected T flip-flops

T flip-flop, behavior clk T-ff q reset Behavior can be captured in three rules: (1) (2) (3) at each negative clock edge: old_state = new_state any time you see a change on old_state: new_state = not old_state q = old_state any time you see a change on reset: new_state = 0

T flip-flop, structure T-ff q reset T-flipflop D D-ff q D-flipflop inverter Thus, we can build a 4-bit counter with inverters and D-flipflops reset

D flipflop in Verilog module D_FF(q, d, clk, reset); output q; input d, clk, reset; reg q; always @(posedge reset or negedge clk) if (reset) q <= 1'b0; else q <= d; endmodule

D flipflop in Verilog module D_FF(q, d, clk, reset); output q; input d, clk, reset; reg q; one output port, three input ports 'reg' means that q is a variable always @(posedge reset or negedge clk) if (reset) always @(condition) means: whenever q <= 1'b0; (condition) is true, proceed. else q <= d; endmodule The '<=' is called a dataflow assignment, in this case the effect is similar to assigning d to q This is a behavioral description in dataflow format

T flipflop in Verilog module T_FF(q, clk, reset); output q; input clk, reset; wire d; D_FF dff0(q, d, clk, reset); not n1(d, q); endmodule

T flipflop in Verilog module T_FF(q, clk, reset); output q; input clk, reset; wire d; D_FF dff0(q, d, clk, reset); not n1(d, q); endmodule connect corresponding terminals of module module D_FF(q, d, clk, reset);

T flipflop in Verilog module T_FF(q, clk, reset); output q; input clk, reset; wire d; one output port, two input ports a wire d has no storage: its value is always determined in terms of other variables D_FF dff0(q, d, clk, reset); not n1(d, q); endmodule 'not' is a primitive in Verilog: the simulator understands what this module does. This is a structural description

4-bit counter in Verilog module ripple_carry_counter(q, clk, reset); output [3:0] q; input clk, reset; T_FF tff0(q[0], clk, reset); T_FF tff1(q[1], q[0], reset); T_FF tff2(q[2], q[1], reset); T_FF tff3(q[3], q[2], reset); endmodule

4-bit counter in Verilog module ripple_carry_counter(q, clk, reset); output [3:0] q; four output ports, two input ports input clk, reset; T_FF tff0(q[0], clk, reset); T_FF tff1(q[1], q[0], reset); T_FF tff2(q[2], q[1], reset); T_FF tff3(q[3], q[2], reset); endmodule This is a structural description

Simulation In order to test the 4-bit counter, we need a clock signal and a reset signal. We also need to monitor the counter's output. These activities can be implemented in a testbench. ripple_carry_counter some behavioral code clk reset q[0:3] clk reset q[0:3]

Testbench module stimulus; reg clk; reg reset; wire [3:0] q; ripple_carry_counter(q, clk,reset); initial clk = 1'b0; always #5 clk = ~clk; initial begin reset = 1'b1; #15 reset = 1'b0; #180 reset = 1'b1; #10 reset = 1'b0; #20 $finish; end initial $monitor($time, " Output q = %d", q); endmodule

Testbench module stimulus; reg clk; reg reset; wire [3:0] q; ripple_carry_counter(q, clk,reset); initial clk = 1'b0; always #5 clk = ~clk; when simulation starts, clk is low each 5 time units, clk will flip value initial begin reset = 1'b1; #15 reset = 1'b0; #180 reset = 1'b1; #10 reset = 1'b0; #20 $finish; end when simulation starts, reset is high. after 15 time units, reset is low. after 180 time units, reset is high. after 10 time units, reset is low. after 20 time units, stop simulation. initial $monitor($time, " Output q = %d", q); endmodule each time q changes, print its value

Modelsim

Summary Behavioral and Structural Modeling are two complementary forms for Hardware Description They are linked with top-down (behavior into structure) or bottom-up (structure into behavior) design 4-bit counter as an example of bottom-up design Check design files on Blackboard