original_docstring: Update a single (digital) IO, often including several LEF pins.
docstring: Update a single (digital) IO, often including several LEF pins.
docstring_tokens: Update a single ( digital ) IO often including several LEF pins .
code: def update_io(inp: TextIOWrapper, n: int, io: tuple) -> None:
      """Update a single (digital) IO, often including several LEF pins."""
  
      if io is None:
          # No connection to this pad; remove its IO from the LEF
          return remove_pins(inp, [f"io_out[{n}]", f"io_in[{n}]", f"io_oeb[{n}]"])
  
      tp = io[0]
      if tp == Dir.OUTPUT:
          name = io[1]
          inp = remove_pins(inp, [f"io_in[{n}]", f"io_oeb[{n}]"])
          inp = rename_pins(inp, {f"io_out[{n}]": name})
          return inp
      if tp == Dir.INPUT:
          name = io[1]
          inp = remove_pins(inp, [f"io_out[{n}]", f"io_oeb[{n}]"])
          inp = rename_pins(inp, {f"io_in[{n}]": name})
          return inp
      if tp == Dir.INOUT:
          in_name, out_name, oe_name = io[1], io[2], io[3]
          return rename_pins(
              inp,
              {
                  f"io_in[{n}]": in_name,
                  f"io_out[{n}]": out_name,
                  f"io_oeb[{n}]": oe_name,
              },
          )
      raise ValueError
code_tokens: def update_io ( inp : TextIOWrapper , n : int , io : tuple ) -> None : if io is None : return remove_pins ( inp , [ f"io_out[{n}]" , f"io_in[{n}]" , f"io_oeb[{n}]" ] ) tp = io [ 0 ] if tp == Dir . OUTPUT : name = io [ 1 ] inp = remove_pins ( inp , [ f"io_in[{n}]" , f"io_oeb[{n}]" ] ) inp = rename_pins ( inp , { f"io_out[{n}]" : name } ) return inp if tp == Dir . INPUT : name = io [ 1 ] inp = remove_pins ( inp , [ f"io_out[{n}]" , f"io_oeb[{n}]" ] ) inp = rename_pins ( inp , { f"io_in[{n}]" : name } ) return inp if tp == Dir . INOUT : in_name , out_name , oe_name = io [ 1 ] , io [ 2 ] , io [ 3 ] return rename_pins ( inp , { f"io_in[{n}]" : in_name , f"io_out[{n}]" : out_name , f"io_oeb[{n}]" : oe_name , } , ) raise ValueError
short_docstring: Update a single (digital) IO, often including several LEF pins.
short_docstring_tokens: Update a single ( digital ) IO often including several LEF pins .
comment: """Update a single (digital) IO, often including several LEF pins."""$SEP$# No connection to this pad; remove its IO from the LEF