1/27/06EECS150 Lab Lecture #21 Designing with Verilog EECS150 Spring 2006 – Lab Lecture #2 Brian Gawalt Greg Gibeling.

Slides:



Advertisements
Similar presentations
VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Advertisements

The Verilog Hardware Description Language
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Combinational Logic.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 07: Verilog (3/3) Prof. Sherief Reda Division of.
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.
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 8: Sequential Design Spring 2009 W. Rhett.
1 COMP541 Sequential Circuits Montek Singh Sep 17, 2014.
ECE 551 Digital System Design & Synthesis Lecture 09 Synthesis of Common Verilog Constructs.
CSE Spring Verilog for Sequential Systems - 1 Today: Verilog and Sequential Logic zFlip-flops yrepresentation of clocks - timing of state.
Spring 20067W. Rhett Davis with minor modifications by Dean Brock ECE 406 at UNASlide 1 ECE 406 Design of Complex Digital Systems Lecture 10: 9: State.
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
Pulse-Width Modulated DAC
Useful Things to Know Norm. Administrative Midterm Grading Finished –Stats on course homepage –Pickup after this lab lec. –Regrade requests within 1wk.
ELEN 468 Lecture 81 ELEN 468 Advanced Logic Design Lecture 8 Behavioral Descriptions II.
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
2/16/2007EECS150 Lab Lecture #51 Logic Analyzers EECS150 Spring 2007 – Lab Lecture #5 Shah Bawany.
2/17/2006EECS150 Lab Lecture #51 Logic Analyzers EECS150 Spring 2006 – Lab Lecture #5 David Lin Greg Gibeling.
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.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 4 - Advanced Verilog.
ELEN 468 Advanced Logic Design
From Design to Verilog EECS150 Fall Lecture #4
Advanced Verilog EECS 270 v10/23/06.
Digital System Design Verilog ® HDL Behavioral Modeling (1) 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.
Overview Logistics Last lecture Today HW5 due today
ECE 551 Digital System Design & Synthesis Lecture 11 Verilog Design for Synthesis.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example,
Sequential Logic in Verilog
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
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.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example, Modeling Flip-Flops Spring.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
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.
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.
Logic Synthesis assign z=a&b a b z What is Synthesis synthesis /sinth siss/ noun ( pl. syntheses /sinth seez/) 1 the combination of components to form.
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.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Overview Logistics Last lecture Today HW5 due today
Supplement on Verilog FF circuit examples
Verilog Introduction Fall
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
Designing with Verilog
Register-Transfer Level Components in Verilog
Debugging EECS150 Fall Lab Lecture #4 Sarah Swisher
Logic Analyzers EECS150 Fall Lab Lecture #5 Arjun Singh
Verilog Synthesis & FSMs
332:437 Lecture 8 Verilog and Finite State Machines
Presentation transcript:

1/27/06EECS150 Lab Lecture #21 Designing with Verilog EECS150 Spring 2006 – Lab Lecture #2 Brian Gawalt Greg Gibeling

1/27/06EECS150 Lab Lecture #22 Today Top-Down and Bottom-Up Partitioning & Interfaces Behavioral vs. Structural Verilog Administrative Info Blocking and Non-Blocking Verilog and Hardware Lab #2 Primitives

1/27/06EECS150 Lab Lecture #23 Top-Down vs. Bottom-Up (1) Top-Down Design Start by defining the project Then break it down Starts here:

1/27/06EECS150 Lab Lecture #24 Top-Down vs. Bottom-Up (2) Top-Down Design Ends here:

1/27/06EECS150 Lab Lecture #25 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

1/27/06EECS150 Lab Lecture #26 Partitioning & Interfaces (1) Partitioning Break the large module up Decide what sub-modules make sense Partitioning is for your benefit It needs to make sense to you Each module should be: A reasonable size Independently testable Successful partitioning allows easier collaboration on a large project

1/27/06EECS150 Lab Lecture #27 Partitioning & Interfaces (2) Interfaces 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

1/27/06EECS150 Lab Lecture #28 Behavioral vs. Structural (1) 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

1/27/06EECS150 Lab Lecture #29 Behavioral vs. Structural (2)

1/27/06EECS150 Lab Lecture #210 Behavioral vs. Structural (3)

1/27/06EECS150 Lab Lecture #211 Administrative Info Lab Grading Get it in by the opening of the next lab Partial credit will be given for incomplete labs Please stick to one lab session Card Key Access for All is coming soon!

1/27/06EECS150 Lab Lecture #212 Blocking vs. Non-Blocking (1) (a) begin b = a; c = b; end (posedge Clock) begin b <= a; c <= b; end C = B = A B = Old A C = Old B Verilog FragmentResult

1/27/06EECS150 Lab Lecture #213 Blocking vs. Non-Blocking (2) Use Non-Blocking for FlipFlop Inference posedge/negedge require Non-Blocking Else simulation and synthesis wont match Use #1 to show causality (posedge Clock) begin b <= #1 a; c <= #1 b; end

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

1/27/06EECS150 Lab Lecture #215 Blocking vs. Non-Blocking (4) file xyz.v: module XYZ(A, B, Clock); inputB, Clock; outputA; regA; (posedge Clock) A = B; endmodule file abc.v: module ABC(B, C, Clock); inputC, Clock; outputB; regB; (posedge Clock) B = C; endmodule Race Conditions THIS IS WRONG

1/27/06EECS150 Lab Lecture #216 Blocking vs. Non-Blocking (5) file xyz.v: module XYZ(A, B, Clock); inputB, Clock; outputA; regA; (posedge Clock) A <= B; endmodule file abc.v: module ABC(B, C, Clock); inputC, Clock; outputB; regB; (posedge Clock) B <= C; endmodule Race Conditions THIS IS CORRECT

1/27/06EECS150 Lab Lecture #217 Verilog and Hardware (1) assign Sum = A + B; reg [1:0]Sum; (A or B) begin Sum = A + B; end

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

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

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

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

1/27/06EECS150 Lab Lecture #222 Lab #2 (2)

1/27/06EECS150 Lab Lecture #223 Lab #2 (3) Accumulator.v

1/27/06EECS150 Lab Lecture #224 Lab #2 (4) PeakDetector.v

1/27/06EECS150 Lab Lecture #225 Primitives (1) wireSIntermediate, SFinal, CPropagrate, CGenerate; xorxor1(SIntermediate,In,Out); andand1(CGenerate,In,Out); xorxor2(SFinal,SIntermediate,CIn); andand2(CPropagate,In,CIn); oror1(COut,CGenerate,CPropagate); FDCEFF(.Q(Out),.C(Clock),.CE(Enable),.CLR(Reset),.D(SFinal));

1/27/06EECS150 Lab Lecture #226 Primitives (2) wireSIntermediate, SFinal, CPropagrate, CGenerate; xorxor1(SIntermediate,In,Out); andand1(CGenerate,In,Out); xorxor2(SFinal,SIntermediate,CIn); andand2(CPropagate,In,CIn); oror1(COut,CGenerate,CPropagate); FDCEFF(.Q(Out),.C(Clock),.CE(Enable),.CLR(Reset),.D(SFinal));

1/27/06EECS150 Lab Lecture #227 Primitives (3) wireSIntermediate, SFinal, CPropagrate, CGenerate; xorxor1(SIntermediate,In,Out); andand1(CGenerate,In,Out); xorxor2(SFinal,SIntermediate,CIn); andand2(CPropagate,In,CIn); oror1(COut,CGenerate,CPropagate); FDCEFF(.Q(Out),.C(Clock),.CE(Enable),.CLR(Reset),.D(SFinal));