diff --git a/flow/scripts/io_placement.tcl b/flow/scripts/io_placement.tcl index c7c003b36d..92b97fa8fa 100644 --- a/flow/scripts/io_placement.tcl +++ b/flow/scripts/io_placement.tcl @@ -1,15 +1,6 @@ source $::env(SCRIPTS_DIR)/load.tcl load_design 3_1_place_gp_skip_io.odb 2_floorplan.sdc -if {[info exists ::env(FLOORPLAN_DEF)]} { - puts "Skipping IO placement as DEF file was used to initialize floorplan." -} else { - if {[info exists ::env(IO_CONSTRAINTS)]} { - source $::env(IO_CONSTRAINTS) - } - place_pins -hor_layer $::env(IO_PLACER_H) \ - -ver_layer $::env(IO_PLACER_V) \ - {*}$::env(PLACE_PINS_ARGS) -} +source $::env(SCRIPTS_DIR)/io_placement_util.tcl write_db $::env(RESULTS_DIR)/3_2_place_iop.odb diff --git a/flow/scripts/io_placement_random.tcl b/flow/scripts/io_placement_random.tcl index c17626b7c0..cb52ddf931 100644 --- a/flow/scripts/io_placement_random.tcl +++ b/flow/scripts/io_placement_random.tcl @@ -1,16 +1,8 @@ source $::env(SCRIPTS_DIR)/load.tcl load_design 2_1_floorplan.odb 1_synth.sdc -if {[info exists ::env(FLOORPLAN_DEF)]} { - puts "Skipping IO placement as DEF file was used to initialize floorplan." -} else { - if {[info exists ::env(IO_CONSTRAINTS)]} { - source $::env(IO_CONSTRAINTS) - } - place_pins -hor_layer $::env(IO_PLACER_H) \ - -ver_layer $::env(IO_PLACER_V) \ - -random \ - {*}$::env(PLACE_PINS_ARGS) -} +lappend ::env(PLACE_PINS_ARGS) -random + +source $::env(SCRIPTS_DIR)/io_placement_util.tcl write_db $::env(RESULTS_DIR)/2_2_floorplan_io.odb diff --git a/flow/scripts/io_placement_util.tcl b/flow/scripts/io_placement_util.tcl new file mode 100644 index 0000000000..c206d496cd --- /dev/null +++ b/flow/scripts/io_placement_util.tcl @@ -0,0 +1,12 @@ +if {[info exists ::env(FLOORPLAN_DEF)]} { + puts "Skipping IO placement as DEF file was used to initialize floorplan." +} else { + if {[info exists ::env(IO_CONSTRAINTS)]} { + source $::env(IO_CONSTRAINTS) + } + set args [list -hor_layer $::env(IO_PLACER_H) \ + -ver_layer $::env(IO_PLACER_V) \ + {*}$::env(PLACE_PINS_ARGS)] + puts "place_pins [join $args " "]" + place_pins {*}$args +}