Commit 2dae4729 by sakundu

Updated Our Progress. Added GF12 results. Updated macro shuffling scripts and…

Updated Our Progress. Added GF12 results. Updated macro shuffling scripts and Bookshelf to Protobuf translator.

Signed-off-by: sakundu <sakundu@ucsd.edu>
parent 158db901
...@@ -192,15 +192,15 @@ class port: ...@@ -192,15 +192,15 @@ class port:
self.side = None self.side = None
self.px = None # Protobuf location self.px = None # Protobuf location
self.py = None # Protobuf location self.py = None # Protobuf location
def connect_net(self, net_id, net_name, isInput): def connect_net(self, net_id, net_name, isInput):
if self.net_id != None: if self.net_id != None:
print(f"[INFO] [ERROR-3] {self.name} is connected. Check Net: {net_name}") print(f"[INFO] [ERROR-3] {self.name} is connected. Check Net: {net_name}")
self.net_id = net_id self.net_id = net_id
self.isInput = isInput self.isInput = isInput
return return
def update_id(self, idx): def update_id(self, idx):
self.id = idx self.id = idx
return return
...@@ -209,7 +209,7 @@ class port: ...@@ -209,7 +209,7 @@ class port:
self.x = x self.x = x
self.y = y self.y = y
return return
def update_side(self, pt_x, pt_y, dx, dy): def update_side(self, pt_x, pt_y, dx, dy):
cond1 = pt_x - pt_y cond1 = pt_x - pt_y
cond2 = pt_x/dx + pt_y/dy - 1 cond2 = pt_x/dx + pt_y/dy - 1
...@@ -241,21 +241,21 @@ class port: ...@@ -241,21 +241,21 @@ class port:
die_lly = coy - c2dy[0] die_lly = coy - c2dy[0]
die_dx = dx + sum(c2dx) die_dx = dx + sum(c2dx)
die_dy = dy + sum(c2dy) die_dy = dy + sum(c2dy)
X = self.x - die_llx X = self.x - die_llx
Y = self.y - die_lly Y = self.y - die_lly
if self.side == None: if self.side == None:
self.update_side(X, Y, die_dx, die_dy) self.update_side(X, Y, die_dx, die_dy)
co_urx = cox + dx co_urx = cox + dx
co_ury = coy + dy co_ury = coy + dy
if self.side == "left": if self.side == "left":
self.px = dd self.px = dd
elif self.side == "right": elif self.side == "right":
self.px = dx - dd self.px = dx - dd
if self.side in ["left", "right"]: if self.side in ["left", "right"]:
if self.y <= coy: if self.y <= coy:
## Directly print py Considering Core origin (0, 0) ## Directly print py Considering Core origin (0, 0)
...@@ -264,12 +264,12 @@ class port: ...@@ -264,12 +264,12 @@ class port:
self.py = dy - dd self.py = dy - dd
else: else:
self.py = self.y - coy self.py = self.y - coy
if self.side == "top": if self.side == "top":
self.py = dy - dd self.py = dy - dd
elif self.side == "bottom": elif self.side == "bottom":
self.py = dd self.py = dd
if self.side in ["top", "bottom"]: if self.side in ["top", "bottom"]:
if self.x <= cox: if self.x <= cox:
self.px = dd self.px = dd
...@@ -295,7 +295,7 @@ class net: ...@@ -295,7 +295,7 @@ class net:
else: else:
print(f"[INFO][ERROR-4] Net has the driver id:{did} type:{dtype}") print(f"[INFO][ERROR-4] Net has the driver id:{did} type:{dtype}")
return return
def add_sink(self, stype, sid): def add_sink(self, stype, sid):
if sid not in self.sids: if sid not in self.sids:
self.sids.append(sid) self.sids.append(sid)
...@@ -433,7 +433,7 @@ class canvas_object: ...@@ -433,7 +433,7 @@ class canvas_object:
_port.update_protobuf_location(self.c2dx, self.c2dy, self.core_llx,\ _port.update_protobuf_location(self.c2dx, self.c2dy, self.core_llx,\
self.core_lly, self.core_dx, self.core_dy, 0.5/self.unit) self.core_lly, self.core_dx, self.core_dy, 0.5/self.unit)
return return
def update_inst_type(self): def update_inst_type(self):
for _inst in self.insts: for _inst in self.insts:
_inst.update_isMacro(self.site_height) _inst.update_isMacro(self.site_height)
...@@ -456,18 +456,18 @@ class canvas_object: ...@@ -456,18 +456,18 @@ class canvas_object:
''' '''
scl_fp = open(scl_file, 'r') scl_fp = open(scl_file, 'r')
row_id = 0 row_id = 0
crow = None crow = None
for line in scl_fp.readlines(): for line in scl_fp.readlines():
if re.match(r"(^\s*#)|(^\s*UCLA\s*scl\s*1.0$)|(^\s*$)|(^\sEnd\s*$)", line): if re.match(r"(^\s*#)|(^\s*UCLA\s*scl\s*1.0$)|(^\s*$)|(^\sEnd\s*$)", line):
continue continue
if re.match("^\s*CoreRow\s*Horizontal\s*$", line): if re.match(r"^\s*CoreRow\s*Horizontal\s*$", line):
self.rows.append(row(row_id)) self.rows.append(row(row_id))
crow = self.rows[row_id] crow = self.rows[row_id]
row_id += 1 row_id += 1
continue continue
lly = re.findall(r"^\s*Coordinate\s*:\s*([0-9,-,\.]*)", line) lly = re.findall(r"^\s*Coordinate\s*:\s*([0-9,-,\.]*)", line)
sheight = re.findall(r"\s*Height\s*:\s*([0-9,-,\.]*)", line) sheight = re.findall(r"\s*Height\s*:\s*([0-9,-,\.]*)", line)
swidth = re.findall(r"^\s*Sitewidth\s*:\s*([0-9,-,\.]*)", line) swidth = re.findall(r"^\s*Sitewidth\s*:\s*([0-9,-,\.]*)", line)
...@@ -479,32 +479,32 @@ class canvas_object: ...@@ -479,32 +479,32 @@ class canvas_object:
if lly and lly[0] != "" : if lly and lly[0] != "" :
_lly = float(lly[0])/self.unit _lly = float(lly[0])/self.unit
crow.update_lly(_lly) crow.update_lly(_lly)
if sheight and sheight[0] != "": if sheight and sheight[0] != "":
if self.site_height == None: if self.site_height == None:
self.site_height = float(sheight[0])/self.unit self.site_height = float(sheight[0])/self.unit
elif self.site_height != float(sheight[0])/self.unit: elif self.site_height != float(sheight[0])/self.unit:
print(f"[INFO][ERROR-8] Row id:{row_id-1} site height is different") print(f"[INFO][ERROR-8] Row id:{row_id-1} site height is different")
if swidth and swidth[0] != "": if swidth and swidth[0] != "":
if self.site_width == None: if self.site_width == None:
self.site_width = float(swidth[0])/self.unit self.site_width = float(swidth[0])/self.unit
elif self.site_width != float(swidth[0])/self.unit: elif self.site_width != float(swidth[0])/self.unit:
print(f"[INFO][ERROR-9] Row id:{row_id-1} site width is different") print(f"[INFO][ERROR-9] Row id:{row_id-1} site width is different")
if sorient and sorient[0] != "": if sorient and sorient[0] != "":
crow.update_orient(sorient[0]) crow.update_orient(sorient[0])
if llx and llx[0] != "": if llx and llx[0] != "":
_llx = float(llx[0])/self.unit _llx = float(llx[0])/self.unit
crow.update_llx(_llx) crow.update_llx(_llx)
if sspacing and sspacing[0] != "": if sspacing and sspacing[0] != "":
if self.site_spacing == None: if self.site_spacing == None:
self.site_spacing = float(sspacing[0])/self.unit self.site_spacing = float(sspacing[0])/self.unit
elif self.site_spacing != float(sspacing[0])/self.unit: elif self.site_spacing != float(sspacing[0])/self.unit:
print(f"[INFO][ERROR-10] Row id:{row_id-1} site spacing is different") print(f"[INFO][ERROR-10] Row id:{row_id-1} site spacing is different")
if numsites and numsites[0] != "": if numsites and numsites[0] != "":
crow.update_site_count(numsites[0]) crow.update_site_count(numsites[0])
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
setenv SYN_HANDOFF $argv[1] setenv SYN_HANDOFF $argv[1]
setenv SEED $argv[2] setenv SEED $argv[2]
if ($#argv >= 3) then
setenv DEF_FILE $argv[3]
endif
set util_dir="/home/fetzfs_projects/MacroPlacement/flow_scripts_run/MacroPlacement/Flows/util/" set util_dir="/home/fetzfs_projects/MacroPlacement/flow_scripts_run/MacroPlacement/Flows/util/"
if ($#argv != 3) then if ($#argv != 3) then
...@@ -17,5 +21,7 @@ innovus -64 -overwrite -log log/macro_shuffle_innovus.log -files ${util_dir}/gen ...@@ -17,5 +21,7 @@ innovus -64 -overwrite -log log/macro_shuffle_innovus.log -files ${util_dir}/gen
## Edit the design file to make sure flow2 reads the new macro placed def instead of the default one ## Edit the design file to make sure flow2 reads the new macro placed def instead of the default one
set def_file=`ls *_fp_shuffled_macros.def | head -n1` set def_file=`ls *_fp_shuffled_macros.def | head -n1`
sed -i "s@\S*_fp_placed_macros.def@${def_file}@" design_setup.tcl sed -i "s@\S*_fp.def@${def_file}@" design_setup.tcl
sed -i "s@./syn_handoff@${SYN_HANDOFF}@" run_invs.tcl
sed -i "s@place_design -concurrent_macros@#place_design -concurrent_macros@" run_invs.tcl
sed -i "s@refine_macro_place@#refine_macro_place@" run_invs.tcl
...@@ -45,7 +45,12 @@ generateVias ...@@ -45,7 +45,12 @@ generateVias
createBasicPathGroups -expanded createBasicPathGroups -expanded
## Generate the floorplan ## ## Generate the floorplan ##
defIn ${handoff_dir}/${DESIGN}.def
if {[info exist ::env(DEF_FILE)] && $::env(DEF_FILE) != ""} {
defIn $::env(DEF_FILE)
} else {
defIn ${handoff_dir}/${DESIGN}.def
}
#### Unplace the standard cells ### #### Unplace the standard cells ###
dbset [dbget top.insts.cell.subClass core -p2 ].pStatus unplaced dbset [dbget top.insts.cell.subClass core -p2 ].pStatus unplaced
...@@ -53,6 +58,7 @@ dbset [dbget top.insts.cell.subClass core -p2 ].pStatus unplaced ...@@ -53,6 +58,7 @@ dbset [dbget top.insts.cell.subClass core -p2 ].pStatus unplaced
source ../../../../util/shuffle_macro.tcl source ../../../../util/shuffle_macro.tcl
shuffle_macros $::env(SEED) shuffle_macros $::env(SEED)
dbset [dbget top.insts.cell.subClass block -p2 ].pStatus fixed
defOut -floorplan ./${DESIGN}_fp_shuffled_macros.def defOut -floorplan ./${DESIGN}_fp_shuffled_macros.def
exit exit
...@@ -11,7 +11,8 @@ if [ $PHY_SYNTH -eq 1 ]; then ...@@ -11,7 +11,8 @@ if [ $PHY_SYNTH -eq 1 ]; then
export HMETIS_DIR="/home/zf4_projects/DREAMPlace/sakundu/GB/CT/hmetis-1.5-linux" export HMETIS_DIR="/home/zf4_projects/DREAMPlace/sakundu/GB/CT/hmetis-1.5-linux"
export PLC_WRAPPER_MAIN="/home/zf4_projects/DREAMPlace/sakundu/GB/CT/plc_wrapper_main" export PLC_WRAPPER_MAIN="/home/zf4_projects/DREAMPlace/sakundu/GB/CT/plc_wrapper_main"
#export CT_PATH="${PROJ_DIR}/../../../GB/CT/circuit_training" #export CT_PATH="${PROJ_DIR}/../../../GB/CT/circuit_training"
export CT_PATH="/home/zf4_projects/DREAMPlace/sakundu/ABK_MP/CT/09092022/circuit_training" #export CT_PATH="/home/zf4_projects/DREAMPlace/sakundu/ABK_MP/CT/09092022/circuit_training"
export CT_PATH="/home/zf4_projects/DREAMPlace/sakundu/ABK_MP/CT/11112022/circuit_training"
#export CT_PATH="/home/zf4_projects/macro_placer/google_brain/TILOS_repo/grouping/circuit_training" #export CT_PATH="/home/zf4_projects/macro_placer/google_brain/TILOS_repo/grouping/circuit_training"
bash -i ../../../../util/run_grp.sh 2>&1 | tee log/grouping.log bash -i ../../../../util/run_grp.sh 2>&1 | tee log/grouping.log
fi fi
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