def run(config): log.info("Implementation stage...") implPath = os.path.abspath(implementPath) + "/" synPath = os.path.abspath(synthesisPath) + "/" clean(implPath) top = os.path.join(synPath, config["top"] + ".edf") progressBar.run() cnt = 50 while not os.path.exists(top) or not cnt: cnt -= 1 time.sleep(1) progressBar.stop() if not cnt: log.error("Cant find netlist, try sythesis step first.") sys.exit(1) ucfSymplicity = structure.search(synPath, onlyExt=".ucf", ignoreDir=hdlGlobals.ignoreRepoDir) ucf = ucfSymplicity[0] or config["ucf"] for i in config.get("depNetlist", []): shutil.copyfile(i, implPath + os.path.split(i)[1]) shutil.copyfile(ucf, implPath + config["top"] + ".ucf") shutil.copyfile(top, implPath + config["top"] + ".edf") os.chdir(implPath) while not os.path.exists(config["top"] + ".edf"): print "cant find file: ", config["top"] time.sleep(0.1) try: subprocess.check_call( ("{xflow} -implement balanced.opt" " -config bitgen.opt {netlist}.edf").format( xflow=toolchain.Tool().get("ise_xflow"), netlist=config["top"] ) ) except subprocess.CalledProcessError as e: log.error(e) sys.exit() bit2mcs(config) log.info("Implementation done")
def searchLight(self): alog.info('Searching {}...'.format(self.tag)) progressBar.run() logicDrives = self.getWin32Drivers() paths = self.paths rootDirs = [] for logicDrive in logicDrives: for path in paths: for nested in ['', '/*/', '/*/'*2, '/*/'*3]: rootDirs += glob.glob('{drive}{nested}{path}'.format(drive=logicDrive, nested=nested, path=path)) self.fullPaths = [] for i in rootDirs: for nested in ['', '/*/', '/*/'*2, '/*/'*3, '/*/'*4, '/*/'*5, '/*/'*6]: self.fullPaths += glob.glob('{0}{1}{2}'.format(i, nested, self.util)) progressBar.stop() if self.fullPaths: self.fullPaths = [i.replace('\\', '/') for i in self.fullPaths] self.fullPaths.sort(cmp=None, key=os.path.getmtime, reverse=True) self.askConfirm() self.saveSearchResult() else: alog.warning('Cant find tool: '+ self.tag)
def setSrc(config): log.info('Analyzing dependences...') progressBar.run() setMainSrc(config) setDepSrc(config) progressBar.stop()