Designing with Verilog

Slides:



Advertisements
Similar presentations
The Verilog Hardware Description Language
Advertisements

EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Combinational Logic.
ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 07: Verilog (3/3) Prof. Sherief Reda Division of.
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
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.
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
Pulse-Width Modulated DAC
1/27/06EECS150 Lab Lecture #21 Designing with Verilog EECS150 Spring 2006 – Lab Lecture #2 Brian Gawalt Greg Gibeling.
Useful Things to Know Norm. Administrative Midterm Grading Finished –Stats on course homepage –Pickup after this lab lec. –Regrade requests within 1wk.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
9/5/2008EECS150 Lab Lecture #21 Designing with Verilog EECS150 Fall Lab Lecture #2 Chen Sun Adopted from slides designed by Greg Gibeling.
2/9/2007EECS150 Lab Lecture #41 Debugging EECS150 Spring2007 – Lab Lecture #4 Laura Pelton Greg Gibeling.
ECEN ECEN475 Introduction to VLSI System Design Verilog HDL.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 4 - Advanced Verilog.
ELEN 468 Advanced Logic Design
Digital System Design Verilog ® HDL Modules and Ports Maziar Goudarzi.
D Flip-Flops in Verilog Discussion 10.3 Example 27.
02/10/06EECS150 Lab Lecture #41 Debugging EECS150 Spring 2006 – Lab Lecture #4 Philip Godoy Greg Gibeling.
Chap. 2 Hierarchical Modeling Concepts. 2 Hierarchical Modeling Concepts Design Methodologies 4-bit Ripple Carry Counter Modules Instances Components.
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.
Module 1.2 Introduction to Verilog
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example, Modeling Flip-Flops Spring.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Chap. 4 Modules and Ports. 2 Modules and Ports Modules Ports Hierarchical Names Summary.
Brief Verilog.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to ASIC flow and Verilog HDL
M.Mohajjel. Objectives Learn How to write synthesizable Verilog code Common mistakes and how to avoid them What is synthesized for what we code Digital.
2/3/2006EECS150 Lab Lecture #31 Implementation of FSMs EECS150 Spring 2006 – Lab Lecture #3 Guang Yang Greg Gibeling.
2/2/07EECS150 Lab Lecture #31 Verilog Synthesis & FSMs EECS150 Spring 2007 – Lab Lecture #3 Brent Mochizuki Greg Gibeling.
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 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
Lecture 10 Flip-Flops/Latches
Supplement on Verilog FF circuit examples
Verilog-HDL Reference: Verilog HDL: a guide to digital design and synthesis, Palnitkar, Samir Some of slides in this lecture are supported by Prof. An-Yeu.
Last Lecture Talked about combinational logic always statements. e.g.,
CSE241A VLSI Digital Circuits Winter 2003 Recitation 2
Discussion 2: More to discuss
Verilog Introduction Fall
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
‘if-else’ & ‘case’ Statements
Hardware Description Languages: Verilog
Hardware Description Languages
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Topics The logic design process..
Hardware Description Language
SYNTHESIS OF SEQUENTIAL LOGIC
Logic Analyzers EECS150 Fall Lab Lecture #5 Arjun Singh
332:437 Lecture 8 Verilog and Finite State Machines
EECS150 Fall 2007 – Lab Lecture #4 Shah Bawany
Debugging EECS150 Fall Lab Lecture #4 Sarah Swisher
The Verilog Hardware Description Language
Verilog-HDL Reference: Verilog HDL: a guide to digital design and synthesis, Palnitkar, Samir Some of slides in this lecture are supported by Prof. An-Yeu.
Debugging EECS150 Fall Lab Lecture #4 Sarah Swisher
The Verilog Hardware Description Language
Logic Analyzers EECS150 Fall Lab Lecture #5 Arjun Singh
Verilog Synthesis & FSMs
332:437 Lecture 8 Verilog and Finite State Machines
Introduction to Digital IC Design
Presentation transcript:

Designing with Verilog EECS150 Fall 2007 – Lab Lecture #2 Shauki Elassaad Thanks to Young Lee, Greg Gibeling 2/23/2019 EECS150 Lab Lecture #2

Today Hierarchical Design Methodology Top-Down and Bottom-Up Partitioning & Interfaces Behavioral vs. Structural Verilog Administrative Info Blocking and Non-Blocking Verilog and Hardware Lab #2 Primitives 2/23/2019 EECS150 Lab Lecture #2

Hierarchical Design Methodology Divide and conquer approach More efficient interms of design productivity. Hierarchy helps in management of large designs. Hierarchy allows for design collaboration. Design is broken to different modules. Each designer is responsible of a set of modules 2/23/2019 EECS150 Lab Lecture #2

Top-Down vs. Bottom-Up (1) Top-Down Design Think of the top-level picture of the project Identify main components/modules Think of inter-module communication Do not get bugged down with details 2/23/2019 EECS150 Lab Lecture #2

Top-Down vs. Bottom-Up (2) Top-Down Design Ends here: 2/23/2019 EECS150 Lab Lecture #2

Top-Down vs. Bottom-Up (3) Bottom-Up Testing Faster, Easier and Cheaper Test each little component thoroughly Allows you to easily replicate working components 2/23/2019 EECS150 Lab Lecture #2

Partitioning & Interfaces (1) Break design into independent modules Decide what modules make sense This is crucial for successful implementation and management of your design. Think of functional components when deciding on module boundaries. Each module should be: A reasonable size Independently testable Successful partitioning allows easier collaboration on a large project 2/23/2019 EECS150 Lab Lecture #2

Partitioning & Interfaces (2) How different partitions talk to one another A concise definition of signals and timing Timing is vital, do NOT omit it Must be clean Don’t send useless signals across Bad partitioning might hinder this An interface is a contract Lets other people use/reuse your module 2/23/2019 EECS150 Lab Lecture #2

