def _build_ise(prj, hwdir): hwdir = hwdir if hwdir is not None else prj.basedir + ".hw" try: shutil2.chdir(hwdir) except: log.error("hardware directory '" + hwdir + "' not found") return subprocess.call(""" source /opt/Xilinx/""" + prj.impinfo.xil[1] + """/ISE_DS/settings64.sh; cd """ + hwdir + """ && echo -e "run hwclean\nrun bits\nexit\n" | xps -nw system""", shell=True) print() with open(shutil2.join(hwdir, "implementation", "system.bin"), "rb") as b: with open(shutil2.join(hwdir, "implementation", "system.bin.rev"), "wb") as r: while True: word = b.read(4) if not word: break r.write(word[::-1]) shutil2.chdir(prj.dir)
def build(args): prj = args.prj swdir = prj.basedir + ".sw" try: shutil2.chdir(swdir) except: log.error("software directory '" + swdir + "' not found") return subprocess.call("make", shell=True) print() shutil2.chdir(prj.dir)
def build(prj, msgdir): msgdir = prj.basedir + ".msg" #try: # shutil2.chdir(swdir) #except: # log.error("software directory '" + swdir + "' not found") # return subprocess.call("bash $RECONOS/tools/arm-docker-build/build_msg.sh", shell=True) print() shutil2.chdir(prj.dir)
def _build_vivado(prj, hwdir): hwdir = hwdir if hwdir is not None else prj.basedir + ".hw" try: shutil2.chdir(hwdir) except: log.error("hardware directory '" + hwdir + "' not found") return subprocess.call(""" source /opt/Xilinx/Vivado/{0}/settings64.sh; vivado -mode batch -notrace -nojournal -nolog -source build.tcl;""". format(prj.impinfo.xil[1]), shell=True) print() shutil2.chdir(prj.dir)
def clean(args): prj = args.prj swdir = prj.basedir + ".sw" if args.remove: shutil2.rmtree(swdir) else: try: shutil2.chdir(swdir) except: log.error("software directory '" + swdir + "' not found") return subprocess.call("make clean", shell=True) print() shutil2.chdir(prj.dir)
def _build_vivado_pr(prj, hwdir): hwdir = hwdir if hwdir is not None else prj.basedir + ".hw" try: shutil2.chdir(hwdir) except: log.error("hardware directory '" + hwdir + "' not found") return subprocess.call(""" source /opt/Xilinx/Vivado/{0}/settings64.sh; vivado -mode batch -source pr_flow/run_pr.tcl -notrace;""".format( prj.impinfo.xil[1]), shell=True, executable="/bin/bash") print() shutil2.chdir(prj.dir)
def clean_ise(args): prj = args.prj hwdir = prj.basedir + ".hw" if args.remove: shutil2.rmtree(hwdir) else: try: shutil2.chdir(hwdir) except: log.error("hardware directory '" + hwdir + "' not found") return subprocess.call(""" source /opt/Xilinx/""" + prj.impinfo.xil[1] + """/ISE_DS/settings64.sh; echo -e "run clean\nexit\n" | xps -nw system""", shell=True) print() shutil2.chdir(prj.dir)
def clean_vivado(args): prj = args.prj hwdir = prj.basedir + ".hw" if args.remove: shutil2.rmtree(hwdir) else: try: shutil2.chdir(hwdir) except: log.error("hardware directory '" + hwdir + "' not found") return subprocess.call(""" source /opt/Xilinx/Vivado/{0}/settings64.sh; vivado -mode batch -notrace -nojournal -nolog -source clean.tcl;""".format( prj.impinfo.xil[1]), shell=True) print() shutil2.chdir(prj.dir)