COMP541 Hierarchical Design & Verilog

Slides:



Advertisements
Similar presentations
Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering.
Advertisements

Verilog.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Combinational Logic with Verilog Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
CMPT150, Ch 3, Tariq Nuruddin, Fall 06, SFU 1 Ch3. Combinatorial Logic Design Modern digital design involves a number of techniques and tools essential.
Combinational Circuits
1 COMP541 Combinational Logic and Design Montek Singh Jan 30, 2007.
1 COMP541 Combinational Logic and Design Montek Singh Jan 25, 2007.
ECE 353 Computer Systems Lab I Verilog Hardware Description Language.
CSE241 R1 Verilog.1Kahng & Cichy, UCSD ©2003 CSE241 VLSI Digital Circuits Winter 2003 Recitation 1: Verilog Introduction.
ECE 2372 Modern Digital System Design
1 COMP541 Hierarchical Design & Verilog Montek Singh Jan 28, 2010.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
1 COMP541 Verilog Primer Montek Singh Aug 28, 2015 (draft version  to be updated)
Module 1.2 Introduction to Verilog
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
1 COMP541 Hierarchical Design & Verilog Montek Singh Aug 29, 2014.
Verilog A Hardware Description Language (HDL ) is a machine readable and human readable language for describing hardware. Verilog and VHDL are HDLs.
EE 5900 Advanced Algorithms for Robust VLSI CAD, Spring 2009 Combinational Circuits.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to ASIC flow and Verilog HDL
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
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.
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,
Combinational Design, Part 2: Procedure. 2 Topics Positive vs. negative logic Design procedure.
1 A hardware description language is a computer language that is used to describe hardware. Two HDLs are widely used Verilog HDL VHDL (Very High Speed.
Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
ENG2410 Digital Design “Cont .. Combinational Logic Circuits”
Montek Singh Sep 16, 2016 (draft version  to be updated)
Discussion 2: More to discuss
EE2174: Digital Logic and Lab
PROPAGATION DELAY.
Structural style Modular design and hierarchy Part 1
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Topics The logic design process..
Introduction to Verilog
Behavioral Modeling in Verilog
Combinatorial Logic Design Practices
Week 5, Verilog & Full Adder
CSE221- Logic Design, Spring 2003 Logic Technology
Introduction to Verilog
Lecture 1.3 Hardware Description Languages (HDLs)
Levels in computer design
Chapter 3 – Combinational Logic Design
Hardware Descriptive Languages these notes are taken from Mano’s book
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Supplement on Verilog adder examples
Combinational Circuits
The Verilog Hardware Description Language
THE ECE 554 XILINX DESIGN PROCESS
Combinational Circuits
Digital Designs – What does it take
Introduction to Digital IC Design
THE ECE 554 XILINX DESIGN PROCESS
COE 202 Introduction to Verilog
Combinational Circuit Design
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

COMP541 Hierarchical Design & Verilog Montek Singh Jan 25, 2012

Topics Hierarchical Design Verilog Primer

Design Hierarchy Just like with large program, to design a large chip need hierarchy Divide and Conquer To create, test, and also to understand Block is equivalent to object

Example 9-input odd func (parity for byte) Block for schematic is box with labels

Design Broken Into Modules Use 3-input odd functions

Each Module uses XOR

Use NAND to Implement XOR In case there’s no XOR, for example

Design Hierarchy

Components in Design RHS shows what must be designed

Reuse is Common Certainly forced because of availability of components Shortens design times Now more flexibility with programmable logic But still reuse from libraries or intellectual property (IP) Example: buy a PCI design Open source, see www.opencores.org Note the many logic blocks available in Xilinx library

Replaces Generic Gates with ones available in Technology Library Flow of CAD System Replaces Generic Gates with ones available in Technology Library Generic Gates Netlist is description of connections

Technology Mapping Full custom Standard cell Gate arrays Pixel-Planes chips (machines in lobby) Memories, CPUs, etc Standard cell Library of cells Engineer determined interconnection Gate arrays Small circuits with interconnect

Hierarchy Example – 4-bit Equality Input: 2 vectors A(3:0) and B(3:0) Output: One bit, E, which is 1 if A and B are bitwise equal, 0 otherwise

Design Hierarchical design seems a good approach One module/bit Final module for E

Design for MX module Logic function is It is actually “not Equal” Can implement as

Design for ME module Final E is 1 only if all intermediate values are 0 So And a design is

Hierarchical Verilog We already saw example of instantiation when we used AND and OR gates Just use module name and an identifier for the particular instance

Vector of Wires (Bus) Denotes a set of wires input [1:0] S; Syntax is [a : b] where a is high-order So this could be “[0:1] S” Order will matter when we make assignments with values bigger than one bit Or when we connect sets of wires NOTE: THIS IS NOT AN ARRAY!

MX module mx(A, B, E); input A, B; output E; assign E = (~A & B) | (A & ~B); endmodule

ME module me(E, Ei); input [3:0] Ei; output E; assign E = ~(Ei[0] | Ei[1] | Ei[2] | Ei[3]); endmodule

Top Level module top(A, B, E); input [3:0] A; input [3:0] B; output E; wire [3:0] Ei; mx m0(A[0], B[0], Ei[0]); mx m1(A[1], B[1], Ei[1]); mx m2(A[2], B[2], Ei[2]); mx m3(A[3], B[3], Ei[3]); me me0(E, Ei); endmodule

Integrated Circuit Known as IC or chip Silicon containing circuit Later in semester we’ll examine design and construction Packaged in ceramic or plastic From 4-6 pins to hundreds Pins wired to pads on chip

Bonding

Levels of Integration SSI MSI LSI VLSI Individual gates Things like counters, single-block adders, etc. Like stuff we’ll be doing next LSI VLSI Larger circuits, like the FPGA, Pentium, etc.

Logic Families RTL, DTL earliest TTL was used 70s, 80s CMOS Still available and used occasionally 7400 series logic, refined over generations CMOS Was low speed, low noise Now fast and is most common BiCMOS and GaAs Speed

Catalogs Catalog pages describe chips Look at Specifications Pinouts http://focus.ti.com/lit/ds/scas014c/scas014c.pdf Specifications Pinouts Packages/Dimensions Electrical characteristics

Electrical Characteristics Fan in max number of inputs to a gate Fan out how many standard loads it can drive (load usually 1) Voltage often 1V, 1.2V, 1.5V, 1.8V, 3.3V or 5V are common Noise margin how much electrical noise it can tolerate Power dissipation how much power chip needs TTL high Some CMOS low (but look at heat sink on a Pentium) Propagation delay – already talked about it

Change Topics to Verilog Verilog test programs First a couple of syntax styles Help you program more efficiently Verilog test programs

Constants in Verilog Syntax Radix can be d, b, h, or o (default d) [size][’radix]constant Radix can be d, b, h, or o (default d) Examples assign Y = 10; // Decimal 10 assign Y = ’b10; // Binary 10, decimal 2 assign Y = ’h10; // Hex 10, decimal 16 assign Y = 8’b0100_0011 // Underline ignored Binary values can be 0, 1 (or x or z)

Conditional Assignment Equality test S == 2’b00 Assignment assign Y = (S == 2’b00)? 1’b0: 1’b1; If true, assign 0 to Y If false, assign 1 to Y

4-to-1 Mux Truth Table-ish module mux_4_to_1_dataflow(S, D, Y); input [1:0] S; input [3:0] D; output Y; assign Y = (S == 2'b00) ? D[0] : (S == 2'b01) ? D[1] : (S == 2'b10) ? D[2] : (S == 2'b11) ? D[3] : 1'bx ; endmodule

Verilog for Decision Tree module mux_4_to_1_binary_decision(S, D, Y); input [1:0] S; input [3:0] D; output Y; assign Y = S[1] ? (S[0] ? D[3] : D[2]) : (S[0] ? D[1] : D[0]) ; endmodule

Binary Decisions If S[1] == 1, branch one way Else assign Y = S[1] ? (S[0] ? D[3] : D[2]) and decide Y = either D[2] or D[3] based on S[0] Else : (S[0] ? D[1] : D[0]) ; decide Y is either D[2] or D[3] based on S[0] Notice that conditional test is for ‘1’ condition like in C

Instance Port Names Module Ports referenced as modp i_name(conC, conA) module modp(output C, input A); Ports referenced as modp i_name(conC, conA) Also as modp i_name(.A(conA), .C(conC));

Parameter Can set constant Like #define parameter SIZE = 16;

Verilog for Simulation & Synthesis you describe the circuit in Verilog simulate it good for testing whether your conceptual design works before your spend $$ getting it fabricated in silicon Synthesis you describe the behavior in Verilog use a compiler to “compile” it into a circuit describing large-scale complex systems without every manually building them the “compiler” translates it into a circuit for you!

Verilog for Simulation & Synthesis Remember: for simulation: Verilog provides many more language constructs and features for synthesis: Verilog supports only a subset of the language that makes sense! called “synthesizable subset”

ISE Make Verilog Test Fixture Will create a wrapper (a module) Instantiating your circuit It’ll be called UUT (unit under test) You then add your test code Example on next slides (also Lab 1)

Module and Instance UUT module syn_adder_for_example_v_tf(); // DATE: 21:22:20 01/25/2004 // ...Bunch of comments... ... // Instantiate the UUT syn_adder uut ( .B(B), .A(A), .C0(C0), .S(S), .C4(C4) ); endmodule

Reg It will create storage for the inputs to the UUT // Inputs reg [3:0] B; reg [3:0] A; reg C0; The keyword reg means “register” We’ll talk more about reg next week

Wires for Outputs That specify bus sizes // Outputs wire [3:0] S; wire C4;

Begin/End Verilog uses begin and end for block instead of curly braces

Initial Initial statement runs when simulation begins initial begin C0 = 0; end

Procedural assignment Why no “assign”? Because it is not a continuous assignment It is a one-off assignment! Explain more next week when we look at storage/clocking

Initialize in Default Test File The test file can specify the initial values of inputs to your circuit // Initialize Inputs initial begin B = 0; A = 0; C0 = 0; end

What to Add? Need to make simulation time pass Use # command for skipping time time increases by 5 units when you encounter #5 Example (note no semicolon after #50) initial begin B = 0; #10; #50 B = 1; end

For Can use for loop in initial statement block initial begin for(i=0; i < 5; i = i + 1) #50 B = i; end

Integers Can declare for loop control variables Can copy to input regs Will not synthesize, as far as I know integer i; integer j; Can copy to input regs There may be problems with negative values

There are also While Repeat Forever

Timescale Need to tell simulator what time scale to use Place at top of test fixture `timescale 1ns/10ps the first number (1ns) is the unit for time the second number (10ps) is the precision at which time is maintained (e.g., 5.01 ns)

System Tasks Tasks for the simulator $stop – end the simulation $display – like C printf $monitor – prints automatically when arguments change (example next) $time – Provides value of simulated time

Monitor // set up monitoring initial begin $monitor(“At time %d: A=%b ,B=%b\n", $time, A, B); end // These statements conduct the actual test Code...

Next Class Combinational blocks multiplexers, decoders, encoders