Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/mpl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ rtl_macro_placer
| `-max_num_level` | Maximum depth of physical hierarchical tree. The default value is `2`, and the allowed values are integers `[0, MAX_INT]`. |
| `-coarsening_ratio` | The larger the coarsening_ratio, the faster the convergence process. The allowed values are floats, and the default value is `10.0`. |
| `-large_net_threshold` | Ignore nets with many connections during clustering, such as global nets. The default value is `50`, and the allowed values are integers `[0, MAX_INT]`. |
| `-halo_width` | **Deprecated: use `set_macro_default_halo` instead.** Horizontal halo around macros (microns). The default value is `0.0`. |
| `-halo_height` | **Deprecated: use `set_macro_default_halo` instead.** Vertical halo around macros (microns). The default value is `0.0`. |
| `-halo_width` | **Deprecated: use `set_macro_base_halo` instead.** Horizontal halo around macros (microns). The default value is `0.0`. |
| `-halo_height` | **Deprecated: use `set_macro_base_halo` instead.** Vertical halo around macros (microns). The default value is `0.0`. |
| `-fence_lx`, `-fence_ly`, `-fence_ux`, `-fence_uy` | Defines the global fence bounding box coordinates. The default values are the core area coordinates). |
| `-target_util` | Specifies the target utilization. The allowed values are floats and the default value is `0.25`. |
| `-min_ar` | Specifies the minimum aspect ratio $a$, or the ratio of its width to height of a `StandardCellCluster` from $[a, \frac{1}{a}]$. The allowed values are floats, and the default value is `0.33`. |
Expand Down Expand Up @@ -123,13 +123,13 @@ set_macro_guidance_region
| `-region` | The lower left corner and upper right corner {lx ly ux uy} of the region in microns. |


### Set Macro Default Halo
### Set Macro Base Halo

Command for setting the default halo around all macros. Per-macro halos set with `set_macro_halo` take precedence.
Command for setting the base halo around all macros. Per-macro halos set with `set_macro_halo` take precedence.

```tcl
set_macro_default_halo left bottom right top
set_macro_default_halo width height
set_macro_base_halo left bottom right top
set_macro_base_halo width height
```

#### Arguments
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/include/mpl/rtl_mp.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class MacroPlacer

void setMacroPlacementFile(const std::string& file_name);
void addGuidanceRegion(odb::dbInst* macro, odb::Rect region);
void setDefaultHalo(int left, int bottom, int right, int top);
void setBaseHalo(int left, int bottom, int right, int top);
void setMacroHalo(odb::dbInst* macro,
int left,
int bottom,
Expand Down
24 changes: 12 additions & 12 deletions src/mpl/src/clusterEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ void ClusteringEngine::setTree(PhysicalHierarchy* tree)
}

void ClusteringEngine::setHalos(
const HardMacro::Halo& default_halo,
const HardMacro::Halo& base_halo,
const std::map<odb::dbInst*, HardMacro::Halo>& macro_to_halo)
{
default_halo_ = default_halo;
base_halo_ = base_halo;
macro_to_halo_ = macro_to_halo;
}

Expand Down Expand Up @@ -306,7 +306,7 @@ void ClusteringEngine::reportDesignData()
"\tArea of std cell instances: {:.2f}\n"
"\tNumber of macros: {}\n"
"\tArea of macros: {:.2f}\n"
"\tDefault halo (L, B, R, T): ({:.2f}, {:.2f}, {:.2f}, {:.2f})\n"
"\tBase halo (L, B, R, T): ({:.2f}, {:.2f}, {:.2f}, {:.2f})\n"
"\tArea of macros with halos: {:.2f}\n"
"\tArea of std cell instances + Area of macros: {:.2f}\n"
"\tFloorplan area: {:.2f}\n"
Expand All @@ -317,10 +317,10 @@ void ClusteringEngine::reportDesignData()
block_->dbuAreaToMicrons(design_metrics_->getStdCellArea()),
design_metrics_->getNumMacro(),
block_->dbuAreaToMicrons(design_metrics_->getMacroArea()),
block_->dbuToMicrons(default_halo_.left),
block_->dbuToMicrons(default_halo_.bottom),
block_->dbuToMicrons(default_halo_.right),
block_->dbuToMicrons(default_halo_.top),
block_->dbuToMicrons(base_halo_.left),
block_->dbuToMicrons(base_halo_.bottom),
block_->dbuToMicrons(base_halo_.right),
block_->dbuToMicrons(base_halo_.top),
Comment thread
AcKoucher marked this conversation as resolved.
block_->dbuAreaToMicrons(tree_->macro_with_halo_area),
block_->dbuAreaToMicrons(design_metrics_->getStdCellArea()
+ design_metrics_->getMacroArea()),
Expand Down Expand Up @@ -2086,13 +2086,13 @@ void ClusteringEngine::createHardMacros()
if (inst->getHalo()->isSoft()) {
halo = HardMacro::Halo(inst->getHalo());
} else {
halo = {std::max(inst_halo.xMin(), default_halo_.left),
std::max(inst_halo.yMin(), default_halo_.bottom),
std::max(inst_halo.xMax(), default_halo_.right),
std::max(inst_halo.yMax(), default_halo_.top)};
halo = {std::max(inst_halo.xMin(), base_halo_.left),
std::max(inst_halo.yMin(), base_halo_.bottom),
std::max(inst_halo.xMax(), base_halo_.right),
std::max(inst_halo.yMax(), base_halo_.top)};
}
} else {
halo = default_halo_;
halo = base_halo_;
}

