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
89e4d8e8
Commit
89e4d8e8
authored
Aug 30, 2022
by
Dinple
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixes
parent
c612bdbc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
.gitignore
+1
-0
CodeElements/Plc_client/plc_client_os.py
+12
-2
CodeElements/Plc_client/plc_client_os_test.py
+16
-4
No files found.
.gitignore
View file @
89e4d8e8
...
...
@@ -7,3 +7,4 @@ CodeElements/Plc_client/test/*/*
CodeElements/Plc_client/plc_client_os.py
CodeElements/Plc_client/__pycache__/*
CodeElements/Plc_client/proto_reader.py
CodeElements/Plc_client/plc_client.py
CodeElements/Plc_client/plc_client_os.py
View file @
89e4d8e8
...
...
@@ -23,6 +23,8 @@ Example:
Todo:
* Add Documentation
* Clean up
* location information update not correctly after restore placement
* test if cell < 5, congestion cost computation
"""
...
...
@@ -429,7 +431,8 @@ class PlacementCost(object):
elif
all
(
it
in
line_item
for
it
in
[
'MACROs'
])
\
and
len
(
line_item
)
==
2
:
_macros_cnt
=
int
(
line_item
[
1
])
elif
all
(
re
.
match
(
r'[0-9N\.\-]+'
,
it
)
for
it
in
line_item
):
elif
all
(
re
.
match
(
r'[0-9NEWS\.\-]+'
,
it
)
for
it
in
line_item
)
\
and
len
(
line_item
)
==
5
:
# [node_index] [x] [y] [orientation] [fixed]
_node_plc
[
int
(
line_item
[
0
])]
=
line_item
[
1
:]
...
...
@@ -473,6 +476,11 @@ class PlacementCost(object):
if
ifInital
:
self
.
init_plc
=
plc_pth
# recompute cost from new location
self
.
FLAG_UPDATE_CONGESTION
=
True
self
.
FLAG_UPDATE_DENSITY
=
True
self
.
FLAG_UPDATE_WIRELENGTH
=
True
# extracted information from .plc file
info_dict
=
self
.
__read_plc
(
plc_pth
)
...
...
@@ -499,7 +507,9 @@ class PlacementCost(object):
self
.
hard_macro_indices
+
\
self
.
soft_macro_indices
)
==
list
(
info_dict
[
'node_plc'
]
.
keys
())
except
AssertionError
:
print
(
'[PLC IDICES MISMATCH ERROR]'
)
print
(
'[PLC INDICES MISMATCH ERROR]'
,
len
(
sorted
(
self
.
port_indices
+
\
self
.
hard_macro_indices
+
\
self
.
soft_macro_indices
)),
len
(
list
(
info_dict
[
'node_plc'
]
.
keys
())))
exit
(
1
)
for
mod_idx
in
info_dict
[
'node_plc'
]
.
keys
():
...
...
CodeElements/Plc_client/plc_client_os_test.py
View file @
89e4d8e8
...
...
@@ -34,6 +34,18 @@ Example:
--marv 5
\
--smooth 2
$ python3 -m Plc_client.plc_client_os_test --netlist ./Plc_client/test/ariane133/netlist.pb.txt
\
--plc ./Plc_client/test/ariane133/initial.plc
\
--width 1599
\
--height 1600.06
\
--col 24
\
--row 21
\
--rpmh 10
\
--rpmv 10
\
--marh 5
\
--marv 5
\
--smooth 2
Todo:
* Clean up code
* Extract argument from command line
...
...
@@ -208,7 +220,7 @@ class PlacementCostTest():
ifValidate
=
True
,
ifReadComment
=
False
)
self
.
plc
.
set_canvas_boundary_check
(
False
)
self
.
plc
.
restore_placement
(
self
.
PLC_PATH
)
#
self.plc.restore_placement(self.PLC_PATH)
else
:
print
(
"[PLC FILE MISSING] Using only netlist info"
)
...
...
@@ -228,10 +240,10 @@ class PlacementCostTest():
# HPWL
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
())
assert
abs
(
self
.
plc
.
get_cost
()
-
self
.
plc_os
.
get_cost
())
<=
1e-3
except
Exception
as
e
:
print
(
"[WIRELENGTH ERROR] Discrepancies found when computing wirelength -- {}
"
.
format
(
str
(
e
)))
print
(
"[WIRELENGTH ERROR] Discrepancies found when computing wirelength -- {}
, {}"
.
format
(
str
(
self
.
plc
.
get_cost
()),
self
.
plc_os
.
get_cost
(
)))
exit
(
1
)
# Density
...
...
@@ -239,7 +251,7 @@ class PlacementCostTest():
assert
int
(
sum
(
self
.
plc_os
.
get_grid_cells_density
()))
==
int
(
sum
(
self
.
plc
.
get_grid_cells_density
()))
assert
int
(
self
.
plc_os
.
get_density_cost
())
==
int
(
self
.
plc
.
get_density_cost
())
except
Exception
as
e
:
print
(
"[DENSITY ERROR] Discrepancies found when computing density -- {}
"
.
format
(
str
(
e
)))
print
(
"[DENSITY ERROR] Discrepancies found when computing density -- {}
, {}"
.
format
(
str
(
self
.
plc
.
get_density_cost
()),
self
.
plc_os
.
get_density_cost
(
)))
exit
(
1
)
# Congestion
...
...
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