Placing a Macro by Hand
The previous articles analyzed macro halos, orientation transforms, and routing channel spacing. This article creates an OpenLane macro placement configuration file.
Advantages of Explicit Macro Placement
OpenLane can place hard macros automatically using standard placement algorithms. However, automated algorithms optimize primarily for wire length or total area. They do not consider pin alignment between specific communicating macro blocks. Explicit macro placement gives designers control over orientation and routing channel dimensions. Fixing macro positions manually prevents sub-optimal channel routing.
Macro Placement Configuration File Format
The OpenLane parameter MACRO_PLACEMENT_CFG points to a plain text configuration file.
The file defines instance positions with one line per macro:
<instance_name> <x> <y> <orientation>
The coordinates x and y define the lower-left corner of the macro in microns.
The orientation field uses one of the eight standard LEF/DEF orientation codes.
Consider regfile_8x8 ($60\ \mu\text{m} \times 40\ \mu\text{m}$, $5\ \mu\text{m}$ halo).
Place the macro at coordinates $(20.0, 30.0)$ with orientation N:
# macro_placement.cfg
# regfile_8x8: 60 x 40 um footprint, 5 um halo (effective 70 x 50 um keep-out)
# Placed at (20, 30) in N: east-side output pins face right, toward alu_macro.
regfile_8x8 20.0 30.0 N
Configure config.json to reference the placement file and define halo dimensions:
{
"DESIGN_NAME": "counter8",
"MACRO_PLACEMENT_CFG": "dir::macro_placement.cfg",
"FP_MACRO_HORIZONTAL_HALO": 5,
"FP_MACRO_VERTICAL_HALO": 5
}
The counter8 tutorial design contains only standard cells.
These macro examples demonstrate configuration syntax for complex designs with SRAM blocks, as shown in Module 10.
Floorplan Execution with Macros
When MACRO_PLACEMENT_CFG is specified, OpenLane places macros before running standard cell placement:
% run_floorplan
[INFO]: Generating floorplan...
[INFO]: Placing macros from MACRO_PLACEMENT_CFG...
[INFO]: regfile_8x8 placed at (20.00, 30.00), orientation N
[INFO]: Registering macro halo blockage: (15.00, 25.00) to (85.00, 75.00)
[INFO]: Generating power distribution network...
[INFO]: Placing I/O pins...
The tool registers a placement blockage from $(15.00, 25.00)$ to $(85.00, 75.00)$. This $70\ \mu\text{m} \times 50\ \mu\text{m}$ boundary encloses the $60\ \mu\text{m} \times 40\ \mu\text{m}$ macro plus the $5\ \mu\text{m}$ halo on all sides. Standard cell placers will not insert cells within this exclusion zone.
Practice Exercise
Write a MACRO_PLACEMENT_CFG entry for macro sram_block ($90\ \mu\text{m} \times 50\ \mu\text{m}$).
Place its lower-left corner at $(10.0, 10.0)$ with vertical flip FS so north pins face south.
Solution
sram_block 10.0 10.0 FS
The line specifies instance name, lower-left coordinates, and orientation.
Orientation FS flips the block across the x-axis, directing north-facing pins toward the south.
Section 3.5 integrates utilization, power grids, pin placements, and tap cells into a complete floorplan run.