Skip to content

Commit 946703d

Browse files
committed
genMetrics: less conditional code, less repetition
Also, what exactly motivates yosys to output 'top ' here isn't entirely clear. This paves the way for a followup pull request Signed-off-by: Øyvind Harboe <[email protected]>
1 parent b0425c9 commit 946703d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

flow/util/genMetrics.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,10 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
251251

252252
hierarchicalSynth = os.environ.get('SYNTH_HIERARCHICAL')
253253

254-
if hierarchicalSynth == '1':
255-
extractTagFromFile('synth__design__instance__area__stdcell',
256-
metrics_dict,
257-
'Chip area for top module.*: +(\S+)',
258-
rptPath + '/synth_stat.txt')
259-
else:
260-
extractTagFromFile('synth__design__instance__area__stdcell',
261-
metrics_dict,
262-
'Chip area for module.*: +(\S+)',
263-
rptPath + '/synth_stat.txt')
254+
extractTagFromFile('synth__design__instance__area__stdcell',
255+
metrics_dict,
256+
'Chip area for (?:top )?module.*: +(\S+)',
257+
rptPath + '/synth_stat.txt')
264258

265259
# Clocks
266260
# =========================================================================

0 commit comments

Comments
 (0)