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
51923065
Commit
51923065
authored
Oct 26, 2022
by
ZhiangWang033
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add repel force
parent
60e8c9d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
CodeElements/FDPlacement/fd_placement.py
+21
-4
No files found.
CodeElements/FDPlacement/fd_placement.py
View file @
51923065
...
@@ -397,9 +397,8 @@ class FDPlacement:
...
@@ -397,9 +397,8 @@ class FDPlacement:
if
(
dist
<=
1e-5
):
if
(
dist
<=
1e-5
):
return
1e5
,
1e5
return
1e5
,
1e5
else
:
else
:
f
=
self
.
func_r
(
dist
)
f_x
=
self
.
repulsive_factor
*
x_dist
/
dist
f_x
=
x_dist
/
dist
*
f
f_y
=
self
.
repulsive_factor
*
y_dist
/
dist
f_y
=
y_dist
/
dist
*
f
return
f_x
,
f_y
return
f_x
,
f_y
# Pull the objects to the nearest center of the gridcell
# Pull the objects to the nearest center of the gridcell
...
@@ -417,6 +416,20 @@ class FDPlacement:
...
@@ -417,6 +416,20 @@ class FDPlacement:
row_id
=
self
.
n_rows
-
1
row_id
=
self
.
n_rows
-
1
self
.
objects
[
object_id
]
.
y
=
(
row_id
+
0.5
)
*
self
.
grid_height
self
.
objects
[
object_id
]
.
y
=
(
row_id
+
0.5
)
*
self
.
grid_height
# Make sure all the clusters are placed within the canvas
def
FitCanvas
(
self
,
object_id
):
if
(
self
.
objects
[
object_id
]
.
x
<=
0.0
):
self
.
objects
[
object_id
]
.
x
=
0.0
if
(
self
.
objects
[
object_id
]
.
x
>=
self
.
canvas_width
):
self
.
objects
[
object_id
]
.
x
=
self
.
canvas_width
if
(
self
.
objects
[
object_id
]
.
y
<=
0.0
):
self
.
objects
[
object_id
]
.
y
=
0.0
if
(
self
.
objects
[
object_id
]
.
y
>=
self
.
canvas_height
):
self
.
objects
[
object_id
]
.
y
=
self
.
canvas_height
# Force-directed Placement for standard-cell clusters
# Force-directed Placement for standard-cell clusters
def
Placement
(
self
):
def
Placement
(
self
):
# initialize the displacement for standard-cell clusters
# initialize the displacement for standard-cell clusters
...
@@ -501,8 +514,12 @@ class FDPlacement:
...
@@ -501,8 +514,12 @@ class FDPlacement:
for
j
in
range
(
self
.
num_step
):
for
j
in
range
(
self
.
num_step
):
print
(
"Runing Step "
,
j
)
print
(
"Runing Step "
,
j
)
self
.
Placement
()
self
.
Placement
()
# Based on our understanding, the stdcell clusters can be placed
# at any place in the canvas instead of the center of gridcells
#for cluster in self.stdcell_clusters:
# self.RoundCenter(cluster)
for
cluster
in
self
.
stdcell_clusters
:
for
cluster
in
self
.
stdcell_clusters
:
self
.
RoundCenter
(
cluster
)
self
.
FitCanvas
(
cluster
)
self
.
WritePbNetlist
(
self
.
pb_netlist_file
+
"."
+
str
(
i
+
1
))
self
.
WritePbNetlist
(
self
.
pb_netlist_file
+
"."
+
str
(
i
+
1
))
self
.
WritePlcFile
(
self
.
plc_file
+
"."
+
str
(
i
+
1
))
self
.
WritePlcFile
(
self
.
plc_file
+
"."
+
str
(
i
+
1
))
self
.
WritePbNetlist
(
self
.
pb_netlist_file
+
".final"
)
self
.
WritePbNetlist
(
self
.
pb_netlist_file
+
".final"
)
...
...
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