Commit d71104dd authored by Tiago Jorge's avatar Tiago Jorge
Browse files

Add Bambu and Synthesis calls for ZynQ.

parent d7f574cf
......@@ -2674,6 +2674,20 @@ struct config_bitfile bitfiles[] = {''');
bitFilesHeader.close()
os.chdir(savedDir)
def ZynQSynthesis(bNoBitfile):
savedDir = os.getcwd()
for zynqMakefile in os.popen("find . -path *VHDL-DESIGN/design/Makefile*"):
os.chdir(os.path.dirname(zynqMakefile))
if bNoBitfile == False:
with os.popen("make") as pipe:
status = pipe.read().strip()
# Following check is hugly and error prone, since it inspects vivado log. Change to check command return code instead using something like subprocess.check_call
# Extract return code out of make? or avoid using Makefiles and call directly vivado etc.
if ("Generating bistream of project succeed" not in status) and ("Now we would call vivado" not in status):
panic('Bitfile synthesis failed in "%s"' % os.getcwd())
os.chdir(savedDir)
os.chdir(savedDir)
def CallBambuForBrave(bNoBitfile):
if bNoBitfile == False:
bambuDir = 'Bambu'
......@@ -2734,6 +2748,66 @@ def CallBambuForBrave(bNoBitfile):
os.chdir(savedDir)
os.chdir(savedDir)
def CallBambuForZynQ(bNoBitfile):
if bNoBitfile == False:
bambuDir = 'Bambu'
savedDir = os.getcwd()
for bambuFile in os.popen("find . -path *GlueAndBuild/glue*_bambu.c"):
os.chdir(os.path.dirname(bambuFile))
fBlockName = os.path.basename(os.getcwd())[4:]
ifName = os.path.basename(bambuFile)[:-9]
if os.path.exists(bambuDir):
shutil.rmtree(bambuDir)
os.makedirs(bambuDir)
os.chdir(bambuDir)
# C files that Bambu might need
dataC = '../../../' + fBlockName + '/' + fBlockName + '/' + ifName + '_data.c'
ifNameC = '../../../' + fBlockName + '/' + fBlockName + '/' + ifName + '.c'
fBlockNameC = '../../../../' + fBlockName + '/' + fBlockName + '.c'
bambu_cmd = ['bambu']
bambu_cmd.append('--compiler=I386_CLANG4')
bambu_cmd.append('--experimental-setup=BAMBU-BALANCED')
bambu_cmd.append('--no-iob')
bambu_cmd.append('--clock-period=40')
bambu_cmd.append('-O2')
bambu_cmd.append('-funroll-loops')
bambu_cmd.append('-fno-inline')
bambu_cmd.append('--speculative-sdc-scheduling')
bambu_cmd.append('--device-name=nx1h35S')
bambu_cmd.append('../' + os.path.basename(bambuFile)[:-1])
bambu_cmd.append('-I../../../auto-src/')
bambu_cmd.append('-I../../../' + fBlockName + '/' + fBlockName + '/')
bambu_cmd.append('-I../../../GlueAndBuild/glue' + fBlockName + '/')
bambu_cmd.append('-DSTATIC=""')
# C bridge needs this
if os.path.isfile(fBlockNameC):
bambu_cmd.append(fBlockNameC)
# whereas Simulink bridge needs this
elif os.path.isfile(ifNameC):
bambu_cmd.append(ifNameC)
# and maybe this one as well
if os.path.isfile(dataC):
bambu_cmd.append(dataC)
bambu_cmd.append('--top-fname=bambu_' + ifName)
bambu_cmd.append('--generate-interface=INFER')
bambu_cmd.append('-v4')
bambu_cmd.append('--do-not-expose-globals')
bambu_cmd.append('-wH')
bambu_cmd.append('--panda-parameter=none-registered-ptrdefault=1')
bambu_cmd.append('--clock-name=clock_' + ifName)
bambu_cmd.append('--reset-name=reset_' + ifName)
bambu_cmd.append('--start-name=start_' + ifName)
bambu_cmd.append('--done-name=finish_' + ifName)
subprocess.check_call(bambu_cmd)
shutil.copyfile("bambu_" + ifName + ".vhd", "../TASTE-VHDL-DESIGN/ip/src/bambu_" + ifName + ".vhd")
os.system("cp *.mem ../TASTE-VHDL-DESIGN/ip/src/")
os.chdir(savedDir)
os.chdir(savedDir)
def main():
FixEnvVars()
cmdLineInformation = ParseCommandLineArgs()
......@@ -2830,8 +2904,12 @@ def main():
pythonSubsystems = DetectPythonSubsystems()
CallBambuForBrave(bNoBitfile)
BraveSynthesisAndHeaderFileGen(bNoBitfile)
if os.getenv("BRAVE") is not None:
CallBambuForBrave(bNoBitfile)
BraveSynthesisAndHeaderFileGen(bNoBitfile)
if os.getenv("ZYNQZC706") is not None:
CallBambuForZynQ(bNoBitfile)
ZynQSynthesis(bNoBitfile)
BuildSCADEsystems(scadeSubsystems, CDirectories, cflagsSoFar)
BuildSimulinkSystems(simulinkSubsystems, CDirectories, cflagsSoFar, bUseSimulinkMakefiles)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment