Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
macroplacement
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
macroplacement
Commits
a548ad45
Commit
a548ad45
authored
Dec 18, 2022
by
ZhiangWang033
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add readme
parent
5addfc90
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
4 deletions
+41
-4
CodeElements/FDPlacement/FD.py
+40
-3
CodeElements/FDPlacement/ariane133/ariane.plc.final.png
+0
-0
CodeElements/FDPlacement/simple_example/simple.os.plc.final
+1
-1
No files found.
CodeElements/FDPlacement/FD.py
View file @
a548ad45
...
...
@@ -610,7 +610,9 @@ class PlcObject:
elif
(
self
.
orientation
==
None
):
self
.
str
+=
"N "
else
:
self
.
str
+=
str
(
self
.
orientation
)
+
" "
string
=
str
(
self
.
orientation
)
.
split
(
'"'
)[
0
]
#self.str += str(self.orientation) + " "
self
.
str
+=
string
+
" "
self
.
str
+=
"0
\n
"
return
self
.
str
...
...
@@ -1071,7 +1073,7 @@ class PBFNetlist:
y_dir
=
src_cy
-
target_cy
dist
=
sqrt
(
x_dir
*
x_dir
+
y_dir
*
y_dir
)
return
x_dir
/
dist
,
y_dir
/
dist
# check the relative position
# This is for attractive force
def
CheckRelativePos
(
self
,
src
,
target
):
...
...
@@ -1217,23 +1219,58 @@ class FDPlacer:
#self.PlotFromPlc(self.open_source_flag)
start_time
=
time
.
time
()
self
.
FDPlacer
(
self
.
open_source_flag
)
end_time
=
time
.
time
()
self
.
final_netlist_pbf_file
=
self
.
run_dir
+
"/"
+
self
.
design_name
+
".pb.txt.final"
self
.
final_plc_file
=
self
.
run_dir
+
"/"
+
self
.
design_name
+
".plc.final"
self
.
final_plc_fig
=
self
.
run_dir
+
"/"
+
self
.
design_name
+
".plc.final.png"
self
.
design
.
WriteNetlist
(
self
.
final_netlist_pbf_file
,
self
.
final_plc_file
)
self
.
WritePlcFile
(
self
.
final_plc_file
)
print
(
"************************************************"
)
print
(
"The results from Circuit Training"
)
self
.
CalCostPlc
(
self
.
final_plc_file
,
isPrint
=
True
)
print
(
"runtime : "
,
end_time
-
start_time
)
print
(
"
\n
"
)
self
.
PlotFromPlc
(
self
.
open_source_flag
,
self
.
final_plc_fig
)
start_time
=
time
.
time
()
self
.
FDPlacer
(
not
self
.
open_source_flag
)
end_time
=
time
.
time
()
self
.
final_netlist_pbf_file
=
self
.
run_dir
+
"/"
+
self
.
design_name
+
".os.pb.txt.final"
self
.
final_plc_file
=
self
.
run_dir
+
"/"
+
self
.
design_name
+
".os.plc.final"
self
.
final_plc_fig
=
self
.
run_dir
+
"/"
+
self
.
design_name
+
".os.plc.final.png"
self
.
design
.
WriteNetlist
(
self
.
final_netlist_pbf_file
,
self
.
final_plc_file
)
print
(
"************************************************"
)
print
(
"The results from Our Implementation"
)
self
.
CalCostPlc
(
self
.
final_plc_file
,
isPrint
=
True
)
print
(
"runtime : "
,
end_time
-
start_time
)
print
(
"
\n
"
)
self
.
PlotFromPlc
(
not
self
.
open_source_flag
,
self
.
final_plc_fig
)
### Call the plc client for cost evulation
def
CalCostPlc
(
self
,
plc_file
,
isPrint
=
True
):
self
.
plc
.
restore_placement
(
plc_file
)
self
.
plc
.
set_canvas_boundary_check
(
False
)
self
.
plc
.
make_soft_macros_square
()
self
.
plc
.
set_placement_grid
(
self
.
design
.
n_cols
,
self
.
design
.
n_rows
)
self
.
plc
.
set_routes_per_micron
(
self
.
design
.
hroute_per_micro
,
self
.
design
.
vroute_per_micro
)
self
.
plc
.
set_macro_routing_allocation
(
self
.
design
.
hrouting_alloc
,
self
.
design
.
vrouting_alloc
)
self
.
plc
.
set_congestion_smooth_range
(
self
.
design
.
smooth_factor
)
self
.
plc
.
set_overlap_threshold
(
self
.
design
.
overlap_threshold
)
self
.
plc
.
set_canvas_size
(
self
.
design
.
canvas_width
,
self
.
design
.
canvas_height
)
wl_cost
=
self
.
plc
.
get_cost
()
den_cost
=
self
.
plc
.
get_density_cost
()
cong_cost
=
self
.
plc
.
get_congestion_cost
()
# the weight parameters are given by Circuit Training
proxy_cost
=
wl_cost
+
0.5
*
den_cost
+
0.5
*
cong_cost
if
(
isPrint
==
True
):
print
(
"WL cost : "
,
wl_cost
,
"Density cost : "
,
den_cost
,
"Congestion Cost : "
,
cong_cost
,
"Proxy cost : "
,
proxy_cost
)
return
proxy_cost
def
PlotFromPlc
(
self
,
open_source_flag
=
True
,
figure_file
=
None
):
plt
.
figure
(
constrained_layout
=
True
,
figsize
=
(
8
,
5
),
dpi
=
600
)
if
(
open_source_flag
==
True
):
...
...
CodeElements/FDPlacement/ariane133/ariane.plc.final.png
View replaced file @
5addfc90
View file @
a548ad45
136 KB
|
W:
|
H:
136 KB
|
W:
|
H:
2-up
Swipe
Onion skin
CodeElements/FDPlacement/simple_example/simple.os.plc.final
View file @
a548ad45
...
...
@@ -45,7 +45,7 @@
#
#
# node_index x y orientation fixed
0 201.0 201.0
"N"
0
0 201.0 201.0 0
1 300.0 300.0 N 0
2 285.0 285.0 N 0
3 400.0 400.0 N 0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment