From 871b433d730c56aaa7406961467f4d56f404f3fb Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 27 Apr 2024 11:13:14 -0600 Subject: nix: peakrdl: initial commit --- flake.nix | 2 ++ nix/peakrdl-regblock.nix | 38 ++++++++++++++++++++++++++++++++++++++ nix/peakrdl.nix | 31 +++++++++++++++++++++++++++++++ nix/pyuvm.nix | 6 ++++-- nix/systemrdl-compiler.nix | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 nix/peakrdl-regblock.nix create mode 100644 nix/peakrdl.nix create mode 100644 nix/systemrdl-compiler.nix diff --git a/flake.nix b/flake.nix index dd7a173..9a146bc 100644 --- a/flake.nix +++ b/flake.nix @@ -146,6 +146,8 @@ numpy pillow pytest # Para cocotb + (py.callPackage ./nix/peakrdl.nix { }) + (py.callPackage ./nix/peakrdl-regblock.nix { }) (py.callPackage ./nix/pyuvm.nix { }) ])) (quartus-prime-lite.override { supportedDevices = [ "Cyclone V" ]; }) diff --git a/nix/peakrdl-regblock.nix b/nix/peakrdl-regblock.nix new file mode 100644 index 0000000..daacc5a --- /dev/null +++ b/nix/peakrdl-regblock.nix @@ -0,0 +1,38 @@ +{ buildPythonPackage +, callPackage +, fetchPypi +, jinja2 +, lib +, setuptools +, setuptools-scm +}: +let + pname = "peakrdl-regblock"; + version = "0.22.0"; +in +buildPythonPackage { + inherit pname version; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-N+YZSuHdSSMCmgko5YZpa7wDj3vMy2J7prPdfjj53GA="; + }; + + propagatedBuildInputs = [ + jinja2 + (callPackage ./systemrdl-compiler.nix { }) + ]; + + propagatedNativeBuildInputs = [ + setuptools + setuptools-scm + ]; + + meta = { + description = "Compile SystemRDL into a SystemVerilog control/status register (CSR) block"; + changelog = "https://github.com/SystemRDL/${pname}/releases/tag/v${version}"; + homepage = "https://github.com/SystemRDL/${pname}"; + license = lib.licenses.gpl3; + }; +} diff --git a/nix/peakrdl.nix b/nix/peakrdl.nix new file mode 100644 index 0000000..48cf1fa --- /dev/null +++ b/nix/peakrdl.nix @@ -0,0 +1,31 @@ +{ buildPythonPackage +, fetchPypi +, lib +, setuptools +, setuptools-scm +}: +let + pname = "peakrdl"; + version = "1.1.0"; +in +buildPythonPackage { + inherit pname version; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-ZiqdXOaovFnOymvUQvT76OSwHlP+FLm/fuj5H/bY10w="; + }; + + propagatedNativeBuildInputs = [ + setuptools + setuptools-scm + ]; + + meta = { + description = "PeakRDL is a free and open-source control & status register (CSR) toolchain"; + changelog = "https://github.com/SystemRDL/${pname}/releases/tag/v${version}"; + homepage = "https://github.com/SystemRDL/${pname}"; + license = lib.licenses.gpl3; + }; +} diff --git a/nix/pyuvm.nix b/nix/pyuvm.nix index a77b20e..5a755bf 100644 --- a/nix/pyuvm.nix +++ b/nix/pyuvm.nix @@ -5,10 +5,12 @@ , pylint , pytest , sphinx -}: let +}: +let pname = "pyuvm"; version = "2.9.1"; -in buildPythonPackage { +in +buildPythonPackage { inherit pname version; src = fetchPypi { diff --git a/nix/systemrdl-compiler.nix b/nix/systemrdl-compiler.nix new file mode 100644 index 0000000..00c92d7 --- /dev/null +++ b/nix/systemrdl-compiler.nix @@ -0,0 +1,32 @@ +{ antlr4-python3-runtime +, buildPythonPackage +, colorama +, fetchPypi +, lib +, markdown +}: +let + pname = "systemrdl-compiler"; + version = "1.27.3"; +in +buildPythonPackage { + inherit pname version; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-22g1S/8ZTMcjbtaLrGTFu4GpoXtbp7bzezAHilClOj4="; + }; + + propagatedBuildInputs = [ + antlr4-python3-runtime + colorama + markdown + ]; + + meta = { + description = "Parse and elaborate front-end for SystemRDL 2.0"; + changelog = "https://github.com/SystemRDL/${pname}/releases/tag/v${version}"; + homepage = "https://github.com/SystemRDL/${pname}"; + license = lib.licenses.mit; + }; +} -- cgit v1.2.3