From e28328e19fb917d7ea230755782d325a6871c209 Mon Sep 17 00:00:00 2001 From: Daniel Lovell Date: Thu, 17 Oct 2024 02:17:11 -0700 Subject: [PATCH] Distinct `run_genus` synthesis step, ICV LVS blackbox support, and Virtuoso netlist export support (#879) * /synthesis/genus make run_genus a distinct step This is useful/necessary for hooks which inject behaviors AFTER the syn.tcl file has been generated. * lvs/icv add lvs.icv.equiv_files for blackboxes Equivalence files are used by ICV LVS to define LVS boxes/blackboxes. This is an extremeley useful feature for debugging LVS/running LVS quickly. * utils/ get_filetype add ".net" as supported ext. Cadence Virtuoso will produce netlists with the .src.net extension when streaming out schematics as netlists (i.e. when running Calibre nmLVS in Virtuoso) --- hammer/lvs/icv/__init__.py | 5 +++++ hammer/synthesis/genus/__init__.py | 14 +++++++------- hammer/utils/__init__.py | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/hammer/lvs/icv/__init__.py b/hammer/lvs/icv/__init__.py index bab2dc594..0cb443ba6 100644 --- a/hammer/lvs/icv/__init__.py +++ b/hammer/lvs/icv/__init__.py @@ -185,6 +185,11 @@ def generate_lvs_args_file(self) -> bool: config_rs = self.get_setting("lvs.icv.config_runset") # type: Optional[str] if config_rs is not None: f.write(" -runset_config " + config_rs) + + # Equivalence files + equiv_files = self.get_setting("lvs.icv.equiv_files") # type: Optional[str] + if equiv_files is not None: + f.write(" -e " + equiv_files) return True @property diff --git a/hammer/synthesis/genus/__init__.py b/hammer/synthesis/genus/__init__.py index efb077436..f87c5eb37 100644 --- a/hammer/synthesis/genus/__init__.py +++ b/hammer/synthesis/genus/__init__.py @@ -91,7 +91,8 @@ def steps(self) -> List[HammerToolStep]: self.add_tieoffs, self.write_regs, self.generate_reports, - self.write_outputs + self.write_outputs, + self.run_genus ] if self.get_setting("synthesis.inputs.retime_modules"): steps_methods.insert(1, self.retime_modules) @@ -112,8 +113,7 @@ def do_between_steps(self, prev: HammerToolStep, next: HammerToolStep) -> bool: def do_post_steps(self) -> bool: assert super().do_post_steps() - return self.run_genus() - + return True @property def mapped_v_path(self) -> str: return os.path.join(self.run_dir, "{}.mapped.v".format(self.top_module)) @@ -477,7 +477,7 @@ def write_outputs(self) -> bool: self.ran_write_outputs = True return True - + def run_genus(self) -> bool: verbose_append = self.verbose_append @@ -486,13 +486,13 @@ def run_genus(self) -> bool: verbose_append("quit") # Create synthesis script. - syn_tcl_filename = os.path.join(self.run_dir, "syn.tcl") - self.write_contents_to_path("\n".join(self.output), syn_tcl_filename) + self.syn_tcl_filename = os.path.join(self.run_dir, "syn.tcl") + self.write_contents_to_path("\n".join(self.output), self.syn_tcl_filename) # Build args. args = [ self.get_setting("synthesis.genus.genus_bin"), - "-f", syn_tcl_filename, + "-f", self.syn_tcl_filename, "-no_gui" ] diff --git a/hammer/utils/__init__.py b/hammer/utils/__init__.py index aea332e88..8397ea21d 100644 --- a/hammer/utils/__init__.py +++ b/hammer/utils/__init__.py @@ -391,7 +391,7 @@ def get_filetype(filename: str) -> HammerFiletype: if len(split) == 1: return HammerFiletype.NONE extension = split[-1] - if extension in ["sp", "spi", "nl", "cir", "spice", "cdl"]: + if extension in ["sp", "spi", "nl", "cir", "spice", "cdl", "net"]: return HammerFiletype.SPICE elif extension in ["v", "sv", "vh"]: return HammerFiletype.VERILOG