Skip to content

Commit c298a08

Browse files
committed
Streamline metrics emission for synth stage
Signed-off-by: Martin Povišer <povik@cutebit.org>
1 parent ca84ff7 commit c298a08

2 files changed

Lines changed: 5 additions & 24 deletions

File tree

flow/scripts/synth_odb.tcl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
utl::set_metrics_stage "floorplan__{}"
1+
utl::set_metrics_stage "synth__{}"
22
source $::env(SCRIPTS_DIR)/load.tcl
33
erase_non_stage_variables synth
44
load_design 1_2_yosys.v 1_2_yosys.sdc
@@ -24,6 +24,9 @@ source_step_tcl PRE SYNTH
2424
# asap7/jpeg_lvt, asap7/swerv_wrapper, nangate45/ariane133).
2525
log_cmd eliminate_dead_logic
2626

27+
report_design_area
28+
report_design_area_metrics
29+
2730
source_step_tcl POST SYNTH
2831
orfs_write_db $::env(RESULTS_DIR)/1_synth.odb
2932
# Canonicalize 1_synth.sdc. The original SDC_FILE provided by

flow/util/genMetrics.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ def merge_jsons(root_path, output, files):
209209
with open(path, "r") as file:
210210
data = json.load(file)
211211
output.update(data)
212-
return len(paths) != 0
213212

214213

215214
def extract_metrics(
@@ -246,27 +245,7 @@ def extract_metrics(
246245

247246
# Synthesis
248247
# =========================================================================
249-
250-
# Try sourcing metrics from OpenROAD's syn flow first, fall back to parsing
251-
# Yosys reports otherwise
252-
found_synthesis_json = merge_jsons(logPath, metrics_dict, "1_*.json")
253-
254-
# The new format (>= 0.57) with -hierarchy is:
255-
# <count> <area> <local_count> <local_area> cells
256-
if not found_synthesis_json:
257-
extractTagFromFile(
258-
"synth__design__instance__count__stdcell",
259-
metrics_dict,
260-
"^\\s+(\\d+)\\s+[-0-9.]+\\s+\\S+\\s+\\S+\\s+cells$",
261-
rptPath + "/synth_stat.txt",
262-
)
263-
264-
extractTagFromFile(
265-
"synth__design__instance__area__stdcell",
266-
metrics_dict,
267-
"Chip area for (?:top )?module.*: +(\\S+)",
268-
rptPath + "/synth_stat.txt",
269-
)
248+
merge_jsons(logPath, metrics_dict, "1_*.json")
270249

271250
# Netlist hashes: fingerprints of the canonical RTLIL (pre-ABC) and
272251
# the final post-synthesis Verilog so the rules-base.json check
@@ -277,7 +256,6 @@ def extract_metrics(
277256
)
278257
metrics_dict["synth__netlist__hash"] = file_sha1(resultPath + "/1_2_yosys.v")
279258

280-
281259
# Clocks
282260
# =========================================================================
283261
clk_list = read_sdc(resultPath + "/2_floorplan.sdc")

0 commit comments

Comments
 (0)