File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -173,19 +173,23 @@ def parse_vivado_report(hls_dir):
173
173
if os .path .isfile (vivado_syn_file ):
174
174
vivado_synth_rpt = {}
175
175
with open (vivado_syn_file ) as f :
176
+ section = 0
176
177
for line in f .readlines ():
178
+ match = re .match (r'^(\d)\.' , line )
179
+ if match :
180
+ section = int (match .group (1 ))
177
181
# Sometimes, phrases such as 'CLB Registers' can show up in the non-tabular sections of the report
178
182
if '|' in line :
179
- if 'CLB LUTs' in line :
183
+ if 'CLB LUTs' in line and section == 1 :
180
184
vivado_synth_rpt ['LUT' ] = line .split ('|' )[2 ].strip ()
181
- elif 'CLB Registers' in line :
185
+ elif 'CLB Registers' in line and section == 1 :
182
186
vivado_synth_rpt ['FF' ] = line .split ('|' )[2 ].strip ()
183
- elif 'RAMB18 ' in line :
187
+ elif 'Block RAM Tile ' in line and section == 2 :
184
188
vivado_synth_rpt ['BRAM_18K' ] = line .split ('|' )[2 ].strip ()
185
- elif 'DSPs' in line :
186
- vivado_synth_rpt ['DSP48E' ] = line .split ('|' )[2 ].strip ()
187
- elif 'URAM' in line :
189
+ elif 'URAM' in line and section == 2 :
188
190
vivado_synth_rpt ['URAM' ] = line .split ('|' )[2 ].strip ()
191
+ elif 'DSPs' in line and section == 3 :
192
+ vivado_synth_rpt ['DSP48E' ] = line .split ('|' )[2 ].strip ()
189
193
report ['VivadoSynthReport' ] = vivado_synth_rpt
190
194
else :
191
195
print ('Vivado synthesis report not found.' )
You can’t perform that action at this time.
0 commit comments