Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LCLayout
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Lanzendörfer
LCLayout
Commits
d9ab9949
Commit
d9ab9949
authored
2 years ago
by
Thomas Kramer
Browse files
Options
Downloads
Patches
Plain Diff
compute costs of terminal nodes and apply them to the graph edges
parent
819ce1a6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lclayout/router.py
+26
-0
26 additions, 0 deletions
lclayout/router.py
lclayout/routing_graph.py
+30
-0
30 additions, 0 deletions
lclayout/routing_graph.py
with
56 additions
and
0 deletions
lclayout/router.py
+
26
−
0
View file @
d9ab9949
...
@@ -462,6 +462,32 @@ class DefaultRouter():
...
@@ -462,6 +462,32 @@ class DefaultRouter():
else
:
else
:
assert
False
,
'
Routing graph is not connected.
'
assert
False
,
'
Routing graph is not connected.
'
# Set via weights based on terminal costs.
regions_by_layer
=
{
# Convert Shapes objects into db.Region for fast 'inside' checks.
layer
:
db
.
Region
(
s
)
for
layer
,
s
in
shapes
.
items
()
}
for
net
,
ts
in
terminals_by_net
:
for
terminal_node
in
ts
:
layer
,
(
x
,
y
)
=
terminal_node
possible_via_layers
=
(
data
[
'
layer
'
]
for
_
,
_
,
data
in
via_layers
.
edges
(
layer
,
data
=
True
))
for
via_layer
in
possible_via_layers
:
via_cost
=
compute_terminal_cost
(
via_layer
,
layer
,
(
x
,
y
),
regions_by_layer
[
layer
],
tech
)
other_node
=
via_layer
,
(
x
,
y
)
# Node on the other side of the via.
if
terminal_node
in
graph
and
other_node
in
graph
:
# Scale the via cost
graph
[
terminal_node
][
other_node
][
'
weight
'
]
*=
via_cost
+
1
self
.
_routing_graph
=
graph
self
.
_routing_graph
=
graph
# TODO: SPLIT HERE
# TODO: SPLIT HERE
...
...
This diff is collapsed.
Click to expand it.
lclayout/routing_graph.py
+
30
−
0
View file @
d9ab9949
...
@@ -396,6 +396,36 @@ def _extract_terminal_nodes_from_shape(routing_nodes: Dict[Any, Set[Tuple[int, i
...
@@ -396,6 +396,36 @@ def _extract_terminal_nodes_from_shape(routing_nodes: Dict[Any, Set[Tuple[int, i
logger
.
debug
(
f
"
routing_terminals:
{
routing_terminals
}
"
)
logger
.
debug
(
f
"
routing_terminals:
{
routing_terminals
}
"
)
return
routing_terminals
return
routing_terminals
def
compute_terminal_cost
(
via_layer
:
str
,
layer
:
str
,
coord
:
Tuple
[
int
,
int
],
layer_region
:
db
.
Region
,
tech
)
->
int
:
"""
Compute the cost of placing a via on `via_layer` which connects to `layer` at `(x, y)`.
The cost is derived from the existing geometries on the layer.
TODO: Move to new module
'
pin_access_analysis
'
Returns an unscaled cost. 0 for vias which can be placed without extending the pin shape,
1 for vias which would extend the pin shape.
"""
enc
=
tech
.
minimum_enclosure
.
get
((
layer
,
via_layer
),
0
)
via_size
=
tech
.
via_size
[
via_layer
]
d
=
enc
+
via_size
//
2
# Test if the via would be completely enclosed in existing shapes.
is_enclosed
=
is_inside
(
coord
,
layer_region
,
d
)
if
is_enclosed
:
# Via can be placed without extending the pin shape.
return
0
else
:
return
1
def
extract_terminal_nodes_by_lvs
(
graph
:
nx
.
Graph
,
def
extract_terminal_nodes_by_lvs
(
graph
:
nx
.
Graph
,
pin_shapes_by_net
:
Dict
[
str
,
List
[
List
[
Tuple
[
str
,
db
.
Polygon
]]]],
pin_shapes_by_net
:
Dict
[
str
,
List
[
List
[
Tuple
[
str
,
db
.
Polygon
]]]],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment