efabless / openlane2

The next generation of OpenLane, rewritten from scratch with a modular architecture
https://openlane2.readthedocs.io/
Apache License 2.0
207 stars 38 forks source link

Add an OpenROAD.WriteAbstractLEF step #555

Closed smunaut closed 1 month ago

smunaut commented 1 month ago

Description

Currently when building a macro with OL2, the only option to get a LEF out (which is required for integration of the macro later on) is to use Magic.

For iHP there is no Magic support yet, but OpenROAD can actually generate a LEF.

Currently in write_views if you have SAVE_OPENROAD_LEF it will save an LEF from OpenROAD however there are two issues with that :

Proposal

So I think the best option is to have a separate step that one can use to achieve that in a custom flow :

@Step.factory.register()
class WriteAbstractLEF(OpenROADStep):

    id = "OpenROAD.WriteAbstractLEF"
    name = "Write Abstract LEF"

    outputs = [
        DesignFormat.LEF
    ]

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

And then write_abstract_lef.tcl something like :

source $::env(SCRIPTS_DIR)/openroad/common/io.tcl
read_current_odb
write_abstract_lef -bloat_occupied_layers $::env(STEP_DIR)/$::env(DESIGN_NAME).lef
donn commented 1 month ago

Should be fairly easy to get through.

donn commented 1 month ago

So there's OpenROAD.WriteViews that does have DesignFormat.OPENROAD_LEF as a "true" output. All it's missing is -bloat_occupied_layers. Would that work for you?

smunaut commented 1 month ago

The -bloat_occupied_layers is required for sure else during integration the top-level tries to route stuff over the macro which is always a mess, but if that can be added as an option, then I guess I could use WriteViews

donn commented 1 month ago

Added to in 2.2.0 -- please wait for release