forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; });
-
in
{
- overlay = final: prev: {};
+ overlay = self: super: {
+ python3Packages = super.python3Packages.override {
+ overrides = pself: psuper: {
+ libresoc-ieee754fpu = pself.callPackage ./nix/ieee754fpu.nix {};
+ libresoc-openpower-isa = pself.callPackage ./nix/openpower-isa.nix {};
+ bigfloat = pself.callPackage ./nix/bigfloat.nix {};
+ };
+ };
+
+ libresoc-verilog = self.callPackage (import ./nix/verilog.nix { inherit version; }) {};
+ };
+
+ packages = forAllSystems (system: {
+ verilog = nixpkgsFor.${system}.libresoc-verilog;
+ });
+
+ defaultPackage = forAllSystems (system: self.packages.${system}.verilog);
};
}
--- /dev/null
+{ lib, buildPythonPackage, bigfloat, fetchPypi, gmp, mpfr }:
+
+buildPythonPackage rec {
+ pname = "bigfloat";
+ version = "0.4.0";
+
+ buildInputs = [ gmp mpfr ];
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "WLlr3ocqylmJ0T2C66Os8qoblOIhF91yoWulkRsMDLg=";
+ };
+
+ doCheck = false;
+
+ meta = with lib; {
+ homepage = "https://pypi.org/project/bigfloat/";
+ license = licenses.lgpl3Plus;
+ };
+}
--- /dev/null
+{ lib, buildPythonPackage, bigfloat, fetchgit }:
+
+buildPythonPackage {
+ pname = "libresoc-ieee754fpu";
+ version = "unstable-2021-06-05";
+
+ src = fetchgit {
+ url = "https://git.libre-soc.org/git/ieee754fpu.git";
+ rev = "c62fa3a7ee95832587d7725729dcdb9a002ae015";
+ sha256 = "wbr1vGFzUlUtBT6IcRsykADYeksiVoq/LacU/dbRQ0o=";
+ };
+
+ propagatedBuildInputs = [ bigfloat ];
+
+ doCheck = false;
+
+ meta = with lib; {
+ homepage = "https://pypi.org/project/libresoc-ieee754fpu/";
+ license = licenses.lgpl3Plus;
+ };
+}
--- /dev/null
+{ lib, buildPythonPackage, fetchgit }:
+
+buildPythonPackage {
+ pname = "libresoc-openpower-isa";
+ version = "unstable-2021-09-04";
+
+ src = fetchgit {
+ url = "https://git.libre-soc.org/git/openpower-isa.git";
+ rev = "6e43a194f3d07ed5a8daa297187a32746c4c4d3c";
+ sha256 = "0EekUouTQruTXGO5jlPJtqh0DOudghILy0nca5eaZz8=";
+ };
+
+ doCheck = false;
+
+ meta = with lib; {
+ homepage = "https://pypi.org/project/libresoc-openpower-isa/";
+ license = licenses.lgpl3Plus;
+ };
+}
--- /dev/null
+{ version }:
+
+{ stdenv, python3Packages }:
+
+stdenv.mkDerivation {
+ pname = "libresoc.v";
+ inherit version;
+
+ src = ../.;
+
+ strictDeps = true;
+
+ nativeBuildInputs = with python3Packages; [ python libresoc-ieee754fpu libresoc-openpower-isa ];
+
+ configurePhase = "true";
+
+ buildPhase = ''
+ runHook preBuild
+ python3 src/soc/simple/issuer_verilog.py \
+ --debug=jtag --enable-core --enable-pll \
+ --enable-xics --enable-sram4x4kblock --disable-svp64 \
+ libresoc.v
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ runHook preInstall
+ mv libresoc.v $out
+ runHook postInstall
+ '';
+
+ fixupPhase = "true";
+}