From aedb3533de153d927dcb95a4b8be8d4574431a50 Mon Sep 17 00:00:00 2001 From: Roland Coeurjoly Date: Fri, 22 May 2026 19:46:37 +0200 Subject: [PATCH] Add patch for PrjxrayDb --- flake.lock | 4 ++++ flake.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index ea01b97..9bf593e 100644 --- a/flake.lock +++ b/flake.lock @@ -54,6 +54,10 @@ "root": { "inputs": { "flake-utils": "flake-utils", + "nixpkgs": [ + "toolchain-nix", + "nixpkgs" + ], "toolchain-nix": "toolchain-nix" } }, diff --git a/flake.nix b/flake.nix index 297a413..fe565b4 100644 --- a/flake.nix +++ b/flake.nix @@ -4,10 +4,50 @@ inputs = { flake-utils.url = "github:numtide/flake-utils"; toolchain-nix.url = "github:openXC7/toolchain-nix"; + nixpkgs.follows = "toolchain-nix/nixpkgs"; }; - outputs = { flake-utils, toolchain-nix, ... }: - flake-utils.lib.eachDefaultSystem (system: { - devShells.default = toolchain-nix.devShell.${system}; - }); + outputs = { flake-utils, nixpkgs, toolchain-nix, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + openXc7Shell = toolchain-nix.devShell.${system}; + nextpnrXilinx = toolchain-nix.packages.${system}.nextpnr-xilinx; + originalPrjxrayDb = "${nextpnrXilinx}/share/nextpnr/external/prjxray-db"; + patchedPrjxrayDb = pkgs.runCommand "prjxray-db-kintex7-lioi3-tbytesrc-oclkm-overlay" { } '' + mkdir -p $out + cp -a ${originalPrjxrayDb}/kintex7 $out/kintex7 + + for db_file in \ + $out/kintex7/segbits_lioi3_tbytesrc.db \ + $out/kintex7/segbits_lioi3_tbytesrc.origin_info.db + do + chmod u+w "$db_file" + done + + if ! grep -q "^LIOI3_TBYTESRC.IOI_OCLKM_0.IOI_IMUX31_1 " \ + $out/kintex7/segbits_lioi3_tbytesrc.db + then + cat >> $out/kintex7/segbits_lioi3_tbytesrc.db <> $out/kintex7/segbits_lioi3_tbytesrc.origin_info.db <