代码拉取完成,页面将自动刷新
#!/usr/bin/python3
import os
import shutil
import subprocess
import sys
# code from https://carlosedp.medium.com/xilinx-open-source-fpga-toolchain-on-docker-containers-93202650a615
containers = {
'yosys' : 'hdlc/yosys',
'nextpnr-ice40': 'hdlc/nextpnr',
'nextpnr-ecp5' : 'hdlc/nextpnr',
'nextpnr-gowin': 'racerxdl/nextpnr:gowin',
'icepack' : 'hdlc/icestorm',
'ecppack' : 'hdlc/prjtrellis',
'gowin_pack' : 'hdlc/apicula',
'icetime' : 'hdlc/icestorm',
'icebox_stat' : 'hdlc/icestorm',
'ghdl' : 'ghdl/ghdl:buster-llvm-7',
'verilator' : 'verilator/verilator',
'mill' : 'adoptopenjdk:8u282-b08-jre-hotspot',
'icepll' : 'hdlc/icestorm',
'ecppll' : 'hdlc/prjtrellis',
'symbiflow_synth' : 'carlosedp/symbiflow',
'symbiflow_pack' : 'carlosedp/symbiflow',
'symbiflow_place' : 'carlosedp/symbiflow',
'symbiflow_route' : 'carlosedp/symbiflow',
'symbiflow_write_fasm' : 'carlosedp/symbiflow',
'symbiflow_write_bitstream' : 'carlosedp/symbiflow',
}
tool = sys.argv[1]
toolname = os.path.basename(tool)
if shutil.which(toolname) is not None:
subprocess.call(sys.argv[1:])
elif toolname in containers:
(build_root, work) = os.path.split(os.getcwd())
dockerEnv = ""
for k in os.environ:
dockerEnv = dockerEnv + "-e " + k + "='" + os.environ[k] + "' "
runtool = os.path.relpath(os.path.realpath(tool), os.getcwd())
cmd = ['docker','run','--rm',
'-v', build_root+':/src',
#'-e', dockerEnv,
'-w', '/src/'+work,
containers[toolname],
runtool] + sys.argv[2:]
print(cmd)
subprocess.call(cmd, env=os.environ)
else:
subprocess.call(sys.argv[1:])
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。