Synopsys Class 2 5 1
Synopsys Class 2 5 1
Synopsys Class 2 5 1
Logic Synthesis
Page 61
Logic Synthesis
Page 62
Logic Synthesis
[cmd] returns the result of the command: like cmd in csh. {} creates a list without variable or command substitution
Use the list command when variable and/or command subtitution is required.
Use the expr command for all arithmetic expressions. Many Tcl resources (for advanced scripts): http://tcl.activestate.com
Page 63
Logic Synthesis
Technology Libraries
Target Library
The target library is the technology library you want to map to during synthesis. It is also known as the destination library. Specify the target library with the pointer variable target_library.
set target_library {"cdr2synPwcslV300T125.db" "scanff.db"}
Target Library
Page 64
Logic Synthesis
Link Library
The link library is a technology library that is used to describe the function of mapped cells prior to optimization. Specify the link library with the variable pointer link_library. Typically, the link and target library are set to the same technology library. The first entry in the list should be "*" to use designs currently in memory.
Link Library HDL Code RTL + manually instantiated gates Design Compiler Netlist from earlier synthesis Design is mapped to gates from target_library. Target Library Optimized Netlist
Page 65
Logic Synthesis
Link Library HDL Code RTL + manually instantiated gates Netlist from earlier synthesis Floorplan Physical Compiler Design mapped to gates from target library Design placed according to physical library Output: Verilog GLV and layout pdef/def format Optimized (mapped and placed) Netlist
Target Library
Physical Library
Page 66
Logic Synthesis
Page 67
Logic Synthesis
Design Read
read_file [-format input_format] [-define macro_names] file_list -format input_format
db Synopsys internal database format (smaller and loads faster than netlist) verilog RTL or gate-level Verilog netlist
-define macro_names: enables setting defined values used in the Verilog source code. If you code uses ifdef statements, you should set: hdlin_enable_vpp=true read_db or read_verilog are equivalent to read_file -format xxx Example: read_file -format verilog -define BLOCK_A_DEF { block_a.v block_b.v } current_design [design] returns or sets the current working design Note: The read command sets the last module read as the current design.
Page 68
Logic Synthesis
Page 69
Logic Synthesis
Design Write
write_file [-format output_format] [-hierarchy] [-output output_file_name] [design_list] output_format can be db or verilog as above -hierarchy writes the entire hierarchy from the named design down; otherwise, only the top-level module is saved The default for design_list is the current design.
Page 70
Logic Synthesis
Design Objects
Design
module m (i1, i2, i3, i4, clk, out1); input i1, i2, i3, i4, clk; output out1; wire int1, int0;
Port
Net
kuku U1 (.a(i1), .b(i2), .c(i3), .d(in4), .q1(int1), .q0(int0)); ind3f U2 (.IN1(int1), .IN2(int0), .IN3(clk), .OUT1(out1)); Reference endmodule Cell Pin
Page 71
Logic Synthesis
Design: A circuit description that performs one or more logical functions (i.e Verilog module). Cell: An instantiation of a design within another design (i.e Verilog instance). Reference:The original design that a cell "points to" (i.e Verilog submodule) Port: Pin: Net: Clock: source. The input, output or inout port of a Design. The input, output or inout pin of a Cell in the Design. The wire that connects Ports to Pins and/or Pins to each other. Port of a Design or Pin of a Cell explicitly defined as a clock
Page 72
Logic Synthesis
all_inputs {"clk", "in1", "in2", "reset"} all_outputs {"out1"} all_clocks /* works only after clocks are defined */ {"clk"} all_registers {"i8"} all_connected int1 {"i1/OUTPUT1", "i8/D"}
Page 73
Logic Synthesis
Timing Paths
Timing paths are usually:
input port -> output port input port -> register register -> output port register -> register
The startpoint from a FF is the clock pin. The endpoint at a FF is a data pin. Timing paths do not go through FFs (except for asynchronous set/ reset).
Page 74
Logic Synthesis
aoi211
q d dffp qb trinv
out[2:0] 2
iand2
aoi21
d dffp qb trinv q
0
trinv
Page 75
Logic Synthesis
set_max_delay
c d rst q
in2
Comb1
c d rst q
Comb2
out set_output_delay
rst (async)
Page 76
Logic Synthesis
c d rst q
in2 set_input_delay
Comb1
c d rst q
Comb2
out
rst (async)
Page 77
Logic Synthesis
c d rst q
in2
Comb1
c d rst q
Comb2
out set_output_delay
rst (async)
Page 78
Logic Synthesis
c d rst q
in2
Comb1
c d rst q
Comb2
out
rst (async)
Page 79
Logic Synthesis
q Latch rst c
en
in2 set_input_delay
Comb1
d DFF q rst
Comb2
out set_output_delay
rst (async)
Page 80
Logic Synthesis
c d rst q
in2
Comb1
c d rst q
Comb2
out
rst (async)
Page 81
Logic Synthesis
Constraints
Defining Clocks
create_clock [port_pin_list] [-name clock_name] [-period period_value] [-waveform edge_list] Creating a clock with a specified period automatically constrains the internal (FF -> FF) paths. -name can be used to give the clock a different name or to create a virtual clock The edge_list consists of an even number (usually 2) of rising and falling edges; the default is {0 period_value/2} to produce a 50% duty cycle. Example:
set cg_host_clk54_period 18 create_clock -period $cg_host_clk54_period cg_host_clk54
Page 82
Logic Synthesis
A propagated clock uses the calculated propagation delays between the clock source and the register clock pins. This is appropriate when the actual clock tree is included in the model (post-layout). set_propagated_clock object_list
Page 83
Logic Synthesis
Page 84
Logic Synthesis
Defining Clocks
create_generated_clock -source master_pin [port_pin_list] [-name clock_name] [-divide_by divide_factor] Defines a clock that is derived within the module from another clock. Insertion latency is calculated automatically; no need to specify timing explicitly. -name can be used to give the clock a different name -divide_by specifis the division factor Example: (divide by 2) clkb clka clkb_reg
Page 85
Logic Synthesis
Input Constraints
All input ports (except clocks) should have 2 types of constraints: load and timing set_driving_cell [-cell library_cell_name] port_list This command specifies the drive capability of the input port in terms of a library cell. It indirectly limits the load seen on the input port. set_max_fanout fanout_value object_list This command limits the number of components that can be driven by the input port. It is useful for signals that drive many blocks (e.g. global buses, reset). Example:
set_driving_cell -cell inv_6 [all_inputs] remove_driving_cell {cg_host_clk54} set normal_fanout 6 set_max_fanout $normal_fanout [all_inputs] set_max_fanout 1 {g_reset}
Page 86
Logic Synthesis
in1 0.5 7.2 set_input_delay -max 7.2 -clock clk {in1} set_input_delay -min 0.5 -clock clk {in1}
Page 87
Logic Synthesis
Output Constraints
All output ports should have 2 types of constraints: load and timing set_load load_value object_list This command specifies the external load that the output port must drive. Example:
# standard load definition of inverter 8X drive according to synopsys library set std_gate_load [load_of $library_name/inv_8/a] # capacitance of 1u from wire_load model parameters in synopsys library set u_wire_load 0.00016 # load variables definition for normal signals set normal_load [expr ($normal_fanout * $std_gate_load) + (1000 * $u_wire_load)] set_load $normal_load [all_outputs]
Page 88
Logic Synthesis
Page 89
Logic Synthesis
Path Constraints
set_max_delay delay_value [-rise | -fall] [-from from_list] [-through through_list] [-to to_list] set_min_delay delay_value [-rise | -fall] [-from from_list] [-through through_list] [-to to_list] Path start points are usually input ports or register clock pins. Path end points are usually output ports or register data pins. Using -from and/or -to with points along a path splits the path into two shorter paths. Use with care! -rise and -fall select paths whose end point is rising or falling -through can be used to select among multiple paths with the same start and end points
Page 90
Logic Synthesis
Timing Exceptions
set_false_path [-rise | -fall] [-from from_list] [-through through_list] [-to to_list] Disables timing constraints on specific paths. Used for paths from signals that are stable during circuit operation:
set_false_path -from cg_scan_test
Used for paths between clock domains. (The timing of signals between asynchronous clocks should be correct by design: synchronizers, etc.!)
set_false_path -from [get_clocks ig_tsiclk] -to [get_clocks cg_host_clk54]
Page 91
Logic Synthesis
Details are somewhat complex. Use the manual for other cases.
Page 92
Logic Synthesis
Page 93
Logic Synthesis
Page 94
Logic Synthesis
endpoint
Page 95
Logic Synthesis
By default - setup timing is related to the Endpoint clock and hold timing related to the Startpoint clock
Page 96
Logic Synthesis
hold relation
set_multicycle_path 3 -hold -from Start -to End Can alse be: set_multicycle_path 1 -hold -end -from Start -to End
Page 97
Logic Synthesis
Fast to Slow startpoint setup relation endpoint set_multicycle_path 2 -setup -start -from Start -to End set_multicycle_path 1 -hold -end -from Start -to End hold relation
Page 98
Logic Synthesis
Page 99
Logic Synthesis
Area Optimization
set_max_area [-ignore_tns] area If the max_area is not defined, DC will do minimal area optimization. This is appropriate if the area is not important since it reduces the compile time.
set_max_area 0
This command will cause DC to reduce the area as much as possible w/o increasing any timing violation (1998.02-). This is recommended for most designs at MSIL where the optimization priority is: (1) timing and (2) area
set_max_area -ignore_tns 0
This command will cause DC to reduce the area as much as possible w/o increasing the worst timing violation of a path group, but may increase delay violations below the worst timing violations. Not Recommended.
Page 100
Logic Synthesis
Compile
compile [-map_effort low | medium | high] [-incremental_mapping] [-verify] [-scan] The compile command performs the mapping and optimization of the current design taking into account the constraints. The map_effort specifies which algorithms should be used. Higher effort produces better results, but requires more run time.
- Low effort can be used to check constraints. Medium effort is the default. High effort should be used for final synthesis to take full advantage of the tool.
-incremental_mapping starts with the current mapping and optimizes where there are violations. Otherwise, an additional compile re-maps the design. -verify checks the logic of the netlist vs. the equations derived from the RTL (sometimes may take very long time !) -scan inserts scan registers - generate a scan-ready design. SDI is tied to Q, and SE is tied to 0. Scan chain is not stiched. More options will be discussed later.
Page 101
Logic Synthesis
Compile Strategy
Top-Down: Use top level constraints and get internally the subdesign to sub-design constaints in one pass. May need flattening the design or uniquifying blocks. Bottom-up: compile a sub-design with its own constraints, then go to the top level, apply top level constraints and compile incrementally (set_dont_touch attribute on identical compiled subblocks or uniquify them. In case of dont_touch, top level compile may not be incremental). How do we choose the compilation strategy ? >> There is no Golden script for that.
Page 102
Logic Synthesis
Page 103
Logic Synthesis
Page 104
Logic Synthesis
Page 105
Logic Synthesis
Page 106
Logic Synthesis
wlm1
mode = top
wlm1
mode = enclosed
wlm1
mode = segmented
Page 107
Logic Synthesis
"CDR2_15_0Kto50K_DW01" "CDR2_15_50Kto75K" "CDR2_15_75Kto100K" "CDR2_15_100Kto150K" "CDR2_15_150Kto200K" "CDR2_15_200Kto300K" "CDR2_15_300Kto600K" "CDR2_15_600Kto700K" "CDR2_15_700Kto800K" "CDR2_15_800Kto3000K" "CDR2_15_3000Kto5500K" "CDR2_15_5500Kto8000K" "CDR2_15_8000Kto10000K" "CDR2_15_10000Kto20000K" ;
); ); ); ); ); ); ); ); ); ); ); ); ); );
Page 108
Logic Synthesis
Page 109
Logic Synthesis
Multiple Instances
B1
B B2
3. uniquify - creates copies of the design and gives a unique name to each
- Takes advantage of the different environment of each instance for better optimiztion.
current_design A uniquify compile
Page 110
Logic Synthesis
Integration
How do we integrate blocks that were synthesized separately? propagate_constraints [-false_path] [-multicycle_path] [-gate_clock] [-all] [-verbose] [-dont_apply] [-design <design_list>] [-output <file_name>] This command translates the constraints that were applied to a lower-level instance and applies them to the current design. Clock definitions should not be propagated if they occur on multiple blocks. -verbose option shows each constraint and its source -dont_apply option checks for problems, but doesnt apply the constraints -output option writes the constraints to file_name -gate_clock required in power compiler flow to move clock setup and hold check previously specified with the set_clock_gating_check command.
Page 111
Logic Synthesis
Integration (cont.)
compile -top The -top option does a compile that only fixes design rule violations and timing violations that cross the top level. No mapping or area optimization is performed. set compile_top_all_paths true can be used to fix all timing violations
Page 112
Logic Synthesis
Integration (cont.)
current_design B source B.con current_design C source C.con current_design A create_clock ... propagate_constraints -verbose compile -top
Example:
set_false_path -from cg_scan_test # in n_mem.con
is changed to:
set_false_path\ -through [get_pins "n_mem/cg_scan_test"]
Page 113
Logic Synthesis
Advanced Commands
The get_* Commands
Returns a collection of objects when used standalone: ({item1 item2 ...}). Should be used when several object types have the same name (e.g. same reference and net names).
Page 114
Logic Synthesis
patterns (optional):
List of names (including wildcards: *) of the design or library objects in dc_shell to be found. If name_list is not specified, then all objects of the specified type are returned. If no matches are found, returns an empty string (with a warning).
Page 115
Logic Synthesis
get_ports {"clk", "in1", "in2", "reset", "out1"} get_cells {"i1", "i8"} get_references {"ind2c", "dffrpc"} get_references dff* {"dffrpc"} get_nets {"in1", "clk", "reset", "in2", "int1", "out1"} set_dont_touch [get_designs]
Page 116
Logic Synthesis
Page 117
Logic Synthesis
A collection can also be filtered when it is created: get_ports -filter "@port_direction == inout"
Page 118
Logic Synthesis
Page 119
Logic Synthesis
Page 120
Logic Synthesis
Page 121
Logic Synthesis
Page 122
Logic Synthesis
Page 123
Logic Synthesis
report_timing_requirements- lists all multicycle and false paths, max_delay and min_delay exceptions report_timing_requirements -ignore- lists all ignored multicycle and false paths
From Through To Setup Hold -------------------------------------------------------------------------------cg_scan_en * * max=18 min=0 cg_scan_test * * FALSE FALSE cg_host_clk54 * cg_mem_clk FALSE FALSE cg_mem_clk * cg_host_clk54 FALSE FALSE ca_clk27 * cg_host_clk54 FALSE FALSE cg_host_clk54 * ca_clk27 FALSE FALSE
Page 124
Logic Synthesis
Page 125
Logic Synthesis
report_net
Attributes: d - dont_touch
Net Fanout Fanin Load Resistance Pins Attributes -------------------------------------------------------------------------------... ao_mem/DOi_26 1 1 0.13 0.05 2 ao_mem/DOi_27 1 1 0.13 0.05 2 ao_mem/DOi_28 1 1 0.13 0.05 2 ao_mem/DOi_29 1 1 0.13 0.05 2 ao_mem/DOi_30 1 1 0.13 0.05 2 ao_mem/DOi_31 1 1 0.13 0.05 2 ca_clk27 3 1 0.15 0.03 4 d cg_dmux_reset 1 1 0.08 0.01 2 cg_host_clk54 175 1 5.42 1.55 176 d cg_mem_clk 11 1 0.55 0.15 12 d ... -------------------------------------------------------------------------------Total 1823 nets 4669 1823 245.21 56.04 6492 Maximum 175 1 5.42 1.55 176 Average 2.56 1.00 0.13 0.03 3.56
Page 126
Logic Synthesis
Page 127