所需文件

标准流程产生的文件

  • spef(start_rc 提取)
  • netlist(布局布线后的网表,以及逻辑综合后的网表)
  • sdc(逻辑综合和布局布线)

自定义的文件提取

  • pt时序报告(逻辑综合和布局布线后,获取每个寄存器数据路径处的slack值的值)
  report_timing -max_paths 100 -slack_lesser_than 100 -nworst 1 -nets -transition_time -capacitance -input_pins -delay_type max -significant_digits 7 -rise_to [all_registers -data_pins]
  • 布局信息(逻辑综合和布线后,获取数据集)
    1.导入特征提取函数(布局布线后的特征提取函数)
proc format_float {number {format_str "%.6f"}} {
        switch -exact -- $number {
        UNINIT { }
        INFINITY { }
             default {set number [format $format_str $number]}
           }
           return $number;
}

proc show_paths {args} {
           echo [format "%-20s %-20s %7s" "From" "To" "Slack"]
           echo "--------------------------------------------------------"
           foreach_in_collection path [get_timing_paths -nworst 1] {
             set slack [get_attribute $path slack]
             set startpoint [get_attribute $path startpoint]
             set endpoint [get_attribute $path endpoint]
             set point [get_attribute $path points]
         echo [llength $point]

         foreach_in_collection cell $point  {
            echo $cell
            echo [format "%s " [get_attribute $cell full_name] ]        
        }
           }
         }

proc show_arcs {args} {

           set arcs [eval [concat get_timing_arcs $args]]
           echo [format "%15s    %-15s  %8s %8s  %s" "from_pin" "to_pin" \
                     "rise" "fall" "is_cellarc"]
           echo [format "%15s    %-15s  %8s %8s  %s" "--------" "------" \
                     "----" "----" "----------"]

           foreach_in_collection arc $arcs {
             set is_cellarc [get_attribute $arc is_cellarc]
             set fpin [get_attribute $arc from_pin]
             set tpin [get_attribute $arc to_pin]
             set rise [get_attribute $arc delay_max_rise]
             set fall [get_attribute $arc delay_max_fall]

             set from_pin_name [get_attribute $fpin full_name]

             set to_pin_name [get_attribute $tpin full_name]
             echo [format "%15s -> %-15s  %8s %8s  %s  %s %s %s" \
                 $from_pin_name\
                 $to_pin_name \
                 [format_float $rise]\
                 [format_float $fall] \
                 $is_cellarc\
                 [get_attribute $arc is_disabled]\
                 [get_attribute $arc when]\
                 [get_attribute $arc sense]\
                 ]
           }
         }

