Skip to content

Commit

Permalink
macro placement: reuse BoomTile_floorplan macro placement
Browse files Browse the repository at this point in the history
Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe committed Oct 24, 2024
1 parent d8b66c2 commit 86f5d52
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
22 changes: 12 additions & 10 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ filegroup(
visibility = [":__subpackages__"],
)

filegroup(
name = "boomtile-macro-placement",
srcs = [
"macros.tcl",
],
visibility = [":__subpackages__"],
)

BLOCK_FLOORPLAN = {
"PDN_TCL": "$(PLATFORM_DIR)/openRoad/pdn/BLOCK_grid_strategy.tcl",
}
Expand Down Expand Up @@ -377,7 +369,7 @@ SWEEP = {
"2": {
"variables": {
"SYNTH_HIERARCHICAL": "0",
"MACRO_PLACEMENT_TCL": "$(location :boomtile-macro-placement)",
"MACRO_PLACEMENT_TCL": "macro_placement.tcl",
},
},
}
Expand Down Expand Up @@ -445,7 +437,7 @@ write_binary(
"synth": [":constraints-boomtile"],
"floorplan": [
":io-boomtile",
] + (["macro_placement.tcl"] if "MACRO_PLACEMENT_TCL" in (BOOMTILE_VARIABLES | SWEEP[variant].get("variables", {})) else []),
] + (["write_macro_placement"] if "MACRO_PLACEMENT_TCL" in (BOOMTILE_VARIABLES | SWEEP[variant].get("variables", {})) else []),
"place": [":io-boomtile"],
},
variant = variant,
Expand Down Expand Up @@ -557,3 +549,13 @@ genrule(
cmd = "$(location plot-retiming.py) $(location retiming.pdf) $(locations :repair_logs)",
visibility = ["//visibility:public"],
)

# Use the macro placement from a different flow
orfs_run(
name = "write_macro_placement",
src = ":BoomTile_1_floorplan",
outs = [
":macro_placement.tcl",
],
script = ":write_macros.tcl",
)
18 changes: 18 additions & 0 deletions write_macros.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
source $::env(SCRIPTS_DIR)/load.tcl

set filename [file join $::env(WORK_HOME) "macro_placement.tcl"]
puts "Macro placement written to $filename"

load_design 2_floorplan.odb 2_floorplan.sdc

write_macro_placement $filename.tmp
set f [open $filename.tmp r]
set content [read $f]
puts "content: $content"
set content [string map {"/" "."} $content]
puts "content after: $content"
close $f

set f [open $filename w]
puts -nonewline $f $content
close $f

0 comments on commit 86f5d52

Please sign in to comment.