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
Aug 31, 2022
by
Dinple
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugging into placement_util
parent
89e4d8e8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
+27
-8
CodeElements/Plc_client/placement_util_os.py
+0
-0
CodeElements/Plc_client/plc_client_os.py
+20
-8
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):
# macro to pins look-up table: [MACRO_NAME] => [PIN_NAME]
self
.
hard_macros_to_inpins
=
{}
self
.
soft_macros_to_inpins
=
{}
# blockage
self
.
blockages
=
[]
# read netlist
self
.
__read_protobuf
()
...
...
@@ -929,6 +932,12 @@ class PlacementCost(object):
"""
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
:
"""
Return Project name
...
...
@@ -1431,7 +1440,12 @@ class PlacementCost(object):
"""
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
):
pass
...
...
@@ -1586,9 +1600,6 @@ class PlacementCost(object):
def
update_node_coords
(
self
):
pass
def
fix_node_coord
(
self
):
pass
def
update_port_sides
(
self
):
pass
...
...
@@ -1614,10 +1625,8 @@ class PlacementCost(object):
"""
pass
def
fix_node_coord
(
self
):
"""Find all ports and fix their coordinates.
"""
pass
def
fix_node_coord
(
self
,
node_idx
):
self
.
modules_w_pins
[
node_idx
]
.
set_fix_flag
(
True
)
def
unplace_all_nodes
(
self
):
pass
...
...
@@ -1646,6 +1655,9 @@ class PlacementCost(object):
def
get_blockages
(
self
):
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
):
"""ref_node_id is used for macro_pins. Refers to the macro it belongs to.
"""
...
...
CodeElements/Plc_client/plc_client_os_test.py
View file @
fdeb44ce
...
...
@@ -238,6 +238,13 @@ class PlacementCostTest():
self
.
plc_os
.
set_canvas_size
(
self
.
CANVAS_WIDTH
,
self
.
CANVAS_HEIGHT
)
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
try
:
assert
int
(
self
.
plc_os
.
get_wirelength
())
==
int
(
self
.
plc
.
get_wirelength
())
...
...
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