def getSlotInstance(
    slot_name, 
    slot_io_name_2_dir_and_width : dict, 
    external_io_name_2_dir_and_width : dict, 
    inner_io_name_2_dir_and_width : dict):
  """
  instantiate a slot in the wrapper
  """
  instance = []
  instance.append(f'  (* black_box *) {slot_name} {slot_name}_U0 (')
  for io, dir_width in slot_io_name_2_dir_and_width.items():
    if io in external_io_name_2_dir_and_width:
      instance.append(f'    .{io}({io}),')
    elif io in inner_io_name_2_dir_and_width:
      if 'input' in dir_width:
        instance.append(f'    .{io}({io}_in),')
      elif 'output' in dir_width:
        instance.append(f'    .{io}({io}_out),')
      else:
        assert False
    else:
      assert False
  instance[-1] = instance[-1].replace(',', ');\n')

  return instance