Behavioral vs Structural (1) Behavioral description describes functionality of design. It is independent of implementation. There is a one-to-many mapping between a behavioral module and a structural module. Structural description defines and decides on an implementation of a module. Here we map the design to actual cells/gates. 2/23/2019 EECS150 Lab Lecture #2

Behavioral vs. Structural (2) Rule of thumb: Behavioral doesn’t have sub-components Structural has sub-components: Instantiated Modules Instantiated Gates Instantiated Primitives Most modules are mixed Obviously this is the most flexible 2/23/2019 EECS150 Lab Lecture #2

Behavioral vs. Structural (2) 2/23/2019 EECS150 Lab Lecture #2

Behavioral vs. Structural (3) 2/23/2019 EECS150 Lab Lecture #2

Administrative Info Lab Grading Get it in by the opening of the next lab Partial credit will be given for incomplete labs Card Key Access for All is coming soon! Start looking for partners! 2/23/2019 EECS150 Lab Lecture #2

Blocking vs. Non-Blocking (1) Verilog Fragment Result always @ (a) begin b = a; c = b; end C = B = A A-----B-------C B = Old A C = Old B always @ (posedge Clock) begin b <= a; c <= b; end B D Q C A Clock 2/23/2019 EECS150 Lab Lecture #2

Blocking vs. Non-Blocking (2) Use Non-Blocking for FlipFlop Inference posedge/negedge require Non-Blocking Else simulation and synthesis wont match 2/23/2019 EECS150 Lab Lecture #2

Blocking vs. Non-Blocking (3) If you use blocking for FlipFlops: YOU WILL NOT GET WHAT YOU WANT! always @ (posedge Clock) begin b = a; // b will go away c = b; // c will be a FlipFlop end // b isn’t needed at all always @ (posedge Clock) begin c = b; // c will be a FlipFlop b = a; // b will be a FlipFlop end 2/23/2019 EECS150 Lab Lecture #2

Blocking vs. Non-Blocking (4) Race Conditions file xyz.v: module XYZ(A, B, Clock); input B, Clock; output A; reg A; always @ (posedge Clock) A = B; endmodule file abc.v: module ABC(B, C, Clock); input C, Clock; output B; reg B; always @ (posedge Clock) B = C; endmodule THIS IS WRONG 2/23/2019 EECS150 Lab Lecture #2

Blocking vs. Non-Blocking (5) Race Conditions file xyz.v: module XYZ(A, B, Clock); input B, Clock; output A; reg A; always @ (posedge Clock) A <= B; endmodule file abc.v: module ABC(B, C, Clock); input C, Clock; output B; reg B; always @ (posedge Clock) B <= C; endmodule THIS IS CORRECT 2/23/2019 EECS150 Lab Lecture #2

Verilog and Hardware (1) assign Sum = A + B; reg [1:0] Sum; always @ (A or B) begin Sum = A + B; end 2/23/2019 EECS150 Lab Lecture #2

Verilog and Hardware (2) assign Out = Select ? A : B; reg [1:0] Out; always @ (Select or A or B) begin if (Select) Out = A; else Out = B; end 2/23/2019 EECS150 Lab Lecture #2

Verilog and Hardware (3) assign Out = Sub ? (A-B) : (A+B); reg [1:0] Out; always @ (Sub or A or B) begin if (Sub) Out = A - B; else Out = A + B; end 2/23/2019 EECS150 Lab Lecture #2

Verilog and Hardware (4) reg [1:0] Out; always @ (posedge Clock) begin if (Reset) Out <= 2’b00; else Out <= In; end 2/23/2019 EECS150 Lab Lecture #2

Lab #2 (1) Lab2Top Accumulator Peak Detector Stores sum of all inputs Written in behavioral verilog Same function as Lab1Circuit Peak Detector Stores largest of all inputs Written in structural verilog 2/23/2019 EECS150 Lab Lecture #2

Lab #2 (2) 2/23/2019 EECS150 Lab Lecture #2

Lab #2 (3) Accumulator.v 2/23/2019 EECS150 Lab Lecture #2

Lab #2 (4) PeakDetector.v 2/23/2019 EECS150 Lab Lecture #2

Primitives (1) wire SIntermediate, SFinal, CPropagrate, CGenerate; xor xor1( SIntermediate, In, Out); and and1( CGenerate, In, Out); xor xor2( SFinal, SIntermediate, CIn); and and2( CPropagate, In, CIn); or or1( COut, CGenerate, CPropagate); FDCE FF( .Q( Out), .C( Clock), .CE( Enable), .CLR( Reset), .D( SFinal)); 2/23/2019 EECS150 Lab Lecture #2

Primitives (2) wire SIntermediate, SFinal, CPropagrate, CGenerate; xor xor1( SIntermediate, In, Out); and and1( CGenerate, In, Out); xor xor2( SFinal, SIntermediate, CIn); and and2( CPropagate, In, CIn); or or1( COut, CGenerate, CPropagate); FDCE FF( .Q( Out), .C( Clock), .CE( Enable), .CLR( Reset), .D( SFinal)); 2/23/2019 EECS150 Lab Lecture #2

Primitives (3) wire SIntermediate, SFinal, CPropagrate, CGenerate; xor xor1( SIntermediate, In, Out); and and1( CGenerate, In, Out); xor xor2( SFinal, SIntermediate, CIn); and and2( CPropagate, In, CIn); or or1( COut, CGenerate, CPropagate); FDCE FF( .Q( Out), .C( Clock), .CE( Enable), .CLR( Reset), .D( SFinal)); 2/23/2019 EECS150 Lab Lecture #2