proc export_timing {} { 
  #Inport
  set count 0
  echo "Inport" 
  echo [sizeof_collection [get_ports * -filter "direction==in"]]
  foreach_in_collection inPort [get_ports * -filter "direction==in"] {
    echo [format "%s %s %s"\
    [get_attribute $inPort full_name] \
    [get_attribute $inPort x_coordinate]\
    [get_attribute $inPort y_coordinate]\
    ]
}
  #Outport
  echo "Outport"
  echo [sizeof_collection [get_ports * -filter "direction==out"] ]
  foreach_in_collection outPort [get_ports * -filter "direction==out"] {
    echo [format "%s %s %s"\
    [get_attribute $outPort full_name]\
    [get_attribute $outPort x_coordinate]\
    [get_attribute $outPort y_coordinate]\
    ]
}
  set count 0
    #com_cell
  echo "com_cell"
  echo [sizeof_collection [get_cells -hierarchical * \
  -filter "is_combinational==true" ]]
  foreach_in_collection cell [get_cells -hierarchical * \
  -filter is_combinational==true] {
      if {  [get_attribute $cell is_hierarchical] ==false \
           && [get_attribute $cell number_of_pins] >1} {
             echo [format "%s" [get_attribute $cell full_name]  ]
             foreach_in_collection pin [get_pins -of_objects $cell \
             -filter "direction==in"] {
               foreach_in_collection pinOut [get_pins -of_objects $cell \
               -filter  "direction==out"] {
                # name  slew  capacitance location1 location2 delay
                  echo [format "%s %s %s %s %s %s %s,%s %s %s %s %s,%s | %s,%s"\
                  [get_attribute $pin full_name]\
                  [get_attribute $pin actual_rise_transition_max]\
                  [get_attribute $pin actual_fall_transition_max]\
                  [get_attribute $pin pin_capacitance_max_rise] \
                  [get_attribute $pin pin_capacitance_max_fall]\
                  [get_attribute $pin x_coordinate]\
                  [get_attribute $pin y_coordinate] \
                  \
                  [get_attribute $pinOut full_name] \
                  [get_attribute $pinOut x_coordinate]\
                  [get_attribute $pinOut y_coordinate]\
                  [get_attribute $pinOut actual_rise_transition_max]\
                  [get_attribute $pinOut actual_fall_transition_max]\
                  \
                  [get_attribute [get_timing_arcs -from $pin -to $pinOut ] delay_max_rise]\
                  [get_attribute [get_timing_arcs -from $pin -to $pinOut ] delay_max_fall]\
                  \
                  [get_attribute [get_timing_arcs -from $pin -to $pinOut] sense ] ]       
                  }                      
                  }         
                  }  else  {
                  set count [expr {$count +1}] 
                  echo [format "alone %s " [get_attribute $cell full_name]  ]
                 } 

    }
  #reg_cell
  echo "reg_cell"
  echo [sizeof_collection [get_cells -hierarchical * \
  -filter "is_combinational==false" ]]
    foreach_in_collection cell [get_cells -hierarchical * \
  -filter "is_combinational==false"] {
    if { [get_attribute $cell is_hierarchical] ==false \
      && [get_attribute $cell number_of_pins] !=1} {
        echo [format "%s " [get_attribute $cell full_name]  ]
        foreach_in_collection pin [get_pins -of_objects $cell \
    -filter "direction==in"] {  
            foreach_in_collection pinOut [get_pins -of_objects $cell \
      -filter "direction==out"] {
            # name  slew  capacitance location1 location2 delay         
            echo [format "%s %s %s %s %s %s %s %s,%s %s %s %s,%s | %s,%s"\
      [get_attribute $pin full_name]\
      [get_attribute $pin actual_rise_transition_max]\
      [get_attribute $pin actual_fall_transition_max]\
      [get_attribute $pin pin_capacitance_max_rise] \
      [get_attribute $pin pin_capacitance_max_fall]\
            [get_attribute $pin x_coordinate]\
      [get_attribute $pin y_coordinate] \
      \
            [get_attribute $pinOut full_name] \
      [get_attribute $pinOut x_coordinate]\
      [get_attribute $pinOut y_coordinate]\
      [get_attribute $pinOut actual_rise_transition_max]\
      [get_attribute $pinOut actual_fall_transition_max]\
      \
      [get_attribute [get_timing_arcs -from $pin -to $pinOut ] delay_max_rise]\
      [get_attribute [get_timing_arcs -from $pin -to $pinOut ] delay_max_fall]\
      \
      [get_attribute [get_timing_arcs -from $pin -to $pinOut ] sense]
      ]
            }
                    
        } 
    }  else  {
       set count [expr {$count +1}] 
       echo [format "alone %s " [get_attribute $cell full_name]  ]  
     }

    }
  echo $count
  echo "netflag"
    foreach_in_collection net  [get_nets -hierarchical *] {
        echo [format "%s %s %s %s" \
    [get_attribute $net full_name]\
    [get_attribute $net pin_capacitance_max_rise]\
    [get_attribute $net pin_capacitance_max_fall]\
    [get_attribute $net wire_capacitance_max]\
    ]
        foreach_in_collection driver [get_attribute $net leaf_drivers] {
            foreach_in_collection sink [get_attribute $net leaf_loads] {
                  #start end delay
                  echo [format "%s  %s  %s  %s" \
            [get_attribute $driver full_name] \
            [get_attribute $sink full_name] \
            [get_attribute [get_timing_arcs -from $driver -to $sink ] delay_max_rise]\
            [get_attribute [get_timing_arcs -from $driver -to $sink ] delay_max_fall]
        ]
            }
        }
    }
}

