def create_new_test(project_path, test_data): ''' given a project_path, a product_name (in product_data), create the appropriate definition file for this new product. test_data = {'defines' : 'test', 'test_name' : str, 'for_hardwaresetup' : str 'test_target' : str --> is 'FT' for Final Test and 'PR' for probing #TODO: add the whole flow stuff here } ''' if is_ATE_project(project_path): test_class = "%s_%s%s" % (test_data['test_name'], test_data['for_hardwaresetup'], test_data['test_target']) if test_data['test_target'] == 'FT': test_root = dict_project_paths(project_path)['test_product_root'] else: test_root = dict_project_paths(project_path)['test_die_root'] test_path = os.path.join(test_root, "%s.py" % test_class) translation = translation_template(project_path) translation['TSTCLASS'] = test_class templating('test.py', test_path, translation)
def list_product_flows(project_path): ''' given an (ATE) project_path, extract a list of all product flows (read: Final test flows) ''' retval = [] if is_ATE_project(project_path): pass return retval,
def list_die_flows(project_path): ''' given an (ATE) project_path, extract a list of all die flows (read: probing flows) ''' retval = [] if is_ATE_project(project_path): pass return retval
def dict_project_paths(project_path): ''' This function will create a dictionary of all paths in the project. ''' from ATE.org.Templates import project_structure retval = {} if is_ATE_project(project_path): for branch in project_structure: path = os.path.normpath(os.path.join(project_path, branch)) retval[project_structure[branch][0]] = path return retval
def dict_ATE_projects(workspace_path): ''' given a workspace_path, create a dictionary with all ATE projects as key, and the project_path as value. ''' retval = {} all_projects = dict_projects(workspace_path) for candidate in all_projects: possible_ATE_project = all_projects[candidate] if is_ATE_project(possible_ATE_project): retval[candidate] = possible_ATE_project return retval
def dict_tests(project_path): retval = {} if is_ATE_project(project_path): test_root = dict_project_paths(project_path)['test_product_root'] for candidate in os.listdir(test_root): if candidate.endswith('FT'): retval[candidate.replace('.py', '')] = os.path.join( test_root, candidate) test_root = dict_project_paths(project_path)['test_die_root'] for candidate in os.listdir(test_root): if candidate.endswith('PR'): retval[candidate.replace('.py', '')] = os.path.join( test_root, candidate) return retval
def dict_single_site_loadboards(project_path): ''' This function creates a dictionary of all single site loadboards in project_path return looks like : {'HWR1' : 'U33301', 'HWR2' : '', 'HWR3' : 'U44547'} Note : if not available for a hardware version, then it equals '' ''' retval = {} if is_ATE_project(project_path): hardware_versions = list_hardwaresetups(project_path) for hardware_version in hardware_versions: pcbs = dict_pcbs_for_hardware_setup(project_path, hardware_version) retval[hardware_version] = pcbs['SingeSiteLoadboard'] return retval
def dict_devices(project_path): ''' given an (ATE) project_path, construct a dictionary where the keys are all devices in the project, and the value is the path tot the definition file. ''' retval = {} if is_ATE_project(project_path): device_root = dict_project_paths(project_path)['device_root'] for candidate in os.listdir(device_root): if candidate.endswith('.pickle'): candidate_name = candidate.replace('.pickle', '') candidate_path = os.path.join(device_root, candidate) retval[candidate_name] = candidate_path return retval
def dict_masksets(project_path): ''' given an (ATE) project_path, extract a dictionary with the maskset names as key and the masket definition file as value. ''' retval = {} if is_ATE_project(project_path): maskset_root = dict_project_paths(project_path)['maskset_root'] for element in os.listdir(maskset_root): if element.endswith('.pickle'): maskset_file = os.path.join(maskset_root, element) maskset_name = element.replace('.pickle', '') retval[maskset_name] = maskset_file return retval
def dict_multi_site_DIBs(project_path): ''' This function creates a dictionary of all multi site DIBs in project_path return looks like : {'V1' : 'U33301', 'V2' : '', 'V3' : 'U44547'} Note : if not available for a hardware version, then it equals '' ''' retval = {} if is_ATE_project(project_path): hardware_versions = list_hardwaresetups(project_path) for hardware_version in hardware_versions: pcbs = dict_pcbs_for_hardware_setup(project_path, hardware_version) retval[hardware_version] = pcbs['MultiSiteDIB'] return retval
def create_new_die(project_path, die_data): ''' given a project_path, a die_name (in die_data), create the appropriate definition file for this new die. die_data = {'defines' : 'die' 'die_name' : str, 'maskset_name' : str} ''' if is_ATE_project(project_path): die_root = dict_project_paths(project_path)['die_root'] die_name = die_data['die_name'] die_path = os.path.join(die_root, "%s.pickle" % die_name) pickle.dump(die_data, open(die_path, 'wb'), protocol=4) # fixing the protocol guarantees compatibility
def create_new_product(project_path, product_data): ''' given a project_path, a product_name (in product_data), create the appropriate definition file for this new product. product_data = {'defines' : 'product', 'product_name' : str, 'from_device' : str} ''' if is_ATE_project(project_path): product_root = dict_project_paths(project_path)['product_root'] product_name = product_data['product_name'] product_path = os.path.join(product_root, "%s.pickle" % product_name) pickle.dump(product_data, open(product_path, 'wb'), protocol=4) # fixing the protocol guarantees compatibility
def dict_hardwaresetups(project_path): ''' given a project_path, create a dictionary with as keys the hardware versions, and as value the path to the defintition file. ''' retval = {} if is_ATE_project(project_path): hwr_root = dict_project_paths(project_path)['hwr_root'] for candidate in os.listdir(hwr_root): candidate_path = os.path.join(hwr_root, candidate) if os.path.isfile(candidate_path) and candidate_path.endswith( '.pickle'): hardwaresetup = candidate.replace('.pickle', '') retval[hardwaresetup] = candidate_path return retval
def create_new_package(project_path, package_data): ''' given a project_path, a package_name (in package_data), create the appropriate definition file for this new package. package_data = {'defines' : 'package', 'package_name' : str, 'number_of_pins' : int, 'Pins' : dict{1:'VDD', 2:'OUT', 3: 'GND'}} ''' if is_ATE_project(project_path): package_root = dict_project_paths(project_path)['package_root'] package_name = package_data['package_name'] package_path = os.path.join(package_root, "%s.pickle" % package_name) pickle.dump(package_data, open(package_path, 'wb'), protocol=4) # fixing the protocol guarantees compatibility
def dict_dies(project_path): ''' given an (ATE) project_path, create a dictionary with the dies as keys, and the die_path as value. die_path is the absolute path to the location where the definition.pickle file is located (including the definition.pickle file itself) ''' retval = {} if is_ATE_project(project_path): die_root = dict_project_paths(project_path)['die_root'] for rel_die_path in os.listdir(die_root): if rel_die_path.endswith('.pickle'): die_name = rel_die_path.replace('.pickle', '') retval[die_name] = os.path.join(die_root, rel_die_path) return retval
def create_new_device(project_path, device_data): ''' given a project_path, a device_name (in device_data), create the appropriate definition file for this new device. device_data = {'defines' : 'device' 'device_name' : str 'package' : str 'dies_in_package' : list[die_names]} ''' if is_ATE_project(project_path): device_root = dict_project_paths(project_path)['device_root'] device_name = device_data['device_name'] device_path = os.path.join(device_root, "%s.pickle" % device_name) pickle.dump(device_data, open(device_path, 'wb'), protocol=4) # fixing the protocol guarantees compatibility
def list_products(project_path): ''' given an (ATE) project_path, extract a list of all products ''' retval = [] if is_ATE_project(project_path): # find path to products from project_structure products_path = '' for branch in project_structure: if 'PRODUCTS' in branch.upper(): products_path = os.path.normpath( os.path.join(project_path, branch)) # find devices if products_path != '': for product in os.listdir(products_path): if os.path.isdir(os.path.join(products_path, product)): retval.append(product) return retval, products_path
def create_new_hardwaresetup(project_path, hardwaresetup_data): ''' given a project_path, a hardwaresetup_name (in hardwaresetup_data), create the appropriate definition file for this new device. ps: hardwaresetup_name is for example HWR1, it is kind of a version too ;-) ''' if is_ATE_project(project_path): hardwaresetup_name = hardwaresetup_data['hardwaresetup_name'].replace( 'HWR', '') print("---> hwsetupname", hardwaresetup_name) hardwaresetup_root = dict_project_paths(project_path)['hwr_root'] hardwaresetup_path = os.path.join(hardwaresetup_root, "%s.pickle" % hardwaresetup_name) pickle.dump(hardwaresetup_data, open(hardwaresetup_path, 'wb'), protocol=4) # fixing the protocol guarantees compatibility
def create_new_maskset(project_path, maskset_data): ''' given a project_path, a maskset_name (in maskset_data), create the appropriate definition file for this new maskset. maskset_data = {'defines' : 'maskset' 'maskset_name' : str, 'number_of_bond_pads' : int, # in μm 'die_size_x' : int, # in μm 'die_size_y' : int, # in μm 'scribe_x' : int, # in μm 'scribe_y' : int, # in μm 'bond_pads' : dict{int'padNr' : tuple(str'Name', int'xcoord', int'ycoord', int'xsize', int'ysize')}, # in μm 'rotation_to_flat' : int # = 0/90/180/270} ''' if is_ATE_project(project_path): maskset_root = dict_project_paths(project_path)['maskset_root'] maskset_name = maskset_data['maskset_name'] maskset_path = os.path.join(maskset_root, "%s.pickle" % maskset_name) print(maskset_path) pickle.dump(maskset_data, open(maskset_path, 'wb'), protocol=4) # fixing the protocol guarantees compatibility
def new_probecard(project_path, probecard_name): ''' given a project_path and a probecard_name, create the directory (and the structure inside ... templating) ''' if not is_ATE_project(project_path): raise Exception("not an ATE project")