Skip to content

Commit

Permalink
fix floorplan issue, rename .make to .Make
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Jan 23, 2025
1 parent 7e52216 commit bc4b73a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 16 deletions.
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
detalied routing iteration.
* Added `DRT_SAVE_DRC_REPORT_ITERS`

* `OpenROAD.Floorplan`

* Fixed an issue in `FP_SIZING`: `absolute` mode where if the die area's
x0 > x1 or y0 > y1, the computed core area would no longer fit in the die
area. Not that we recommend you ever do that, but technically OpenROAD
allows it.

* `OpenROAD.GlobalPlacement`

* Added optional variable `PL_ROUTABILITY_MAX_DENSITY_PCT`
Expand Down
2 changes: 1 addition & 1 deletion openlane/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def run(
)
ctx.exit(1)
elif isinstance(meta.flow, list):
TargetFlow = SequentialFlow.make(meta.flow)
TargetFlow = SequentialFlow.Make(meta.flow)
if meta.substituting_steps is not None and issubclass(
TargetFlow, SequentialFlow
):
Expand Down
12 changes: 11 additions & 1 deletion openlane/flows/sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
Union,
)

from deprecated.sphinx import deprecated
from rapidfuzz import process, fuzz, utils

from .flow import Flow, FlowException, FlowError
Expand Down Expand Up @@ -145,7 +146,7 @@ def __init_subclass__(Self, scm_type=None, name=None, **kwargs):
)

@classmethod
def make(Self, step_ids: List[str]) -> Type[SequentialFlow]:
def Make(Self, step_ids: List[str]) -> Type[SequentialFlow]:
Step_list = []
for name in step_ids:
step = Step.factory.get(name)
Expand All @@ -159,6 +160,15 @@ class CustomSequentialFlow(SequentialFlow):

return CustomSequentialFlow

@classmethod
@deprecated(
"use .Make",
version="3.0.0",
action="once",
)
def make(Self, step_ids: List[str]) -> Type[SequentialFlow]:
return Self.Make(step_ids)

@classmethod
def Substitute(Self, Substitutions: SubstitutionsObject) -> Type[SequentialFlow]:
"""
Expand Down
21 changes: 12 additions & 9 deletions openlane/scripts/openroad/floorplan.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,20 @@ if {$::env(FP_SIZING) == "absolute"} {
exit_unless_gui 1
}
if { ! [info exists ::env(CORE_AREA)] } {
set die_ll_x [lindex $::env(DIE_AREA) 0]
set die_ll_y [lindex $::env(DIE_AREA) 1]
set die_ur_x [lindex $::env(DIE_AREA) 2]
set die_ur_y [lindex $::env(DIE_AREA) 3]
set die_x0 [lindex $::env(DIE_AREA) 0]
set die_y0 [lindex $::env(DIE_AREA) 1]
set die_x1 [lindex $::env(DIE_AREA) 2]
set die_y1 [lindex $::env(DIE_AREA) 3]

set core_ll_x [expr {$die_ll_x + $left_margin}]
set core_ll_y [expr {$die_ll_y + $bottom_margin}]
set core_ur_x [expr {$die_ur_x - $right_margin}]
set core_ur_y [expr {$die_ur_y - $top_margin}]
set x_dir [expr $die_x1 < $die_x0]
set y_dir [expr $die_y1 < $die_y0]

set ::env(CORE_AREA) [list $core_ll_x $core_ll_y $core_ur_x $core_ur_y]
set core_x0 [expr {$die_x0 + (-1 ** $x_dir) * $left_margin}]
set core_y0 [expr {$die_y0 + (-1 ** $y_dir) * $bottom_margin}]
set core_x1 [expr {$die_x1 - (-1 ** $x_dir) * $right_margin}]
set core_y1 [expr {$die_y1 - (-1 ** $y_dir) * $top_margin}]

set ::env(CORE_AREA) [list $core_x0 $core_y0 $core_x1 $core_y1]
} else {
if { [llength $::env(CORE_AREA)] != 4 } {
puts stderr "Invalid core area string '$::env(CORE_AREA)'."
Expand Down
10 changes: 5 additions & 5 deletions test/flows/test_sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Dummy(SequentialFlow):
def test_custom_seqflow(MetricIncrementer):
from openlane.flows import SequentialFlow

MyFlow = SequentialFlow.make(
MyFlow = SequentialFlow.Make(
[
"Test.MetricIncrementer",
"Test.MetricIncrementer",
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_custom_seqflow_bad_id(MetricIncrementer):
from openlane.flows import SequentialFlow

with pytest.raises(TypeError, match="No step found with id"):
SequentialFlow.make(
SequentialFlow.Make(
[
"Test.MetricIncrementer",
"Test.MetricIncrementer",
Expand Down Expand Up @@ -147,7 +147,7 @@ class FinalMetricIncrementer(MetricIncrementer):
id = "Test.FinalMetricIncrementer"
counter_name = "final_counter"

MyFlow = SequentialFlow.make(
MyFlow = SequentialFlow.Make(
[
"Test.MetricIncrementer",
"Test.MetricIncrementer",
Expand Down Expand Up @@ -224,7 +224,7 @@ class FinalMetricIncrementer(MetricIncrementer):
def test_substitute_none(MetricIncrementer):
from openlane.flows import SequentialFlow, FlowException

MyFlow = SequentialFlow.make(
MyFlow = SequentialFlow.Make(
[
"Test.MetricIncrementer",
"Test.MetricIncrementer",
Expand Down Expand Up @@ -264,7 +264,7 @@ def test_substitute_none(MetricIncrementer):
def test_bad_substitution(MetricIncrementer):
from openlane.flows import SequentialFlow, FlowException

MyFlow = SequentialFlow.make(
MyFlow = SequentialFlow.Make(
[
"Test.MetricIncrementer",
"Test.MetricIncrementer",
Expand Down

0 comments on commit bc4b73a

Please sign in to comment.