ELEN 468 Lecture 131 ELEN 468 Advanced Logic Design Lecture 13 Synthesis of Combinational Logic II.

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
ECE 551 Digital Design And Synthesis
Combinational Logic.
ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Table 7.1 Verilog Operators.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
ECE 551 Digital System Design & Synthesis Lecture 08 The Synthesis Process Constraints and Design Rules High-Level Synthesis Options.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Slide 1 7. Verilog: Combinational always statements. VHDL: Combinational Processes: To avoid (I.E. DO NOT What in your HDL code?) Cases that generate Synthesis.
ECE 551 Digital System Design & Synthesis Lecture 09 Synthesis of Common Verilog Constructs.
ELEN 468 Lecture 151 ELEN 468 Advanced Logic Design Lecture 15 Synthesis of Language Construct I.
ELEN 468 Lecture 121 ELEN 468 Advanced Logic Design Lecture 12 Synthesis of Combinational Logic I.
Digital System Design by Verilog University of Maryland ENEE408C.
ELEN 468 Lecture 81 ELEN 468 Advanced Logic Design Lecture 8 Behavioral Descriptions II.
ELEN 468 Lecture 91 ELEN 468 Advanced Logic Design Lecture 9 Behavioral Descriptions III.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
ELEN 468 Lecture 161 ELEN 468 Advanced Logic Design Lecture 16 Synthesis of Language Construct II.
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.
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 Behavioral Modeling (1) Maziar Goudarzi.
Spring 2002EECS150 - Lec0-intro Page 1 EECS150 - Digital Design Lecture 8 - Hardware Description Languages February 14, 2002 John Wawrzynek.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Overview Logistics Last lecture Today HW5 due today
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Slide 1 6. VHDL/Verilog Behavioral Description. Slide 2 Verilog for Synthesis: Behavioral description Instead of instantiating components, describe them.
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
EMT 351 Digital IC Design Lecturers: En. Rizalafande Che Ismail (Subject Coordinator) Pn. Siti Zarina Md. Naziri Blok B, Tingkat 2, Kompleks Pusat Pengajian.
Module 1.2 Introduction to Verilog
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Digital System Design Verilog ® HDL Behavioral Modeling Maziar Goudarzi.
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,
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
M.Mohajjel. Structured Procedures Two basic structured procedure statements always initial All behavioral statements appear only inside these blocks Each.
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.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 6: Procedural Modeling Spring 2009 W. Rhett.
03/31/031 ECE 551: Digital System Design & Synthesis Lecture Set 8 8.1: Miscellaneous Synthesis (In separate file) 8.2: Sequential Synthesis.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
ELEN 468 Lecture 171 ELEN 468 Advanced Logic Design Lecture 17 Midterm1 Review.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
TODAY’S OUTLINE Verilog Codings Concurrent and Sequential If-else
ELEN 468 Advanced Logic Design
Discussion 2: More to discuss
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
Synthesis of Combinational Logic
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Verilog HDL.
ELEN 468 Advanced Logic Design
SYNTHESIS OF SEQUENTIAL LOGIC
The Verilog Hardware Description Language
The Verilog Hardware Description Language
The Verilog Hardware Description Language
ECE 551: Digital System Design & Synthesis
Introduction to Verilog – Part-2 Procedural Statements
Presentation transcript:

ELEN 468 Lecture 131 ELEN 468 Advanced Logic Design Lecture 13 Synthesis of Combinational Logic II

ELEN 468 Lecture 132 Verilog Code Styles One behavior or functionality can be described with Verilog in different styles Different styled Verilog code may generate different synthesis results Need to understand such difference to design circuit efficiently

ELEN 468 Lecture 133 General Rules for Combinational Logic Avoid to model specific technology Synthesis functionality Ignore timing Avoid feedback loops Feedback loop may result in sequential circuit

ELEN 468 Lecture 134 Combinational Synthesis from Netlist of Primitives Let design be synthesized to remove any redundant logic y = (a+b)(b+c) y = ac + b Example 8.6, page 300

ELEN 468 Lecture 135 Combinational Synthesis from UDPs Any combinational UDP can be synthesized Table entry with “x” is ignored “?” is treated as don’t care Post-synthesis simulation result may be different from pre-synthesis simulation if a table has “x” or “?”

