dc_shell教程

好长时间了想搞懂dc的脚本书写 终于让我找见一个好的教程 写的非常详细 弄过来给大家参考。
 
Design CompilerTutorial

--------------------------------------------------------------------------------

 

Before running synthesis the tool environmentfile must be sourced. If you have not done this please go back tothe environment setup page. All steps on this page may be completed from atelnet or ssh window.

1.Create a .synopsys_dc.setup environment file inyour home directory specifying the location of the technologylibrary files you want to use. Here is one premade that points toour open source technology libraries. Place a copy in your ~/ directory.

2.Write the verilog code for the part you wish to synthesize.For the purposes of this example we will use the same verilog asthe simulation tutorial:

module mux2_1 ( out, in0, in1, sel ) ;

   input [3:0] in0, in1;
   input sel;

   output [3:0] out;


   // All the real work gets donehere in the assign.
   assign  ut =sel ? in1 : in0;


endmodule // mux2_1
   As you can seethis is a very simple four bit 2 to 1 mux. You may also copy thefile from here .

3.Next one must write a design complier script.The script. should do the following:

  • Load all the verilog files into dc_shell andtell dc_shell which module is the top level module.
  • Set up the constraints for compilation. Thecontraints tune how the dc_shell tool converts the behavioral RTLinto a netlist. For example one may set timing contraints or areacontraints dependent on which is more important for the design athand.
  • Issue the compile command and tell dc_shell toreport back on the resultant area and timing so the designer willget feedback on the resultant design.
  • Save the netlist back to a verilog format foruse in downstream tools.


Here is an example design compiler shell script. forthe mux2_1 that does all of these things:

 

# Load up the verilog files (when more files are includedthere
# will be more analyze lines)
analyze -format verilog ./mux2_1.v

# Tell dc_shell the name of the top level module
elaborate mux2_1

# Set timing constaints, this says that a max of .5ns of delayfrom
# input to output is alowable
set_max_delay .5 -to [all_outputs]

# Set the characteristics of the driving cell for allinputs
set_driving_cell -lib_cell INVX1 -pin Y [all_inputs]

# If this were a clocked piece of logic we could set aclock
period to shoot for like this

# create_clock clk -period 1.800

# Check for warnings/errors
check_design

# Use module compiler for arth. DW components
set dw_prefer_mc_inside true

# ungroup everything
ungroup -flatten -all

# flatten it all, this forces all the hierarchy to be flattenedout
set_flatten true -effort high
uniquify

# This forces the compiler to spend as much effort (andtime)
# compiling this RTL to achieve timing possible.
compile_ultra

# Now that the compile is complete report on the results
report_area
report_timing

# Finally write the post synthesis netlist out to a verilogfile
write -f verilog mux2_1 -output mux2_1_post_synth.v -hierarchy

exit


   A copy of thismay be downloaded from here .

4.Now everything is set to compile the mux. Do doso issue the command shown in red in the directory containing thefiles listed above.

pgratz@deskworkingdir $ dc_shell-t -f mux2_1.dc_cmd |tee output.txt


5.Assuming no errors occur there will be severalnew files in your directory once dc_shell is done. The first one tolook at is the output.txt file. This is the log of the compileoutput. Looking at this copy for comparison you should look over the warnings and errors anddetermine if there were any problems durning compile. Note: somewarnings are not indicative of a problem with your design. If thewarning appears in the sample output.txt then it can safely beignored.

 

6.Once satisfied that there are no errors in therun you should skim down nearly to the bottom of output.txt whereyou will find some text like the following:

 ...
report_area
Information: Updating design information... (UID-85)
 
****************************************
Report : area
Design : mux2_1
Version: V-2004.06-SP1
Date   : Mon Nov 27 00:54:532006
****************************************

Library(s) Used:

   osu018_stdcells (File:/projects/cad/open_source_synth_libs/osu_stdcells/lib/tsmc018/lib/osu018_stdcells.db)

Number ofports:              13
Number ofnets:               17
Number ofcells:               8
Number ofreferences:          2

Combinationalarea:       256.000000
Noncombinationalarea:      0.000000
Net Interconnectarea:     undefined  (No wire load specified)

Total cellarea:          256.000000
Totalarea:                undefined
1
...
   This is the area report fromthe synthesis run. The important data here is the "Total cell area:256.000000". This states that the total area used by the

design is 256 "cell units".

 

