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