diff --git a/ipbb/cli/repo.py b/ipbb/cli/repo.py index f5484ec8..35e6fefc 100644 --- a/ipbb/cli/repo.py +++ b/ipbb/cli/repo.py @@ -72,11 +72,15 @@ def git(env, repo, branch, dest): # Maybe not necessary lUrl = urlparse(repo) - # Strip '.git' at the end - lRepoName = splitext(basename(lUrl.path))[0] if dest is None else dest + # Strip '.git' at the end if it exists, this supports git in a folder + if 'git' in lUrl.path: + lRepoName = splitext(basename(lUrl.path))[0] if dest is None else dest + else: + lRepoName = lUrl.path if dest is None else dest + lRepoLocalPath = join(env.work.path, kSourceDir, lRepoName) - # Check for + # Check for if exists(lRepoLocalPath): raise click.ClickException( 'Repository already exists \'%s\'' % lRepoLocalPath @@ -122,7 +126,7 @@ def git(env, repo, branch, dest): if dest is not None: lArgs += [dest] - sh.git(*lArgs, _out=sys.stdout, _cwd=env.srcdir) + sh.git(*lArgs)#glein: , _out=sys.stdout, _cwd=env.srcdir) if branch is not None: @@ -402,4 +406,4 @@ def status(env): @srcs.command('find', short_help="Find src files.") @click.pass_obj def find(env): - sh.find(env.srcdir,'-name', '*.vhd', _out=sys.stdout) \ No newline at end of file + sh.find(env.srcdir,'-name', '*.vhd', _out=sys.stdout) diff --git a/ipbb/cli/vivado.py b/ipbb/cli/vivado.py index 6a1b4f2c..3669cde3 100644 --- a/ipbb/cli/vivado.py +++ b/ipbb/cli/vivado.py @@ -8,6 +8,8 @@ import sys import sh import time +import re +import hashlib # Elements from os.path import join, split, exists, splitext, abspath, basename @@ -20,6 +22,8 @@ from ..depparser.VivadoProjectMaker import VivadoProjectMaker from ..tools.xilinx import VivadoOpen, VivadoConsoleError, VivadoSnoozer +# Debugging and testing +#import pdb; pdb.set_trace() # ------------------------------------------------------------------------------ def ensureVivado(env): @@ -259,6 +263,91 @@ def synth(env, jobs): secho("\n{}: Synthesis completed successfully.\n".format(env.currentproj.name), fg='green') # ------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ +def getIPCoresCompiled(aConsole, proj): + lVivProjPath = proj.path + print(lVivProjPath) + lIPCoresPath = join(lVivProjPath, 'top', 'top.srcs', 'sources_1', 'ip') + for folder in next(os.walk(lIPCoresPath))[1]: + if not os.path.isdir(join(lIPCoresPath, folder, 'sim')): + secho("Simulation directory does not exist for %s. Compiling the ip-core."%(folder), fg='yellow') + aConsole('generate_target all [get_files %s/top/top.srcs/sources_1/ip/%s/%s.xci]' % (lVivProjPath, folder, folder)) + aConsole('export_ip_user_files -of_objects [get_files %s/top/top.srcs/sources_1/ip/%s/%s.xci] -no_script -sync -force -quiet' % (lVivProjPath,folder,folder)) + aConsole('export_simulation -of_objects [get_files %s/top/top.srcs/sources_1/ip/%s/%s.xci] -directory %s/top/top.ip_user_files/sim_scripts -ip_user_files_dir %s/top/top.ip_user_files -ipstatic_source_dir %s/top/top.ip_user_files/ipstatic -lib_map_path [list {modelsim=%s/top/top.cache/compile_simlib/modelsim} {questa=%s/top/top.cache/compile_simlib/questa} {ies=%s/top/top.cache/compile_simlib/ies} {xcelium=%s/top/top.cache/compile_simlib/xcelium} {vcs=%s/top/top.cache/compile_simlib/vcs} {riviera=%s/top/top.cache/compile_simlib/riviera}] -use_ip_compiled_libs -force -quiet' %(lVivProjPath, folder, folder, lVivProjPath, lVivProjPath, lVivProjPath, lVivProjPath, lVivProjPath, lVivProjPath, lVivProjPath, lVivProjPath, lVivProjPath)) + +# ------------------------------------------------------------------------------ +@vivado.command('sim', short_help='Run the simulation step on the specified dependency.') +@click.option('-rf', '--run-for', metavar='