summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2024-04-27 11:13:14 -0600
committerAlejandro Soto <alejandro@34project.org>2024-04-27 11:13:14 -0600
commit871b433d730c56aaa7406961467f4d56f404f3fb (patch)
treebaa9fd3900e2dcdb1de05185ce2c1e3ea7ee053b
parentdc0262c63df60987ec64ce8e8df09359310d7a3d (diff)
nix: peakrdl: initial commit
-rw-r--r--flake.nix2
-rw-r--r--nix/peakrdl-regblock.nix38
-rw-r--r--nix/peakrdl.nix31
-rw-r--r--nix/pyuvm.nix6
-rw-r--r--nix/systemrdl-compiler.nix32
5 files changed, 107 insertions, 2 deletions
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;
+ };
+}