7.Skimming further down in output.txt you will find thefollowing output: ...
report_timing
 
****************************************
Report : timing
       -path full
       -delay max
       -max_paths 1
Design : mux2_1
Version: V-2004.06-SP1
Date   : Mon Nov 27 00:54:532006
****************************************

Operating Conditions:typical   Library:osu018_stdcells
Wire Load Model Mode: top

  Startpoint: sel (input port)
  Endpoint: out[0] (output port)
  Path Group: default
  Path Type: max

 Point                                   Incr      Path
 -----------------------------------------------------------
  input externaldelay                    0.00      0.00 r
  sel(in)                                0.13      0.13 r
  U20/Y(MUX2X1)                          0.15      0.28 f
  U19/Y(INVX2)                           0.03      0.31 r
  out[0](out)                            0.00      0.31 r
  data arrivaltime                                  0.31

 max_delay                               0.50      0.50
  output externaldelay                   0.00      0.50
  data requiredtime                                 0.50
 -----------------------------------------------------------
  data requiredtime                                 0.50
  data arrivaltime                                 -0.31
 -----------------------------------------------------------
  slack(MET)                                        0.19


1
...

   This piece of text is theoutput of the timing report. It details the worst case or slowestpath through the post synthesis design. Times are shown in

pico seconds. In this case it shows that the slowest paththrough the design takes .31ns. In the mux2_1.dc_cmd file we placeda constraint on the timing that

all outputs must be asserted by at least .500 ns after theinputs change and this is shown in the "data required time". The"slack" is the difference between

the worst case path and the required time. In this case timingis met so the slack is a positive .19 ps. If timing was not metthen the slack would be a

negative value.

 

8.Another file created during the synthesis step aboveis the "mux2_1_post_synth.v"file.

 The contents of this file should be likethis:

 

module mux2_1 ( out, in0, in1, sel );
  output [3:0] out;
  input [3:0] in0;
  input [3:0] in1;
  input sel;
  wire   n7, n8,n9, n10;

  INVX2 U13 ( .A(n7), .Y(out[3]) );
  MUX2X1 U14 ( .A(in1[3]), .B(in0[3]), .S(sel),.Y(n7) );
  INVX2 U15 ( .A(n8), .Y(out[2]) );
  MUX2X1 U16 ( .A(in1[2]), .B(in0[2]), .S(sel),.Y(n8) );
  INVX2 U17 ( .A(n9), .Y(out[1]) );
  MUX2X1 U18 ( .A(in1[1]), .B(in0[1]), .S(sel),.Y(n9) );
  INVX2 U19 ( .A(n10), .Y(out[0]) );
  MUX2X1 U20 ( .A(in1[0]), .B(in0[0]), .S(sel),.Y(n10) );
endmodule

  1.  As you can see this is thepost synthesis netlist written out durning the final step in themux2_1.dc_cmd. In it the behavioral "assign" statment has beenreplaced with multiple instatiations of single bit library MUX2X1mux cells and some INVX2 inverter cells.

This completes the design compiler tutorial. Moreinformation on design compiler may be found on the main cad pageunder synthesis documentation.

Modified by Paul Gratz, pgratz@cs.utexas.edu


.synopsys_dc.setup

set search_path [list ".""/projects/cad/open_source_synth_libs/osu_stdcells/lib/tsmc018/lib""/projects/cad/synopsys/synth/libraries/syn/"

"/projects/cad/synopsys/synth/mc/lib/dp/dplite/""/projects/cad/synopsys/synth/mc/lib/dp""/projects/cad/synopsys/synth/dw/sim_ver/"]

set target_library [list osu018_stdcells.db]

set synthetic_library [list dw_foundation.sldb dw01.sldbdw02.sldb dw03.sldb dw04.sldb dw05.sldb dw06.sldb dw08.sldbdw07.sldb standard.sldb]

set link_library [concat  $target_library$synthetic_library]

set command_log_file "./command.log"

define_design_lib WORK -path ./work

 

脚本文件

# Load up the verilog files (when more files are includedthere
# will be more analyze lines)
analyze -format verilog ./mux2_1.v

# Tell dc_shell the name of the top level module
elaborate mux2_1

# Set timing constaints, this says that a max of .5ns of delayfrom
# input to output is alowable
set_max_delay .5 -to [all_outputs]

# Set the characteristics of the driving cell for allinputs
set_driving_cell -lib_cell INVX1 -pin Y [all_inputs]