ELEN 468 Lecture 136 Combinational Synthesis from a Cyclic Behavior Combinational logic can be described by a cyclic behavior – enumerate all input cases, otherwise a latch will be inferred A register variable does not necessarily implies storage element Signals appear at RHS of assignment cannot appear on LHS

ELEN 468 Lecture 137 Combinational Synthesis from a Cyclic Behavior: Example module and4_behav( y, x ); input [3:0] x; output y; reg y; integer k; ( x ) begin: check y = 1; for ( k = 0; k <= 3; k = k+1 ) if ( x[k] == 0 ) begin y = 0; disable check; end endmodule module and4_behav( y, x ); input [3:0] x; output y; reg y; integer k; ( x ) begin: check y = 1; for ( k = 0; k <= 3; k = k+1 ) if ( x[k] == 0 ) begin y = 0; disable check; end endmodule x y

ELEN 468 Lecture 138 Combinational Synthesis from Function or Task Functions inherently represent combinational logic Avoid incomplete case statements or incomplete conditionals Task has similar restrictions as a function Avoid timing controls in tasks

ELEN 468 Lecture 139 Constructs to Avoid in Combinational Synthesis – Sequential Behavior Inferred Multiple event controls in same procedural block Named event with edge-sensitive event control Feedback loops PCA with event or delay control Parallel threads: fork … join Suspended activity: wait External disable statement Procedural loops with timing controls Data-dependent loops Tasks with timing controls Sequential UDPs

ELEN 468 Lecture 1310 Simulation Efficiency and PCA module orNand1(y, en, a, b, c, d ); input en, a, b, c, d; output y; reg y; (en or a or b or c or d ) y = ~( en & (a | b) & (c | d) ); endmodule module orNand1(y, en, a, b, c, d ); input en, a, b, c, d; output y; reg y; (en or a or b or c or d ) y = ~( en & (a | b) & (c | d) ); endmodule module orNand1(y, en, a, b, c, d ); input en, a, b, c, d; output y; reg y; ( en ) if ( en ) assign y = ~((a|b) & (c|d)); else assign y = 1; endmodule module orNand1(y, en, a, b, c, d ); input en, a, b, c, d; output y; reg y; ( en ) if ( en ) assign y = ~((a|b) & (c|d)); else assign y = 1; endmodule Less efficient Generally, PCA is efficient on implementing combinational logic in behavioral descriptions Keyword deassign is only used in sequential circuits.

ELEN 468 Lecture 1311 Note Synthesis tool may issue a confusing message about syntax violations because it does not accept your coding style, even though your code is correct in syntax

ELEN 468 Lecture 1312 Unexpected and Unwanted Latch Combinational logic must specify output value for all input values Incomplete case statements and conditionals (if) imply Output should retain value for unspecified input values Unwanted latches

ELEN 468 Lecture 1313 Example of Unwanted Latch module myMux( y, selA, selB, a, b ); input selA, selB, a, b; output y; reg y; ( selA or selB or a or b ) case ( {selA, selB} ) 2’b10: y = a; 2’b01: y = b; endcase endmodule module myMux( y, selA, selB, a, b ); input selA, selB, a, b; output y; reg y; ( selA or selB or a or b ) case ( {selA, selB} ) 2’b10: y = a; 2’b01: y = b; endcase endmodule b a selA’ selB selA selB’ latch y en

ELEN 468 Lecture 1314 Synthesis of case and if case and if statement imply priority Synthesis tool will determine if case items of a case statement are mutually exclusive If so, synthesis will treat them with same priority and synthesize a mux A synthesis tool will treat casex and casez same as case “x” and “z” will be treated as don’t cares Post-synthesis simulation result may be different from pre-synthesis simulation

ELEN 468 Lecture 1315 Example of if and case … input [3:0] data; output [1:0] code; reg [1:0] code; begin // implicit priority if ( data[3] ) code = 3; else if (data[2]) code = 2; else if (data[1]) code = 1; else if (data[0]) code = 0; else code = 2’bx; end … input [3:0] data; output [1:0] code; reg [1:0] code; begin // implicit priority if ( data[3] ) code = 3; else if (data[2]) code = 2; else if (data[1]) code = 1; else if (data[0]) code = 0; else code = 2’bx; end … input [3:0] data; output [1:0] code; reg [1:0] code; case (data) 4’b1000: code = 3; 4’b0100: code = 2; 4’b0010: code = 1; 4’b0001: code = 0; default: code = 2’bx; endcase … input [3:0] data; output [1:0] code; reg [1:0] code; case (data) 4’b1000: code = 3; 4’b0100: code = 2; 4’b0010: code = 1; 4’b0001: code = 0; default: code = 2’bx; endcase … No priority

ELEN 468 Lecture 1316 Technology Mapping Map logic gates to library cells Synthesis tool may map y = a + b into a library adder Synthesis tool will not recognize an adder that is implicitly represented by a hierarchical netlists

ELEN 468 Lecture 1317 Tri-State Buses module stuffToBus1( data, enable, clock ); input enable, clock; output [31:0] data; reg [31:0] outToBus; assign data = ( enable ) ? outToBus : 32’bz; // code to generate outToBus // … endmodule module stuffToBus1( data, enable, clock ); input enable, clock; output [31:0] data; reg [31:0] outToBus; assign data = ( enable ) ? outToBus : 32’bz; // code to generate outToBus // … endmodule Synthesized to a three-state device

ELEN 468 Lecture 1318 Bi-directional Bus Drivers module stuffToBus2 ( data, clock, send_data, rcv_data ); input clock, send_data, rcv_data; inout [31:0] data_to_from_bus; reg [31:0] reg_to_bus; wire [31:0] dataToFrom_bus, inbound_data; assign inbound_data = (rcv_data) ? dataToFrom_bus : 32’bz; assign dataToFrom_bus = (send_data) ? Reg_to_bus : dataToFrom_bus; endmodule module stuffToBus2 ( data, clock, send_data, rcv_data ); input clock, send_data, rcv_data; inout [31:0] data_to_from_bus; reg [31:0] reg_to_bus; wire [31:0] dataToFrom_bus, inbound_data; assign inbound_data = (rcv_data) ? dataToFrom_bus : 32’bz; assign dataToFrom_bus = (send_data) ? Reg_to_bus : dataToFrom_bus; endmodule Core Circuit 32 inbound_data reg_to_bus dataToFrom_bus send_data rcv_data

ELEN 468 Lecture 1319 Exercise 4

ELEN 468 Lecture 1320 Simulation Output `timescale 1ns/100ps module m(y,x); output y, input x; not #1.234 (y,x); endmodule `timescale 10ns/100ps module modA; wire a; reg b; m m1(b, a); initial $monitor ( $time, “ realtime=%f, a=%b, b=%b”, $readtime, a, b); initial begin #10 a = 0; #10 a = 1; #10 $finish; end endmodule `timescale 1ns/100ps module m(y,x); output y, input x; not #1.234 (y,x); endmodule `timescale 10ns/100ps module modA; wire a; reg b; m m1(b, a); initial $monitor ( $time, “ realtime=%f, a=%b, b=%b”, $readtime, a, b); initial begin #10 a = 0; #10 a = 1; #10 $finish; end endmodule 0 realtime=0.0 a=x b=x 10 realtime=10.0 a=0 b=x 10 realtime=10.12 a=0 b=1 20 realtime=20.0 a=1 b=1 20 realtime=20.12 a=1 b=0 0 realtime=0.0 a=x b=x 10 realtime=10.0 a=0 b=x 10 realtime=10.12 a=0 b=1 20 realtime=20.0 a=1 b=1 20 realtime=20.12 a=1 b=0

ELEN 468 Lecture 1321 Transistor Level Structural Code module nand2( y, a, b ); output y; input a, b; supply1 pwr; pulldown ( y ); pmos( y, pwr, a ); pmos( y, pwr, b ); endmodule module nand2( y, a, b ); output y; input a, b; supply1 pwr; pulldown ( y ); pmos( y, pwr, a ); pmos( y, pwr, b ); endmodule Y V dd A B