original_docstring: 
          There are some sensitive PIPs and features which mostly deal with clocking resources
          and require special handling, as without the extra features, the clocking tree configuration
          migth be incomplete, resulting in unexpected hardware behavior.
  
          This function handles all the special extra features corresponding to a restricted class
          of special PIPs.
          
docstring: There are some sensitive PIPs and features which mostly deal with clocking resources
  and require special handling, as without the extra features, the clocking tree configuration
  migth be incomplete, resulting in unexpected hardware behavior.
  
  This function handles all the special extra features corresponding to a restricted class
  of special PIPs.
docstring_tokens: There are some sensitive PIPs and features which mostly deal with clocking resources and require special handling as without the extra features the clocking tree configuration migth be incomplete resulting in unexpected hardware behavior . This function handles all the special extra features corresponding to a restricted class of special PIPs .
code: def handle_extra_pip_features(self, extra_pip_features):
          """
          There are some sensitive PIPs and features which mostly deal with clocking resources
          and require special handling, as without the extra features, the clocking tree configuration
          migth be incomplete, resulting in unexpected hardware behavior.
  
          This function handles all the special extra features corresponding to a restricted class
          of special PIPs.
          """
  
          def run_regex_match(extra_feature,
                              tile,
                              wire,
                              extra_wires,
                              enable_extra_wires=True):
              """
              This helper function adds the corresponding extra features based on the callback of
              the ExtraFeature element and the regex match status.
  
              It also adds, if enabled, a set of extra wires belonging to the input wire's
              node, that may require some extra features as well.
              """
  
              extra_wires_to_check = ["CLK_BUFG_REBUF_R_CK", "HCLK_CK_BUFHCLK"]
  
              if any(
                      wire.startswith(extra_wire) for extra_wire in
                      extra_wires_to_check) and enable_extra_wires:
                  node_index = self.device_resources.node(tile, wire).node_index
                  wires = self.device_resources.device_resource_capnp.nodes[
                      node_index].wires
                  for wire_idx in wires:
                      tile_wire = self.device_resources.device_resource_capnp.wires[
                          wire_idx]
                      wire_name = self.device_resources.strs[tile_wire.wire]
                      tile_name = self.device_resources.strs[tile_wire.tile]
  
                      extra_wires.add((tile_name, wire_name))
  
              regex = re.compile(extra_feature.regex)
              m = regex.match(wire)
  
              if m:
                  prefix = extra_feature.callback(m)
  
                  for f in extra_feature.features:
                      f = "{}{}".format(prefix, f)
                      self.add_cell_feature((tile, f))
  
          # TODO: The FASM database should be reformatted so to have more
          #       regular extra PIP features.
          regexs = list()
          regexs.append(
              ExtraFeatures(
                  regex="(CLK_HROW_CK_IN_[LR][0-9]+)",
                  features=["_ACTIVE"],
                  callback=lambda m: m.group(1)))
          regexs.append(
              ExtraFeatures(
                  regex="(CLK_HROW_R_CK_GCLK[0-9]+)",
                  features=["_ACTIVE"],
                  callback=lambda m: m.group(1)))
          regexs.append(
              ExtraFeatures(
                  regex="(HCLK_CMT_CCIO[0-9]+)",
                  features=["_ACTIVE", "_USED"],
                  callback=lambda m: m.group(1)))
          regexs.append(
              ExtraFeatures(
                  regex="(HCLK_CMT_CK_BUFHCLK[0-9]+)",
                  features=["_USED"],
                  callback=lambda m: m.group(1)))
          regexs.append(
              ExtraFeatures(
                  regex="CLK_BUFG_REBUF_R_CK_(GCLK[0-9]+)_BOT",
                  features=["_ENABLE_ABOVE"],
                  callback=lambda m: m.group(1)))
          regexs.append(
              ExtraFeatures(
                  regex="CLK_BUFG_REBUF_R_CK_(GCLK[0-9]+)_TOP",
                  features=["_ENABLE_BELOW"],
                  callback=lambda m: m.group(1)))
          regexs.append(
              ExtraFeatures(
                  regex="(HCLK_CK_BUFHCLK[0-9]+)",
                  features=[""],
                  callback=lambda m: "ENABLE_BUFFER.{}".format(m.group(1))))
  
          extra_wires = set()
          for tile_pips in extra_pip_features.values():
              for tile, wire in tile_pips:
                  for extra_feature in regexs:
                      run_regex_match(extra_feature, tile, wire, extra_wires)
  
          # Handle extra wires
          exclude_tiles = [
              "HCLK_L", "HCLK_R", "HCLK_L_BOT_UTURN", "HCLK_R_BOT_UTURN"
          ]
          for tile, wire in extra_wires:
              if any(
                      tile.startswith(exclude_tile)
                      for exclude_tile in exclude_tiles):
                  continue
  
              for extra_feature in regexs:
                  run_regex_match(extra_feature, tile, wire, extra_wires, False)
