yuanpin318的个人空间 https://blog.eetop.cn/13812 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

synthesis

热度 3已有 1755 次阅读| 2019-6-16 23:13 |个人分类:DC|系统分类:芯片设计


1. 综合过程
    RTL->GTECH->Gate Netlist + SDC
          GTECH: 只有DC使用,GTECH没有timing和load的特征
          ddc:DC内部使用的一种binary design数据库格式,ICC和PT也可以使用
          db:DC使用的旧的一种binary design数据库格式,已经被ddc取代,但libary文件还在使用db格式
          Interconnect RC的两种mode
                   WLM: 有两种nets: 过度估计延迟,过少估计延迟,都会计算出确切的R和C的值
                   netlist中会包含over-buffered和under-buffered的gate,都会对physical design工具造成额外的负担,造成额外的iteration
                          under-buffered path: 工具需要fix timing
                          over-buffered path: 工具需要减少area, power
        topographical:综合时根据congestion-aware的routing预估会做粗略的placement
                  使得post-layout的结果和相关的RC更加紧密,从而获得更好的post-layout 的QoR和TTR
                         QoR: Quality of Results: Timing, area, power, testability and congestion(routability)
                        TTR: Time to Results: 做完整个design flow所要花费的时间
                 但是需要physical libary和physical technology data
                 为获得更好的结果,最好需要floorplan的definition
                 DC-ultra, DesignWare不需要额外的license
                 DC-extension license可以进行congestion分析和优化
                 推荐2-pass综合流程
                        a. layout工具使用第一次的netlist来进行floorplan
                        b. 在floorplan的基础上得到的netlist来进行P&R
                                 floorplan的约束: core logic的placement区域的size和shape
                                        Macro的placement
                                        standard cell所需要避让的区域
                                    
    translation -> gate optimization -> gate mapping
   
2. 综合

3. DC启动方式
    3.1 GUI:  design_vision -topographical_mode    // -topo: 使用P&R信息
           topo流程:运行dc(没有topo option), 生成的netlist交给place tool,生成具有place的timing信息,再启动dc + topo + spef (dct or dcg)
    3.2 DC_SHELL: dc_shell -topographical_mode
    3.3 batch mode: dc_shell -topo -f run.tcl | tee -i dc.log
    3.4 DC中类似unix的命令: pwd, cd, ls, history, !!, !7,  !rep, sh <UNIX_command>,  get_unix_variable <UNIX_env_variable>

4. .synopsys_dc.setup配置文件(或用户自己写一个配置文件,在DC启动后再调用) -- logical library
   a. 运行顺序
      dc安装目录($SYNOPSYS/admin/setup) -> ~user -> DC启动的目录
   b. 用于设置libaray和DC variables
   c. search_path: design and library的搜索路径,包括“target_library", "link_library"所在的目录
           e.g.:   set_app_var search_path   ".    data/lib/ram_lib"
           DC搜索时只会搜索指定的目录,不会去它的子目录搜索
           set_app_var也可以用set,因为DC支持Tcl,但不推荐。如果使用set, 一旦发生错误,如果变量名写错,DC不会报错。set_app_var的话,DC会报错
   d. target_library: 与foundary工艺相关的标准库,用于将GTECH映射到gate-level netlist
           e.g.: set_app_var target_library "s90_mhvt_slown40.db"
           .db文件不是ASCII格式,用户无法读取。可以读取.lib文件
   e. link_library: 解决design中所有要例化的模块,包括hard IP(RAM, IO PAD和analog IP)
           e.g.: set_app_var link_library "* $ram_lib $io_lib $analog_lib $target_library"    #*: 表示DC memory
   f. symbol_libary: GUI模式下的cell的符号库,只用于显示

5. tartget_lib:
    a. 包含了许多cell,在每个cell中,包括了function, transition, delay, capacitance...
    b. 使用.db格式,不可读,通常会有一个可读取的对应的.lib的文件
        library header: 各种变量的单位
               
        standard cell:
             

6. read RTL design:
    a. current_design: active design
    b. read verilog RTL:
         b.1 read_verilog top.v   #等价于read_file -format verilog     #功能上相当于DC命令analyze+elaborate
               read_verilog A.v
               read_verilog B.v     #current_design is last file read: B.v
        b.2  read_verilog {top.v A.v B.v}    #current_design is 1st file in list: top.v
        b.3  不要使用默认的current_design,直接使用DC命令current_design定义
    c. link: 解决current_design中的所有reference
    d. analyze: 还会分析语法错误
             d.1 elaborate: 具有current_design+link的操作
             d.2 analyze命令: analyze -define {} -format {verilog|sverilog|vhdl}
                                                   -define: 制定synthesis时所用的constant macro
                                                   -format: 如果没有,DC会根据文件的扩展名自行决定哪一种语言
                               analyze -format verilog {A.v B.v chip_top.v}
                               elaborate chip_top
            d.3 所以就可以不需要current_design和link命令了
    e. read命令的作用:
        e.1 导入GTECH库和link library
        e.2 读入RTL文件并翻译成unmapped GTECH ddc
        e.3 从DC memory中选择一个作为current design
   f. read_ddc: read_ddc {DECODE.ddc ENCODE.ddc}
      f.1 .ddc是synopsys内部数据库格式
      f.2 加密的IP可以在RTL中例化,综合库中使用ddc格式,用户只能compile但不能看到其中的RTL,例如ARM core
  g. check_design:
      g.1 最好在link结束使用check_design命令
      g.2 检查current design: connectivity, hierarchy issue, 例如: missing ports, unconnected input pin
      g.3 在DC(所有的synopsys EDA)中,返回值1表示成功,0表示失败
            所以如果有什么issue,check_design的返回值是0
   h: 使用write命令把design写成ddc格式的文件: write -format ddc -hier -output unmapped/chip_top_gtech.ddc
      h.1 为什么保存unmapped DDC文件
         h.1.1 大的design的RTL->ddc的转换非常耗时
         h.1.2 将来可能需要重读un-compiled design
         h.1.3 而使用read_ddc读取unmapped gtech file就会快得多

i: 从旧的工艺库转换成新的工艺库:永远从最原始的RTL开始
   i.1 旧的工艺库及约束:  libs/old_slow_55n.db   scr/old_con.tcl
       新的工艺库及约束:  libs/new_slow_40n.db   scr/new_con.tcl
            set_app_var search_path "./libs ./scr"
            set_app_var targ_library "new_slow_40n.db"
            set_app_var link_library "* old_slow_55n.db"   #防止RTL中例化了某些旧的工艺库中的cell
            read_verilog original_rtl.v
            link
            check_design
            source new_con.tcl
            check_timing
            compile_ultra
   i.2 但是只有旧的netlist该怎么办?
            set_app_var search_path "./libs ./scr"
            set_app_var targ_library "new_slow_40n.db"
            set_app_var link_library "* old_slow_55n.db"   #防止RTL中例化了某些旧的工艺库中的cell
            read_verilog old_netlist.v
            link
            check_design
            source new_con.tcl
            check_timing
            compile_ultra
            write -f verilog -out new_netlist.verilog
            set_app_var link_library "new_slow_40n.db"     #使后续操作全部使用新的库文件

7. design & library objects
   
    7.1  design: 里面一定要有sub-design或library cell;可以包含instances,nets,ports,pins
           reference: 可以是library component或sub-design
           hierarchical design: 有一个或多个sub-design
           flat design: 没有sub-design,里面只有library cell和hard ip
              e.g.:           design: TOP, ENCODER, REGFILE      # 为什么INV不是design?   #INV是leaf cell
                                reference: ENCODER, REGFILE, INV   #reference: RTL中的module
                                instance: U1, U2, U3, U4
                                port: A, B, C, D, CLK, OUT                 #current_design的input, output; 方向可以是input, output, inout
                                pin: cell 的input和output                    #sub-design的port在parent-design中就是pin
                                                                                         #pin-port在current_design切换时会改变
           a. design可以包含6种object: design, cell, port, pin, net, clock
           b. port attributes: direction, load, driving_cell_rise, max_capacitance ...
           c. cell attributes: dont_touch, is_hierarchical, is_mapped, is_sequential ...
                     显示attributes: list_attributes -application -class <object_type>   #object_type = design, port, pin, net, clock, lib, reference, cluster or bag
                    将命令的output redirect到其它文件: redirect -file xxx {list_attributes -application -class cell}


    7.2 get_* command: set_load 3 [get_net OUT1]
          7.2.1 返回current_design, DC memory或library中的object的handle
          7.2.2 可以以stand-alone或embedded的方式使用(Tcl的embedded命令方式是[...])
          7.2.3 可以和通配符?或*一起使用(?匹配一个字符,*匹配0或多个字符)
                   set_load 3 [get_ports  and2*]
                   set_load 5 [get_ports  "y??p Z*"]
         7.2.4 get_*命令的返回值是匹配她的argument的objects的collection
                  如果没有匹配的object, 返回值就是一个空的collection
        7.2.5 get_clocks, get_cells, get_designsget_libs, get_nets, get_pins, get_ports
        7.2.6 all_*命令
                   all_inputs: 返回curren_design中的所有的input和inout的ports的collection
                   all_outputs: 返回curren_design中的所有的output和inout的ports的collection
                   all_clocks: 返回curren_design(不包括sub-design)中的所有的clock
                   all_registers: 返回整个design(包括sub-design)中的所有的register的collection
                   all_ideal_nets:
                   all_fanin:
                   all_fanout:
                   all_connected:
                  all_dont_touch:
                  all_high_fanout:
        7.2.7 举例
                
          a. get_ports ZOUT   #返回2-bit
             get_ports ZOUT[1]
         b. get_pins ENCODER/AIN
         c. get_ports C*      #返回的是{C, CLK}
         d. get_pin ENCODER/A?N    #返回的是{ENCODER/AIN}
         e. remove_from collection [all_inputs] [get_ports CLK]       #返回{A B C D}
         f. query_ojects $pci_ports     # 返回一个collection
            get_object_name                 #返回一个string:object的name
         g. sizeof_collection $pci_ports   #
         h. add_to_collection $pci_ports [get_ports CTRL*]
         i. filter_collections [get_cells *] "ref_name=~AN*" [get_ports CLK]
         j. get_cells * -filter "dont_touch == true"
         k. list_attributes -application -class <object_type>
    7.3 get_port
        a. 完整的命令是get_ports
        b. DC中规定,如果不完整的命令可以和别的命令区分,DC会把它当作一个完整的mingling
                 get_po, get_port: DC都会把它们当作是get_ports命令
    7.4 DC使用的Tcl命令
          a. set: 定义一个变量:set foo [get_ports p*]
          b. echo: 在屏幕上显示:echo $foo
          c. Tcl中,list和collection是两个概念。list命令(concat, llength, lappend...)不可以和collection命令的输出一起使用
                  list: 一种structure,存储着user-defined data,遍历访问采用“forreach”
                  collection: 用于访问database data,遍历访问采用“forreach_in_collection”
          d. collection相关的命令:
              add_to_collection, compare_collections, copy_collection, filter_collection, foreach_in_collection, index_collection, remove_from_collection, sizeof_collection, sort_collection
              d.1 filter_collection [get_cells *] "ref_name =~ AN*"    #filter_collection 会产生一个新的collection
              d.2 filter_collection [get_cells *] "is_mapped != true"
              d.3 -filter是filter_collection的short-cut:                        #-filter更加有效,因为不需要读两次
                     get_cells* -filter "dont_touch == true"
                     set fastclks [get_clocks * -filter "period <10"]
              d.4 关系操作符:==, !=, >, <, >=, <=, =~,!~
              d.5 foreach_in_collection cell [get_cells -hier * -filter "is_hierarchical == true"] {  echo "[get_object_name $cell]"}

