Full bit and timing log generation
Signed-off-by: Joppe Blondel <joppe@blondel.nl>
This commit is contained in:
@ -23,6 +23,9 @@ toplevel = toplevel
|
||||
#ngdbuild_opts =
|
||||
#map_opts =
|
||||
#par_opts =
|
||||
#netgen_opts =
|
||||
#bitgen_opts =
|
||||
#trce_opts =
|
||||
|
||||
# Fileset
|
||||
files_vhdl = RTL/toplevel.vhd
|
||||
|
@ -3,6 +3,8 @@ from .util_ISE.ngdbuild import ngdbuild
|
||||
from .util_ISE.map import map
|
||||
from .util_ISE.par import par
|
||||
from .util_ISE.netgen import netgen
|
||||
from .util_ISE.bitgen import bitgen
|
||||
from .util_ISE.trce import trce
|
||||
|
||||
def do(config, target, log, subprocesses, prefix='.'):
|
||||
log("Syntesize:")
|
||||
@ -29,7 +31,21 @@ def do(config, target, log, subprocesses, prefix='.'):
|
||||
print("ERROR: par returned with", res)
|
||||
return res
|
||||
|
||||
log("Generate output files")
|
||||
|
||||
res = netgen(config, target, log, subprocesses, prefix)
|
||||
if res != 0:
|
||||
print("ERROR: netgen returned with", res)
|
||||
return res
|
||||
|
||||
res = bitgen(config, target, log, subprocesses, prefix)
|
||||
if res != 0:
|
||||
print("ERROR: bitgen returned with", res)
|
||||
return res
|
||||
|
||||
log("Analyze design")
|
||||
|
||||
res = trce(config, target, log, subprocesses, prefix)
|
||||
if res != 0:
|
||||
print("ERROR: trce returned with", res)
|
||||
return res
|
37
remotesyn/toolchains/util_ISE/bitgen.py
Normal file
37
remotesyn/toolchains/util_ISE/bitgen.py
Normal file
@ -0,0 +1,37 @@
|
||||
import shutil
|
||||
import os
|
||||
import time
|
||||
import subprocess
|
||||
|
||||
def bitgen(config, target, log, subprocesses, prefix='.') -> int:
|
||||
log(" - parsing options")
|
||||
bitgen_opts = config.get(f'target.{target}', 'bitgen_opts', fallback='')
|
||||
build_dir = config.get(f'project', 'build_dir', fallback='build')
|
||||
out_dir = config.get(f'project', 'out_dir', fallback='out')
|
||||
|
||||
prefix = f'{os.getcwd()}/{prefix}'
|
||||
build_dir = f'{prefix}/{build_dir}'
|
||||
out_dir = f'{prefix}/{out_dir}/{target}'
|
||||
|
||||
log(" - creating output directories")
|
||||
os.makedirs(build_dir, exist_ok=True)
|
||||
os.makedirs(out_dir, exist_ok=True)
|
||||
|
||||
log(" - run bitgen")
|
||||
p = subprocess.Popen(f"bitgen -intstyle xflow {bitgen_opts} -g Binary:Yes -w {out_dir}/{target}.ncd {target}.bit {out_dir}/{target}.pcf 2> bitgen.log",
|
||||
shell=True, cwd=build_dir,
|
||||
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
subprocesses.append(p)
|
||||
while p.poll() is None:
|
||||
time.sleep(1)
|
||||
res = p.returncode
|
||||
|
||||
log(" - copy logs")
|
||||
shutil.copy(f'{build_dir}/bitgen.log', f'{out_dir}/bitgen.log')
|
||||
|
||||
if res==0:
|
||||
log(" - copy output files")
|
||||
shutil.copy(f'{build_dir}/{target}.bit', f'{out_dir}/{target}.bit')
|
||||
shutil.copy(f'{build_dir}/{target}.bin', f'{out_dir}/{target}.bin')
|
||||
|
||||
return res
|
32
remotesyn/toolchains/util_ISE/trce.py
Normal file
32
remotesyn/toolchains/util_ISE/trce.py
Normal file
@ -0,0 +1,32 @@
|
||||
import shutil
|
||||
import os
|
||||
import time
|
||||
import subprocess
|
||||
|
||||
def trce(config, target, log, subprocesses, prefix='.') -> int:
|
||||
log(" - parsing options")
|
||||
trce_opts = config.get(f'target.{target}', 'trce_opts', fallback='')
|
||||
build_dir = config.get(f'project', 'build_dir', fallback='build')
|
||||
out_dir = config.get(f'project', 'out_dir', fallback='out')
|
||||
|
||||
prefix = f'{os.getcwd()}/{prefix}'
|
||||
build_dir = f'{prefix}/{build_dir}'
|
||||
out_dir = f'{prefix}/{out_dir}/{target}'
|
||||
|
||||
log(" - creating output directories")
|
||||
os.makedirs(build_dir, exist_ok=True)
|
||||
os.makedirs(out_dir, exist_ok=True)
|
||||
|
||||
log(" - run trce")
|
||||
p = subprocess.Popen(f"trce -intstyle xflow {trce_opts} -v 3 -s 2 -n 3 -fastpaths {out_dir}/{target}.ncd {out_dir}/{target}.pcf",
|
||||
shell=True, cwd=build_dir,
|
||||
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
subprocesses.append(p)
|
||||
while p.poll() is None:
|
||||
time.sleep(1)
|
||||
res = p.returncode
|
||||
|
||||
log(" - copy logs")
|
||||
shutil.copy(f'{build_dir}/{target}.twr', f'{out_dir}/timing.log')
|
||||
|
||||
return res
|
Reference in New Issue
Block a user