Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion test/orfs/mock-array/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,26 @@ VARIANTS = [
"flat",
]

orfs_run(
name = "write_macro_placement",
src = ":MockArray_floorplan",
outs = [
":macro-placement.tcl",
],
script = ":write_macros.tcl",
tags = ["manual"],
)

orfs_run(
name = "write_pin_placement",
src = ":MockArray_floorplan",
outs = [
":io-placement.tcl",
],
script = ":write_pin_placement.tcl",
tags = ["manual"],
)

[orfs_flow(
name = "MockArray",
arguments = {
Expand Down Expand Up @@ -147,7 +167,12 @@ VARIANTS = [
"RULES_JSON": [":rules-base.json"],
"SDC_FILE": [":mock-array-constraints"],
"IO_CONSTRAINTS": [":mock-array-io"],
},
} | (
{
"MACRO_PLACEMENT_TCL": [":write_macro_placement"],
"IO_CONSTRAINTS": [":write_pin_placement"],
} if variant == "flat" else {}
),
variant = variant,
verilog_files = [":verilog"],
) for variant in VARIANTS]
Expand Down
19 changes: 19 additions & 0 deletions test/orfs/mock-array/write_macros.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
source $::env(SCRIPTS_DIR)/load.tcl

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

# good 'nuf for pin placement for now
load_design 2_floorplan.odb 2_floorplan.sdc

write_macro_placement $filename.tmp
set f [open $filename.tmp r]
set content [read $f]
# Uncomment when using this in a SYNTH_HIERARCHICAL=0 context
#
# set content [string map {"/" "."} $content]
close $f

set f [open $filename w]
puts -nonewline $f $content
close $f
8 changes: 8 additions & 0 deletions test/orfs/mock-array/write_pin_placement.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source $::env(SCRIPTS_DIR)/global_place_skip_io.tcl

log_cmd place_pins \
-hor_layers $::env(IO_PLACER_H) \
-ver_layers $::env(IO_PLACER_V) \
{*}[env_var_or_empty PLACE_PINS_ARGS]

write_pin_placement [file join $::env(WORK_HOME) "io-placement.tcl"]