From: Las Safin Date: Sun, 12 Sep 2021 19:06:04 +0000 (+0000) Subject: Package c4m-jtag X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ffe6e5688c3f569b5338ace133cdece1bb7c211c;p=soc.git Package c4m-jtag --- diff --git a/flake.lock b/flake.lock index d6bf6a5a..df14d0ad 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "c4m-jtag": { + "flake": false, + "locked": { + "lastModified": 1619101523, + "narHash": "sha256-y1OY8URcE1lnu5L7IDFcJ8zT8sqlrfMP9VPNmVvACGk=", + "ref": "master", + "rev": "c2bf4810f9f91ced7fcda777b92b86ab353da288", + "revCount": 146, + "type": "git", + "url": "https://git.libre-soc.org/git/c4m-jtag.git" + }, + "original": { + "type": "git", + "url": "https://git.libre-soc.org/git/c4m-jtag.git" + } + }, "nixpkgs": { "locked": { "lastModified": 1630612789, @@ -18,6 +34,7 @@ }, "root": { "inputs": { + "c4m-jtag": "c4m-jtag", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 75e3ed63..3df85429 100644 --- a/flake.nix +++ b/flake.nix @@ -4,11 +4,11 @@ description = "FOSS CPU/GPU/VPU/SoC all in one, see https://libre-soc.org/"; inputs.nixpkgs.url = "github:L-as/nixpkgs?ref=alliance"; # for alliance + inputs.c4m-jtag.url = "git+https://git.libre-soc.org/git/c4m-jtag.git"; + inputs.c4m-jtag.flake = false; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, c4m-jtag }: let - version = builtins.substring 0 8 self.lastModifiedDate; - supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; @@ -16,17 +16,19 @@ nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; }); in { - 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-nmutil = pself.callPackage ./nix/nmutil.nix {}; + overlay = final: prev: { + python3Packages = prev.python3Packages.override { + overrides = pfinal: pprev: { + libresoc-ieee754fpu = pfinal.callPackage ./nix/ieee754fpu.nix {}; + libresoc-openpower-isa = pfinal.callPackage ./nix/openpower-isa.nix {}; + c4m-jtag = pfinal.callPackage (import ./nix/c4m-jtag.nix { src = c4m-jtag; version = c4m-jtag.lastModifiedDate; }) {}; + bigfloat = pfinal.callPackage ./nix/bigfloat.nix {}; + modgrammar = pfinal.callPackage ./nix/modgrammar.nix {}; + libresoc-nmutil = pfinal.callPackage ./nix/nmutil.nix {}; }; }; - libresoc-verilog = self.callPackage (import ./nix/verilog.nix { inherit version; }) {}; + libresoc-verilog = final.callPackage (import ./nix/verilog.nix { version = self.lastModifiedDate; }) {}; }; packages = forAllSystems (system: { diff --git a/nix/bigfloat.nix b/nix/bigfloat.nix index 1438f519..4355ef04 100644 --- a/nix/bigfloat.nix +++ b/nix/bigfloat.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, bigfloat, fetchPypi, gmp, mpfr, six }: +{ lib, buildPythonPackage, fetchPypi, gmp, mpfr, six }: buildPythonPackage rec { pname = "bigfloat"; diff --git a/nix/c4m-jtag.nix b/nix/c4m-jtag.nix new file mode 100644 index 00000000..cf4dcf4d --- /dev/null +++ b/nix/c4m-jtag.nix @@ -0,0 +1,19 @@ +{ version, src }: + +{ lib, python, buildPythonPackage, nmigen-soc, nmigen, modgrammar }: + +buildPythonPackage { + pname = "libresoc-openpower-isa"; + inherit version src; + + propagatedBuildInputs = [ nmigen-soc nmigen modgrammar ]; + + doCheck = false; + + pythonImportsCheck = [ "c4m.nmigen.jtag.tap" ]; + + meta = with lib; { + homepage = "https://pypi.org/project/libresoc-openpower-isa/"; + license = licenses.lgpl3Plus; + }; +} diff --git a/nix/ieee754fpu.nix b/nix/ieee754fpu.nix index ac221c93..e520437d 100644 --- a/nix/ieee754fpu.nix +++ b/nix/ieee754fpu.nix @@ -14,6 +14,12 @@ buildPythonPackage { doCheck = false; + prePatch = '' + touch ./src/ieee754/part/__init__.py + ''; + + pythonImportsCheck = [ "ieee754.part" ]; + meta = with lib; { homepage = "https://pypi.org/project/libresoc-ieee754fpu/"; license = licenses.lgpl3Plus; diff --git a/nix/modgrammar.nix b/nix/modgrammar.nix new file mode 100644 index 00000000..ce0f3482 --- /dev/null +++ b/nix/modgrammar.nix @@ -0,0 +1,20 @@ +{ lib, buildPythonPackage, fetchFromGitHub }: + +buildPythonPackage rec { + pname = "modgrammar"; + version = "unstable-2020-09-20"; + + src = fetchFromGitHub { + owner = "bloerwald"; + repo = "modgrammar"; + rev = "d363ad5a86584e560a8b03cbe11c0168d7610691"; + sha256 = "SO2qjfEVaJfgbA5HLJYwXlaeUzt5EFoljYQ2SsdDCbc="; + }; + + doCheck = false; + + meta = with lib; { + homepage = "https://pypi.org/project/modgrammar/"; + # license = licenses.bsd; # FIXME: Which BSD? + }; +} diff --git a/nix/verilog.nix b/nix/verilog.nix index cb6df044..afd884bf 100644 --- a/nix/verilog.nix +++ b/nix/verilog.nix @@ -10,7 +10,9 @@ stdenv.mkDerivation { strictDeps = true; - nativeBuildInputs = with python3Packages; [ nmigen-soc python libresoc-ieee754fpu libresoc-openpower-isa ]; + nativeBuildInputs = with python3Packages; [ + c4m-jtag nmigen-soc python libresoc-ieee754fpu libresoc-openpower-isa + ]; configurePhase = "true";