From 33866b05e139ccdf0088b99de8299ac91123ce64 Mon Sep 17 00:00:00 2001 From: Jack Leightcap Date: Fri, 26 Apr 2024 02:25:25 -0400 Subject: [PATCH] libresoc: move into packages defined in by-name Signed-off-by: Jack Leightcap --- pkgs/{ => by-name}/libresoc/ieee754fpu.nix | 0 .../libresoc/libresoc-c4m-jtag.nix} | 0 .../libresoc/libresoc-pyelftools.nix | 0 pkgs/{ => by-name}/libresoc/mdis.nix | 0 pkgs/{ => by-name}/libresoc/nmigen-soc.nix | 0 pkgs/{ => by-name}/libresoc/nmigen.nix | 0 pkgs/{ => by-name}/libresoc/nmutil.nix | 0 pkgs/{ => by-name}/libresoc/openpower-isa.nix | 0 pkgs/by-name/libresoc/package.nix | 56 +++++++++++++++++++ pkgs/{ => by-name}/libresoc/pinmux.nix | 0 .../libresoc/power-instruction-analyzer.nix | 0 .../prefixed-openpower-isa-tools.patch | 0 .../libresoc/pytest-output-to-files.nix | 0 .../libresoc/remove-gitignore-check.patch | 0 .../soc-nmigen-soc-no-implicit-arg.patch | 0 pkgs/{ => by-name}/libresoc/soc.nix | 0 .../use-vendored-git-dependencies.patch | 0 pkgs/{ => by-name}/libresoc/verilog.nix | 0 pkgs/default.nix | 51 ----------------- 19 files changed, 56 insertions(+), 51 deletions(-) rename pkgs/{ => by-name}/libresoc/ieee754fpu.nix (100%) rename pkgs/{libresoc/c4m-jtag.nix => by-name/libresoc/libresoc-c4m-jtag.nix} (100%) rename pkgs/{ => by-name}/libresoc/libresoc-pyelftools.nix (100%) rename pkgs/{ => by-name}/libresoc/mdis.nix (100%) rename pkgs/{ => by-name}/libresoc/nmigen-soc.nix (100%) rename pkgs/{ => by-name}/libresoc/nmigen.nix (100%) rename pkgs/{ => by-name}/libresoc/nmutil.nix (100%) rename pkgs/{ => by-name}/libresoc/openpower-isa.nix (100%) create mode 100644 pkgs/by-name/libresoc/package.nix rename pkgs/{ => by-name}/libresoc/pinmux.nix (100%) rename pkgs/{ => by-name}/libresoc/power-instruction-analyzer.nix (100%) rename pkgs/{ => by-name}/libresoc/prefixed-openpower-isa-tools.patch (100%) rename pkgs/{ => by-name}/libresoc/pytest-output-to-files.nix (100%) rename pkgs/{ => by-name}/libresoc/remove-gitignore-check.patch (100%) rename pkgs/{ => by-name}/libresoc/soc-nmigen-soc-no-implicit-arg.patch (100%) rename pkgs/{ => by-name}/libresoc/soc.nix (100%) rename pkgs/{ => by-name}/libresoc/use-vendored-git-dependencies.patch (100%) rename pkgs/{ => by-name}/libresoc/verilog.nix (100%) diff --git a/pkgs/libresoc/ieee754fpu.nix b/pkgs/by-name/libresoc/ieee754fpu.nix similarity index 100% rename from pkgs/libresoc/ieee754fpu.nix rename to pkgs/by-name/libresoc/ieee754fpu.nix diff --git a/pkgs/libresoc/c4m-jtag.nix b/pkgs/by-name/libresoc/libresoc-c4m-jtag.nix similarity index 100% rename from pkgs/libresoc/c4m-jtag.nix rename to pkgs/by-name/libresoc/libresoc-c4m-jtag.nix diff --git a/pkgs/libresoc/libresoc-pyelftools.nix b/pkgs/by-name/libresoc/libresoc-pyelftools.nix similarity index 100% rename from pkgs/libresoc/libresoc-pyelftools.nix rename to pkgs/by-name/libresoc/libresoc-pyelftools.nix diff --git a/pkgs/libresoc/mdis.nix b/pkgs/by-name/libresoc/mdis.nix similarity index 100% rename from pkgs/libresoc/mdis.nix rename to pkgs/by-name/libresoc/mdis.nix diff --git a/pkgs/libresoc/nmigen-soc.nix b/pkgs/by-name/libresoc/nmigen-soc.nix similarity index 100% rename from pkgs/libresoc/nmigen-soc.nix rename to pkgs/by-name/libresoc/nmigen-soc.nix diff --git a/pkgs/libresoc/nmigen.nix b/pkgs/by-name/libresoc/nmigen.nix similarity index 100% rename from pkgs/libresoc/nmigen.nix rename to pkgs/by-name/libresoc/nmigen.nix diff --git a/pkgs/libresoc/nmutil.nix b/pkgs/by-name/libresoc/nmutil.nix similarity index 100% rename from pkgs/libresoc/nmutil.nix rename to pkgs/by-name/libresoc/nmutil.nix diff --git a/pkgs/libresoc/openpower-isa.nix b/pkgs/by-name/libresoc/openpower-isa.nix similarity index 100% rename from pkgs/libresoc/openpower-isa.nix rename to pkgs/by-name/libresoc/openpower-isa.nix diff --git a/pkgs/by-name/libresoc/package.nix b/pkgs/by-name/libresoc/package.nix new file mode 100644 index 00000000..2af95aed --- /dev/null +++ b/pkgs/by-name/libresoc/package.nix @@ -0,0 +1,56 @@ +{callPackage}: let + # JTAG debugging + libresoc-c4m-jtag = callPackage ./libresoc-c4m-jtag.nix {inherit nmigen nmigen-soc;}; + # floating point implementation + libresoc-ieee754fpu = callPackage ./ieee754fpu.nix {inherit nmutil nmigen pytest-output-to-files;}; + # openpower-isa definition + libresoc-openpower-isa = callPackage ./openpower-isa.nix { + inherit + libresoc-pyelftools + mdis + nmigen + nmutil + pytest-output-to-files + ; + }; + # libresoc's fork of pyelftools, few commits have diverged from pyelftools packaged by nixpkgs + libresoc-pyelftools = callPackage ./libresoc-pyelftools.nix {}; + mdis = callPackage ./mdis.nix {}; + # libresoc's nmigen fork has been renamed to https://github.com/amaranth-lang/amaranth + # amaranth is packaged in nixpkgs but we can't just override a few of the attributes the way we did for pyelftools, + # because the names are different, so much of this is copied from the amaranth build recipe + nmigen = callPackage ./nmigen.nix {}; + # libresoc's nmigen-soc fork has been renamed to https://github.com/amaranth-lang/amaranth-soc. + # suffers from the same rename issue as the previous commit with renaming issue as nmigen/amaranth + nmigen-soc = callPackage ./nmigen-soc.nix {inherit nmigen;}; + # libresoc's nmutil fork, used for differential testing + nmutil = callPackage ./nmutil.nix {inherit nmigen pytest-output-to-files;}; + # library for running pin multiplexers + pinmux = callPackage ./pinmux.nix {}; + # libresoc's PowerPC emulator + power-instruction-analyzer = callPackage ./power-instruction-analyzer.nix {}; + # libresoc's test harness + pytest-output-to-files = callPackage ./pytest-output-to-files.nix {}; + # SoC target circuit synthesized to nmigen(-soc) + soc = callPackage ./soc.nix { + inherit + libresoc-c4m-jtag + libresoc-ieee754fpu + libresoc-openpower-isa + nmigen-soc + power-instruction-analyzer + pytest-output-to-files + ; + }; +in + # SoC synthesized to Verilog + callPackage ./soc.nix { + inherit + libresoc-c4m-jtag + libresoc-ieee754fpu + libresoc-openpower-isa + nmigen-soc + power-instruction-analyzer + pytest-output-to-files + ; + } diff --git a/pkgs/libresoc/pinmux.nix b/pkgs/by-name/libresoc/pinmux.nix similarity index 100% rename from pkgs/libresoc/pinmux.nix rename to pkgs/by-name/libresoc/pinmux.nix diff --git a/pkgs/libresoc/power-instruction-analyzer.nix b/pkgs/by-name/libresoc/power-instruction-analyzer.nix similarity index 100% rename from pkgs/libresoc/power-instruction-analyzer.nix rename to pkgs/by-name/libresoc/power-instruction-analyzer.nix diff --git a/pkgs/libresoc/prefixed-openpower-isa-tools.patch b/pkgs/by-name/libresoc/prefixed-openpower-isa-tools.patch similarity index 100% rename from pkgs/libresoc/prefixed-openpower-isa-tools.patch rename to pkgs/by-name/libresoc/prefixed-openpower-isa-tools.patch diff --git a/pkgs/libresoc/pytest-output-to-files.nix b/pkgs/by-name/libresoc/pytest-output-to-files.nix similarity index 100% rename from pkgs/libresoc/pytest-output-to-files.nix rename to pkgs/by-name/libresoc/pytest-output-to-files.nix diff --git a/pkgs/libresoc/remove-gitignore-check.patch b/pkgs/by-name/libresoc/remove-gitignore-check.patch similarity index 100% rename from pkgs/libresoc/remove-gitignore-check.patch rename to pkgs/by-name/libresoc/remove-gitignore-check.patch diff --git a/pkgs/libresoc/soc-nmigen-soc-no-implicit-arg.patch b/pkgs/by-name/libresoc/soc-nmigen-soc-no-implicit-arg.patch similarity index 100% rename from pkgs/libresoc/soc-nmigen-soc-no-implicit-arg.patch rename to pkgs/by-name/libresoc/soc-nmigen-soc-no-implicit-arg.patch diff --git a/pkgs/libresoc/soc.nix b/pkgs/by-name/libresoc/soc.nix similarity index 100% rename from pkgs/libresoc/soc.nix rename to pkgs/by-name/libresoc/soc.nix diff --git a/pkgs/libresoc/use-vendored-git-dependencies.patch b/pkgs/by-name/libresoc/use-vendored-git-dependencies.patch similarity index 100% rename from pkgs/libresoc/use-vendored-git-dependencies.patch rename to pkgs/by-name/libresoc/use-vendored-git-dependencies.patch diff --git a/pkgs/libresoc/verilog.nix b/pkgs/by-name/libresoc/verilog.nix similarity index 100% rename from pkgs/libresoc/verilog.nix rename to pkgs/by-name/libresoc/verilog.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 49763f27..c5b3eaae 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -33,57 +33,6 @@ pretalx-venueless pretalx-public-voting ; - - libresoc = let - in rec { - # JTAG debugging - libresoc-c4m-jtag = callPackage ./libresoc/c4m-jtag.nix {inherit nmigen nmigen-soc;}; - # floating point implementation - libresoc-ieee754fpu = callPackage ./libresoc/ieee754fpu.nix {inherit nmutil nmigen pytest-output-to-files;}; - # openpower-isa - libresoc-openpower-isa = callPackage ./libresoc/openpower-isa.nix { - inherit - libresoc-pyelftools - mdis - nmigen - nmutil - pytest-output-to-files - ; - }; - # use libre-soc's fork of pyelftools, few commits have diverged from pyelftools packaged by nixpkgs - libresoc-pyelftools = callPackage ./libresoc/libresoc-pyelftools.nix {}; - mdis = callPackage ./libresoc/mdis.nix {}; - # upstream nmigen has been renamed to https://github.com/amaranth-lang/amaranth. - # amaranth is packaged in nixpkgs but we can't just override a few of the attributes the way we did for pyelftools, - # because the names are different, so much of this is copied from the amaranth build recipe. - nmigen = callPackage ./libresoc/nmigen.nix {}; - # nmigen-soc was not currently packaged in nixpkgs during work on this PR. However, - # it was also renamed to https://github.com/amaranth-lang/amaranth-soc and has now been packaged in nixpkgs, - # but suffers from the same rename issue as the previous commit with nmigen and amaranth - nmigen-soc = callPackage ./libresoc/nmigen-soc.nix {inherit nmigen;}; - # upstream tool for running verilog circuit against linux emulator - nmutil = callPackage ./libresoc/nmutil.nix {inherit nmigen pytest-output-to-files;}; - # upstream library for running pin multiplexers - pinmux = callPackage ./libresoc/pinmux.nix {}; - # upstream emulator of power ISA - power-instruction-analyzer = callPackage ./libresoc/power-instruction-analyzer.nix {}; - # upstream test harness - pytest-output-to-files = callPackage ./libresoc/pytest-output-to-files.nix {}; - # SoC target circuit synthesized to nmigen(-soc) - soc = callPackage ./libresoc/soc.nix { - inherit - libresoc-c4m-jtag - libresoc-ieee754fpu - libresoc-openpower-isa - nmigen-soc - power-instruction-analyzer - pytest-output-to-files - ; - }; - - # SoC synthesized to Verilog - verilog = callPackage ./libresoc/verilog.nix {inherit pinmux soc;}; - }; }; in self