SuperAPI AI Directory

lib-db-gen

Coding & development

View repository

Updated 10-16 09:29

About this skill

Lib DB Gen

Use this skill when a flow needs a Synopsys .db and only has either a Liberty .lib or an RTL top module whose ports should become a black-box stub cell.

Commands

The bundled script is scripts/lib_db_gen.py.

Convert an existing Liberty file to DB:

python3 .agents/skills/lib-db-gen/scripts/lib_db_gen.py convert \
  --lib path/to/input.lib \
  --db path/to/output.db

Generate an early black-box Liberty from a Verilog top and compile it to DB:

python3 .agents/skills/lib-db-gen/scripts/lib_db_gen.py stub \
  --top-v path/to/top.v \
  --top top_module_name \
  --lib path/to/top_stub.lib \
  --db path/to/top_stub.db

Use --no-run to only emit the .lib and the Library Compiler Tcl script. Use --lc-shell /path/to/lc_shell when lc_shell is not on PATH. Use --work-dir <dir> to control where Library Compiler writes lc_command.log and lc_output.txt; by default this is <db-output-dir>/lc_work, not the repository root.

Workflow

  1. Prefer a real foundry or platform Liberty for timing signoff and mapped synthesis.
  2. Use convert for real Liberty to .db conversion.
  3. Use stub only for early integration, link, or black-box bring-up. The generated cell has ports and zero-area placeholder attributes; it is not timing or power evidence.
  4. Keep generated .db, .lib, and LC logs out of Git unless they are reviewed release collateral.
  5. For Design Compiler setup, point local ignored config such as scripts/local.mk at the generated .db, for example SKY130HD_DC_DB := /path/to/lib.db.

Notes

  • stub parses ANSI-style module headers and simple non-ANSI declarations.
  • Numeric packed ranges like [7:0] become Liberty bus types. Parameterized widths are treated as scalar with a warning; use a resolved wrapper if bus width fidelity matters.
  • The generated stub DB is for black-box linking, not cell mapping. It does not replace a standard-cell target library.