code_tokens: def handle_extra_pip_features ( self , extra_pip_features ) : def run_regex_match ( extra_feature , tile , wire , extra_wires , enable_extra_wires = True ) : """
              This helper function adds the corresponding extra features based on the callback of
              the ExtraFeature element and the regex match status.
  
              It also adds, if enabled, a set of extra wires belonging to the input wire's
              node, that may require some extra features as well.
              """ extra_wires_to_check = [ "CLK_BUFG_REBUF_R_CK" , "HCLK_CK_BUFHCLK" ] if any ( wire . startswith ( extra_wire ) for extra_wire in extra_wires_to_check ) and enable_extra_wires : node_index = self . device_resources . node ( tile , wire ) . node_index wires = self . device_resources . device_resource_capnp . nodes [ node_index ] . wires for wire_idx in wires : tile_wire = self . device_resources . device_resource_capnp . wires [ wire_idx ] wire_name = self . device_resources . strs [ tile_wire . wire ] tile_name = self . device_resources . strs [ tile_wire . tile ] extra_wires . add ( ( tile_name , wire_name ) ) regex = re . compile ( extra_feature . regex ) m = regex . match ( wire ) if m : prefix = extra_feature . callback ( m ) for f in extra_feature . features : f = "{}{}" . format ( prefix , f ) self . add_cell_feature ( ( tile , f ) ) regexs = list ( ) regexs . append ( ExtraFeatures ( regex = "(CLK_HROW_CK_IN_[LR][0-9]+)" , features = [ "_ACTIVE" ] , callback = lambda m : m . group ( 1 ) ) ) regexs . append ( ExtraFeatures ( regex = "(CLK_HROW_R_CK_GCLK[0-9]+)" , features = [ "_ACTIVE" ] , callback = lambda m : m . group ( 1 ) ) ) regexs . append ( ExtraFeatures ( regex = "(HCLK_CMT_CCIO[0-9]+)" , features = [ "_ACTIVE" , "_USED" ] , callback = lambda m : m . group ( 1 ) ) ) regexs . append ( ExtraFeatures ( regex = "(HCLK_CMT_CK_BUFHCLK[0-9]+)" , features = [ "_USED" ] , callback = lambda m : m . group ( 1 ) ) ) regexs . append ( ExtraFeatures ( regex = "CLK_BUFG_REBUF_R_CK_(GCLK[0-9]+)_BOT" , features = [ "_ENABLE_ABOVE" ] , callback = lambda m : m . group ( 1 ) ) ) regexs . append ( ExtraFeatures ( regex = "CLK_BUFG_REBUF_R_CK_(GCLK[0-9]+)_TOP" , features = [ "_ENABLE_BELOW" ] , callback = lambda m : m . group ( 1 ) ) ) regexs . append ( ExtraFeatures ( regex = "(HCLK_CK_BUFHCLK[0-9]+)" , features = [ "" ] , callback = lambda m : "ENABLE_BUFFER.{}" . format ( m . group ( 1 ) ) ) ) extra_wires = set ( ) for tile_pips in extra_pip_features . values ( ) : for tile , wire in tile_pips : for extra_feature in regexs : run_regex_match ( extra_feature , tile , wire , extra_wires ) exclude_tiles = [ "HCLK_L" , "HCLK_R" , "HCLK_L_BOT_UTURN" , "HCLK_R_BOT_UTURN" ] for tile , wire in extra_wires : if any ( tile . startswith ( exclude_tile ) for exclude_tile in exclude_tiles ) : continue for extra_feature in regexs : run_regex_match ( extra_feature , tile , wire , extra_wires , False )
short_docstring: There are some sensitive PIPs and features which mostly deal with clocking resources
  and require special handling, as without the extra features, the clocking tree configuration
  migth be incomplete, resulting in unexpected hardware behavior.
short_docstring_tokens: There are some sensitive PIPs and features which mostly deal with clocking resources and require special handling as without the extra features the clocking tree configuration migth be incomplete resulting in unexpected hardware behavior .
comment: """
          There are some sensitive PIPs and features which mostly deal with clocking resources
          and require special handling, as without the extra features, the clocking tree configuration
          migth be incomplete, resulting in unexpected hardware behavior.
  
          This function handles all the special extra features corresponding to a restricted class
          of special PIPs.
          """$SEP$"""
              This helper function adds the corresponding extra features based on the callback of
              the ExtraFeature element and the regex match status.
  
              It also adds, if enabled, a set of extra wires belonging to the input wire's
              node, that may require some extra features as well.
              """$SEP$# TODO: The FASM database should be reformatted so to have more$SEP$#       regular extra PIP features.$SEP$# Handle extra wires