Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion bootstrap/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6778,6 +6778,24 @@ fn run_fpga_build(
prjxray_db_path: Option<&str>,
output: &str,
) -> anyhow::Result<()> {
// #2225: P&R against a database for a different part is silent poison — the
// router succeeds against whatever database it is handed, and the mismatch
// surfaces two steps later in fasm2frames as "Part None not found". Check the
// pair HERE, before minutes of synthesis, where the cause is still visible.
if let Some(p) = chipdb_path {
let stem = Path::new(p)
.file_stem()
.and_then(|s| s.to_str())
.unwrap_or("");
if stem != device {
anyhow::bail!(
"chipdb/device mismatch: --chipdb names '{}' but --device is '{}'.\n\
nextpnr would place-and-route against the wrong database and the\n\
build would fail two steps later in fasm2frames. Pass a matching pair.",
stem, device
);
}
}
let specs_dir = repo_root.join("specs/fpga");
let build_dir = repo_root.join(output);
let gen_dir = build_dir.join("generated");
Expand Down Expand Up @@ -7069,7 +7087,10 @@ endmodule
let chipdb = match chipdb_path {
Some(p) => PathBuf::from(p),
None => {
let default = PathBuf::from("build/fpga/chipdb/xc7a100tcsg324-1.bin");
// Derive the default from --device instead of naming one part: a
// hardcoded 100T filename here is exactly how the 200T default flip
// survived P&R against the wrong database (#2225).
let default = PathBuf::from(format!("build/fpga/chipdb/{}.bin", device));
if repo_root.join(&default).exists() {
repo_root.join(&default)
} else {
Expand Down
14 changes: 14 additions & 0 deletions docs/NOW.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# NOW -- the mismatch now fails where the cause is (2026-08-19)

Last updated: 2026-08-19

## fix(fpga-build): chipdb/device agreement asserted before P&R (Closes #2231)

- t27c fpga-build now fails at start when an explicit --chipdb filename disagrees
with --device, naming both and the two-steps-later consequence (fasm2frames
'Part None not found'); the default chipdb path is derived from --device instead
of hardcoding the 100T filename -- the hardcode is exactly how the 200T default
flip survived P&R against the wrong database (#2225)
- Negative controls: planted mismatch bails instantly; matched pair proceeds


# NOW -- apt attempts are bounded, and the onion's lessons are a skill (2026-08-19)

Last updated: 2026-08-19
Expand Down
Loading