# If this were a clocked piece of logic we could set aclock
period to shoot for like this

# create_clock clk -period 1.800

# Check for warnings/errors
check_design

# Use module compiler for arth. DW components
set dw_prefer_mc_inside true

# ungroup everything
ungroup -flatten -all

# flatten it all, this forces all the hierarchy to be flattenedout
set_flatten true -effort high
uniquify

# This forces the compiler to spend as much effort (andtime)
# compiling this RTL to achieve timing possible.
compile_ultra

# Now that the compile is complete report on the results
report_area
report_timing

# Finally write the post synthesis netlist out to a verilogfile
write -f verilog mux2_1 -output mux2_1_post_synth.v -hierarchy

exit 

 

写好以后 
在在当前目录里面运行 dc_shell-t -f mux2_1.dc_cmd |tee output.txt
就可以了

结果一般如下:

          
                      DC Professional (TM)
                          DC Expert (TM)
                           DC Ultra (TM)
                        VHDL Compiler (TM)
                         HDL Compiler (TM)
                       Library Compiler (TM)
                        Power Compiler (TM)
                         DFT Compiler (TM)
                           BSD Compiler
                     DesignWare Developer (TM)

          Version V-2004.06-SP1 for linux -- Jul 15, 2004
             Copyright (c) 1988-2004 by Synopsys, Inc.
                        ALL RIGHTS RESERVED

This program is proprietary and confidential information ofSynopsys, Inc.
and may be used and disclosed only as authorized in a licenseagreement
controlling such use and disclosure.

Initializing...
# Load up the verilog files (when more files are includedthere
# will be more analyze lines)
analyze -format verilog ./mux2_1.v
Running PRESTO HDLC
Compiling source file ./mux2_1.v
Presto compilation completed successfully.
1
# Tell dc_shell the name of the top level module
elaborate mux2_1
Running PRESTO HDLC
Loading db file'/projects/cad/synopsys/synth/libraries/syn/gtech.db'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/standard.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw_foundation.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw01.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw02.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw03.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw04.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw05.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw06.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw08.sldb'
Loading db file'/projects/cad/synopsys/synth/libraries/syn/dw07.sldb'
Loading db file'/projects/cad/open_source_synth_libs/osu_stdcells/lib/tsmc018/lib/osu018_stdcells.db'
Presto compilation completed successfully.
Current design is now 'mux2_1'
1
# Set timing constaints, this says that a max of .5ns of delayfrom
# input to output is alowable
set_max_delay .5 -to [all_outputs]
1
# Set the characteristics of the driving cell for all inputs
set_driving_cell -lib_cell INVX1 -pin Y [all_inputs]
Warning: Design rule attributes from the driving cell will be
 set on the port. (UID-401)
1
# If this were a clocked piece of logic we could set a clock
period to shoot for like this
# create_clock clk -period 1.800
# Check for warnings/errors
check_design
1
# Use module compiler for arth. DW components
set dw_prefer_mc_inside true
true
# ungroup everything
ungroup -flatten -all
Current instance is the top-level of design 'mux2_1'.
Information: Updating design information... (UID-85)
Warning: Design has no hierarchy.  No cells can beungrouped. (UID-228)
0
# flatten it all, this forces all the hierarchy to be flattenedout
set_flatten true -effort high
1
uniquify
1
# This forces the compiler to spend as much effort (and time)
# compiling this RTL to achieve timing possible.
compile_ultra
Information: Data-path optimization is enabled. (DP-1)
Information: Evaluating DesignWare library utilization.(UISN-27)

============================================================================
| DesignWare Building BlockLibrary          Version      | Available |
============================================================================
| Basic DW BuildingBlocks               | V-2004.06-DWF_0406|       |
| Licensed DW BuildingBlocks            | V-2004.06-DWF_0406|       |
============================================================================


  Beginning Pass 1 Mapping
  ------------------------
  Processing 'mux2_1'

  Updating timing information

  Beginning MappingOptimizations  (Ultra High effort)
  -------------------------------
Information: There is no timing violation in design mux2_1.Delay-based auto_ungroup will not be performed. (OPT-780)
  Flattening 'mux2_1'  (Higheffort)  (Single Output Minimization)
  Structuring 'mux2_1'
  Mapping 'mux2_1'

  ELAPSED           WORST NEG TOTAL NEG DESIGN                           
   TIME     AREA     SLACK    SLACK   RULECOST        ENDPOINT        
  --------- --------- --------- ------------------ -------------------------
   0:00:00    256.0     0.00      0.0      0.0                         
   0:00:00    256.0     0.00      0.0      0.0                         


  Beginning Delay Optimization Phase
  ----------------------------------

  ELAPSED           WORST NEG TOTAL NEG DESIGN                           
   TIME     AREA     SLACK    SLACK   RULECOST        ENDPOINT        
  --------- --------- --------- ------------------ -------------------------
   0:00:00    256.0     0.00      0.0      0.0                         
   0:00:00    256.0     0.00      0.0      0.0                         
   0:00:00    256.0     0.00      0.0      0.0                         

  Beginning MappingOptimizations  (Ultra Higheffort)  (Incremental)
  -------------------------------


  Beginning Delay Optimization Phase
  ----------------------------------

  ELAPSED           WORST NEG TOTAL NEG DESIGN                           
   TIME     AREA     SLACK    SLACK   RULECOST        ENDPOINT        
  --------- --------- --------- ------------------ -------------------------
   0:00:00    256.0     0.00      0.0      0.0                         


  Beginning Area-Recovery Phase (max_area 0)
  -----------------------------

  ELAPSED           WORST NEG TOTAL NEG DESIGN                           
   TIME     AREA     SLACK    SLACK   RULECOST        ENDPOINT        
  --------- --------- --------- ------------------ -------------------------
   0:00:00    256.0     0.00      0.0      0.0                         
   0:00:00    256.0     0.00      0.0      0.0                         
   0:00:00    256.0     0.00      0.0      0.0                         
   0:00:00    256.0     0.00      0.0      0.0                         
   0:00:00    256.0     0.00      0.0      0.0                         
   0:00:00    256.0     0.00      0.0      0.0                         

  Optimization Complete
  ---------------------
  Transferring design 'mux2_1' to database'mux2_1.db'

Current design is 'mux2_1'.
1
# Now that the compile is complete report on the results
report_area
Information: Updating design information... (UID-85)
 
****************************************
Report : area
Design : mux2_1
Version: V-2004.06-SP1
Date   : Mon Nov 27 00:54:532006
****************************************

Library(s) Used:

   osu018_stdcells (File:/projects/cad/open_source_synth_libs/osu_stdcells/lib/tsmc018/lib/osu018_stdcells.db)

Number ofports:              13
Number ofnets:               17
Number ofcells:               8
Number ofreferences:          2

Combinationalarea:       256.000000
Noncombinationalarea:      0.000000
Net Interconnectarea:     undefined  (No wire load specified)

Total cellarea:          256.000000
Totalarea:                undefined
1
report_timing
 
****************************************
Report : timing
       -path full
       -delay max
       -max_paths 1
Design : mux2_1
Version: V-2004.06-SP1
Date   : Mon Nov 27 00:54:532006
****************************************

Operating Conditions:typical   Library:osu018_stdcells
Wire Load Model Mode: top

  Startpoint: sel (input port)
  Endpoint: out[0] (output port)
  Path Group: default
  Path Type: max

 Point                                   Incr      Path
 -----------------------------------------------------------
  input externaldelay                    0.00      0.00 r
  sel(in)                                0.13      0.13 r
  U20/Y(MUX2X1)                          0.15      0.28 f
  U19/Y(INVX2)                           0.03      0.31 r
  out[0](out)                            0.00      0.31 r
  data arrivaltime                                  0.31

 max_delay                               0.50      0.50
  output externaldelay                   0.00      0.50
  data requiredtime                                 0.50
 -----------------------------------------------------------
  data requiredtime                                 0.50
  data arrivaltime                                 -0.31
 -----------------------------------------------------------
  slack(MET)                                        0.19


1
# Finally write the post synthesis netlist out to a verilogfile
write -f verilog mux2_1 -output mux2_1_post_synth.v-hierarchy
1
exitInformation: Defining new variable'synlib_iis_accept_all_gened_impl'. (CMD-041)

Thank you...  


  
基本就可以了  成功后可以分析一下代码写的过程 基本就可以搞懂怎么实现脚本的书写了
要注意的有两点 
首先要修改设置里面的目录。
其次是脚本语言的后缀要写对
这样在没有问题执行以后

 

  • 3
    点赞
  • 39
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值