Commit 64a3535e authored by Tiago Jorge's avatar Tiago Jorge
Browse files

Brave header file now with max-bitfile-size-based offsets; Function block name...

Brave header file now with max-bitfile-size-based offsets; Function block name added as well for global status update at app level.
parent 59e46c28
......@@ -2595,12 +2595,15 @@ def ApplyPatchForDeploymentViewNeededByOcarinaForNewEllidissTools(depl_aadlFile)
def BraveSynthesisAndHeaderFileGen(bNoBitfile):
if bNoBitfile == False:
maxBitfileSize = 1526250 # 12210000 bits / 8
bitFileOffset = 0;
savedDir = os.getcwd()
isFirst = True
bitFilesHeader = open("auto-src/bravebitfiles.h", "w")
bitFilesHeader.write('''
struct config_bitfile {
char *config;
char *function;
int offset;
int size;
};
......@@ -2614,19 +2617,23 @@ struct config_bitfile bitfiles[] = {''');
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')
btfileSize = os.path.getsize('bitfile-swapped.nxb') # in bytes
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
if isFirst:
bitFilesHeader.write('''
"%s", "%s", %s, %s''' % (config, fBlockName, bitFileOffset, btfileSize))
isFirst = False
else:
bitFilesHeader.write(''',
"%s", "%s", %s, %s''' % (config, fBlockName, bitFileOffset, btfileSize))
bitFileOffset = bitFileOffset + maxBitfileSize
os.chdir(savedDir)
bitFilesHeader.write('''
"0",0,0
};''')
bitFilesHeader.close()
os.chdir(savedDir)
......
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