~ruther/guix-local

ref: e72ccef56625fbaf8a80bea9af60bee6a0d6e806 guix-local/gnu/packages/hdl.scm -rw-r--r-- 3.5 KiB
e72ccef5 — Murilo gnu: hyprland: Update to 0.53.3. 30 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2026 Cayetano Santos <csantosb@inventati.org>
;;;
;;; 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)))