Skip to content

Instantly share code, notes, and snippets.

@olofk
Created March 24, 2021 22:02
Show Gist options
  • Select an option

  • Save olofk/505070f9ce4377ed9e4eeb69f797c826 to your computer and use it in GitHub Desktop.

Select an option

Save olofk/505070f9ce4377ed9e4eeb69f797c826 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import os
import subprocess
import sys
containers = {
'yosys' : 'hdlc/yosys',
'nextpnr-ice40': 'hdlc/nextpnr',
'nextpnr-ecp5' : 'hdlc/nextpnr',
'icepack' : 'hdlc/icestorm',
'ecppack' : 'hdlc/prjtrellis',
'icetime' : 'hdlc/icestorm',
'icebox_stat' : 'hdlc/icestorm',
'ghdl' : 'ghdl/ghdl:buster-llvm-7',
'verilator' : 'verilator/verilator',
}
tool = sys.argv[1]
if tool in containers:
(build_root, work) = os.path.split(os.getcwd())
subprocess.call(['docker','run','--rm',
'-v', build_root+':/src',
'-w', '/src/'+work,
containers[tool],
tool]+
sys.argv[2:])
else:
subprocess.call(sys.argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment