From 1ffcdb62cd7e95ccd3f971d0b5cb2e617e1481b2 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 5 May 2024 18:19:50 -0600 Subject: nix: patch peakrdl-regblock to silence verilator's MULTIDRIVEN warning --- nix/peakrdl-regblock.nix | 38 -------------------- nix/peakrdl.nix | 31 ---------------- .../0001-Add-verilator-MULTIDRIVEN-hack.patch | 24 +++++++++++++ nix/peakrdl/peakrdl-regblock.nix | 42 ++++++++++++++++++++++ nix/peakrdl/peakrdl.nix | 31 ++++++++++++++++ nix/peakrdl/systemrdl-compiler.nix | 32 +++++++++++++++++ nix/systemrdl-compiler.nix | 32 ----------------- 7 files changed, 129 insertions(+), 101 deletions(-) delete mode 100644 nix/peakrdl-regblock.nix delete mode 100644 nix/peakrdl.nix create mode 100644 nix/peakrdl/0001-Add-verilator-MULTIDRIVEN-hack.patch create mode 100644 nix/peakrdl/peakrdl-regblock.nix create mode 100644 nix/peakrdl/peakrdl.nix create mode 100644 nix/peakrdl/systemrdl-compiler.nix delete mode 100644 nix/systemrdl-compiler.nix (limited to 'nix') diff --git a/nix/peakrdl-regblock.nix b/nix/peakrdl-regblock.nix deleted file mode 100644 index daacc5a..0000000 --- a/nix/peakrdl-regblock.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ 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 deleted file mode 100644 index 48cf1fa..0000000 --- a/nix/peakrdl.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ 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/peakrdl/0001-Add-verilator-MULTIDRIVEN-hack.patch b/nix/peakrdl/0001-Add-verilator-MULTIDRIVEN-hack.patch new file mode 100644 index 0000000..13bf7c1 --- /dev/null +++ b/nix/peakrdl/0001-Add-verilator-MULTIDRIVEN-hack.patch @@ -0,0 +1,24 @@ +From aef302875ec38e6f91e04f9368ba0ed84cc73b69 Mon Sep 17 00:00:00 2001 +From: Alejandro Soto +Date: Sun, 5 May 2024 18:17:10 -0600 +Subject: [PATCH] Add verilator MULTIDRIVEN hack + +--- + src/peakrdl_regblock/module_tmpl.sv | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/peakrdl_regblock/module_tmpl.sv b/src/peakrdl_regblock/module_tmpl.sv +index bcb8566..92183b5 100644 +--- a/src/peakrdl_regblock/module_tmpl.sv ++++ b/src/peakrdl_regblock/module_tmpl.sv +@@ -27,6 +27,7 @@ module {{ds.module_name}} + {{hwif.port_declaration|indent(8)}} + ); + ++ // verilator lint_off MULTIDRIVEN + //-------------------------------------------------------------------------- + // CPU Bus interface logic + //-------------------------------------------------------------------------- +-- +2.42.0 + diff --git a/nix/peakrdl/peakrdl-regblock.nix b/nix/peakrdl/peakrdl-regblock.nix new file mode 100644 index 0000000..3a3f0f6 --- /dev/null +++ b/nix/peakrdl/peakrdl-regblock.nix @@ -0,0 +1,42 @@ +{ 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="; + }; + + patches = [ + ./0001-Add-verilator-MULTIDRIVEN-hack.patch + ]; + + 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/peakrdl.nix b/nix/peakrdl/peakrdl.nix new file mode 100644 index 0000000..48cf1fa --- /dev/null +++ b/nix/peakrdl/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/peakrdl/systemrdl-compiler.nix b/nix/peakrdl/systemrdl-compiler.nix new file mode 100644 index 0000000..00c92d7 --- /dev/null +++ b/nix/peakrdl/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; + }; +} diff --git a/nix/systemrdl-compiler.nix b/nix/systemrdl-compiler.nix deleted file mode 100644 index 00c92d7..0000000 --- a/nix/systemrdl-compiler.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ 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