Commit 1b8753e0 by sakundu

Updated def generation from plc and pl

Signed-off-by: sakundu <sakundu@ucsd.edu>
parent c462529e
#!/bin/tcsh
## Set to 1 to run refine_macro_place ##
setenv run_refine_macro_place 0
setenv run_refine_macro_place 1
setenv SYN_HANDOFF $argv[1]
if ($#argv == 3) then
setenv pb_netlist $argv[2]
setenv plc_file $argv[3]
else if ($#argv == 2) then
setenv pl_file $argv[2]
else
echo "Required clustered netlist and plc file to generate macro placed defs"
endif
......
......@@ -56,9 +56,12 @@ if {[info exist ::env(pb_netlist)] &&
exec /home/sakundu/.conda/envs/py-tf/bin/python3.8 \
../../../../util/plc_pb_to_placement_tcl.py $::env(plc_file) $::env(pb_netlist) \
"macro_place.tcl" $origin_x $origin_y
source macro_place.tcl
} elseif { [info exist ::env(pl_file)] && [file exist $::env(pl_file)] } {
source ../../../../util/place_from_pl.tcl
place_macro_from_pl $::env(pl_file)
}
source macro_place.tcl
if { [info exist ::env(run_refine_macro_place)] && $::env(run_refine_macro_place) == 1 } {
dbset [dbget top.insts.cell.subClass block -p2 ].pStatus placed
......
......@@ -21,22 +21,28 @@ proc get_orient { tmp_orient } {
return $orient
}
proc place_macro_from_pl {file_path} {
proc place_macro_from_pl {file_path {place_std 0}} {
set dbu 100
set fp [open $file_path r]
while { [gets $fp line] >= 0} {
if {[llength $line] == 7} {
if {[llength $line] >= 6 && [llength $line] <= 7} {
set inst_name [lindex $line 0]
puts "$inst_name"
set pt_x [expr [lindex $line 1]/$dbu]
set pt_y [expr [lindex $line 2]/$dbu]
set tmp_orient [expr [lindex $line 5]]
set orient [get_orient $tmp_orient]
#puts "$inst_name"
if {[dbget top.insts.name $inst_name -e] == ""} {
puts "\[ERROR\] $inst_name does not exists."
#puts "\[ERROR\] $inst_name does not exists."
} else {
placeInstance $inst_name $pt_x $pt_y $orient -fixed
set pt_x [expr [lindex $line 1]/$dbu]
set pt_y [expr [lindex $line 2]/$dbu]
set tmp_orient [expr [lindex $line 5]]
set orient [get_orient $tmp_orient]
if {[dbget [dbget top.insts.name $inst_name -p ].cell.subClass block -e] != "" } {
puts "Placing $inst_name"
placeInstance $inst_name $pt_x $pt_y $orient -placed
}
if { $place_std == 1 && [dbget [dbget top.insts.name $inst_name -p ].cell.subClass core -e] != "" } {
placeInstance $inst_name $pt_x $pt_y
}
}
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment