Skip to content

Yap support - #4672

Open
openroad-ci wants to merge 13 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:yap-support
Open

openroad-ci wants to merge 13 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:yap-support

Conversation

@openroad-ci

Copy link
Copy Markdown
Member

Summary

  • New 3D hybrid bonding yield flow, selected per design with FLOW_TYPE=3d in config.mk. flow/Makefile includes scripts/3d.mk instead of the RTL-to-GDS setup, so 2D designs are untouched.
  • Add tools/YAP submodule (yap-stack branch). ./build_openroad.sh --3d installs its Python requirements into tools/install/yap-venv.
  • Flow steps (make runs 1-5):
    1. check_3dblox: read the .3dbx into OpenROAD, check it and write an odb
    2. prepare: stage design files and the YAP config into objects/
    3. generate_criticality: default criticality for any .bmap missing one
    4. yap_simulate: YAP W2W or D2W Monte Carlo bonding simulation
    5. generate_risk_map: YAP per-pad fail maps -> per-mechanism risk CSVs (failure %)
    6. view_heatmaps: open the web viewer with the risk maps as chiplet heatmaps (web_load_chiplet_heatmap)
  • Add designs/3d/design_2: four Compute_Large chiplets on an organic substrate, D2W. Taken from https://doi.org/10.5061/dryad.76hdr7tb6
  • Add docs/user/ThreeDFlow.md

Type of Change

  • New feature

Impact

  • None for existing designs. Everything 3D is behind FLOW_TYPE=3d.
  • YAP Python deps are only installed with --3d.

Verification

  • I have verified that the local build succeeds.
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

Osama and others added 12 commits September 17, 2026 18:55
Signed-off-by: Osama <osama@precisioninno.com>
Signed-off-by: Osama <osama@precisioninno.com>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
@openroad-ci
openroad-ci requested a review from a team as a code owner October 13, 2026 12:18
@openroad-ci
openroad-ci requested review from sombraSoft and removed request for a team October 13, 2026 12:18

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new 3D Hybrid Bonding Yield Flow (FLOW_TYPE=3d) that integrates the YAP (Yield Analysis Platform) tool as a submodule. It adds documentation, scripts, makefiles, and a sample design (design_2) to support wafer-to-wafer (W2W) and die-to-wafer (D2W) hybrid bonding yield simulations. The review feedback highlights several opportunities to improve robustness: ensuring absolute paths are used for YAP requirements in the build script, handling empty glob matches in the Makefile, defensively converting configuration parameters to float in generate_risk_map.py, and using os.path.dirname for robust path extraction in visualize_design.py.

Comment thread build_openroad.sh Outdated
local venv="${DIR}/tools/install/yap-venv"
echo "[INFO FLW-0032] Installing YAP Python requirements for the 3D flow into ${venv}."
${PYTHON_EXE:-python3} -m venv "${venv}"
"${venv}/bin/python" -m pip install -r tools/YAP/requirements.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using a relative path for tools/YAP/requirements.txt can fail if the script is executed from a directory other than the repository root. Since venv is defined using ${DIR}, the requirements file path should also use ${DIR} to ensure robustness.

Suggested change
"${venv}/bin/python" -m pip install -r tools/YAP/requirements.txt
"${venv}/bin/python" -m pip install -r "${DIR}/tools/YAP/requirements.txt"

Comment thread flow/scripts/3d.mk
crit="$${bmap%.bmap}$(CRITICALITY_SUFFIX)"; \
if [ -f "$$crit" ]; then \
echo "Exists: $$crit"; \
else \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If no files match the glob pattern *_From_*.bmap, the shell loop will execute once with the literal pattern string containing *, causing subsequent commands like [ -f "$crit" ] and generate_criticality.py to fail. Adding a check to ensure the file exists before proceeding avoids this failure.

		bash -c 'set -e; for bmap in $(abspath $(OBJECTS_DIR))/*_From_*.bmap; do if [ ! -f "$$bmap" ]; then continue; fi; \'

continue