逻辑综合后,特征提取的函数

proc format_float {number {format_str "%.6f"}} {
        switch -exact -- $number {
        UNINIT { }
        INFINITY { }
             default {set number [format $format_str $number]}
           }
           return $number;
}

proc show_paths {args} {
           echo [format "%-20s %-20s %7s" "From" "To" "Slack"]
           echo "--------------------------------------------------------"
           foreach_in_collection path [get_timing_paths -nworst 1] {
             set slack [get_attribute $path slack]
             set startpoint [get_attribute $path startpoint]
             set endpoint [get_attribute $path endpoint]
             set point [get_attribute $path points]
         echo [llength $point]

         foreach_in_collection cell $point  {
            echo $cell
            echo [format "%s " [get_attribute $cell full_name] ]        
        }
           }
         }

proc show_arcs {args} {

           set arcs [eval [concat get_timing_arcs $args]]
           echo [format "%15s    %-15s  %8s %8s  %s" "from_pin" "to_pin" \
                     "rise" "fall" "is_cellarc"]
           echo [format "%15s    %-15s  %8s %8s  %s" "--------" "------" \
                     "----" "----" "----------"]

           foreach_in_collection arc $arcs {
             set is_cellarc [get_attribute $arc is_cellarc]
             set fpin [get_attribute $arc from_pin]
             set tpin [get_attribute $arc to_pin]
             set rise [get_attribute $arc delay_max_rise]
             set fall [get_attribute $arc delay_max_fall]

             set from_pin_name [get_attribute $fpin full_name]

             set to_pin_name [get_attribute $tpin full_name]
             echo [format "%15s -> %-15s  %8s %8s  %s  %s %s %s" \
                 $from_pin_name\
                 $to_pin_name \
                 [format_float $rise]\
                 [format_float $fall] \
                 $is_cellarc\
                 [get_attribute $arc is_disabled]\
                 [get_attribute $arc when]\
                 [get_attribute $arc sense]\
                 ]
           }
         }

