summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfpi2024-03-01 14:57:32 +0100
committerfpi2024-03-10 19:02:39 +0100
commitb6474d4eb1d814ec40ca5404e1af92406771ccd7 (patch)
tree90f29f2e46564b3d3ff97866b5074b6bddae61a8
Initial flakeHEADmain
-rw-r--r--download.sh.patch44
-rw-r--r--flake.lock146
-rw-r--r--flake.nix100
3 files changed, 290 insertions, 0 deletions
diff --git a/download.sh.patch b/download.sh.patch
new file mode 100644
index 0000000..0eb96fb
--- /dev/null
+++ b/download.sh.patch
@@ -0,0 +1,44 @@
+diff --git a/scripts/download.sh b/scripts/download.sh2.sh
+index eb9ce59..7c9eaf4 100755
+--- a/scripts/download.sh
++++ b/scripts/download.sh
+@@ -40,6 +40,8 @@ function git_retry() {
+
+ set -e
+
++echo download.sh $@
++
+ if [ "${1: -3}" == ".gz" ] ; then
+
+ # Neither curl or wget are guaranteed to be included in all *nix systems,
+@@ -79,25 +81,11 @@ if [ "${1: -3}" == ".gz" ] ; then
+
+ else
+
+- if type "git" > /dev/null; then
+- echo "Cloning $1 to $2"
+- if [ $# -gt 2 ]; then
+- if [ "$3" == "unknown" ]; then
+- git_retry clone --depth 1 $1 $2
+- else
+- # Not gonna retry on the first `git clone`- the backup command
+- # exists anyway
+- { git clone --branch $3 --single-branch $1 $2; } ||
+- { git_retry clone $1 $2 && git -C $2 checkout $3; }
+- fi
+- else
+- git_retry clone --depth 1 $1 $2
+- fi
+-
+- else
+- echo "ERROR: \"git\" is required to automatically install tools."
+- exit 1
+- fi
++ echo "Copying $1 to $2"
++ reference=$(echo $1 | sed -e 's/https:\/\/github.com\//git_/' | sed -e 's/\//_/' | sed -e 's/-/_/g')
++ mkdir -p $(dirname $2)
++ cp -r ${!reference} $2
++ chmod -R 755 $2
+ fi
+
+ exit 0
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..b9dab49
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,146 @@
+{
+ "nodes": {
+ "PaulSchulz_sky130_pschulz_xx_hd": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1606871627,
+ "narHash": "sha256-+7DxRIZJM7rsMUcWA6DjVNMaPrhlY2CwdK8RhVNOuDA=",
+ "owner": "PaulSchulz",
+ "repo": "sky130_pschulz_xx_hd",
+ "rev": "6eb3b0718552b034f1bf1870285ff135e3fb2dcb",
+ "type": "github"
+ },
+ "original": {
+ "owner": "PaulSchulz",
+ "repo": "sky130_pschulz_xx_hd",
+ "type": "github"
+ }
+ },
+ "StefanSchippers_xschem_sky130": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1709198611,
+ "narHash": "sha256-/HhwFUQtun6XTGuglullWdDqwXp5LuZfo9LZll+uxTA=",
+ "owner": "StefanSchippers",
+ "repo": "xschem_sky130",
+ "rev": "7a60184f1ccb8d733dfbbb08793ae85a21804d3e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "StefanSchippers",
+ "repo": "xschem_sky130",
+ "type": "github"
+ }
+ },
+ "efabless_mpw_precheck": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1701877692,
+ "narHash": "sha256-qPN4ruExANz1rgnAMTuVSRVlOnovH9FZkPPenWYvw4Q=",
+ "owner": "efabless",
+ "repo": "mpw_precheck",
+ "rev": "f6b9c3d3f00694f96dce8444149449b4719180f0",
+ "type": "github"
+ },
+ "original": {
+ "owner": "efabless",
+ "repo": "mpw_precheck",
+ "type": "github"
+ }
+ },
+ "efabless_sky130_klayout_pdk": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1693742232,
+ "narHash": "sha256-NuIVKcuKElOl9UPWd3tSXV3MF3E2DQFY23E6IcjfqGk=",
+ "owner": "efabless",
+ "repo": "sky130_klayout_pdk",
+ "rev": "c4b125f216edda5d755e429cfe876855ff300974",
+ "type": "github"
+ },
+ "original": {
+ "owner": "efabless",
+ "repo": "sky130_klayout_pdk",
+ "type": "github"
+ }
+ },
+ "efabless_skywater-pdk-libs-sky130_fd_io": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1701284474,
+ "narHash": "sha256-USPGTqpdllHvBS4amiU68h9i/hiYxLXoQZnMQVixySs=",
+ "owner": "efabless",
+ "repo": "skywater-pdk-libs-sky130_fd_io",
+ "rev": "979f0a09c39b12e195e5da872eeac62c9f49f8b1",
+ "type": "github"
+ },
+ "original": {
+ "owner": "efabless",
+ "repo": "skywater-pdk-libs-sky130_fd_io",
+ "type": "github"
+ }
+ },
+ "efabless_skywater-pdk-libs-sky130_fd_pr": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1707674658,
+ "narHash": "sha256-sRzM12A2o6o9xsSkmxjPNCdksNl903ye85RTa3ngAhg=",
+ "owner": "efabless",
+ "repo": "skywater-pdk-libs-sky130_fd_pr",
+ "rev": "be000a2f9122310e60ac30d762a91aef18e24b48",
+ "type": "github"
+ },
+ "original": {
+ "owner": "efabless",
+ "repo": "skywater-pdk-libs-sky130_fd_pr",
+ "type": "github"
+ }
+ },
+ "efabless_skywater-pdk-libs-sky130_fd_sc_hd": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1707674799,
+ "narHash": "sha256-EoilITD3qQpF+kyXBlMzksX6PRHbgNcYhAKYs+bv7kg=",
+ "owner": "efabless",
+ "repo": "skywater-pdk-libs-sky130_fd_sc_hd",
+ "rev": "89492a051231edb799c330208ed48542eb6a29d7",
+ "type": "github"
+ },
+ "original": {
+ "owner": "efabless",
+ "repo": "skywater-pdk-libs-sky130_fd_sc_hd",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1709237383,
+ "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "PaulSchulz_sky130_pschulz_xx_hd": "PaulSchulz_sky130_pschulz_xx_hd",
+ "StefanSchippers_xschem_sky130": "StefanSchippers_xschem_sky130",
+ "efabless_mpw_precheck": "efabless_mpw_precheck",
+ "efabless_sky130_klayout_pdk": "efabless_sky130_klayout_pdk",
+ "efabless_skywater-pdk-libs-sky130_fd_io": "efabless_skywater-pdk-libs-sky130_fd_io",
+ "efabless_skywater-pdk-libs-sky130_fd_pr": "efabless_skywater-pdk-libs-sky130_fd_pr",
+ "efabless_skywater-pdk-libs-sky130_fd_sc_hd": "efabless_skywater-pdk-libs-sky130_fd_sc_hd",
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..97a27f8
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,100 @@
+{
+ description = "Open pdks";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
+
+ # download.sh https://github.com/efabless/skywater-pdk-libs-sky130_fd_pr /build/open_pdks-1.0.470/sources/sky130_fd_pr
+ efabless_skywater-pdk-libs-sky130_fd_pr = {
+ url = "github:efabless/skywater-pdk-libs-sky130_fd_pr";
+ flake = false;
+ };
+ # download.sh https://github.com/efabless/skywater-pdk-libs-sky130_fd_io ../sources/sky130_fd_io
+ efabless_skywater-pdk-libs-sky130_fd_io = {
+ url = "github:efabless/skywater-pdk-libs-sky130_fd_io";
+ flake = false;
+ };
+ # download.sh https://github.com/efabless/skywater-pdk-libs-sky130_fd_sc_hd /build/open_pdks-1.0.470/sources/sky130_fd_sc_hd
+ efabless_skywater-pdk-libs-sky130_fd_sc_hd = {
+ url = "github:efabless/skywater-pdk-libs-sky130_fd_sc_hd";
+ flake = false;
+ };
+ # download.sh https://github.com/PaulSchulz/sky130_pschulz_xx_hd ../sources/sky130_ml_xx_hd
+ PaulSchulz_sky130_pschulz_xx_hd = {
+ url = "github:PaulSchulz/sky130_pschulz_xx_hd";
+ flake = false;
+ };
+ # download.sh https://github.com/StefanSchippers/xschem_sky130 ../sources/xschem_sky130
+ StefanSchippers_xschem_sky130 = {
+ url = "github:StefanSchippers/xschem_sky130";
+ flake = false;
+ };
+ # download.sh https://github.com/efabless/sky130_klayout_pdk ../sources/klayout_sky130
+ efabless_sky130_klayout_pdk = {
+ url = "github:efabless/sky130_klayout_pdk";
+ flake = false;
+ };
+ # download.sh https://github.com/efabless/mpw_precheck ../sources/precheck_sky130
+ efabless_mpw_precheck = {
+ url = "github:efabless/mpw_precheck";
+ flake = false;
+ };
+
+ };
+
+ outputs = { self, nixpkgs, efabless_skywater-pdk-libs-sky130_fd_pr, efabless_skywater-pdk-libs-sky130_fd_io, efabless_skywater-pdk-libs-sky130_fd_sc_hd, PaulSchulz_sky130_pschulz_xx_hd, StefanSchippers_xschem_sky130, efabless_sky130_klayout_pdk, efabless_mpw_precheck }: {
+
+ packages.x86_64-linux.open_pdks =
+ let pkgs = import nixpkgs {
+ system = "x86_64-linux";
+ };
+ in pkgs.stdenv.mkDerivation rec {
+ pname = "open_pdks";
+ version = "1.0.470";
+ src = pkgs.fetchurl {
+ url = "http://opencircuitdesign.com/open_pdks/archive/open_pdks-${version}.tgz";
+ sha256 = "sha256-Q8Tiy5569XWTpme9V234CrJjaJ3SpgaEDSdjkJOafHk=";
+ };
+ # nativeBuildInputs = [pkgs.breakpointHook];
+ nativeBuildInputs = [ pkgs.python3 pkgs.magic-vlsi pkgs.git ];
+
+ enableParallelBuildung = true;
+
+ git_efabless_skywater_pdk_libs_sky130_fd_pr = efabless_skywater-pdk-libs-sky130_fd_pr;
+ git_efabless_skywater_pdk_libs_sky130_fd_io = efabless_skywater-pdk-libs-sky130_fd_io;
+ git_efabless_skywater_pdk_libs_sky130_fd_sc_hd = efabless_skywater-pdk-libs-sky130_fd_sc_hd;
+ git_PaulSchulz_sky130_pschulz_xx_hd = PaulSchulz_sky130_pschulz_xx_hd;
+ git_StefanSchippers_xschem_sky130 = StefanSchippers_xschem_sky130;
+ git_efabless_sky130_klayout_pdk = efabless_sky130_klayout_pdk;
+ git_efabless_mpw_precheck = efabless_mpw_precheck;
+
+ configureFlags = [
+ "--prefix=\${out}"
+ "--datarootdir=\${out}"
+ "--enable-sky130-pdk"
+ "--enable-primitive-sky130"
+ "--disable-sc-hs-sky130"
+ "--disable-sc-ms-sky130"
+ "--disable-sc-ls-sky130"
+ "--disable-sc-lp-sky130"
+ "--enable-sc-hd-sky130"
+ "--disable-sc-hdll-sky130"
+ "--disable-sc-hvl-sky130"
+ "--disable-gf180mcu-pdk"
+ ];
+
+ postPatch = ''
+ patchShebangs scripts/*
+ patchShebangs common/*
+ patchShebangs sky130/custom/*
+ '';
+ patches = [
+ ./download.sh.patch
+ ];
+
+ };
+
+ packages.x86_64-linux.default = self.packages.x86_64-linux.open_pdks;
+
+ };
+}