Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenROAD.WriteViews to generate LEF using OpenROAD and powered netlists excluding some cells #267

Merged
merged 6 commits into from
Nov 22, 2023
Merged
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
18 changes: 18 additions & 0 deletions openlane/common/design_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ class DesignFormat(Enum):
"pnl.v",
"Powered Verilog Netlist",
)
POWERED_NETLIST_SDF_FRIENDLY: DesignFormatObject = DesignFormatObject(
"pnl-sdf-friendly",
"pnl-sdf.v",
"Powered Verilog Netlist For SDF Simulation (Without Fill Cells)",
folder_override="pnl",
)
POWERED_NETLIST_NO_PHYSICAL_CELLS: DesignFormatObject = DesignFormatObject(
"pnl-npc",
"pnl-npc.v",
"Powered Verilog Netlist Without Physical Cells (Fill Cells and Diode Cells)",
folder_override="pnl",
)

DEF: DesignFormatObject = DesignFormatObject(
"def",
Expand All @@ -55,6 +67,12 @@ class DesignFormat(Enum):
"lef",
"Library Exchange Format",
)
OPENROAD_LEF: DesignFormatObject = DesignFormatObject(
"openroad-lef",
"openroad.lef",
"Library Exchange Format Generated by OpenROAD",
folder_override="lef",
)
ODB: DesignFormatObject = DesignFormatObject(
"odb",
"odb",
Expand Down
23 changes: 23 additions & 0 deletions openlane/scripts/openroad/common/io.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,29 @@ proc write_views {args} {
write_verilog -include_pwr_gnd $::env(SAVE_POWERED_NETLIST)
}

if { [info exists ::env(SAVE_POWERED_NETLIST_SDF_FRIENDLY)] } {
set exclude_cells "[join $::env(FILL_CELL)] [join $::env(DECAP_CELL)] [join $::env(FP_WELLTAP_CELL)] [join $::env(FP_ENDCAP_CELL)]"
puts "Writing nofill powered netlist to '$::env(SAVE_POWERED_NETLIST_SDF_FRIENDLY)'…"
puts "Excluding $exclude_cells"
write_verilog -include_pwr_gnd \
-remove_cells "$exclude_cells"\
$::env(SAVE_POWERED_NETLIST_SDF_FRIENDLY)
}

if { [info exists ::env(SAVE_POWERED_NETLIST_NO_PHYSICAL_CELLS)] } {
set exclude_cells "[join [lindex [split $::env(DIODE_CELL) "/"] 0]] [join $::env(FILL_CELL)] [join $::env(DECAP_CELL)] [join $::env(FP_WELLTAP_CELL)] [join $::env(FP_ENDCAP_CELL)]"
puts "Writing nofilldiode powered netlist to '$::env(SAVE_POWERED_NETLIST_NO_PHYSICAL_CELLS)'…"
puts "Excluding $exclude_cells"
write_verilog -include_pwr_gnd \
-remove_cells "$exclude_cells"\
$::env(SAVE_POWERED_NETLIST_NO_PHYSICAL_CELLS)
}

if { [info exists ::env(SAVE_OPENROAD_LEF)] } {
puts "Writing LEF to '$::env(SAVE_OPENROAD_LEF)'…"
write_abstract_lef $::env(SAVE_OPENROAD_LEF)
}

if { [info exists ::env(SAVE_DEF)] } {
puts "Writing layout to '$::env(SAVE_DEF)'…"
write_def $::env(SAVE_DEF)
Expand Down
18 changes: 18 additions & 0 deletions openlane/steps/openroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,24 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]:
return views_updates, metrics_updates


@Step.factory.register()
class WriteViews(OpenROADStep):
"""
Write various layout views of an ODB design
"""

id = "OpenROAD.WriteViews"
name = "OpenROAD Write Views"
outputs = OpenROADStep.outputs + [
DesignFormat.POWERED_NETLIST_SDF_FRIENDLY,
DesignFormat.POWERED_NETLIST_NO_PHYSICAL_CELLS,
DesignFormat.OPENROAD_LEF,
]

def get_script_path(self):
return os.path.join(get_script_dir(), "openroad", "write_views.tcl")


# Resizer Steps


Expand Down
Loading