20. TCL与DC
      20.1 Tcl 基本语法
             20.1.1 变量
                   set  target_library "wc.db   io_wc.db"
                   echo $target_libary
                   puts "Expression is 3"
                   printvar target_libary   #DC特有,一般用于显示DC中特殊变量
            20.1.2 程序控制
                   20.1.2.1 if-else
                          if { $num == 0 } {                              if { $num == 0 } {
                              echo "Number is 0"                                echo "Number is 0"
                          } else {                                                } elseif { $num == 1) {
                             echo "Number is non-zero"                      echo "Number is 1"
                          }                                   }                     else {
                                                                                             echo "Number is not 0 or 1"
                                                                                         }
                20.1.2.2 switch
                       switch $num
                           0 { puts "Expression is 0" }
                           1 { puts "Expression is 1" }
                           2 { puts "Expression is 2" }
                           default { puts "Expression is $num" }
                20.1.2.3 loop
                        set i 0                                  for { set i 0 } { $i < 10 } { incr i 1 } {                        
                        while { $i < 10 } {                         puts "value is $i"
                            puts "value is $i"                   }
                        }
        20.1.3 数组(列表)与数组(列表)的遍历
                     set names [ list "Icer" "Coder" "number" 11 22 ]
                     foreach num_list $names {
                         switch $num_list {
                             "ICer" { puts "Name 1 is $num_list" }
                             "Coder" { puts "Name 2 is $num_list" }
                             default { puts "$num_list isn't a name" }
        20.1.4 子程序的定义和调用
            proc max { a b } {  #max: 函数名, 参数列表: a, b
               if { $a > $b } {
                  set y $a;
               } elseif { $a < $b } {
                   set y $b;
               } else {
                   set y "a=b=$a";
               }
               return $y; #返回值
            }
            调用: max 2 3
        20.1.5 文件的读写
            set valuefile "hello tcl"                           set read_value "";
            set wfh [ open data.txt w+ ]                        set rfh [ open data.txt r ]
            puts $wfh $valuefile                                gets $rfh read_value ; #读取第一行
            flush $wfh ;                                        close $rfh
            close $wfh ;                                        puts $read_value
             
    
2

点赞

刚表态过的朋友 (2 人)

发表评论 评论 (1 个评论)

回复 弗兰明 2023-3-22 13:03
非常有用!!!

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 11

    粉丝
  • 2

    好友
  • 18

    获赞
  • 7

    评论
  • 3605

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-29 17:48 , Processed in 0.169398 second(s), 10 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部