Skip to content

feat(aig): make the vendored-PDK root configurable via JACQUARD_VENDOR_DIR#94

Open
robtaylor wants to merge 1 commit into
mainfrom
pdk-vendor-root-env
Open

feat(aig): make the vendored-PDK root configurable via JACQUARD_VENDOR_DIR#94
robtaylor wants to merge 1 commit into
mainfrom
pdk-vendor-root-env

Conversation

@robtaylor

Copy link
Copy Markdown
Contributor

Problem

The gf180mcu / sky130 cell-library decomposition in AIG::from_netlistdb_* (src/aig.rs) hardcodes the PDK functional-model path to vendor/..., resolved relative to the process CWD:

let pdk_path = std::path::PathBuf::from("vendor/sky130_fd_sc_hd/cells");
...
let pdk_path = std::path::PathBuf::from("vendor/gf180mcu_fd_sc_mcu7t5v0");

This works when you run jacquard from the repo root (where the vendor/ submodule lives). But a consumer that embeds jacquard as a submodule and invokes sim/cosim from the parent repo's working directory has no way to point at the vendored PDKs — the only workaround today is to symlink vendor/ into the parent CWD.

Fix

Resolve the vendor root through a small helper that honours a new JACQUARD_VENDOR_DIR environment variable and defaults to vendor:

fn pdk_vendor_root() -> PathBuf {
    env::var_os("JACQUARD_VENDOR_DIR").map(PathBuf::from)
        .unwrap_or_else(|| PathBuf::from("vendor"))
}
  • Backward-compatible — unset behaviour is byte-identical to before (vendor/...).
  • Follows the existing JACQUARD_* runtime-knob convention (JACQUARD_SRAM_DUMP, etc.).
  • Downstream callers set JACQUARD_VENDOR_DIR=path/to/jacquard/vendor instead of symlinking.
  • The gf180 "PDK models required" panic hint now mentions the env var.

Tests

The env-independent resolution logic is split into a pure pdk_vendor_root_from(Option<OsString>) and unit-tested (default + override). cargo test --lib pdk_vendor_root is green.

A CLI flag could later layer on top of the same helper if preferred; this PR keeps the change minimal and matches the established env-var pattern.

The gf180mcu/sky130 cell-library decomposition in `from_netlistdb_*`
hardcoded the PDK functional-model path to `vendor/...` relative to the
process CWD. A consumer that runs jacquard from a different working
directory (e.g. embedding it as a submodule and invoking from the parent
repo root) had no way to point at the vendored PDKs except to symlink
`vendor/` into its CWD.

Resolve the vendor root via a small helper that honours a new
`JACQUARD_VENDOR_DIR` env var and defaults to `vendor` — so existing
in-repo behaviour is unchanged, and downstream callers can set the env
var instead of symlinking. Matches the existing `JACQUARD_*` runtime-knob
convention. Updates the gf180 "PDK models required" panic hint to mention
the env var, and unit-tests the (env-independent) resolution logic.

Co-developed-by: Claude Code v2.1.159 (claude-opus-4-8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant