guix_mirror_bot pushed a commit to branch next-master
in repository guix.

commit 58fb3cf5166a1de39e96a149d42f4a38fd43071a
Author: Cayetano Santos <[email protected]>
AuthorDate: Fri Jan 23 12:26:29 2026 +0100

    gnu: Add neorv32.
    
    * gnu/packages/hdl.scm: New variable.
    * CODEOWNERS: Regenerate.
    * gnu/local.mk: Register.
    * po/packages/POTFILES.in: Likewise.
    * etc/teams.scm (electronics)<#:scope>: Add "gnu/packages/hdl.scm".
    
    Change-Id: I188087a03272b9a63f23fd96c9cd2af7228dc0d9
---
 CODEOWNERS              |  1 +
 etc/teams.scm           |  1 +
 gnu/local.mk            |  1 +
 gnu/packages/hdl.scm    | 89 +++++++++++++++++++++++++++++++++++++++++++++++++
 po/packages/POTFILES.in |  1 +
 5 files changed, 93 insertions(+)

diff --git a/CODEOWNERS b/CODEOWNERS
index 0a0015208f..86dabfda2d 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -146,6 +146,7 @@ gnu/system/examples/lightweight-desktop\.tmpl      
@guix/documentation
 gnu/system/examples/desktop\.tmpl                  @guix/documentation
 
 gnu/packages/electronics\.scm                      @guix/electronics
+gnu/packages/hdl\.scm                              @guix/electronics
 gnu/packages/libftdi\.scm                          @guix/electronics
 gnu/packages/engineering\.scm                      @guix/electronics
 gnu/packages/flashing-tools\.scm                   @guix/electronics
diff --git a/etc/teams.scm b/etc/teams.scm
index 53b61dab67..bf6595b757 100755
--- a/etc/teams.scm
+++ b/etc/teams.scm
@@ -630,6 +630,7 @@ of Rebar and Mix build systems and Hex.pm importer."
         #:name "Electronics team"
         #:description "Electronics and hardware related packages."
         #:scope (list "gnu/packages/electronics.scm"
+                      "gnu/packages/hdl.scm"
                       "gnu/packages/libftdi.scm"
                       "gnu/packages/engineering.scm"
                       "gnu/packages/flashing-tools.scm")))
diff --git a/gnu/local.mk b/gnu/local.mk
index 2fd563fa56..b32e86329a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -367,6 +367,7 @@ GNU_SYSTEM_MODULES =                                \
   %D%/packages/haskell-web.scm                 \
   %D%/packages/haskell-xyz.scm                 \
   %D%/packages/haxe.scm                                \
+  %D%/packages/hdl.scm                         \
   %D%/packages/heads.scm                       \
   %D%/packages/hexedit.scm                     \
   %D%/packages/high-availability.scm                   \
diff --git a/gnu/packages/hdl.scm b/gnu/packages/hdl.scm
new file mode 100644
index 0000000000..c8ad7c2223
--- /dev/null
+++ b/gnu/packages/hdl.scm
@@ -0,0 +1,89 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2026 Cayetano Santos <[email protected]>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages hdl)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system copy)
+  #:use-module (guix gexp)
+  #:use-module (guix git-download)
+  #:use-module (guix packages)
+  #:use-module (gnu packages electronics))
+
+(define-public neorv32
+  (package
+    (name "neorv32")
+    (version "1.12.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/stnolting/neorv32";)
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "030djnf5ww4b2w6lhb9lpprq2iawf8v93rmmgfgnbr56k4blyyk6"))))
+    (outputs
+     '("out" "neorv32"))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:tests? #f            ;FIXME: nvc checksum errors inside the build env
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'install 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (substitute* '("rtl/file_list_cpu.f" "rtl/file_list_soc.f")
+                  (("NEORV32_RTL_PATH_PLACEHOLDER") "rtl"))
+                (for-each
+                 (lambda (f)
+                   (invoke
+                    "sh" "-c"
+                    (format #f "cat rtl/~a.f | xargs nvc --work=neorv32 -a" 
f)))
+                 '("file_list_soc" "file_list_cpu"))
+                (for-each
+                 (lambda (f)
+                   (invoke "nvc" "--work=neorv32" "-a" f))
+                 `("sim/sim_uart_rx.vhd"
+                   ,@(find-files "sim" "x.*\\.vhd$")
+                   "sim/neorv32_tb.vhd"))
+                (invoke "nvc" "--work=neorv32" "-e" "neorv32_tb")
+                (invoke "nvc" "--work=neorv32" "-r" "--stop-time=10ms"
+                        "neorv32_tb")))))
+      #:install-plan
+      #~'(("rtl" "share/neorv32/work/rtl"
+           #:exclude-regexp (".*\\.f$" ".*\\.sh$"))
+          ("rtl" "share/neorv32/neorv32/rtl"
+           #:exclude-regexp (".*\\.f$" ".*\\.sh$")
+           #:output "neorv32"))))
+    (native-inputs (list nvc))
+    (native-search-paths
+     (list (search-path-specification
+             (variable "FW_NEORV32")
+             (separator #f)
+             (files (list "share/neorv32")))))
+    (home-page "https://stnolting.github.io/neorv32/";)
+    (synopsis "RISC-V soft core CPU in VHDL")
+    (description
+     "Neorv32 is a small, customizable 32 bits microcontroller-like system on
+chip written in platform-independent VHDL.")
+    (properties
+     `((output-synopsis "out" "Instance this design library as work")
+       (output-synopsis "neorv32" "Instance this design library as neorv32")))
+    (license license:bsd-3)))
diff --git a/po/packages/POTFILES.in b/po/packages/POTFILES.in
index 8aecdecf56..68055e36c7 100644
--- a/po/packages/POTFILES.in
+++ b/po/packages/POTFILES.in
@@ -198,6 +198,7 @@ gnu/packages/haskell-web.scm
 gnu/packages/haskell-xyz.scm
 gnu/packages/haskell.scm
 gnu/packages/haxe.scm
+gnu/packages/hdl.scm
 gnu/packages/heads.scm
 gnu/packages/hexedit.scm
 gnu/packages/high-availability.scm

Reply via email to