1 Star 1 Fork 0

sammulk/chip8-ministar

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fpga.py 1.82 KB
一键复制 编辑 原始数据 按行查看 历史
sammulk 提交于 2021-05-17 22:06 . update docs
#!/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:])
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Verilog
1
https://gitee.com/sammulk/chip8-ministar.git
git@gitee.com:sammulk/chip8-ministar.git
sammulk
chip8-ministar
chip8-ministar
master

搜索帮助