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 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_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 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 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 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 tree_update(self): ''' this method will update the 'project explorer' ''' if self.active_project != '': self.tree.setHeaderHidden(True) # self.project_info projects = dict_ATE_projects(workspace_path) previous_project = None for project_name in projects: project = QtWidgets.QTreeWidgetItem(self.tree, previous_project) previous_project = project project.setText(0, project_name) project.setText(1, 'project') project.setText(2, projects[project_name]) font = project.font(0) font.setWeight(QtGui.QFont.Bold) project.setFont(0, font) project.setForeground(0, QtGui.QBrush(QtGui.QColor("#FFFF00"))) documentation = QtWidgets.QTreeWidgetItem(project) documentation.setText(0, 'documentation') documentation.setText(1, 'documentation') doc_root = os.path.join(self.active_project_path, 'documentation') #TODO: cycle the directory structure, and add the documents sources = QtWidgets.QTreeWidgetItem(project, documentation) sources.setText(0, 'sources') sources.setText(1, 'sources') definitions = QtWidgets.QTreeWidgetItem(sources) definitions.setText(0, 'definitions') definitions.setText(1, 'definitions') states = QtWidgets.QTreeWidgetItem(definitions) states.setText(0, 'states') states.setText(1, 'states') states_root = dict_project_paths( self.active_project_path)['states_root'] previous = None for state_file in os.listdir(states_root): if state_file.startswith('__'): continue if not state_file.endswith('.py'): continue state = QtWidgets.QTreeWidgetItem(states, previous) state.setIcon(0, qta.icon('mdi.shoe-print', color='orange')) state.setText(0, state_file) state.setText(1, 'state') state.setText(2, os.path.join(states_root, state_file)) previous = state protocols = QtWidgets.QTreeWidgetItem(definitions, states) protocols.setText(0, 'protocols') protocols.setText(1, 'protocols') #TODO: cycle through the directory and add the protocols registermap = QtWidgets.QTreeWidgetItem(definitions, protocols) registermap.setText(0, 'register maps') registermap.setText(1, 'registermaps') #TODO: cycle through the directory and add the registermaps flows = QtWidgets.QTreeWidgetItem(definitions, registermap) flows.setText(0, 'flows') flows.setText(1, 'flows') #TODO: insert the right flows from the database products = QtWidgets.QTreeWidgetItem(definitions, flows) products.setText(0, 'products') products.setText(1, 'products') #TODO: insert the right products from the database devices = QtWidgets.QTreeWidgetItem(definitions, products) devices.setText(0, 'devices') devices.setText(1, 'devices') #TODO: insert the right devices from the database packages = QtWidgets.QTreeWidgetItem(definitions, devices) packages.setText(0, 'packages') packages.setText(1, 'packages') #TODO: insert the right packages from the database dies = QtWidgets.QTreeWidgetItem(definitions, packages) dies.setText(0, 'dies') dies.setText(1, 'dies') #TODO: inset the right dies from the database masksets = QtWidgets.QTreeWidgetItem(definitions, dies) masksets.setText(0, 'masksets') masksets.setText(1, 'masksets') #TODO: insert the right masksets from the database hardwaresetups = QtWidgets.QTreeWidgetItem( definitions, masksets) hardwaresetups.setText(0, 'hardwaresetups') hardwaresetups.setText(1, 'hardwaresetups') previous = None for hwsetup in self.project_info.list_hardwaresetups(): setup = QtWidgets.QTreeWidgetItem(hardwaresetups, previous) setup.setText(0, hwsetup) setup.setText(1, 'hardwaresetup') previous = setup #TODO: insert the right hardwaresetups from the database tests = QtWidgets.QTreeWidgetItem(sources) tests.setText(0, 'tests') tests.setText(1, 'tests') #TODO: insert the appropriate test names from /sources/tests, based on HWR and base (read: die- or product-based or probing/final test) progs = QtWidgets.QTreeWidgetItem(sources, tests) progs.setText(0, 'programs') progs.setText(1, 'programs') #TODO: insert the appropriate programs from /sources/programs, based on HWR and base patterns = QtWidgets.QTreeWidgetItem(sources, progs) patterns.setText(0, 'patterns') patterns.setText(1, 'patterns')