Skip to content

Commit

Permalink
Distinct run_genus synthesis step, ICV LVS blackbox support, and Vi…
Browse files Browse the repository at this point in the history
…rtuoso 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)
  • Loading branch information
daniellovell authored Oct 17, 2024
1 parent faa61a1 commit e28328e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions hammer/lvs/icv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions hammer/synthesis/genus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand Down Expand Up @@ -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

Expand All @@ -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"
]

Expand Down
2 changes: 1 addition & 1 deletion hammer/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e28328e

Please sign in to comment.