diff --git a/hammer/technology/sky130/__init__.py b/hammer/technology/sky130/__init__.py index 11dec55cb..6e871ed32 100644 --- a/hammer/technology/sky130/__init__.py +++ b/hammer/technology/sky130/__init__.py @@ -221,20 +221,13 @@ def gen_config(self) -> None: ] drc_decks = [ DRCDeck( - tool_name="calibre", - deck_name="calibre_drc", - path="$SKY130_NDA/s8/V2.0.1/DRC/Calibre/s8_drcRules", - ), - DRCDeck( - tool_name="klayout", - deck_name="klayout_drc", - path="$SKY130A/libs.tech/klayout/drc/sky130A.lydrc", - ), - DRCDeck( - tool_name="pegasus", - deck_name="pegasus_drc", - path="$SKY130_CDS/Sky130_DRC/sky130_rev_0.0_2.2.drc.pvl", - ), + tool_name=self.get_setting("vlsi.core.drc_tool").replace( + "hammer.drc.", "" + ), + deck_name=f"{self.get_setting('vlsi.core.drc_tool').replace('hammer.drc.', '')}_drc", + path=path, + ) + for path in self.get_setting("technology.sky130.drc_deck_sources") ] elif slib == "sky130_scl": @@ -300,17 +293,13 @@ def gen_config(self) -> None: ] drc_decks = [ DRCDeck( - tool_name="calibre", - deck_name="calibre_drc", - path="$SKY130_NDA/s8/V2.0.1/DRC/Calibre/s8_drcRules", - ), - DRCDeck( - tool_name="pegasus", - deck_name="pegasus_drc", - path=os.path.join( - SKY130_CDS, "Sky130_DRC", "sky130_rev_0.0_2.2.drc.pvl" + tool_name=self.get_setting("vlsi.core.drc_tool").replace( + "hammer.drc.", "" ), - ), + deck_name=f"{self.get_setting('vlsi.core.drc_tool').replace('hammer.drc.', '')}_drc", + path=path, + ) + for path in self.get_setting("technology.sky130.drc_deck_sources") ] else: @@ -850,6 +839,11 @@ def get_tech_drc_hooks(self, tool_name: str) -> List[HammerToolHookAction]: "generate_drc_ctl_file", pegasus_drc_blackbox_io_cells ) ) + pegasus_hooks.append( + HammerTool.make_post_insertion_hook( + "generate_drc_ctl_file", false_rules_off + ) + ) hooks = {"calibre": calibre_hooks, "pegasus": pegasus_hooks} return hooks.get(tool_name, []) @@ -1149,6 +1143,27 @@ def pegasus_drc_blackbox_io_cells(ht: HammerTool) -> bool: f.write(drc_box) return True +def false_rules_off(x: HammerTool) -> bool: + # in sky130_rev_0.0_2.3 rules, cadence included a .cfg to turn off false rules - this typically has to be loaded via the GUI but this step hacks the flags into pegasusdrcctl and turns the false rules off + # if FALSEOFF is defined, the rules are turned off + # docs for hooks: /scratch/ee198-20-aaf/barduino-ofot/vlsi/hammer/hammer/drc/pegasus/README.md + drc_box = """ +//=== Configurator controls === +// Turn OFF rules that may be inaccurate due to out-of-date DRM information +// (these rules are on by default and may produce false violations) +#DEFINE FALSEOFF +// Recommended Rules (RC,RR) & Guidelines (NC) +#UNDEFINE RC +#UNDEFINE NC +// Optional Switches +#UNDEFINE frontend +#UNDEFINE backend +//=== End of configurator controls === + """ + run_file = x.drc_ctl_file # type: ignore + with open(run_file, "a") as f: + f.write(drc_box) + return True def pegasus_drc_blackbox_srams(ht: HammerTool) -> bool: assert isinstance(ht, HammerDRCTool), "Exlude SRAMs only in DRC" diff --git a/hammer/technology/sky130/defaults.yml b/hammer/technology/sky130/defaults.yml index 25931fc38..881b9e0c9 100644 --- a/hammer/technology/sky130/defaults.yml +++ b/hammer/technology/sky130/defaults.yml @@ -28,6 +28,8 @@ technology.sky130: pdk_home: "${technology.sky130.sky130_nda}/s8/V2.0.1" # Shouldn't need to change these pdk_home_meta: lazysubst + drc_deck_sources: # DRC decks, one element for each deck + - "${technology.sky130.sky130_cds}/Sky130_DRC/sky130_rev_0.0_2.6.drc.pvl" lvs_deck_sources: - "${technology.sky130.pdk_home}/LVS/Calibre/lvsControlFile_s8" lvs_deck_sources_meta: lazysubst diff --git a/hammer/technology/sky130/defaults_types.yml b/hammer/technology/sky130/defaults_types.yml index a0196e2a9..b8d621851 100644 --- a/hammer/technology/sky130/defaults_types.yml +++ b/hammer/technology/sky130/defaults_types.yml @@ -27,6 +27,7 @@ technology.sky130: # Shouldn't need to change these pdk_home: Optional[str] + drc_deck_sources: Optional[list[str]] lvs_deck_sources: Optional[list[str]] # Path to IO file