auto macro = std::make_unique<HardMacro>(inst, halo);
Expand Down
4 changes: 2 additions & 2 deletions src/mpl/src/clusterEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ClusteringEngine
void run();

void setTree(PhysicalHierarchy* tree);
void setHalos(const HardMacro::Halo& default_halo,
void setHalos(const HardMacro::Halo& base_halo,
const std::map<odb::dbInst*, HardMacro::Halo>& macro_to_halo);

// Methods to update the tree as the hierarchical
Expand Down Expand Up @@ -252,7 +252,7 @@ class ClusteringEngine

std::unordered_set<odb::dbInst*> ignorable_macros_;

HardMacro::Halo default_halo_;
HardMacro::Halo base_halo_;
std::map<odb::dbInst*, HardMacro::Halo> macro_to_halo_;
};

Expand Down
10 changes: 5 additions & 5 deletions src/mpl/src/hier_rtlmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ void HierRTLMP::setGlobalFence(odb::Rect global_fence)
}
}

void HierRTLMP::setDefaultHalo(int left, int bottom, int right, int top)
void HierRTLMP::setBaseHalo(int left, int bottom, int right, int top)
{
if (!default_halo_.isZero()) {
logger_->warn(MPL, 71, "Overwriting default macro halo.");
if (!base_halo_.isZero()) {
logger_->warn(MPL, 71, "Overwriting base macro halo.");
}

default_halo_ = {left, bottom, right, top};
base_halo_ = {left, bottom, right, top};
}

void HierRTLMP::setGuidanceRegions(
Expand Down Expand Up @@ -274,7 +274,7 @@ void HierRTLMP::runMultilevelAutoclustering()

// Set target structure
clustering_engine_->setTree(tree_.get());
clustering_engine_->setHalos(default_halo_, macro_to_halo_);
clustering_engine_->setHalos(base_halo_, macro_to_halo_);
clustering_engine_->run();

if (!tree_->has_unfixed_macros) {
Expand Down
4 changes: 2 additions & 2 deletions src/mpl/src/hier_rtlmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class HierRTLMP
// Interfaces functions for setting options
// Hierarchical Macro Placement Related Options
void setGlobalFence(odb::Rect global_fence);
void setDefaultHalo(int left, int bottom, int right, int top);
void setBaseHalo(int left, int bottom, int right, int top);
void setGuidanceRegions(
const std::map<odb::dbInst*, odb::Rect>& guidance_regions);
void setMacroHalo(odb::dbInst* macro,
Expand Down Expand Up @@ -294,7 +294,7 @@ class HierRTLMP
std::map<std::string, odb::Rect> fences_; // macro_name, fence
std::map<odb::dbInst*, odb::Rect> guides_; // Macro -> Guidance Region

HardMacro::Halo default_halo_;
HardMacro::Halo base_halo_;
std::map<odb::dbInst*, HardMacro::Halo> macro_to_halo_;

std::vector<odb::Rect> placement_blockages_;
Expand Down
16 changes: 8 additions & 8 deletions src/mpl/src/mpl.i
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ add_guidance_region(odb::dbInst* macro,
}

void
set_default_halo(float left,
float bottom,
float right,
float top)
set_base_halo(float left,
float bottom,
float right,
float top)
{
odb::dbBlock* block = ord::OpenRoad::openRoad()->getDb()->getChip()->getBlock();
getMacroPlacer()->setDefaultHalo(block->micronsToDbu(left),
block->micronsToDbu(bottom),
block->micronsToDbu(right),
block->micronsToDbu(top));
getMacroPlacer()->setBaseHalo(block->micronsToDbu(left),
block->micronsToDbu(bottom),
block->micronsToDbu(right),
block->micronsToDbu(top));
}

void
Expand Down
18 changes: 12 additions & 6 deletions src/mpl/src/mpl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ proc rtl_macro_placer { args } {

if { [info exists keys(-halo_width)] || [info exists keys(-halo_height)] } {
utl::warn MPL 74 "-halo_width/-halo_height are deprecated, use\
the set_macro_default_halo command instead."
the set_macro_base_halo command instead."
Comment thread
AcKoucher marked this conversation as resolved.
set halo_width 0.0
set halo_height 0.0

Expand All @@ -125,7 +125,7 @@ proc rtl_macro_placer { args } {
}
}

mpl::set_default_halo $halo_width $halo_height $halo_width $halo_height
mpl::set_base_halo $halo_width $halo_height $halo_width $halo_height
}

if { [info exists keys(-fence_lx)] } {
Expand Down Expand Up @@ -298,13 +298,19 @@ proc set_macro_guidance_region { args } {
mpl::add_guidance_region $macro $x1 $y1 $x2 $y2
}

sta::define_cmd_args "set_macro_default_halo" { halo }
proc set_macro_default_halo { args } {
sta::parse_key_args "set_macro_default_halo" args \
sta::define_cmd_args "set_macro_base_halo" { halo }
proc set_macro_base_halo { args } {
sta::parse_key_args "set_macro_base_halo" args \
keys {} flags {}

lassign [mpl::parse_halo $args] left bottom right top
mpl::set_default_halo $left $bottom $right $top
mpl::set_base_halo $left $bottom $right $top
}
Comment thread
AcKoucher marked this conversation as resolved.

proc set_macro_default_halo { args } {
utl::warn MPL 75 "set_macro_default_halo is deprecated, use\
set_macro_base_halo instead."
set_macro_base_halo {*}$args
}

sta::define_cmd_args "set_macro_halo" { -macro_name macro_name \
Expand Down
4 changes: 2 additions & 2 deletions src/mpl/src/rtl_mp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ void MacroPlacer::addGuidanceRegion(odb::dbInst* macro, odb::Rect region)
guidance_regions_[macro] = region;
}

void MacroPlacer::setDefaultHalo(int left, int bottom, int right, int top)
void MacroPlacer::setBaseHalo(int left, int bottom, int right, int top)
{
hier_rtlmp_->setDefaultHalo(left, bottom, right, top);
hier_rtlmp_->setBaseHalo(left, bottom, right, top);
}

void MacroPlacer::setMacroHalo(odb::dbInst* macro,
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/boundary_push1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Die Area: (0.00, 0.00) (220.02, 221.20), Floorplan Area: (0.00, 0.00) (220.02,
Area of std cell instances: 0.00
Number of macros: 4
Area of macros: 40000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 40000.00
Area of std cell instances + Area of macros: 40000.00
Floorplan area: 48668.42
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/centralization1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Die Area: (0.00, 0.00) (302.10, 301.00), Floorplan Area: (0.00, 0.00) (302.10,
Area of std cell instances: 0.00
Number of macros: 1
Area of macros: 10000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 10000.00
Area of std cell instances + Area of macros: 10000.00
Floorplan area: 91355.04
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/clocked_macro.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Die Area: (0.00, 0.00) (450.00, 450.00), Floorplan Area: (4.94, 4.20) (444.98,
Area of std cell instances: 0.00
Number of macros: 1
Area of macros: 43000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 43000.00
Area of std cell instances + Area of macros: 43000.00
Floorplan area: 193441.58
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/fixed_covers.ok
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Die Area: (0.00, 0.00) (220.02, 221.20), Floorplan Area: (0.00, 0.00) (220.02,
Area of std cell instances: 678.30
Number of macros: 2
Area of macros: 20000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 10000.00
Area of std cell instances + Area of macros: 20678.30
Floorplan area: 48668.42
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/fixed_ios1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Die Area: (0.00, 0.00) (150.00, 125.00), Floorplan Area: (0.00, 0.00) (149.91,
Area of std cell instances: 678.30
Number of macros: 1
Area of macros: 10000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 10000.00
Area of std cell instances + Area of macros: 10678.30
Floorplan area: 18678.79
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/fixed_macros1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Die Area: (0.00, 0.00) (220.02, 221.20), Floorplan Area: (0.00, 0.00) (220.02,
Area of std cell instances: 678.30
Number of macros: 2
Area of macros: 20000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 10000.00
Area of std cell instances + Area of macros: 20678.30
Floorplan area: 48668.42
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/fixed_macros2.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Die Area: (0.00, 0.00) (220.02, 221.20), Floorplan Area: (0.00, 15.40) (220.02,
Area of std cell instances: 1808.80
Number of macros: 2
Area of macros: 20000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 10000.00
Area of std cell instances + Area of macros: 21808.80
Floorplan area: 45280.12
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/guides1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Die Area: (0.00, 0.00) (150.00, 125.00), Floorplan Area: (0.00, 0.00) (149.91,
Area of std cell instances: 678.30
Number of macros: 1
Area of macros: 10000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 10000.00
Area of std cell instances + Area of macros: 10678.30
Floorplan area: 18678.79
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/guides2.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Die Area: (0.00, 0.00) (450.00, 450.00), Floorplan Area: (4.94, 4.20) (444.98,
Area of std cell instances: 0.00
Number of macros: 10
Area of macros: 166000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 166000.00
Area of std cell instances + Area of macros: 166000.00
Floorplan area: 193441.58
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/halos1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Die Area: (0.00, 0.00) (220.02, 221.20), Floorplan Area: (0.00, 0.00) (220.02,
Area of std cell instances: 678.30
Number of macros: 2
Area of macros: 20000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 22650.00
Area of std cell instances + Area of macros: 20678.30
Floorplan area: 48668.42
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/halos2.ok
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Die Area: (0.00, 0.00) (220.02, 221.20), Floorplan Area: (0.00, 0.00) (220.02,
Area of std cell instances: 678.30
Number of macros: 2
Area of macros: 20000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 22782.00
Area of std cell instances + Area of macros: 20678.30
Floorplan area: 48668.42
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/halos3.ok
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Die Area: (0.00, 0.00) (250.00, 250.00), Floorplan Area: (9.00, 9.80) (249.92,
Area of std cell instances: 0.00
Number of macros: 1
Area of macros: 10000.00
Default halo (L, B, R, T): (12.00, 6.00, 12.00, 6.00)
Base halo (L, B, R, T): (12.00, 6.00, 12.00, 6.00)
Area of macros with halos: 13888.00
Area of std cell instances + Area of macros: 10000.00
Floorplan area: 57676.25
Expand Down
4 changes: 2 additions & 2 deletions src/mpl/test/halos3.tcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Test if default halos are correctly generated using 2 arguments.
# Test if base halos are correctly generated using 2 arguments.
source "helpers.tcl"

read_lef "./Nangate45/Nangate45.lef"
Expand All @@ -7,7 +7,7 @@ read_lef "./testcases/orientation_improve1.lef"
read_def "./testcases/halo3.def"

set_thread_count 0
set_macro_default_halo 12.0 6.0
set_macro_base_halo 12.0 6.0
rtl_macro_placer -report_directory [make_result_dir]

set def_file [make_result_file halos3.def]
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/halos4.ok
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Die Area: (0.00, 0.00) (250.00, 250.00), Floorplan Area: (9.00, 9.80) (249.92,
Area of std cell instances: 0.00
Number of macros: 1
Area of macros: 10000.00
Default halo (L, B, R, T): (16.00, 8.00, 4.00, 2.00)
Base halo (L, B, R, T): (16.00, 8.00, 4.00, 2.00)
Area of macros with halos: 13200.00
Area of std cell instances + Area of macros: 10000.00
Floorplan area: 57676.25
Expand Down
4 changes: 2 additions & 2 deletions src/mpl/test/halos4.tcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Test if default halos are correctly generated using 4 arguments.
# Test if base halos are correctly generated using 4 arguments.
source "helpers.tcl"

read_lef "./Nangate45/Nangate45.lef"
Expand All @@ -7,7 +7,7 @@ read_lef "./testcases/orientation_improve1.lef"
read_def "./testcases/halo3.def"

set_thread_count 0
set_macro_default_halo 16.0 8.0 4.0 2.0
set_macro_base_halo 16.0 8.0 4.0 2.0
rtl_macro_placer -report_directory [make_result_dir]

set def_file [make_result_file halos4.def]
Expand Down
2 changes: 1 addition & 1 deletion src/mpl/test/io_constraints1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Die Area: (0.00, 0.00) (150.00, 125.00), Floorplan Area: (0.00, 0.00) (149.91,
Area of std cell instances: 678.30
Number of macros: 1
Area of macros: 10000.00
Default halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Base halo (L, B, R, T): (0.00, 0.00, 0.00, 0.00)
Area of macros with halos: 10000.00
Area of std cell instances + Area of macros: 10678.30
Floorplan area: 18678.79
Expand Down
Loading
Loading