Skip to content
cornell-zhangPublic

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Cedar

Cedar optimizes the area, delay and power of RTL designs by combining an AI coding agent with formally checked compiler machinery:

  1. the agent proposes direct RTL rewrites and generalizes the verified ones into egglog rewrite rules;
  2. every rule is proved with Z3 at each exact bit width it is applied to before it may enter an e-graph;
  3. equality saturation (CIRCT + DialEgg + egglog) explores equivalent implementations and a weighted per-e-node PPA cost model drives extraction (extraction-gym);
  4. every candidate is checked for equivalence against the original RTL (Cadence Conformal, a self-checking simulation, or open-source circt-lec) and measured with your EDA flow (Synopsys DC, Cadence Innovus, Synopsys VCS + PrimeTime with SAIF activity), and a verified Pareto frontier is reported.

The agent can be Claude Code or Codex: both load the same skills from this repository, and the same Python package does all deterministic work (compilation, proofs, verification, measurement, run state).

Cedar does not include or redistribute commercial EDA tools or technology libraries. You configure your own through private profiles.

Repository layout

Path Contents
src/cedar/ cedar-workflow Python package and cedar CLI
skills/ shared agent skills: cedar, cedar-setup, cedar-doctor
.claude-plugin/, .codex-plugin/, .agents/plugins/ Claude Code and Codex plugin/marketplace manifests
third_party/dialegg, third_party/extraction-gym Cedar versions of DialEgg and extraction-gym (provenance in each UPSTREAM.md)
toolchain/ pinned sources (sources.lock.json), native/container build, cedar-toolchain wheel, source bundle, templates
examples/ small redistributable designs
tests/ regression tests
docs/ setup, architecture, workflow, build and troubleshooting guides

Install

Requirements: Linux x86-64 (glibc >= 2.28), Python >= 3.9.

python -m venv ~/venvs/cedar && . ~/venvs/cedar/bin/activate
pip install cedar_toolchain-0.1.0-py3-none-manylinux_2_28_x86_64.whl   # prebuilt compiler toolchain
pip install cedar_workflow-0.1.0-py3-none-any.whl                     # or: pip install -e <this checkout>
cedar doctor

The wheels are built from this repository (docs/building.md): the toolchain wheel by toolchain/wheel/build_wheel.sh, the workflow wheel by python -m build. They are not published on PyPI for v0.1. You can also build the toolchain natively (toolchain/build/build-native.sh) and select it with CEDAR_TOOLCHAIN_PREFIX=<prefix>; Cedar never falls back to tools found on PATH.

Try it without commercial tools

cedar example open --output-dir /tmp/cedar-open

This runs RTL -> MLIR -> e-graph (with Z3-certified seed rules) -> area- and delay-weighted extraction -> Verilog, and proves each result equivalent to the input with circt-lec + Z3.

Use with an agent

Claude Code (from a checkout, for development):

claude --plugin-dir /path/to/Cedar
# or install through the bundled marketplace:
claude plugin marketplace add /path/to/Cedar && claude plugin install cedar@cedar

Codex:

codex plugin marketplace add /path/to/Cedar && codex plugin add cedar@cedar

Then ask the agent to "set up Cedar" (cedar-setup skill: guided tool and technology profiles, design spec with an explicit timing goal) and to "optimize with Cedar" (cedar skill). The agent runs cedar run start ..., performs the tasks the run hands it (RTL rewrites, rule proposals, ...), submits them with cedar task submit, and reports the verified frontier from report.json.

Full PPA optimization

  1. Create private profiles (outside any repository) with the cedar-setup skill or by hand (docs/configuration.md):
    • a tool profile — executables and environment setup for DC, Innovus, VCS, vcd2saif, PrimeTime and Conformal;
    • a technology profile — corners (.db, .lib, Verilog cell models, RC file), LEF, P&R parameters and optional Tcl hooks.
  2. Validate: cedar doctor --profile <p> --technology <t> and once cedar flow-check --design <design.yaml> --output-dir <scratch>.
  3. Create a design spec with an explicit timing goal: cedar design init --top ... --rtl ... --period-ns 1.0 --verification conformal ....
  4. Optimize: cedar run start --design design.yaml --work-dir <scratch> (--preset quick for a bounded smoke run, --preset paper for the paper's

    =10-iteration exploration).

Measured quantities and stages are explicit in every report: area and delay from DC post-synthesis reports, power from PrimeTime on the post-route netlist with SPEF parasitics and SAIF activity from SDF-annotated gate-level simulation. Missing measurements are reported as unavailable, never as zero. Cedar does not search for a clock frequency: the timing goal is always yours.

Documentation

Citation

If you use Cedar in your research, please cite our ICCAD 2026 paper:

@inproceedings{zhang2026cedar,
  author    = {Zhang, Niansong and Deng, Chenhui and Kuehn, Johannes Maximilian and Ho, Chia-Tung and Yu, Cunxi and Zhang, Zhiru and Khailany, Brucek},
  title     = {{Cedar}: Learning to Optimize {RTL} via Accumulating Verified Rewrite Rules},
  booktitle = {Proceedings of the IEEE/ACM International Conference on Computer-Aided Design},
  series    = {ICCAD '26},
  year      = {2026},
  doi       = {10.1145/3831252.3834087},
  url       = {https://doi.org/10.1145/3831252.3834087}
}

The entry is also available in citation.bib. GitHub's citation metadata is provided in CITATION.cff.

License

Apache License 2.0 (see LICENSE). Third-party components and their licenses are listed in THIRD_PARTY_NOTICES.md.

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages