30. SRAM Hard Macro Integration

🧱 Macro-Aware Floorplanning in OpenLane2 (Classic Flow)


🎯 Purpose

This document explains how an SRAM hard macro is integrated into an
OpenLane2 Classic flow.

The SRAM is treated strictly as an external, fixed hard macro.

The focus is on physical integration, specifically:


⚠️ Key Reality Check (Important)

OpenLane2 does not have a first-class β€œmacro” abstraction.

Instead:

This document reflects what actually works in practice,
not an idealized abstraction.


πŸ“œ SRAM Macro Policy

The following policies are enforced throughout this project:

This mirrors real-world SoC physical design methodology.


πŸ“¦ Required SRAM Files

The following files must be provided externally by the user:

File Purpose
sram.gds Final physical layout
sram.lef Abstract layout for P&R
sram_blackbox.v Verilog blackbox
sram.lib (Optional) timing model

⚠️ These files are not included in this repository.


πŸ“ Macro Directory Convention

Recommended (but not mandatory) directory structure:

macro/
└─ sram/
   β”œβ”€ README.md
   β”œβ”€ sram.lef        (external or symlink)
   β”œβ”€ sram.gds        (external or symlink)
   β”œβ”€ sram.lib        (optional)
   └─ sram_blackbox.v

Only the integration methodology is documented here.


🧩 RTL Integration (Blackbox)

β–Ά SRAM Blackbox Definition

design/src/sram_blackbox.v

module sram (
    input  wire        clk,
    input  wire        csb,
    input  wire        web,
    input  wire [7:0]  addr,
    input  wire [31:0] din,
    output wire [31:0] dout
);
endmodule

β–Ά Top-Level Instantiation

design/src/top.v

module top (
    input  wire        clk,
    input  wire        rst_n,
    input  wire        csb,
    input  wire        web,
    input  wire [7:0]  addr,
    input  wire [31:0] din,
    output wire [31:0] dout
);

sram u_sram (
    .clk  (clk),
    .csb  (csb),
    .web  (web),
    .addr (addr),
    .din  (din),
    .dout (dout)
);

endmodule

No SRAM logic is inferred or synthesized.


βš™οΈ OpenLane2 Configuration (JSON-Based)

OpenLane2 Classic flow is driven by JSON configuration files.

Key Integration Points

Conceptual example:

{
  "verilog_files": [
    "design/src/top.v",
    "design/src/sram_blackbox.v"
  ],
  "lef_files": [
    "macro/sram/sram.lef"
  ],
  "gds_files": [
    "macro/sram/sram.gds"
  ]
}

⚠️ Exact filenames and paths depend on the design directory structure.


πŸ“ Fixed Macro Placement (OpenROAD)

Macro placement is enforced using OpenROAD TCL commands,
not JSON configuration keys.

Typical operations:

Conceptual example:

place_macro u_sram 100 100 N
set_macro_fixed u_sram
set_macro_halo u_sram 10 10 10 10

These commands are executed before standard-cell placement.


🧭 Floorplanning Strategy

Key principles:

⚠️ Poor macro placement cannot be corrected later in the flow.


πŸ”Œ PDN Considerations

Typical mitigations:


πŸ§ͺ DRC / LVS Policy

This is an explicit and intentional trade-off.


βœ… Expected Outcomes (M2)

At the end of this step:

⚠️ A final GDS is not required at this stage.


❌ Common Failure Modes

Issue Cause Mitigation
Macro overlaps cells Missing halo Increase halo
Congestion Poor placement Move macro / resize die
PDN errors Pin mismatch Inspect LEF
CTS issues Clock routed near macro Reroute clock

🧭 Role of This Step

This step proves that:

Only after this is validated should final routing and sign-off-style runs be attempted.


➑ Next Step

Proceed to:

➑ docs/40_results.md
Final GDS generation, warnings, and lessons learned


Last updated: SRAM macro integration validated in OpenLane2 Classic flow βœ