Commit 60aa2089 authored by Tiago Jorge's avatar Tiago Jorge
Browse files

Add Brave auto synthesis and header file generation with different configurations.

parent 919ac169
......@@ -2686,6 +2686,43 @@ def main():
pythonSubsystems = DetectPythonSubsystems()
if bNoBitfile == False:
bitFileOffset = 0;
savedDir = os.getcwd()
bitFilesHeader = open("bravebitfiles.h", "a")
bitFilesHeader.write('''
struct config_bitfile {
char *config;
int offset;
int size;
};
struct config_bitfile bitfiles[] = {''');
for braveMakefile in os.popen("find . -path *VHDL-DESIGN/design/Makefile*"):
os.chdir(os.path.dirname(braveMakefile))
os.environ["NANOXPLORE_BYPASS"] = "x86_64_UBUNTU_16"
with os.popen("make") as pipe:
status = pipe.read().strip()
if "Generating bistream of project succeed" not in status:
bitFilesHeader.close()
panic('Bitfile synthesis failed in "%s"' % os.getcwd())
btfileSize = os.path.getsize('bitfile-swapped.nxb')
os.chdir('../..')
fBlockName = os.path.basename(os.getcwd())[4:]
os.chdir('../../' + fBlockName)
with os.popen("cat mini_cv.aadl | grep -o -P '(?<=FPGA_Configurations => \").*(?=\";)'") as pipe:
configs = pipe.read().strip().split(',')
for config in configs:
bitFilesHeader.write('''
"%s", %s, %s,''' % (config, bitFileOffset, bitFileOffset + btfileSize))
bitFileOffset = bitFileOffset + btfileSize
os.chdir(savedDir)
bitFilesHeader.write('''
"0",0,0
};''')
bitFilesHeader.close()
os.chdir(savedDir)
BuildSCADEsystems(scadeSubsystems, CDirectories, cflagsSoFar)
BuildSimulinkSystems(simulinkSubsystems, CDirectories, cflagsSoFar, bUseSimulinkMakefiles)
BuildMicroPythonSystems(micropythonSubsystems, CDirectories, cflagsSoFar)
......
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