lec39 full
TRANSCRIPT
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 1/27
3/15/2006 1
CS623 – CAD for VLSILecture 37 – Synthesis II
Shankar BalachandranDept. of Computer Science and Engineering
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 2/27
23/15/2006
Recap - Synthesis• Three things are needed
– Verilog Model
– Constraints on the circuit• Area
• Delay
– Library Models• What kind of components we have?
• How are they characterized for area, delay etc?
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 3/27
33/15/2006
Recap - Verilog as a Synthesis Language
• Verilog is primarily a simulation language
• Features of Verilog
– Describe hardware at Behavioral, RTL and Gatelevel
– Create Test Stimulus
– Error checking on the model and its usage – File I/O
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 4/27
43/15/2006
Recap - Focus on Synthesis
Simulatable
Verilog
Goal of the
course
Synthesis
Tool Z
Synthesis
Tool Y
Synthesis
Tool X
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 5/27
53/15/2006
Recap - Synthesis Flow• Basic synthesis steps are:
– Analyze
– Elaborate – Compile
– Report
– Save
• Basic steps are subject to constraints andoptions
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 6/27
63/15/2006
Recap - Timing Report
Point Incr Path-----------------------------------------------------------
clock CLK (rise edge) 0.00 0.00clock network delay (ideal) 0.00 0.00COUNT_reg<0>/CP (FJK2S) 0.00 0.00 rCOUNT_reg<0>/Q (FJK2S) 2.08 2.08 rU57/Z (ND2) 0.30 2.38 fU55/Z (NR2) 1.07 3.45 rU54/Z (EO) 1.13 4.57 f
COUNT_reg<3>/TI (FJK2S) 0.00 4.57 fdata arrival time 4.57
clock CLK (rise edge) 10.00 10.00clock network delay (ideal) 0.00 10.00COUNT_reg<3>/CP (FJK2S) 0.00 10.00 r
library setup time -1.80 8.20data required time 8.20-----------------------------------------------------------data required time 8.20data arrival time -4.57
-----------------------------------------------------------slack (MET) 3.63
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 7/27
73/15/2006
Recap - Area Report
****************************************Report : areaDesign : SM_COUNT
****************************************
Library(s) Used:
lsi_10k (File:/software/synopsys/1998.02/libraries/syn/lsi_10k.db)
Number of ports: 7Number of nets: 19Number of cells: 12Number of references: 5Combinational area: 14.000000Noncombinational area: 52.000000
Net Interconnect area: undefined(No wire load specified)
Total cell area: 66.000000Total area: undefined
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 8/27
83/15/2006
Verilog Style for Synthesis• Verilog coding style is very important for
synthesis
• Hardware corresponds to RTL – This may be overkill as the synthesis tools can
handle behavioral abstractness
• Hardware structure must be clear for the tool tounderstand!
• RTL style allows behavioral abstractions suchas always, integer and parameter types, andmost arithmetic operators
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 9/27
93/15/2006
Verilog Style for Synthesis• Some elements of Verilog may not be handled
although capabilities improve as tools evolve.
• Verilog allows several ways to describe one thing,
Synthesis tools often require only a limited subset ofconstructs; Example: Registers and Flip Flops must bedescribed in a certain way
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 10/27
103/15/2006
Example Verilog Codemodule load_n_select (input CLK, input LOAD_EN, input
[3:0] DATA, input [3:0] SEL_CODE, output RESULT);
reg [3:0] DATA_Q;
always @(posedge CLK)
if (LOAD_EN == 1’b1) DATA_Q <= DATA;
always @(SEL_CODE or DATA_Q)
case SEL_CODE0 : RESULT <= DATA_Q(0);
1 : RESULT <= DATA_Q(1);
2 : RESULT <= DATA_Q(2);
3 : RESULT <= DATA_Q(3);
default : RESULT <= DATA_Q(0);
endcase
endmodule
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 11/27
113/15/2006
Inference of Hardware
• Two always blockscorrespond to the intendedtwo hardware blocks
• Inferred flip-flop as aclocked process
• Combinational process hasall input signals in thesensitivity list; If not, maylead to differences insimulation vs. synthesisresults
DATA
DATA_Q
CLK
LOAD_EN
SEL_IN
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 12/27
123/15/2006
Categories of Verilog Constructs
• Categories of applicability for synthesis tools:
– Ignored - Many constructs are ignored with no errormessages
– Not Supported - Some constructs produce errormessages
– Supported with constraints -Many constructs aresupported but in certain forms produce errormessages
– Fully supported - Generally allowed in all forms
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 13/27
133/15/2006
Constructs – Not Supportedreal x;
BEGIN
x <= x/3.0;--Error: Literal ’of type REAL’ is
--not supported for synthesis
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 14/27
143/15/2006
Constructs – Supported With Restrictions
c <= a/5; --Error: The second operand must
--be a power of two
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 15/27
153/15/2006
Constructs - Ignoredinitialbegin
a = 10;
b = 15;
end
-- Warning: initial statements are not supported insynthesis
always @(a or b)
#5 C <= A + B;
-- Warning: Assignment delays are not-- supported for synthesis. They are
-- ignored.
$display(“C = %d”,C);
-- Warning: Display statements are not
-- supported for synthesis. They are
-- ignored.
END
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 16/27
163/15/2006
Restricting Ranges• Some very simple Verilog code can generate
large amounts of circuitry.integer a,b,c;
always @(a or b) C = A * B;
• If A = 0 to 7 and B = 0 to 7, C = 0 to 49
• The code will compile quickly with nowarnings or errors, but will take hours toconvert into gates. – The type integer implies 32 bits.
• The range of values should always be specified.
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 17/27
173/15/2006
Restricting Ranges
• The implementation shown below givesidentical results as the previous integer
version and has the advantage of astandard port interface. It also makes therange more obvious.
module math_test (input [2:0] a, input
[2:0] b, output [2:0] c);
always @(a or b)
c <= a * b;
endmodule
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 18/27
183/15/2006
Sensitivity List
• Combinational blocks should have allinputs in the sensitivity list
Tool X: Error, A should bedeclared on the sensitivity list of
the process. Error found in
Verilog source Synthesis Failed.
Tool Y: Warning: Variable ’A’ is
being read ... but is not in the
process sensitivity list of the
block
Important : Simulation Synthesis
Mismatch
always @(B or C)
BEGIN
IF A == 1’b1
Y <= B & C;
ELSEY <= B | C;
end
END
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 19/27
193/15/2006
Another Tool
C
A
B
Y
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 20/27
203/15/2006
Logic Eqns Vs Gates
Sometimes what you expect is not what you get in gates
module simple (input A, input B, input C, output Y);
assign Y = (A AND B) OR C;
endmodule
One would expect an implementation of one AND gate and one ORgate; Instead the synthesis tool selected differently
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 21/27
213/15/2006
Influence of Loading
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 22/27
223/15/2006
Tristatemodule design (C, C_EN, D, D_EN, y);input C, C_EN, D, D_EN;
output Y;
always @(C_EN or C)
BEGIN
IF (C_EN == 1’b1) Y <= C;
ELSE Y <= 1’bz;
END
always @(D_EN or D)
BEGIN
IF (D_EN == 1’b1) Y <= D;
ELSE Y <= 1’bz;
END
endmodule
•Assignment of ‘Z’ infers a tri-state
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 23/27
233/15/2006
Trimmed Logicmodule design (input IN1, output OUT1);
OUT1 <= IN1;
endmodule
module design (inpu IN1, input IN2);
wire A;
assign a = IN1 ^ IN2;
endmodule
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 24/27
243/15/2006
Miscellaneous
• Masking of unsupported constructs usingspecial format Verilog comments:
// synopsys synthesis_off<unsupported Verilog code>
// synopsys synthesis_on
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 25/27
253/15/2006
Inference of Hardware
• A correct hardware model for the given Verilogcode
• Not a simple process – Many ways of modeling the same thing
• Eg. If-Then-Else vs. Case
– What hardware structure? – Order of Verilog code Vs. Synthesized Hardware
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 26/27
263/15/2006
Simple Ways to Infer
• Infer from Declarations – Data types and ranges are available
• Infer from signal assignments – A data flow view
• From Verilog statements
– If-then, Case, Loops etc
• Registers, Flip-Flops
• State Elements and State Machine Synthesis
8/14/2019 Lec39 Full
http://slidepdf.com/reader/full/lec39-full 27/27
273/15/2006
Post-Synthesis Simulation
• We get actual delays and area after synthesis
• Can verify the transformation
• Verify the design for timing – In terms of library cells from target library – Gives
more confidence