proc export_timing {} { 
  #Inport
  set pad "0"
  set count 0
  echo "Inport" 
  echo [sizeof_collection [get_ports * -filter "direction==in"]]
  foreach_in_collection inPort [get_ports * -filter "direction==in"] {
    echo [format "%s %s %s"\
    [get_attribute $inPort full_name] \
    $pad\
    $pad\
    ]
}
  #Outport
  echo "Outport"
  echo [sizeof_collection [get_ports * -filter "direction==out"] ]
  foreach_in_collection outPort [get_ports * -filter "direction==out"] {
    echo [format "%s %s %s"\
    [get_attribute $outPort full_name]\
    $pad\
    $pad\
    ]
}
  set count 0
    #com_cell
  echo "com_cell"
  echo [sizeof_collection [get_cells -hierarchical * \
  -filter "is_combinational==true" ]]
  foreach_in_collection cell [get_cells -hierarchical * \
  -filter is_combinational==true] {
      if {  [get_attribute $cell is_hierarchical] ==false \
           && [get_attribute $cell number_of_pins] >1} {
             echo [format "%s" [get_attribute $cell full_name]  ]
             foreach_in_collection pin [get_pins -of_objects $cell \
             -filter "direction==in"] {
               foreach_in_collection pinOut [get_pins -of_objects $cell \
               -filter  "direction==out"] {
                # name  slew  capacitance location1 location2 delay
                  echo [format "%s %s %s %s %s %s %s,%s %s %s %s %s,%s | %s,%s"\
                  [get_attribute $pin full_name]\
                  [get_attribute $pin actual_rise_transition_max]\
                  [get_attribute $pin actual_fall_transition_max]\
                  [get_attribute $pin pin_capacitance_max_rise] \
                  [get_attribute $pin pin_capacitance_max_fall]\
                  $pad\
                  $pad\
                  \
                  [get_attribute $pinOut full_name] \
                  $pad\
                  $pad\
                  [get_attribute $pinOut actual_rise_transition_max]\
                  [get_attribute $pinOut actual_fall_transition_max]\
                  \
                  [get_attribute [get_timing_arcs -from $pin -to $pinOut ] delay_max_rise]\
                  [get_attribute [get_timing_arcs -from $pin -to $pinOut ] delay_max_fall]\
                  \
                  [get_attribute [get_timing_arcs -from $pin -to $pinOut] sense ] ]       
                  }                      
                  }         
                  }  else  {
                  set count [expr {$count +1}] 
                  echo [format "alone %s " [get_attribute $cell full_name]  ]
                 } 

    }
  #reg_cell
  echo "reg_cell"
  echo [sizeof_collection [get_cells -hierarchical * \
  -filter "is_combinational==false" ]]
    foreach_in_collection cell [get_cells -hierarchical * \
  -filter "is_combinational==false"] {
    if { [get_attribute $cell is_hierarchical] ==false \
      && [get_attribute $cell number_of_pins] !=1} {
        echo [format "%s " [get_attribute $cell full_name]  ]
        foreach_in_collection pin [get_pins -of_objects $cell \
    -filter "direction==in"] {  
            foreach_in_collection pinOut [get_pins -of_objects $cell \
      -filter "direction==out"] {
            # name  slew  capacitance location1 location2 delay         
            echo [format "%s %s %s %s %s %s %s %s,%s %s %s %s,%s | %s,%s"\
      [get_attribute $pin full_name]\
      [get_attribute $pin actual_rise_transition_max]\
      [get_attribute $pin actual_fall_transition_max]\
      [get_attribute $pin pin_capacitance_max_rise] \
      [get_attribute $pin pin_capacitance_max_fall]\
            $pad\
      $pad \
            [get_attribute $pinOut full_name] \
      \
      $pad\
      $pad\
      [get_attribute $pinOut actual_rise_transition_max]\
      [get_attribute $pin actual_fall_transition_max]\
      \
      [get_attribute [get_timing_arcs -from $pin -to $pinOut ] delay_max_rise]\
      [get_attribute [get_timing_arcs -from $pin -to $pinOut ] delay_max_fall]\
      \
      [get_attribute [get_timing_arcs -from $pin -to $pinOut ] sense]
      ]
            }
                    
        } 
    }  else  {
       set count [expr {$count +1}] 
       echo [format "alone %s " [get_attribute $cell full_name]  ]  
     }

    }
  echo $count
  echo "netflag"
    foreach_in_collection net  [get_nets -hierarchical *] {
        echo [format "%s %s %s %s" \
    [get_attribute $net full_name]\
    [get_attribute $net pin_capacitance_max_rise]\
    [get_attribute $net pin_capacitance_max_fall]\
    [get_attribute $net wire_capacitance_max]\
    ]
        foreach_in_collection driver [get_attribute $net leaf_drivers] {
            foreach_in_collection sink [get_attribute $net leaf_loads] {
                  #start end delay
                  echo [format "%s  %s  %s  %s" \
            [get_attribute $driver full_name] \
            [get_attribute $sink full_name] \
            [get_attribute [get_timing_arcs -from $driver -to $sink ] delay_max_rise]\
            [get_attribute [get_timing_arcs -from $driver -to $sink ] delay_max_fall]
        ]
            }
        }
    }
}

2.输出特征

export_timing
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容