xsvf_file = os.path.splitext(bitstream_file)[0]+'.xsvf'
print("\nGenerating xsvf formatted bitstream")
print("="*n)
+ if os.path.exists(xsvf_file):
+ os.unlink(xsvf_file)
_create_xsvf(bitstream_file, xsvf_file)
print("\n"+"="*n+"\n")
+import os
import sys
import subprocess
with subprocess.Popen("impact -batch", stdin=subprocess.PIPE, shell=True) as process:
process.stdin.write(cmds.encode("ASCII"))
process.communicate()
+ return process.returncode
def _create_xsvf(bitstream_file, xsvf_file):
- _run_impact("""
+ assert os.path.exists(bitstream_file), bitstream_file
+ assert not os.path.exists(xsvf_file), xsvf_file
+ assert 0 == _run_impact("""
setPreference -pref KeepSVF:True
setMode -bs
setCable -port xsvf -file {xsvf}