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
fdeb44ce
Commit
fdeb44ce
authored
2 years ago
by
Dinple
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugging into placement_util
parent
89e4d8e8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
CodeElements/Plc_client/placement_util_os.py
+0
-0
CodeElements/Plc_client/plc_client_os.py
+21
-9
CodeElements/Plc_client/plc_client_os_test.py
+7
-0
No files found.
CodeElements/Plc_client/placement_util_os.py
0 → 100644
View file @
fdeb44ce
This diff is collapsed.
Click to expand it.
CodeElements/Plc_client/plc_client_os.py
View file @
fdeb44ce
...
@@ -85,6 +85,9 @@ class PlacementCost(object):
...
@@ -85,6 +85,9 @@ class PlacementCost(object):
# macro to pins look-up table: [MACRO_NAME] => [PIN_NAME]
# macro to pins look-up table: [MACRO_NAME] => [PIN_NAME]
self
.
hard_macros_to_inpins
=
{}
self
.
hard_macros_to_inpins
=
{}
self
.
soft_macros_to_inpins
=
{}
self
.
soft_macros_to_inpins
=
{}
# blockage
self
.
blockages
=
[]
# read netlist
# read netlist
self
.
__read_protobuf
()
self
.
__read_protobuf
()
...
@@ -929,6 +932,12 @@ class PlacementCost(object):
...
@@ -929,6 +932,12 @@ class PlacementCost(object):
"""
"""
return
sorted
(
self
.
hard_macro_indices
+
self
.
soft_macro_indices
)
return
sorted
(
self
.
hard_macro_indices
+
self
.
soft_macro_indices
)
def
set_project_name
(
self
,
project_name
):
"""
Set Project name
"""
self
.
project_name
=
project_name
def
get_project_name
(
self
)
->
str
:
def
get_project_name
(
self
)
->
str
:
"""
"""
Return Project name
Return Project name
...
@@ -1431,7 +1440,12 @@ class PlacementCost(object):
...
@@ -1431,7 +1440,12 @@ class PlacementCost(object):
"""
"""
Return Vertical/Horizontal Macro Allocation
Return Vertical/Horizontal Macro Allocation
"""
"""
return
self
.
modules
[
node_idx
]
.
get_type
()
try
:
return
self
.
modules_w_pins
[
node_idx
]
.
get_type
()
except
IndexError
:
# NOTE: Google's API return NONE if out of range
print
(
"[INDEX OUT OF RANGE ERROR] Can not process index at {}"
.
format
(
node_idx
))
return
None
def
make_soft_macros_square
(
self
):
def
make_soft_macros_square
(
self
):
pass
pass
...
@@ -1586,9 +1600,6 @@ class PlacementCost(object):
...
@@ -1586,9 +1600,6 @@ class PlacementCost(object):
def
update_node_coords
(
self
):
def
update_node_coords
(
self
):
pass
pass
def
fix_node_coord
(
self
):
pass
def
update_port_sides
(
self
):
def
update_port_sides
(
self
):
pass
pass
...
@@ -1613,11 +1624,9 @@ class PlacementCost(object):
...
@@ -1613,11 +1624,9 @@ class PlacementCost(object):
"""In case plc is loaded with fixed macros
"""In case plc is loaded with fixed macros
"""
"""
pass
pass
def
fix_node_coord
(
self
):
def
fix_node_coord
(
self
,
node_idx
):
"""Find all ports and fix their coordinates.
self
.
modules_w_pins
[
node_idx
]
.
set_fix_flag
(
True
)
"""
pass
def
unplace_all_nodes
(
self
):
def
unplace_all_nodes
(
self
):
pass
pass
...
@@ -1646,6 +1655,9 @@ class PlacementCost(object):
...
@@ -1646,6 +1655,9 @@ class PlacementCost(object):
def
get_blockages
(
self
):
def
get_blockages
(
self
):
pass
pass
def
create_blockage
(
self
,
minx
,
miny
,
maxx
,
maxy
,
blockage_rate
):
self
.
blockages
.
append
([
minx
,
miny
,
maxx
,
maxy
,
blockage_rate
])
def
get_ref_node_id
(
self
,
node_idx
=-
1
):
def
get_ref_node_id
(
self
,
node_idx
=-
1
):
"""ref_node_id is used for macro_pins. Refers to the macro it belongs to.
"""ref_node_id is used for macro_pins. Refers to the macro it belongs to.
"""
"""
...
...
This diff is collapsed.
Click to expand it.
CodeElements/Plc_client/plc_client_os_test.py
View file @
fdeb44ce
...
@@ -238,6 +238,13 @@ class PlacementCostTest():
...
@@ -238,6 +238,13 @@ class PlacementCostTest():
self
.
plc_os
.
set_canvas_size
(
self
.
CANVAS_WIDTH
,
self
.
CANVAS_HEIGHT
)
self
.
plc_os
.
set_canvas_size
(
self
.
CANVAS_WIDTH
,
self
.
CANVAS_HEIGHT
)
self
.
plc_os
.
set_placement_grid
(
self
.
GRID_COL
,
self
.
GRID_ROW
)
self
.
plc_os
.
set_placement_grid
(
self
.
GRID_COL
,
self
.
GRID_ROW
)
# TODO: Setting blockage has no effect on proxy cost computation
self
.
plc
.
create_blockage
(
0
,
0
,
400
,
400
,
1
)
self
.
plc
.
create_blockage
(
0
,
0
,
200
,
200
,
1
)
print
(
self
.
plc
.
get_blockages
())
print
(
self
.
plc
.
make_soft_macros_square
())
print
(
self
.
plc_os
.
get_soft_macros_count
())
# HPWL
# HPWL
try
:
try
:
assert
int
(
self
.
plc_os
.
get_wirelength
())
==
int
(
self
.
plc
.
get_wirelength
())
assert
int
(
self
.
plc_os
.
get_wirelength
())
==
int
(
self
.
plc
.
get_wirelength
())
...
...
This diff is collapsed.
Click to expand it.
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