CSE241 RTL Performance.1Kahng & Cichy, UCSD ©2003 CSE241A VLSI Digital Circuits Winter 2003 Recitation 2.5: Performance Coding.

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

//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
ECE 551 Digital Design And Synthesis
Supplement on Verilog adder examples
Combinational Logic.
1 ECE 4436ECE 5367 Computer Arithmetic I-II. 2 ECE 4436ECE 5367 Addition concepts 1 bit adder –2 inputs for the operands. –Third input – carry in from.
A Digital Circuit Toolbox
Table 7.1 Verilog Operators.
Verilog Intro: Part 1.
Combinational Logic with Verilog Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer.
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
CPE 626 CPU Resources: Adders & Multipliers Aleksandar Milenkovic Web:
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 
1 Lecture 12: Hardware for Arithmetic Today’s topics:  Designing an ALU  Carry-lookahead adder Reminder: Assignment 5 will be posted in a couple of days.
ECE 551 Digital System Design & Synthesis Lecture 08 The Synthesis Process Constraints and Design Rules High-Level Synthesis Options.
Datorteknik ArithmeticCircuits bild 1 Computer arithmetic Somet things you should know about digital arithmetic: Principles Architecture Design.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
Fast Adders See: P&H Chapter 3.1-3, C Goals: serial to parallel conversion time vs. space tradeoffs design choices.
Kazi Spring 2008CSCI 6601 CSCI-660 Introduction to VLSI Design Khurram Kazi.
The Multicycle Processor II CPSC 321 Andreas Klappenecker.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
CSE241 R1 Verilog.1Kahng & Cichy, UCSD ©2003 CSE241 VLSI Digital Circuits Winter 2003 Recitation 1: Verilog Introduction.
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
Lecture # 12 University of Tehran
Overview Logistics Last lecture Today HW5 due today
ECE 551 Digital System Design & Synthesis Lecture 11 Verilog Design for Synthesis.
each of these is an instantiation of “full_adder”
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
Synthesis Presented by: Ms. Sangeeta L. Mahaddalkar ME(Microelectronics) Sem II Subject: Subject:ASIC Design and FPGA.
Chapter 6-1 ALU, Adder and Subtractor
C ONTINUOUS A SSIGNMENTS. C OMBINATIONAL L OGIC C IRCUITS each output of a Combinational Logic Circuit  A function of the inputs - Mapping functions.
EKT 221/4 DIGITAL ELECTRONICS II  Registers, Micro-operations and Implementations - Part3.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
CH71 Chapter 7 Hardware Description Language (HDL) By Taweesak Reungpeerakul.
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
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.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
COMP541 Arithmetic Circuits
EKT 221 : Digital 2 Serial Transfers & Microoperations Date : Lecture : 2 hr.
1 Carry Lookahead Logic Carry Generate Gi = Ai Bi must generate carry when A = B = 1 Carry Propagate Pi = Ai xor Bi carry in will equal carry out here.
Introduction to ASIC flow and Verilog HDL
Introduction to Verilog
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
Digital System Design Verilog ® HDL Dataflow Modeling Maziar Goudarzi.
1 The ALU l ALU includes combinational logic. –Combinational logic  a change in inputs directly causes a change in output, after a characteristic delay.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Overview Logistics Last lecture Today HW5 due today
ELEN 468 Advanced Logic Design
CSE241A VLSI Digital Circuits Winter 2003 Recitation 2
Verilog Introduction Fall
Supplement on Verilog adder examples
Lecture 2 Supplement Verilog-01
Basics Combinational Circuits Sequential Circuits
Behavioral Modeling in Verilog
Combinatorial Logic Design Practices
CSE Winter 2001 – Arithmetic Unit - 1
ARM implementation the design is divided into a data path section that is described in register transfer level (RTL) notation control section that is viewed.
Supplement on Verilog adder examples
The Verilog Hardware Description Language
COE 202 Introduction to Verilog
Presentation transcript:

CSE241 RTL Performance.1Kahng & Cichy, UCSD ©2003 CSE241A VLSI Digital Circuits Winter 2003 Recitation 2.5: Performance Coding

CSE241 RTL Performance.2Kahng & Cichy, UCSD ©2003 Introduction: Performance Coding l Overview l Critical Paths l Hierarchy l RTL Operators l Multiplexers l Parallelism l Order

CSE241 RTL Performance.3Kahng & Cichy, UCSD ©2003 Overview: Why Code?  Motivation l Increase speed! l Reduce cycle times l Build portability

CSE241 RTL Performance.4Kahng & Cichy, UCSD ©2003 Critical Paths  Identify critical signals l Slow signals, slow paths l Reduce logic path depth -Less, gates in path = higher clock rate l Connect critical net closest to output -Decrease overall delay for function a b c d e a b e d c

CSE241 RTL Performance.5Kahng & Cichy, UCSD ©2003 Hierarchy  Block size l Too many blocks increase delay (logic depth) l Too much hierarchy -Signals have to traverse whole hierarchy. l Possible for synthesizer to reduce this -Synopsys “ungroup” command

CSE241 RTL Performance.6Kahng & Cichy, UCSD ©2003 Resource Sharing  Bad Example l Adders use a lot of resources + + MUX sum if (select) sum <= a + b; else sum <= c + d; A D C B select

CSE241 RTL Performance.7Kahng & Cichy, UCSD ©2003 Resource Sharing  Good Example l Infer two muxes + sum if (select) tmp1 <= a; tmp2 <= b; else tmp1 <= c; tmp2 <= d; sum <= tmp1 + tmp2; A D C B select

CSE241 RTL Performance.8Kahng & Cichy, UCSD ©2003 Loops  Move operators outside loops l I.e move + (adder) outside the loop l Will reduce adders instantiated l Make sure: -Critical signals are addressed

CSE241 RTL Performance.9Kahng & Cichy, UCSD ©2003 Muxes  Instantiate Muxes l Don’t wait for the tool to infer muxes l Create a gate-level mux and use it in code l If – then else -Might create unwanted logic l Use explicit case statements to infer muxes -If not using muxes -Technology independence

CSE241 RTL Performance.10Kahng & Cichy, UCSD ©2003 Parentheses  Use parentheses to optimize e.g.: out = a + b + c + d; vs out = (a + b) + (c + d);  The first statement creates 3 adders in series  The second statement creates 2 adders in parallel

CSE241 RTL Performance.11Kahng & Cichy, UCSD ©2003 Operators  * / %  Multiply, divide, and modulo l High Cost of operators l Will create extra non-optimized logic l Better to create design blocks -Instantiate fast tree adder -Instantiate wallace tree -Otherwise have synthesis tool create RCA (Ripple Carry Adder)

CSE241 RTL Performance.12Kahng & Cichy, UCSD ©2003 Adder example  Adder Carry look ahead module Add_prop_gen (sum, c_out, a, b, c_in);// generic 4-bit carry // look-ahead adder // behavioral model output [3:0] sum; output c_out; input [3:0] a, b; input c_in; reg [3:0] carrychain; wire [3:0] g = a & b; // carry generate, contin assignment, bitwise and wire [3:0] p = a ^ b; // carry propagate, contin assignment, bitwise xor or b or c_in) // event "or" begin: carry_generation // usage: block name integer i; #0 carrychain[0] = g[0] | (p[0] & c_in); / Eliminate race for(i = 1; i <= 3; i = i + 1) begin carrychain[i] = g[i] | (p[i] & carrychain[i-1]); end wire [4:0] shiftedcarry = {carrychain, c_in} ; // concatenation wire [3:0] sum = p ^ shiftedcarry; // summation wire c_out = shiftedcarry[4]; // carry out bit select endmodule

CSE241 RTL Performance.13Kahng & Cichy, UCSD ©2003 Parallelizing  Use hierarchy l Like in hardware, use parallel connections l + operator will create RCA l Example: Carry lookahead adder C 1 = G 0 | P 0 C 0 C 2 = G 1 | P 1 G 0 | P 1 P 0 C 0 C 3 = G 2 | P 2 G 1 | P 2 P 1 G 0 | P 2 P 1 P 0 C 0 C 4 = G 3 | P 3 G 2 | P 3 P 2 G 1 | P 3 P 2 P 1 G 0 | P 3 P 2 P 1 P 0 C 0 l Only 4 gate delay vs 9 gates for RCA l Only trade-off is more logic (more area) -Silicon has lots of real estate (to a point; think wiring)

CSE241 RTL Performance.14Kahng & Cichy, UCSD ©2003 If – then else, Case  Use of if statement l Introduces priority of nested “ifs” l Case has no order l Can mix cas and if Similar delay for all data signals CASE state IS WHEN s1 => Z Z Z Z <= d; END CASE; Speeds up signal s2 CASE state IS WHEN s1 => tmp <= a; WHEN s3 => tmp <= c; WHEN OTHERS => tmp <= d; END CASE; IF (state = s2) THEN Z <= b; ELSE Z <= tmp; END IF;

CSE241 RTL Performance.15Kahng & Cichy, UCSD ©2003 Order Dependency  Blocking vs. Non-Blocking Assignments l Use non-blocking statements when doing sequential assignments like pipelining and modeling of several mutually exclusive data transfers l Blocking assignments within sequential processes may cause race conditions l Non-blocking assignments are order independent