itf_cfg = OmegaConf.load(itf_cfg_path)
pad_r = float(itf_cfg.PAD_TOP_R_um)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If PAD_TOP_R_um is None or missing in the configuration (which is the default in design_2.yaml), calling float() directly will raise a TypeError. Enforce defensive programming by checking for None or string "None" before converting to float.

Suggested change
pad_r = float(itf_cfg.PAD_TOP_R_um)
pad_r_val = itf_cfg.get("PAD_TOP_R_um")
pad_r = float(pad_r_val) if pad_r_val not in (None, "None") else 0.0

Comment thread flow/scripts/3d/visualize_design.py Outdated
cfg_skeleton = OmegaConf.load(args.config)[args.mode]

cfg_dict = get_config_dict(
cfg_folder=args.config.rsplit('/', 1)[0],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using rsplit('/', 1)[0] to extract the directory path will fail or return the filename itself if args.config is a relative path with no slashes (e.g., just design_2.yaml). Use os.path.dirname(args.config) instead, which is robust and cross-platform.

Suggested change
cfg_folder=args.config.rsplit('/', 1)[0],
cfg_folder=os.path.dirname(args.config),

Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
@openroad-ci

Copy link
Copy Markdown
Member Author

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit aa2e48a · Jenkins build #3 · Baseline: build · View build on dashboard

62 design(s) checked — 11 with regression(s), 0 without a comparable baseline.

❌ asap7/riscv32i base — 1 failing metric(s)
Metric target base delta limit band
finish__timing__setup__tns -9426.61 -960.116 -881.819905094801% -1152.1392 PeriodPadding 20%
❌ asap7/swerv_wrapper base — 1 failing metric(s)
Metric target base delta limit band
finish__timing__setup__tns -2792.12 -1551.92 -79.91391308830352% -1862.304 PeriodPadding 20%
❌ gf180/jpeg base — 1 failing metric(s)
Metric target base delta limit band
cts__timing__setup__tns -27.2462 -0.0219633 -123953.30710776614% -1.2219633 PeriodPadding 20%
❌ ihp-sg13g2/jpeg base — 1 failing metric(s)
Metric target base delta limit band
detailedroute__antenna_diodes_count 168 125 34.4% 125.125 Metric 0.1%
❌ nangate45/ariane133 base — 3 failing metric(s)
Metric target base delta limit band
cts__timing__setup__tns -448.866 -315.386 -42.32274102211259% -378.4632 PeriodPadding 20%
finish__timing__setup__tns -460.744 -292.142 -57.71234536629447% -350.5704 PeriodPadding 20%
globalroute__timing__setup__tns -446.739 -369.105 -21.033039379038485% -442.926 PeriodPadding 20%
❌ nangate45/bp_be_top base — 1 failing metric(s)
Metric target base delta limit band
finish__timing__setup__tns -1.51448 0 — -0.52 PeriodPadding 20%
❌ nangate45/ibex base — 1 failing metric(s)
Metric target base delta limit band
finish__timing__setup__tns -14.9384 -2.69773 -453.7396255370256% -3.237276 PeriodPadding 20%
❌ sky130hd/aes base — 1 failing metric(s)
Metric target base delta limit band
finish__timing__setup__tns -3.92986 -0.491536 -699.5060382149019% -1.211536 PeriodPadding 20%
❌ sky130hd/chameleon base — 3 failing metric(s)
Metric target base delta limit band
cts__timing__setup__tns -16.6271 -12.6783 -31.146131579154932% -15.21396 PeriodPadding 20%
detailedroute__antenna_diodes_count 165 114 44.73684210526316% 114.114 Metric 0.1%
finish__timing__setup__tns -19.8521 -8.71935 -127.67866870810325% -10.46322 PeriodPadding 20%
❌ sky130hd/microwatt base — 3 failing metric(s)
Metric target base delta limit band
cts__timing__setup__tns -258.337 -213.433 -21.03892087915177% -256.1196 PeriodPadding 20%
detailedroute__antenna_diodes_count 1639 1457 12.491420727522305% 1458.457 Metric 0.1%
finish__timing__setup__tns -228.158 -165.245 -38.07255892765288% -198.294 PeriodPadding 20%
❌ sky130hs/aes base — 1 failing metric(s)
Metric target base delta limit band
finish__timing__setup__tns -1.43322 -0.0290776 -4828.948744050403% -0.5890776 PeriodPadding 20%

@osamahammad21

Copy link
Copy Markdown
Member

The metrics failure are coming from updating OR to master

@oharboe

oharboe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Nice to see this behind FLOW_TYPE=3d with the 2D flow untouched.

To make the 3D flow consistent with how ORFS works today, please make the following changes:

  1. Each step writes only its own new files. As in the 2D flow, where each step reads the previous results and writes new files of its own (2_floorplan.odb → 3_place.odb), so a rerun gives the same answer whatever else is on disk. This applies to generate_criticality, which today writes *_criticality.txt next to the .bmap files staged by prepare and skips any that exist. It also applies to yap_simulate, which per the comment in 3d.mk writes alongside its inputs.

  2. Add do-<step> targets for the five steps, matching do-floorplan, do-place and so on in the 2D flow.

  3. Seed the YAP Monte Carlo so that the same inputs give the same results, as every other ORFS step does. The seed goes in the run summary in place of random_source: system_entropy.

Why ORFS works this way

  • Its own new files per step means a step's results are exactly what came out of its inputs. A step can be rerun on its own, intermediate results can be inspected and compared between runs, and a stale file from an earlier run can never change an answer.
  • do- targets keep checking dependencies separate from running a step: the normal target checks them, and the do- target only runs the step. Scripts and CI can then run one step at a time on existing results and take care of the order themselves, for example to rerun one step under a debugger or with a changed setting. bazel-orfs relies on this separation today to support ORFS: it tracks the dependencies itself and calls the do- targets to run each step.
  • Same inputs, same results is what makes the QoR check against a baseline meaningful. It also makes a regression bisectable and lets a reported problem be reproduced by someone else.

@oharboe

oharboe commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

I checked this against bazel-orfs and it has no effect there: the 2D flow is untouched, and nothing bazel-orfs builds or analyses sees the 3D files. Not urgent, and I see the value in having this on master to collaborate on.

Going forward, the 3D flow could be made more congruent with the rest of ORFS, and simpler, as a first-class flow rather than one that's if'd out. Below is a quick list Claude put together that I read over. I checked the first group, which is about the parts shared with the rest of ORFS, and it looks good. The second group is 3D-specific; it looks plausible to me and is worth a look.

Shared with the rest of ORFS (checked):

  • Share the setup instead of copying it. Make the PLATFORM check in variables.mk conditional, or split the tool setup into its own include. The 3D flow then gets OPENROAD_EXE, PYTHON_EXE, RUN_CMD, UNSET_AND_MAKE and the results/…/$(DESIGN_NICKNAME)/$(FLOW_VARIANT) layout as they are, without copying them.
  • Numbered steps with fixed output names, defined with do-step or a sibling of it. This gives do- targets for free, and the stamp files and output globs go away.
  • Step 1 uses flow.sh as it is. It is an OpenROAD Tcl step, so its Tcl can write $::env(RESULTS_DIR)/3d_1_check.odb the way the 2D stages do.
  • Each step writes only its own new files, so a stale file can never change a result.
  • Add the new variables to variables.yaml (FLOW_TYPE, YAP_*, NUM_DIE_STACKS, BMAP_FILES, …) so they are documented and checked like the rest.

3D-specific (plausible, worth a look):

  • Shell and sed logic moves into a Python script per step: staging the inputs, the YAML overrides through OmegaConf instead of sed -i, the per-.bmap criticality loop instead of bash -c, and the cd into YAP. 3d.mk becomes a thin dependency graph.
  • Seed the Monte Carlo so the same inputs give the same results.
  • Small changes in YAP would shrink the scripts further: a --seed option, output paths relative to the working directory rather than its source tree, and explicit input paths instead of fixed file names.

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.

4 participants