summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCayetano Santos <csantosb@inventati.org>2025-09-14 18:43:57 +0200
committerGabriel Wicki <gabriel@erlikon.ch>2025-09-17 11:36:57 +0200
commitd970689f80ef554a8a8771808e1d036e1dac74c8 (patch)
tree5c1acbf1c2b36183c23630d69dc17e9c31e3d17d
parent7c5054876a6bd43daf19a2951d93ed7aa9270837 (diff)
gnu: Merge fpga in electronics module.
* gnu/local.mk: Drop fpga.scm. * etc/teams: Drop fpga.scm. * CODEOWNERS: Drop fpga.scm. * po/packages/POTFILES.in: Drop fpga.scm. * gnu/packages/fpga.scm: Remove file. (abc, abc-yosyshq, apycula, fftgen, gtkwave, iverilog, icestorm, libfst) (nextpnr, nextpnr-ice40, nvc, openfpgaloader, python-hdlmake) (python-migen, python-myhdl, python-vunit, systemc, verilator) (yosys, yosys-clang): Move from here… * gnu/packages/electronics.scm: … to here. Change-Id: Ia920313a383d21210b217e3bf3f5c60c4682fc43
-rw-r--r--CODEOWNERS1
-rwxr-xr-xetc/teams.scm3
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/electronics.scm902
-rw-r--r--gnu/packages/emacs-xyz.scm2
-rw-r--r--gnu/packages/fpga.scm920
-rw-r--r--po/packages/POTFILES.in1
7 files changed, 901 insertions, 929 deletions
diff --git a/CODEOWNERS b/CODEOWNERS
index 3d840a915af..e30e1815d25 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -126,7 +126,6 @@ gnu/system/examples/bare-bones\.tmpl @guix/documentation
126gnu/system/examples/lightweight-desktop\.tmpl @guix/documentation 126gnu/system/examples/lightweight-desktop\.tmpl @guix/documentation
127gnu/system/examples/desktop\.tmpl @guix/documentation 127gnu/system/examples/desktop\.tmpl @guix/documentation
128 128
129gnu/packages/fpga\.scm @guix/electronics
130gnu/packages/electronics\.scm @guix/electronics 129gnu/packages/electronics\.scm @guix/electronics
131gnu/packages/libftdi\.scm @guix/electronics 130gnu/packages/libftdi\.scm @guix/electronics
132gnu/packages/engineering\.scm @guix/electronics 131gnu/packages/engineering\.scm @guix/electronics
diff --git a/etc/teams.scm b/etc/teams.scm
index 18b7aca0aa2..33f72a96009 100755
--- a/etc/teams.scm
+++ b/etc/teams.scm
@@ -601,8 +601,7 @@ already exists. Lookup team IDs among CURRENT-TEAMS."
601 (team 'electronics 601 (team 'electronics
602 #:name "Electronics team" 602 #:name "Electronics team"
603 #:description "Electronics and hardware related packages." 603 #:description "Electronics and hardware related packages."
604 #:scope (list "gnu/packages/fpga.scm" 604 #:scope (list "gnu/packages/electronics.scm"
605 "gnu/packages/electronics.scm"
606 "gnu/packages/libftdi.scm" 605 "gnu/packages/libftdi.scm"
607 "gnu/packages/engineering.scm"))) 606 "gnu/packages/engineering.scm")))
608 607
diff --git a/gnu/local.mk b/gnu/local.mk
index ab14fe8f68f..415be7c4347 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -291,7 +291,6 @@ GNU_SYSTEM_MODULES = \
291 %D%/packages/fluidplug.scm \ 291 %D%/packages/fluidplug.scm \
292 %D%/packages/fonts.scm \ 292 %D%/packages/fonts.scm \
293 %D%/packages/fontutils.scm \ 293 %D%/packages/fontutils.scm \
294 %D%/packages/fpga.scm \
295 %D%/packages/forth.scm \ 294 %D%/packages/forth.scm \
296 %D%/packages/fortran-check.scm \ 295 %D%/packages/fortran-check.scm \
297 %D%/packages/fortran-xyz.scm \ 296 %D%/packages/fortran-xyz.scm \
diff --git a/gnu/packages/electronics.scm b/gnu/packages/electronics.scm
index cb2a7a0bd2b..e24a1f72c73 100644
--- a/gnu/packages/electronics.scm
+++ b/gnu/packages/electronics.scm
@@ -2,16 +2,24 @@
2;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <theodoros@foradis.org> 2;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <theodoros@foradis.org>
3;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr> 3;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
4;;; Copyright © 2019 Clément Lassieur <clement@lassieur.org> 4;;; Copyright © 2019 Clément Lassieur <clement@lassieur.org>
5;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il> 5;;; Copyright © 2021, 2024 Efraim Flashner <efraim@flashner.co.il>
6;;; Copyright © 2021 Leo Famulari <leo@famulari.name> 6;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
7;;; Copyright © 2022, 2023, 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com> 7;;; Copyright © 2022, 2023, 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
8;;; Copyright © 2024 Juliana Sims <juli@incana.org> 8;;; Copyright © 2024 Juliana Sims <juli@incana.org>
9;;; Copyright © 2025 Cayetano Santos <csantosb@inventati.org> 9;;; Copyright © 2025 Cayetano Santos <csantosb@inventati.org>
10;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com> 10;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com>
11;;; Copyright © 2022 Konstantinos Agiannis <agiannis.kon@gmail.com> 11;;; Copyright © 2022 Konstantinos Agiannis <agiannis.kon@gmail.com>
12;;; Copyright © 2018-2021 Tobias Geerinckx-Rice <me@tobias.gr>
13;;; Copyright © 2015-2025 Ricardo Wurmus <rekado@elephly.net> 12;;; Copyright © 2015-2025 Ricardo Wurmus <rekado@elephly.net>
14;;; Copyright © 2022, 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com> 13;;; Copyright © 2022, 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com>
14;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
15;;; Copyright © 2019 Amin Bandali <bandali@gnu.org>
16;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
17;;; Copyright © 2021 Andrew Miloradovsky <andrew@interpretmath.pw>
18;;; Copyright © 2022 Christian Gelinek <cgelinek@radlogic.com.au>
19;;; Copyright © 2022 jgart <jgart@dismail.de>
20;;; Copyright © 2023 Simon South <simon@simonsouth.net>
21;;; Copyright © 2024 Jakob Kirsch <jakob.kirsch@web.de>
22;;; Copyright © 2025 Zheng Junjie <873216071@qq.com>
15;;; 23;;;
16;;; This file is part of GNU Guix. 24;;; This file is part of GNU Guix.
17;;; 25;;;
@@ -34,8 +42,11 @@
34 #:use-module (guix build-system copy) 42 #:use-module (guix build-system copy)
35 #:use-module (guix build-system glib-or-gtk) 43 #:use-module (guix build-system glib-or-gtk)
36 #:use-module (guix build-system gnu) 44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system meson)
37 #:use-module (guix build-system pyproject) 46 #:use-module (guix build-system pyproject)
47 #:use-module (guix build-system python)
38 #:use-module (guix build-system qt) 48 #:use-module (guix build-system qt)
49 #:use-module (guix deprecation)
39 #:use-module (guix download) 50 #:use-module (guix download)
40 #:use-module (guix gexp) 51 #:use-module (guix gexp)
41 #:use-module (guix git-download) 52 #:use-module (guix git-download)
@@ -52,46 +63,136 @@
52 #:use-module (gnu packages check) 63 #:use-module (gnu packages check)
53 #:use-module (gnu packages cmake) 64 #:use-module (gnu packages cmake)
54 #:use-module (gnu packages compression) 65 #:use-module (gnu packages compression)
66 #:use-module (gnu packages cpp)
55 #:use-module (gnu packages documentation) 67 #:use-module (gnu packages documentation)
68 #:use-module (gnu packages elf)
56 #:use-module (gnu packages engineering) 69 #:use-module (gnu packages engineering)
57 #:use-module (gnu packages embedded) 70 #:use-module (gnu packages embedded)
58 #:use-module (gnu packages flex) 71 #:use-module (gnu packages flex)
59 #:use-module (gnu packages freedesktop) 72 #:use-module (gnu packages freedesktop)
60 #:use-module (gnu packages fontutils) 73 #:use-module (gnu packages fontutils)
61 #:use-module (gnu packages fpga)
62 #:use-module (gnu packages gawk) 74 #:use-module (gnu packages gawk)
63 #:use-module (gnu packages gd) 75 #:use-module (gnu packages gd)
76 #:use-module (gnu packages gdb)
77 #:use-module (gnu packages gettext)
78 #:use-module (gnu packages ghostscript)
64 #:use-module (gnu packages gl) 79 #:use-module (gnu packages gl)
65 #:use-module (gnu packages glib) 80 #:use-module (gnu packages glib)
66 #:use-module (gnu packages gnome) 81 #:use-module (gnu packages gnome)
67 #:use-module (gnu packages gperf) 82 #:use-module (gnu packages gperf)
68 #:use-module (gnu packages graphviz) 83 #:use-module (gnu packages graphviz)
69 #:use-module (gnu packages gtk) 84 #:use-module (gnu packages gtk)
85 #:use-module (gnu packages libffi)
70 #:use-module (gnu packages libftdi) 86 #:use-module (gnu packages libftdi)
71 #:use-module (gnu packages libusb) 87 #:use-module (gnu packages libusb)
72 #:use-module (gnu packages linux) 88 #:use-module (gnu packages linux)
89 #:use-module (gnu packages llvm)
90 #:use-module (gnu packages man)
73 #:use-module (gnu packages maths) 91 #:use-module (gnu packages maths)
74 #:use-module (gnu packages m4) 92 #:use-module (gnu packages m4)
75 #:use-module (gnu packages maths) 93 #:use-module (gnu packages maths)
94 #:use-module (gnu packages perl)
76 #:use-module (gnu packages pkg-config) 95 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages python) 96 #:use-module (gnu packages python)
78 #:use-module (gnu packages python-build) 97 #:use-module (gnu packages python-build)
79 #:use-module (gnu packages python-check) 98 #:use-module (gnu packages python-check)
80 #:use-module (gnu packages python-xyz) 99 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages qt) 100 #:use-module (gnu packages qt)
101 #:use-module (gnu packages readline)
102 #:use-module (gnu packages ruby)
82 #:use-module (gnu packages sdl) 103 #:use-module (gnu packages sdl)
83 #:use-module (gnu packages serialization) 104 #:use-module (gnu packages serialization)
105 #:use-module (gnu packages sphinx)
84 #:use-module (gnu packages sqlite) 106 #:use-module (gnu packages sqlite)
85 #:use-module (gnu packages stb) 107 #:use-module (gnu packages stb)
86 #:use-module (gnu packages swig) 108 #:use-module (gnu packages swig)
109 #:use-module (gnu packages texinfo)
87 #:use-module (gnu packages textutils) 110 #:use-module (gnu packages textutils)
88 #:use-module (gnu packages tcl) 111 #:use-module (gnu packages tcl)
89 #:use-module (gnu packages tls) 112 #:use-module (gnu packages tls)
90 #:use-module (gnu packages toolkits) 113 #:use-module (gnu packages toolkits)
91 #:use-module (gnu packages version-control) 114 #:use-module (gnu packages version-control)
115 #:use-module (gnu packages web)
92 #:use-module (gnu packages xorg) 116 #:use-module (gnu packages xorg)
93 #:use-module (gnu packages xml)) 117 #:use-module (gnu packages xml))
94 118
119(define-public abc
120 (let ((commit "e29dcd9f3275874c8d31a2f781487efac1dabb7b")
121 (revision "6"))
122 (package
123 (name "abc")
124 (version (git-version "0.0" revision commit))
125 (source (origin
126 (method git-fetch)
127 (uri (git-reference
128 (url "https://github.com/berkeley-abc/abc")
129 (commit commit)))
130 (file-name (git-file-name name version))
131 (sha256
132 (base32
133 "18g4i1kdsxvp25p5z3wja4jkxppgrp6ybxal9y2p2d2qvlafiw5z"))))
134 (build-system gnu-build-system)
135 (inputs
136 (list readline))
137 (arguments
138 (list #:license-file-regexp "copyright.txt"
139 #:tests? #f ; no tests
140 #:phases
141 #~(modify-phases %standard-phases
142 (delete 'configure)
143 (replace 'install
144 (lambda _
145 (install-file "abc" (string-append #$output "/bin")))))))
146 (home-page "https://people.eecs.berkeley.edu/~alanmi/abc/")
147 (synopsis "Sequential logic synthesis and formal verification")
148 (description "ABC is a program for sequential logic synthesis and
149formal verification.")
150 (license
151 (license:non-copyleft
152 "https://people.eecs.berkeley.edu/~alanmi/abc/copyright.htm")))))
153
154(define-public abc-yosyshq
155 (package
156 (inherit abc)
157 (name "abc-yosyshq")
158 (version "0.57")
159 (source (origin
160 (method git-fetch)
161 (uri (git-reference
162 (url "https://github.com/YosysHQ/abc/")
163 (commit (string-append "v" version))))
164 (file-name (git-file-name name version))
165 (sha256
166 (base32
167 "191hsznsmsjn8100n50qsh3ng8wgrnyfhr7qcnb8yskiwqp37pjh"))))
168 (home-page "https://github.com/YosysHQ/abc/")
169 (description "ABC is a program for sequential logic synthesis and
170formal verification. This is the Yosyshq fork of ABC.")
171 (license (license:non-copyleft "file:///copyright.txt"))))
172
173(define-public apycula
174 (package
175 (name "apycula")
176 (version "0.24")
177 ;; The pypi tar.gz file includes the necessary .pickle files, not available
178 ;; in the home-page repository.
179 (source
180 (origin
181 (method url-fetch)
182 (uri (pypi-uri "apycula" version))
183 (sha256
184 (base32 "1mlasq8lf90jcdwp4sk5a834bbmnnfxk2gswwcw83ypg75lli1gw"))))
185 (build-system pyproject-build-system)
186 (arguments (list #:tests? #f)) ;requires Gowin EDA tools
187 (inputs (list python-crc))
188 (native-inputs (list python-setuptools python-wheel))
189 (home-page "https://github.com/YosysHQ/apicula/")
190 (synopsis "Gowin FPGA bitstream format")
191 (description
192 "The project Apycula provides tools to support development and
193generating bitstreams with Gowin FPGAs.")
194 (license license:expat)))
195
95(define-public camv-rnd 196(define-public camv-rnd
96 (package 197 (package
97 (name "camv-rnd") 198 (name "camv-rnd")
@@ -147,6 +248,192 @@ individual low-level driver modules.")
147 (home-page "https://www.comedi.org/") 248 (home-page "https://www.comedi.org/")
148 (license license:lgpl2.1))) 249 (license license:lgpl2.1)))
149 250
251(define-public fftgen
252 (let ((commit "3378b77d83a98b06184656a5cb9b54e50dfe4485") ;no releases
253 (revision "1"))
254 (package
255 (name "fftgen")
256 (version (git-version "0" revision commit))
257 (source
258 (origin
259 (method git-fetch)
260 (uri (git-reference
261 (url "https://github.com/ZipCPU/dblclockfft")
262 (commit commit)))
263 (file-name (git-file-name name version))
264 (sha256
265 (base32
266 "1rvln871wjkbbqnv88jnx328xlhn5sgbr8fglk3ajnd9rwgiq3jg"))))
267 (build-system gnu-build-system)
268 (arguments
269 (list
270 #:test-target "bench-test"
271 #:make-flags #~(list "CFLAGS=-g -O2") ;default flags lack -O2
272 #:phases
273 #~(modify-phases %standard-phases
274 (delete 'configure)
275 (replace 'install
276 (lambda _
277 (install-file "sw/fftgen"
278 (string-append #$output "/bin")))))))
279 (native-inputs (list bc fftw python-minimal verilator which))
280 (synopsis "Generic pipelined FFT core generator")
281 (description "fftgen produces @acronym{FFT, fast-Fourier transforms}
282hardware designs in Verilog.")
283 (home-page "https://github.com/ZipCPU/zipcpu/")
284 (license license:lgpl3+))))
285
286(define-public gtkwave
287 ;; The last release is more than 2 years old, and there are improvements in
288 ;; the master branch, such as GTK 4 support: pick the latest commit that
289 ;; passes their CI.
290 (let ((commit "bb978d9d667d569b9153ffa34007e300302907dc")
291 (revision "0"))
292 (package
293 (name "gtkwave")
294 ;; The version string can be found in meson.build.
295 (version (git-version "3.4.0" revision commit))
296 (source
297 (origin
298 (method git-fetch)
299 (uri (git-reference
300 (url "https://github.com/gtkwave/gtkwave")
301 (commit commit)))
302 (file-name (git-file-name name version))
303 (sha256
304 (base32 "1nv27cpz5937cb6bkhpw8w0ji6hm9xr8f0znvfwzfl1fwwypf23y"))))
305 (build-system meson-build-system)
306 (arguments (list #:glib-or-gtk? #t))
307 (native-inputs (list desktop-file-utils
308 flex
309 `(,glib "bin") ;for glib-mkenums
310 gobject-introspection
311 gperf
312 `(,gtk "bin")
313 pkg-config))
314 (inputs (list gtk gtk+ libfst))
315 (synopsis "Waveform viewer for FPGA simulator trace files")
316 (description "This package is a waveform viewer for @acronym{FST, FPGA
317Simulator Trace} files.")
318 (home-page "https://github.com/gtkwave/gtkwave")
319 ;; Exception against free government use in tcl_np.c and tcl_np.h.
320 (license (list license:gpl2+ license:expat license:tcl/tk)))))
321
322(define-public iverilog
323 (package
324 (name "iverilog")
325 (version "12.0")
326 (source
327 (origin
328 (method git-fetch)
329 (uri (git-reference
330 (url "https://github.com/steveicarus/iverilog")
331 (commit
332 (string-append "v" (string-replace-substring version "." "_")))))
333 (file-name (git-file-name name version))
334 (sha256
335 (base32 "1cm3ksxyyp8ihs0as5c2nk3a0y2db8dmrrw0f9an3sl255smxn17"))))
336 (build-system gnu-build-system)
337 (arguments
338 (list
339 #:bootstrap-scripts #~(list "autoconf.sh")
340 #:phases #~(modify-phases %standard-phases
341 (add-after 'unpack 'ensure-native-baked-CC/CXX
342 (lambda _
343 ;; The compilers used to build are retained in
344 ;; bin/iverilog-vpi, which is a Makefile
345 ;; script. Normalize these to just 'gcc' and 'g++' to
346 ;; avoid having these set to cross compilers.
347 (substitute* "Makefile.in"
348 (("s;@IVCC@;\\$\\(CC);")
349 "s;@IVCC@;gcc;")
350 (("s;@IVCXX@;\\$\\(CXX);")
351 "s;@IVCXX@;g++;")))))))
352 (native-inputs (list autoconf bison flex gperf))
353 (inputs (list zlib))
354 (home-page "https://steveicarus.github.io/iverilog/")
355 (synopsis "FPGA Verilog simulation and synthesis tool")
356 (description
357 "Icarus Verilog is a Verilog simulation and synthesis tool.
358It operates as a compiler, compiling source code written in Verilog
359(IEEE-1364) into some target format.
360For batch simulation, the compiler can generate an intermediate form
361called vvp assembly.
362This intermediate form is executed by @command{vvp}.
363For synthesis, the compiler generates netlists in the desired format.")
364 ;; GPL2 only because of:
365 ;; - ./driver/iverilog.man.in
366 ;; - ./iverilog-vpi.man.in
367 ;; - ./tgt-fpga/iverilog-fpga.man
368 ;; - ./vvp/vvp.man.in
369 ;; Otherwise would be GPL2+.
370 ;; You have to accept both GPL2 and LGPL2.1+.
371 (license (list license:gpl2 license:lgpl2.1+))))
372
373(define-public icestorm
374 (let ((commit "3cdcf4b009bb8681ab7e2e09d65043f04334b60e")
375 (revision "5"))
376 (package
377 (name "icestorm")
378 (version (git-version "0.0" revision commit))
379 (source
380 (origin
381 (method git-fetch)
382 (uri (git-reference
383 (url "https://github.com/YosysHQ/icestorm/")
384 (commit commit)))
385 (file-name (git-file-name name version))
386 (sha256
387 (base32 "0ygp6cj7grlnyji572kx215p2mw4crllskif9g795f390bp38g68"))))
388 (build-system gnu-build-system)
389 (arguments
390 (list
391 #:tests? #f ;avoid a cyclic dependency with nextpr-ice40
392 #:make-flags
393 #~(list (string-append "CC="
394 #$(cc-for-target))
395 (string-append "CXX="
396 #$(cxx-for-target))
397 (string-append "PREFIX="
398 #$output)
399 "ICEPROG=1")
400 #:phases
401 #~(modify-phases %standard-phases
402 (add-after 'unpack 'fix-usr-local
403 (lambda* (#:key outputs #:allow-other-keys)
404 (substitute* "icepack/Makefile"
405 (("/usr/local")
406 #$output))
407 (substitute* "icebox/Makefile"
408 (("/usr/local")
409 #$output))
410 (substitute* "icebox/icebox_vlog.py"
411 (("/usr/local")
412 #$output))))
413 (add-after 'build 'make-info
414 (lambda* (#:key outputs #:allow-other-keys)
415 (with-directory-excursion "docs"
416 (invoke "make" "info")
417 (install-file "build/texinfo/projecticestorm.info"
418 (string-append #$output "/share/info"))
419 (copy-recursively "build/texinfo/projecticestorm-figures"
420 (string-append #$output
421 "/share/info/projecticestorm-figures")))))
422 (delete 'configure))))
423 (inputs (list libftdi))
424 (native-inputs (list pkg-config
425 python
426 python-sphinx
427 python-sphinx-rtd-theme
428 texinfo))
429 (home-page "https://prjicestorm.readthedocs.io/")
430 (synopsis "Bitstream tools for Lattice iCE40 FPGAs")
431 (description
432 "Project IceStorm aims at documenting the bitstream format of
433Lattice iCE40 FPGAs and providing simple tools for analyzing and creating bitstream
434files.")
435 (license license:isc))))
436
150(define-public json-for-vhdl 437(define-public json-for-vhdl
151 ;; No tagged releases. 438 ;; No tagged releases.
152 (let ((commit "0dc9e317440263cd4941f157f5e5668baa858ec2") 439 (let ((commit "0dc9e317440263cd4941f157f5e5668baa858ec2")
@@ -229,6 +516,33 @@ used in the declarative section of design units.")
229@end itemize") 516@end itemize")
230 (license license:gpl2+))) 517 (license license:gpl2+)))
231 518
519(define-public libfst
520 ;; There are no release nor tags.
521 (let ((commit "6a52070cd62ec65c29832bc95e7db493504aa7ac")
522 (revision "0"))
523 (package
524 (name "libfst")
525 (version (git-version "1.0.0" revision commit))
526 (source
527 (origin
528 (method git-fetch)
529 (uri (git-reference
530 (url "https://github.com/gtkwave/libfst/")
531 (commit commit)))
532 (file-name (git-file-name name version))
533 (sha256
534 (base32 "0b1r660m5aib316jjl4nhs10y7vhhqy2mvxjip3ynahig3hpi46z"))))
535 (build-system meson-build-system)
536 (native-inputs (list gobject-introspection pkg-config))
537 (inputs (list bzip2))
538 (propagated-inputs (list zlib)) ;in Requires.private of libfst.pc
539 (synopsis "Fast Signal Trace (FST) format waveforms library")
540 (description "Libfst is a small library used to read and write
541@acronym{FST, Fast Signal Trace} format waveforms.")
542 (home-page "https://github.com/gtkwave/libfst/")
543 (license (list license:expat ;libfst and fastlz-derived sources
544 license:bsd-2))))) ;for lz4-derived sources
545
232(define-public libserialport 546(define-public libserialport
233 (package 547 (package
234 (name "libserialport") 548 (name "libserialport")
@@ -407,6 +721,172 @@ which allows one to install the M8 firmware on any Teensy.")
407 license:public-domain 721 license:public-domain
408 license:zlib)))) 722 license:zlib))))
409 723
724(define-public nextpnr
725 ;; Necessary for compatibility with latest apycula.
726 ;; TODO: Remove with release 0.9.
727 (let ((commit "d796cc720b60ccc18580c686d93c8751fe461532")
728 (revision "0"))
729 (package
730 (name "nextpnr")
731 (version (git-version "0.8" revision commit))
732 (source
733 (origin
734 (method git-fetch)
735 (uri (git-reference
736 (url "https://github.com/YosysHQ/nextpnr/")
737 (commit commit)
738 ;; XXX: Fetch some bundled libraries such as QtPropertyBrowser,
739 ;; json11 and python-console, which have custom modifications or
740 ;; no longer have their original upstream.
741 (recursive? #t)))
742 (file-name (git-file-name name version))
743 (modules '((guix build utils)
744 (ice-9 ftw)
745 (srfi srfi-26)))
746 (snippet
747 '(begin
748 ;; XXX: 'delete-all-but' is copied from the turbovnc package.
749 (define (delete-all-but directory . preserve)
750 (with-directory-excursion directory
751 (let* ((pred (negate (cut member <>
752 (cons* "." ".." preserve))))
753 (items (scandir "." pred)))
754 (for-each (cut delete-file-recursively <>) items))))
755 (delete-all-but "3rdparty"
756 ;; The following sources have all been patched, so
757 ;; cannot easily be unbundled.
758 "QtPropertyBrowser"
759 "json11"
760 "python-console"
761 "oourafft")))
762 (patches (search-patches "nextpnr-gtest.patch"
763 "nextpnr-imgui.patch"))
764 (sha256
765 (base32 "1arj25vad76wg6b5yaaky4cby5zp9v92pdd4y3l0kxi7wvxhmmya"))))
766 (build-system qt-build-system)
767 (arguments
768 (list
769 #:cmake cmake ;CMake 3.25 or higher is required.
770 #:configure-flags
771 ;; TODO: enable more architectures?
772 #~(list "-DARCH=generic;ice40;ecp5;himbaechel"
773 "-DBUILD_GUI=ON"
774 "-DUSE_OPENMP=ON"
775 "-DBUILD_TESTS=ON"
776 "-DHIMBAECHEL_UARCH=ng-ultra;gowin"
777 "-DHIMBAECHEL_NGULTRA_DEVICES=ng-ultra"
778 "-DHIMBAECHEL_SPLIT=ON"
779 "-DHIMBAECHEL_PRJBEYOND_DB=/tmp/prjbeyond-db"
780 (string-append "-DCURRENT_GIT_VERSION=nextpnr-" #$version)
781 (string-append "-DICESTORM_INSTALL_PREFIX="
782 #$(this-package-input "icestorm"))
783 (string-append "-DTRELLIS_INSTALL_PREFIX="
784 #$(this-package-input "prjtrellis"))
785 "-DUSE_IPO=OFF")
786 #:phases
787 #~(modify-phases %standard-phases
788 ;; Required by himbaechel architecture, ng-ultra support.
789 (add-after 'unpack 'get-prjbeyond-db
790 (lambda _
791 (copy-recursively
792 #$(origin
793 (method git-fetch)
794 (uri (git-reference
795 (url "https://github.com/yosyshq-GmbH/prjbeyond-db/")
796 ;; We take latest commit, as indicated in nextpnr’s
797 ;; README.md file
798 (commit "06d3b424dd0e52d678087c891c022544238fb9e3")))
799 (sha256
800 (base32
801 "17dd3cgms2fy6xvz7magdmvv92km4cqh2kz9dyjrvz5y8caqav4y")))
802 "/tmp/prjbeyond-db")))
803 (add-after 'unpack 'unbundle-sanitizers-cmake
804 (lambda _
805 (substitute* "CMakeLists.txt"
806 ;; Use the system sanitizers-cmake module. This is made
807 ;; necessary 'sanitizers-cmake' installing a FindPackage
808 ;; module but no CMake config file.
809 (("\\$\\{CMAKE_SOURCE_DIR}/3rdparty/sanitizers-cmake/cmake")
810 (string-append
811 #$(this-package-native-input "sanitizers-cmake")
812 "/share/sanitizers-cmake/cmake"))))))))
813 (native-inputs
814 (list googletest
815 sanitizers-cmake))
816 (inputs
817 (list apycula
818 boost
819 corrosion
820 eigen
821 icestorm
822 prjtrellis
823 pybind11
824 python
825 qtbase-5
826 qtwayland-5
827 qtimgui
828 yosys))
829 (synopsis "Place-and-Route tool for FPGAs")
830 (description "Nextpnr is a portable FPGA place and route tool.")
831 (home-page "https://github.com/YosysHQ/nextpnr/")
832 (license license:isc))))
833
834(define-public nextpnr-ice40
835 (deprecated-package "nextpnr-ice40" nextpnr))
836
837(define-public nvc
838 (package
839 (name "nvc")
840 (version "1.17.2")
841 (source (origin
842 (method git-fetch)
843 (uri (git-reference
844 (url "https://github.com/nickg/nvc")
845 (commit (string-append "r" version))))
846 (file-name (git-file-name name version))
847 (sha256
848 (base32
849 "0hr5y9ys5kf096x18mh10wwqa0hbzlmdj7pyayc6szsjla1d3mk0"))))
850 (build-system gnu-build-system)
851 (arguments
852 (list #:out-of-source? #t
853 #:configure-flags
854 #~(list "--enable-tcl"
855 "--enable-llvm"
856 "--enable-verilog"
857 "--enable-vital"
858 "--enable-server"
859 "--with-ncurses"
860 "--enable-parallel-make"
861 "--enable-vital"
862 (string-append "--with-bash-completion=" #$output
863 "/share/bash-completion/completions"))
864 #:phases #~(modify-phases %standard-phases
865 (add-after 'unpack 'clean-up
866 (lambda _
867 (delete-file "autogen.sh"))))))
868 (native-inputs
869 (list automake
870 autoconf
871 check ; for the tests
872 flex
873 gettext-minimal
874 libtool
875 pkg-config
876 python-minimal
877 which))
878 (inputs
879 (list jansson
880 libffi
881 llvm
882 readline
883 tcl
884 `(,zstd "lib")))
885 (synopsis "VHDL compiler and simulator")
886 (description "This package provides a VHDL compiler and simulator.")
887 (home-page "https://www.nickg.me.uk/nvc/")
888 (license license:gpl3+)))
889
410(define-public openboardview 890(define-public openboardview
411 (package 891 (package
412 (name "openboardview") 892 (name "openboardview")
@@ -678,6 +1158,52 @@ formats.")
678GUI for sigrok.") 1158GUI for sigrok.")
679 (license license:gpl3+))) 1159 (license license:gpl3+)))
680 1160
1161(define-public openfpgaloader
1162 (package
1163 (name "openfpgaloader")
1164 (version "0.13.1")
1165 (source (origin
1166 (method git-fetch)
1167 (uri (git-reference
1168 (url "https://github.com/trabucayre/openfpgaloader")
1169 (commit (string-append "v" version))))
1170 (file-name (git-file-name name version))
1171 (sha256
1172 (base32
1173 "1p5qvr0bq27rp7f20ysjml7zy4bbwjx3s4yd5qjsg4b01mw4hbiq"))))
1174 (build-system cmake-build-system)
1175 (native-inputs
1176 (list pkg-config))
1177 (inputs (list eudev
1178 hidapi
1179 libftdi
1180 libgpiod
1181 libusb
1182 zlib))
1183 (arguments
1184 (list #:tests? #f ;no test suite
1185 #:phases
1186 #~(modify-phases %standard-phases
1187 (add-after 'install 'install-rules
1188 (lambda _
1189 (install-file
1190 "../source/99-openfpgaloader.rules"
1191 (string-append #$output "/lib/udev/rules.d/")))))))
1192 (synopsis "Utility for programming FPGA")
1193 (description "This package provides a program to transfer a bitstream
1194to an FPGA. To use @code{openfpgaloader} without root privileges it is
1195necessary to install the necessary udev rules. This can be done by extending
1196@code{udev-service-type} in the @code{operating-system} configuration file with
1197this package, as in:
1198@lisp
1199(udev-rules-service 'openfpgaloader openfpgaloader #:groups '(\"plugdev\")
1200@end lisp
1201Additionally, the @samp{plugdev} group should be registered in the
1202@code{supplementary-groups} field of your @code{user-account} declaration. Refer
1203to @samp{info \"(guix) Base Services\"} for examples.")
1204 (home-page "https://trabucayre.github.io/openFPGALoader/")
1205 (license license:asl2.0)))
1206
681(define-public osvvm 1207(define-public osvvm
682 (package 1208 (package
683 (name "osvvm") 1209 (name "osvvm")
@@ -862,6 +1388,105 @@ perhaps a couple of Verilog `defines, some top-level parameters/generics or
862some tool-specific options are set.") 1388some tool-specific options are set.")
863 (license license:bsd-2))) 1389 (license license:bsd-2)))
864 1390
1391(define-public python-hdlmake
1392 (let ((commit "c56cb8efa2000d06cec698f0149bc4ca4ef4e5bc")
1393 (revision "3"))
1394 (package
1395 (name "python-hdlmake")
1396 (version (git-version "3.3" revision commit))
1397 (source
1398 (origin
1399 (method git-fetch)
1400 (uri (git-reference
1401 (url "https://gitlab.com/ohwr/project/hdl-make/")
1402 (commit commit)))
1403 (file-name (git-file-name name version))
1404 (sha256
1405 (base32 "1w4b0g015rzfypr8sjyr8xqij6s2p5qxhxraswrhjvg1w86b6s36"))))
1406 (build-system pyproject-build-system)
1407 (arguments (list #:phases #~(modify-phases %standard-phases
1408 (add-before 'check 'chdir
1409 (lambda _
1410 (chdir "testsuite"))))
1411 #:test-flags #~(list "test_all.py")))
1412 (native-inputs (list python-pytest python-setuptools-next))
1413 (propagated-inputs (list python-networkx python-six))
1414 (home-page "https://ohwr.gitlab.io/project/hdl-make/")
1415 (synopsis "Generate multi-purpose makefiles for HDL projects")
1416 (description
1417 "Hdlmake helps manage and share @acronym{HDL, hardware description
1418language} code by automatically finding file dependencies, writing synthesis
1419and simulation Makefiles.")
1420 (license license:gpl3+))))
1421
1422(define-public python-migen
1423 ;; XXX: The latest version tag (0.9.2) was placed in 2019, there are latest
1424 ;; changes supporting Python 3.11 on master branch, see
1425 ;; <https://github.com/m-labs/migen/issues/259>.
1426 (let ((commit "6e3a9e150fb006dabc4b55043d3af18dbfecd7e8")
1427 (revision "1"))
1428 (package
1429 (name "python-migen")
1430 (version (git-version "0.9.2" revision commit))
1431 (source
1432 (origin
1433 ;; Tests fail in the PyPI tarball due to missing files.
1434 (method git-fetch)
1435 (uri (git-reference
1436 (url "https://github.com/m-labs/migen")
1437 (commit commit)))
1438 (file-name (git-file-name name version))
1439 (sha256
1440 (base32 "1hibhjnj5b3ka5y4nnqx9zp5w730gfqfa3r5injpa14i4cz6bj1n"))))
1441 (build-system pyproject-build-system)
1442 (native-inputs
1443 (list python-pytest
1444 python-setuptools-next))
1445 (propagated-inputs
1446 (list python-colorama))
1447 (home-page "https://m-labs.hk/gateware/migen/")
1448 (synopsis "Python toolbox for building complex digital hardware")
1449 (description
1450 "Migen FHDL is a Python library that replaces the event-driven paradigm
1451of Verilog and VHDL with the notions of combinatorial and synchronous
1452statements, has arithmetic rules that make integers always behave like
1453mathematical integers, and allows the design's logic to be constructed by a
1454Python program.")
1455 (license license:bsd-2))))
1456
1457(define-public python-myhdl
1458 (let ((commit "7dc29c242cd33cb835c336a81ffc3a461eaa92f4")
1459 (revision "0"))
1460 (package
1461 (name "python-myhdl")
1462 (version (git-version "0.11" revision commit))
1463 (source
1464 (origin
1465 (method git-fetch)
1466 (uri (git-reference
1467 (url "https://github.com/myhdl/myhdl/")
1468 (commit commit)))
1469 (file-name (git-file-name name version))
1470 (sha256
1471 (base32
1472 "1b91yvr0ksrw3bx61i7914caf8pyks9c242kwmj4l12zjd06mp56"))))
1473 (arguments
1474 (list
1475 #:phases
1476 #~(modify-phases %standard-phases
1477 (replace 'check
1478 (lambda* (#:key tests? #:allow-other-keys)
1479 (when tests?
1480 (invoke "make" "iverilog" "core")))))))
1481 (build-system pyproject-build-system)
1482 (native-inputs
1483 (list iverilog python-setuptools-next python-pytest))
1484 (home-page "http://www.myhdl.org/")
1485 (synopsis "Python as a Hardware Description Language")
1486 (description "This package provides a library to turn Python into
1487a hardware description and verification language.")
1488 (license license:lgpl2.1+))))
1489
865(define-public python-pydigitalwavetools 1490(define-public python-pydigitalwavetools
866 (package 1491 (package
867 (name "python-pydigitalwavetools") 1492 (name "python-pydigitalwavetools")
@@ -969,6 +1594,60 @@ design.")
969to enforce it.") 1594to enforce it.")
970 (license license:gpl3+))) 1595 (license license:gpl3+)))
971 1596
1597(define-public python-vunit
1598 (package
1599 (name "python-vunit")
1600 (version "5.0.0-dev.6") ;v4.7.0 dates back from 2 years ago.
1601 (source
1602 (origin
1603 (method git-fetch)
1604 (uri (git-reference
1605 (url "https://github.com/VUnit/vunit")
1606 (commit (string-append "v" version))
1607 (recursive? #t)))
1608 (file-name (git-file-name name version))
1609 (sha256
1610 (base32 "0zm7733g7ivcx6y00bigvqzkxa2i46sw4pb5k1n3lfbqvsjymshh"))))
1611 (build-system pyproject-build-system)
1612 (arguments
1613 (list
1614 #:phases
1615 #~(modify-phases %standard-phases
1616 (add-after 'unpack 'fix-ghdl-jit
1617 (lambda _
1618 ;; TODO: Remove when fixed upstream (see:
1619 ;; https://github.com/VUnit/vunit/pull/1121).
1620 (substitute* "vunit/sim_if/ghdl.py"
1621 ((": \"llvm\",")
1622 (string-append
1623 ": \"llvm\",\n\tr\"static elaboration, LLVM JIT code "
1624 "generator\": \"llvm-jit\","))))))
1625 #:test-flags
1626 ;; Skip lint tests which require python-pycodestyle, python-pylint and
1627 ;; python-mypy to reduce closoure size; some lint test fails, see
1628 ;; <https://github.com/VUnit/vunit/issues/1111>.
1629 ;;
1630 ;; XXX: Acceptance tests take 10+ minutes to complete, hang on
1631 ;; "test_external_run_scripts.py" and fail eventually, consider to
1632 ;; improve them; ignore for now.
1633 #~(list "tests/unit")))
1634 (native-inputs
1635 (list nvc
1636 python-pytest
1637 python-setuptools
1638 python-setuptools-scm
1639 python-wheel))
1640 (propagated-inputs
1641 (list python-colorama))
1642 (home-page "https://vunit.github.io")
1643 (synopsis "Unit testing framework for VHDL/SystemVerilog")
1644 (description
1645 "VUnit features the functionality needed to realize continuous and
1646automated testing of HDL code.")
1647 ;; According to 'LICENSE.rst', VUnit itself is under MPL but two
1648 ;; subdirectories are under ASL.
1649 (license (list license:mpl2.0 license:asl2.0))))
1650
972(define-public qucsator-rf 1651(define-public qucsator-rf
973 (package 1652 (package
974 (name "qucsator-rf") 1653 (name "qucsator-rf")
@@ -1308,6 +1987,44 @@ them usable as simple logic analyzer and/or oscilloscope hardware.")
1308verification flows.") 1987verification flows.")
1309 (license license:isc))) 1988 (license license:isc)))
1310 1989
1990(define-public systemc
1991 (package
1992 (name "systemc")
1993 (version "3.0.1")
1994 (source
1995 (origin
1996 (method git-fetch)
1997 (uri (git-reference
1998 (url "https://github.com/accellera-official/systemc")
1999 (commit version)))
2000 (file-name (git-file-name name version))
2001 (sha256
2002 (base32 "1c8brlv3702p2ivifai9929bg20y30jb301ap0gdmz305q8mcb33"))))
2003 (native-inputs (list perl))
2004 (build-system cmake-build-system)
2005 (arguments
2006 (list
2007 #:modules '((guix build cmake-build-system)
2008 ((guix build gnu-build-system) #:prefix gnu:)
2009 (guix build utils))
2010 #:phases
2011 #~(modify-phases %standard-phases
2012 (replace 'check (assoc-ref gnu:%standard-phases 'check)))))
2013 (home-page "https://systemc.org/")
2014 (synopsis "Library for event-driven simulation")
2015 (description
2016 "SystemC is a C++ library for modeling concurrent systems, and the
2017reference implementation of IEEE 1666-2011. It provides a notion of timing as
2018well as an event-driven simulations environment. Due to its concurrent and
2019sequential nature, SystemC allows the description and integration of complex
2020hardware and software components. To some extent, SystemC can be seen as
2021a Hardware Description Language. However, unlike VHDL or Verilog, SystemC
2022provides sophisticated mechanisms that offer high abstraction levels on
2023components interfaces. This, in turn, facilitates the integration of systems
2024using different abstraction levels.")
2025 ;; homepages.cae.wisc.edu/~ece734/SystemC/Esperan_SystemC_tutorial.pdf
2026 (license license:asl2.0)))
2027
1311(define-public uhdm 2028(define-public uhdm
1312 (package 2029 (package
1313 (name "uhdm") 2030 (name "uhdm")
@@ -1347,6 +2064,65 @@ verification flows.")
1347VPI Interface, Elaborator, Serialization, Visitor and Listener.") 2064VPI Interface, Elaborator, Serialization, Visitor and Listener.")
1348 (license license:asl2.0))) 2065 (license license:asl2.0)))
1349 2066
2067(define-public verilator
2068 (package
2069 (name "verilator")
2070 (version "5.040")
2071 (source
2072 (origin
2073 (method git-fetch)
2074 (uri (git-reference
2075 (url "https://github.com/verilator/verilator/")
2076 (commit (string-append "v" version))))
2077 (file-name (git-file-name name version))
2078 (sha256
2079 (base32 "0xw2w7fikli3jffwd819rx8bwbh3zsymhrn3zbq34glklff07rsb"))))
2080 (native-inputs
2081 (list autoconf
2082 automake
2083 bison
2084 cmake-minimal
2085 flex
2086 gdb/pinned
2087 gettext-minimal
2088 help2man
2089 python-distro
2090 python-minimal
2091 which))
2092 (inputs
2093 (list perl python systemc))
2094 (build-system gnu-build-system)
2095 (arguments
2096 (list
2097 #:phases
2098 #~(modify-phases %standard-phases
2099 (replace 'bootstrap
2100 (lambda _ (invoke "autoconf")))
2101 (add-after 'unpack 'adjust-source
2102 (lambda _
2103 (substitute* "bin/verilator"
2104 (("/bin/echo") "echo"))))
2105 (add-before 'check 'set-SYSTEMC_ROOT
2106 (lambda _
2107 (setenv "SYSTEMC_ROOT" #$(this-package-input systemc))))
2108 (add-before 'check 'disable-gdb-safe-path
2109 (lambda _
2110 (setenv "HOME" (getcwd))
2111 (mkdir-p (string-append (getcwd) "/.config/gdb"))
2112 (with-output-to-file
2113 (string-append (getcwd) "/.config/gdb/gdbinit")
2114 (lambda ()
2115 (display "set auto-load safe-path /"))))))
2116 #:test-target "test"))
2117 (home-page "https://www.veripool.org/verilator/")
2118 (synopsis "Verilog/SystemVerilog simulator")
2119 (description
2120 "Verilator transforms the specified Verilog or SystemVerilog code by
2121reading it, performing lint checks, and optionally inserting assertion checks
2122and coverage-analysis points. It outputs single- or multi-threaded
2123@file{.cpp} and @file{.h} files.")
2124 (license license:lgpl3)))
2125
1350(define-public xoscope 2126(define-public xoscope
1351 (package 2127 (package
1352 (name "xoscope") 2128 (name "xoscope")
@@ -1369,3 +2145,123 @@ from ALSA, ESD, and COMEDI sources. This package currently does not include
1369support for ESD sources.") 2145support for ESD sources.")
1370 (home-page "https://xoscope.sourceforge.net/") 2146 (home-page "https://xoscope.sourceforge.net/")
1371 (license license:gpl2+))) 2147 (license license:gpl2+)))
2148
2149(define-public yosys
2150 (package
2151 (name "yosys")
2152 (version "0.57")
2153 (source
2154 (origin
2155 (method git-fetch)
2156 (uri (git-reference
2157 (url "https://github.com/YosysHQ/yosys")
2158 (commit (string-append "v" version))))
2159 (sha256
2160 (base32 "0bix5zlv9zp9fxqpn9l9bdw65xrgih5w0csq1xkkhm2c7p3vqjbb"))
2161 (file-name (git-file-name name version))))
2162 (build-system gnu-build-system)
2163 (arguments
2164 (list
2165 #:test-target "test"
2166 #:make-flags
2167 #~(list (string-append "CC="
2168 #$(cc-for-target))
2169 (string-append "CXX="
2170 #$(cxx-for-target))
2171 (string-append "PREFIX="
2172 #$output))
2173 #:phases
2174 #~(modify-phases %standard-phases
2175 (add-before 'configure 'fix-paths
2176 (lambda* (#:key inputs #:allow-other-keys)
2177 (substitute* "backends/smt2/smtio.py"
2178 (("\\['z3")
2179 (string-append "['"
2180 (search-input-file inputs "bin/z3"))))
2181 (substitute* "kernel/fstdata.cc"
2182 (("vcd2fst")
2183 (search-input-file inputs "bin/vcd2fst")))
2184 (substitute* "kernel/driver.cc"
2185 (("^#include \"libs/cxxopts/include/cxxopts.hpp\"")
2186 "#include <cxxopts.hpp>"))
2187 (substitute* '("passes/cmds/show.cc" "passes/cmds/viz.cc")
2188 (("exec xdot")
2189 (string-append "exec "
2190 (search-input-file inputs "bin/xdot")))
2191 (("dot -")
2192 (string-append (search-input-file inputs "bin/dot") " -"))
2193 (("fuser")
2194 (search-input-file inputs "bin/fuser")))))
2195 (replace 'configure
2196 (lambda* (#:key make-flags #:allow-other-keys)
2197 (apply invoke "make" "config-gcc" make-flags)))
2198 (add-after 'configure 'use-external-abc
2199 (lambda* (#:key inputs #:allow-other-keys)
2200 (substitute* '("Makefile")
2201 (("ABCEXTERNAL \\?=")
2202 (string-append "ABCEXTERNAL = "
2203 (search-input-file inputs "/bin/abc"))))))
2204 (add-after 'install 'add-symbolic-link
2205 (lambda* (#:key inputs #:allow-other-keys)
2206 ;; Previously this package provided a copy of the "abc"
2207 ;; executable in its output, named "yosys-abc". Create a
2208 ;; symbolic link so any external uses of that name continue to
2209 ;; work.
2210 (symlink (search-input-file inputs "/bin/abc")
2211 (string-append #$output "/bin/yosys-abc"))))
2212 (add-after 'install 'keep-pmgen-py
2213 (lambda* (#:key inputs #:allow-other-keys)
2214 ;; pmgen.py is required by some yosys plugins.
2215 (install-file (search-input-file inputs
2216 "/passes/pmgen/pmgen.py")
2217 (string-append #$output "/bin"))))
2218 (add-after 'install 'wrap
2219 (lambda* (#:key inputs #:allow-other-keys)
2220 (wrap-program (string-append #$output "/bin/yosys-witness")
2221 `("GUIX_PYTHONPATH" ":" prefix
2222 (,(getenv "GUIX_PYTHONPATH")))))))))
2223 (native-inputs (list bison
2224 cxxopts ;header-only library
2225 flex
2226 gawk ;for the tests and "make" progress pretty-printing
2227 iverilog ;for the tests
2228 pkg-config
2229 python
2230 tcl)) ;tclsh for the tests
2231 (inputs (list abc-yosyshq
2232 bash-minimal
2233 graphviz
2234 gtkwave
2235 libffi
2236 psmisc
2237 python
2238 python-click
2239 readline
2240 tcl
2241 xdot
2242 z3
2243 zlib))
2244 (home-page "https://yosyshq.net/yosys/")
2245 (synopsis "FPGA Verilog RTL synthesizer")
2246 (description "Yosys synthesizes Verilog-2005.")
2247 (license license:isc)))
2248
2249(define-public yosys-clang
2250 (package
2251 (inherit yosys)
2252 (name "yosys-clang")
2253 (arguments
2254 (substitute-keyword-arguments (package-arguments yosys)
2255 ((#:make-flags _ #f)
2256 #~(list "CC=clang"
2257 "CXX=clang++"
2258 (string-append "PREFIX=" #$output)))
2259 ((#:phases phases)
2260 #~(modify-phases #$phases
2261 (replace 'configure
2262 (lambda* (#:key make-flags #:allow-other-keys)
2263 (apply invoke "make" "config-clang" make-flags)))))))
2264 (inputs
2265 (modify-inputs (package-inputs yosys)
2266 (append clang)))
2267 (synopsis "FPGA Verilog RTL synthesizer (Clang variant)")))
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index f6ca09abb38..dcbe99de369 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -210,11 +210,11 @@
210 #:use-module (gnu packages dictionaries) 210 #:use-module (gnu packages dictionaries)
211 #:use-module (gnu packages djvu) 211 #:use-module (gnu packages djvu)
212 #:use-module (gnu packages ebook) 212 #:use-module (gnu packages ebook)
213 #:use-module (gnu packages electronics)
213 #:use-module (gnu packages emacs) 214 #:use-module (gnu packages emacs)
214 #:use-module (gnu packages emacs-build) 215 #:use-module (gnu packages emacs-build)
215 #:use-module (gnu packages enchant) 216 #:use-module (gnu packages enchant)
216 #:use-module (gnu packages fonts) 217 #:use-module (gnu packages fonts)
217 #:use-module (gnu packages fpga)
218 #:use-module (gnu packages freedesktop) 218 #:use-module (gnu packages freedesktop)
219 #:use-module (gnu packages games) 219 #:use-module (gnu packages games)
220 #:use-module (gnu packages gawk) 220 #:use-module (gnu packages gawk)
diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm
deleted file mode 100644
index 180219086d3..00000000000
--- a/gnu/packages/fpga.scm
+++ /dev/null
@@ -1,920 +0,0 @@
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
3;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org>
4;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
5;;; Copyright © 2019 Amin Bandali <bandali@gnu.org>
6;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
7;;; Copyright © 2021 Andrew Miloradovsky <andrew@interpretmath.pw>
8;;; Copyright © 2022 Christian Gelinek <cgelinek@radlogic.com.au>
9;;; Copyright © 2022 jgart <jgart@dismail.de>
10;;; Copyright © 2023 Simon South <simon@simonsouth.net>
11;;; Copyright © 2024 Efraim Flashner <efraim@flashner.co.il>
12;;; Copyright © 2024 Jakob Kirsch <jakob.kirsch@web.de>
13;;; Copyright © 2025 Zheng Junjie <873216071@qq.com>
14;;; Copyright © 2025 Cayetano Santos <csantosb@inventati.org>
15;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
16;;;
17;;; This file is part of GNU Guix.
18;;;
19;;; GNU Guix is free software; you can redistribute it and/or modify it
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
24;;; GNU Guix is distributed in the hope that it will be useful, but
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32(define-module (gnu packages fpga)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix gexp)
35 #:use-module (guix packages)
36 #:use-module (guix deprecation)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix utils)
40 #:use-module (guix build-system glib-or-gtk)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system cmake)
43 #:use-module (guix build-system meson)
44 #:use-module (guix build-system python)
45 #:use-module (guix build-system pyproject)
46 #:use-module (guix build-system qt)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages algebra)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages bash)
52 #:use-module (gnu packages bison)
53 #:use-module (gnu packages boost)
54 #:use-module (gnu packages check)
55 #:use-module (gnu packages cmake)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages cpp)
58 #:use-module (gnu packages electronics)
59 #:use-module (gnu packages elf)
60 #:use-module (gnu packages flex)
61 #:use-module (gnu packages freedesktop)
62 #:use-module (gnu packages gawk)
63 #:use-module (gnu packages gdb)
64 #:use-module (gnu packages gettext)
65 #:use-module (gnu packages ghostscript)
66 #:use-module (gnu packages glib)
67 #:use-module (gnu packages gperf)
68 #:use-module (gnu packages graphviz)
69 #:use-module (gnu packages gtk)
70 #:use-module (gnu packages libffi)
71 #:use-module (gnu packages linux)
72 #:use-module (gnu packages llvm)
73 #:use-module (gnu packages man)
74 #:use-module (gnu packages maths)
75 #:use-module (gnu packages perl)
76 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages python)
78 #:use-module (gnu packages python-build)
79 #:use-module (gnu packages python-check)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages ruby)
82 #:use-module (gnu packages qt)
83 #:use-module (gnu packages readline)
84 #:use-module (gnu packages sphinx)
85 #:use-module (gnu packages tcl)
86 #:use-module (gnu packages texinfo)
87 #:use-module (gnu packages toolkits)
88 #:use-module (gnu packages version-control)
89 #:use-module (gnu packages web))
90
91(define-public abc
92 (let ((commit "e29dcd9f3275874c8d31a2f781487efac1dabb7b")
93 (revision "6"))
94 (package
95 (name "abc")
96 (version (git-version "0.0" revision commit))
97 (source (origin
98 (method git-fetch)
99 (uri (git-reference
100 (url "https://github.com/berkeley-abc/abc")
101 (commit commit)))
102 (file-name (git-file-name name version))
103 (sha256
104 (base32
105 "18g4i1kdsxvp25p5z3wja4jkxppgrp6ybxal9y2p2d2qvlafiw5z"))))
106 (build-system gnu-build-system)
107 (inputs
108 (list readline))
109 (arguments
110 (list #:license-file-regexp "copyright.txt"
111 #:tests? #f ; no tests
112 #:phases
113 #~(modify-phases %standard-phases
114 (delete 'configure)
115 (replace 'install
116 (lambda _
117 (install-file "abc" (string-append #$output "/bin")))))))
118 (home-page "https://people.eecs.berkeley.edu/~alanmi/abc/")
119 (synopsis "Sequential logic synthesis and formal verification")
120 (description "ABC is a program for sequential logic synthesis and
121formal verification.")
122 (license
123 (license:non-copyleft
124 "https://people.eecs.berkeley.edu/~alanmi/abc/copyright.htm")))))
125
126(define-public abc-yosyshq
127 (package
128 (inherit abc)
129 (name "abc-yosyshq")
130 (version "0.57")
131 (source (origin
132 (method git-fetch)
133 (uri (git-reference
134 (url "https://github.com/YosysHQ/abc/")
135 (commit (string-append "v" version))))
136 (file-name (git-file-name name version))
137 (sha256
138 (base32
139 "191hsznsmsjn8100n50qsh3ng8wgrnyfhr7qcnb8yskiwqp37pjh"))))
140 (home-page "https://github.com/YosysHQ/abc/")
141 (description "ABC is a program for sequential logic synthesis and
142formal verification. This is the Yosyshq fork of ABC.")
143 (license (license:non-copyleft "file:///copyright.txt"))))
144
145(define-public apycula
146 (package
147 (name "apycula")
148 (version "0.24")
149 ;; The pypi tar.gz file includes the necessary .pickle files, not available
150 ;; in the home-page repository.
151 (source
152 (origin
153 (method url-fetch)
154 (uri (pypi-uri "apycula" version))
155 (sha256
156 (base32 "1mlasq8lf90jcdwp4sk5a834bbmnnfxk2gswwcw83ypg75lli1gw"))))
157 (build-system pyproject-build-system)
158 (arguments (list #:tests? #f)) ;requires Gowin EDA tools
159 (inputs (list python-crc))
160 (native-inputs (list python-setuptools python-wheel))
161 (home-page "https://github.com/YosysHQ/apicula/")
162 (synopsis "Gowin FPGA bitstream format")
163 (description
164 "The project Apycula provides tools to support development and
165generating bitstreams with Gowin FPGAs.")
166 (license license:expat)))
167
168(define-public iverilog
169 (package
170 (name "iverilog")
171 (version "12.0")
172 (source
173 (origin
174 (method git-fetch)
175 (uri (git-reference
176 (url "https://github.com/steveicarus/iverilog")
177 (commit
178 (string-append "v" (string-replace-substring version "." "_")))))
179 (file-name (git-file-name name version))
180 (sha256
181 (base32 "1cm3ksxyyp8ihs0as5c2nk3a0y2db8dmrrw0f9an3sl255smxn17"))))
182 (build-system gnu-build-system)
183 (arguments
184 (list
185 #:bootstrap-scripts #~(list "autoconf.sh")
186 #:phases #~(modify-phases %standard-phases
187 (add-after 'unpack 'ensure-native-baked-CC/CXX
188 (lambda _
189 ;; The compilers used to build are retained in
190 ;; bin/iverilog-vpi, which is a Makefile
191 ;; script. Normalize these to just 'gcc' and 'g++' to
192 ;; avoid having these set to cross compilers.
193 (substitute* "Makefile.in"
194 (("s;@IVCC@;\\$\\(CC);")
195 "s;@IVCC@;gcc;")
196 (("s;@IVCXX@;\\$\\(CXX);")
197 "s;@IVCXX@;g++;")))))))
198 (native-inputs (list autoconf bison flex gperf))
199 (inputs (list zlib))
200 (home-page "https://steveicarus.github.io/iverilog/")
201 (synopsis "FPGA Verilog simulation and synthesis tool")
202 (description
203 "Icarus Verilog is a Verilog simulation and synthesis tool.
204It operates as a compiler, compiling source code written in Verilog
205(IEEE-1364) into some target format.
206For batch simulation, the compiler can generate an intermediate form
207called vvp assembly.
208This intermediate form is executed by @command{vvp}.
209For synthesis, the compiler generates netlists in the desired format.")
210 ;; GPL2 only because of:
211 ;; - ./driver/iverilog.man.in
212 ;; - ./iverilog-vpi.man.in
213 ;; - ./tgt-fpga/iverilog-fpga.man
214 ;; - ./vvp/vvp.man.in
215 ;; Otherwise would be GPL2+.
216 ;; You have to accept both GPL2 and LGPL2.1+.
217 (license (list license:gpl2 license:lgpl2.1+))))
218
219(define-public yosys
220 (package
221 (name "yosys")
222 (version "0.57")
223 (source
224 (origin
225 (method git-fetch)
226 (uri (git-reference
227 (url "https://github.com/YosysHQ/yosys")
228 (commit (string-append "v" version))))
229 (sha256
230 (base32 "0bix5zlv9zp9fxqpn9l9bdw65xrgih5w0csq1xkkhm2c7p3vqjbb"))
231 (file-name (git-file-name name version))))
232 (build-system gnu-build-system)
233 (arguments
234 (list
235 #:test-target "test"
236 #:make-flags
237 #~(list (string-append "CC="
238 #$(cc-for-target))
239 (string-append "CXX="
240 #$(cxx-for-target))
241 (string-append "PREFIX="
242 #$output))
243 #:phases
244 #~(modify-phases %standard-phases
245 (add-before 'configure 'fix-paths
246 (lambda* (#:key inputs #:allow-other-keys)
247 (substitute* "backends/smt2/smtio.py"
248 (("\\['z3")
249 (string-append "['"
250 (search-input-file inputs "bin/z3"))))
251 (substitute* "kernel/fstdata.cc"
252 (("vcd2fst")
253 (search-input-file inputs "bin/vcd2fst")))
254 (substitute* "kernel/driver.cc"
255 (("^#include \"libs/cxxopts/include/cxxopts.hpp\"")
256 "#include <cxxopts.hpp>"))
257 (substitute* '("passes/cmds/show.cc" "passes/cmds/viz.cc")
258 (("exec xdot")
259 (string-append "exec "
260 (search-input-file inputs "bin/xdot")))
261 (("dot -")
262 (string-append (search-input-file inputs "bin/dot") " -"))
263 (("fuser")
264 (search-input-file inputs "bin/fuser")))))
265 (replace 'configure
266 (lambda* (#:key make-flags #:allow-other-keys)
267 (apply invoke "make" "config-gcc" make-flags)))
268 (add-after 'configure 'use-external-abc
269 (lambda* (#:key inputs #:allow-other-keys)
270 (substitute* '("Makefile")
271 (("ABCEXTERNAL \\?=")
272 (string-append "ABCEXTERNAL = "
273 (search-input-file inputs "/bin/abc"))))))
274 (add-after 'install 'add-symbolic-link
275 (lambda* (#:key inputs #:allow-other-keys)
276 ;; Previously this package provided a copy of the "abc"
277 ;; executable in its output, named "yosys-abc". Create a
278 ;; symbolic link so any external uses of that name continue to
279 ;; work.
280 (symlink (search-input-file inputs "/bin/abc")
281 (string-append #$output "/bin/yosys-abc"))))
282 (add-after 'install 'keep-pmgen-py
283 (lambda* (#:key inputs #:allow-other-keys)
284 ;; pmgen.py is required by some yosys plugins.
285 (install-file (search-input-file inputs
286 "/passes/pmgen/pmgen.py")
287 (string-append #$output "/bin"))))
288 (add-after 'install 'wrap
289 (lambda* (#:key inputs #:allow-other-keys)
290 (wrap-program (string-append #$output "/bin/yosys-witness")
291 `("GUIX_PYTHONPATH" ":" prefix
292 (,(getenv "GUIX_PYTHONPATH")))))))))
293 (native-inputs (list bison
294 cxxopts ;header-only library
295 flex
296 gawk ;for the tests and "make" progress pretty-printing
297 iverilog ;for the tests
298 pkg-config
299 python
300 tcl)) ;tclsh for the tests
301 (inputs (list abc-yosyshq
302 bash-minimal
303 graphviz
304 gtkwave
305 libffi
306 psmisc
307 python
308 python-click
309 readline
310 tcl
311 xdot
312 z3
313 zlib))
314 (home-page "https://yosyshq.net/yosys/")
315 (synopsis "FPGA Verilog RTL synthesizer")
316 (description "Yosys synthesizes Verilog-2005.")
317 (license license:isc)))
318
319(define-public yosys-clang
320 (package
321 (inherit yosys)
322 (name "yosys-clang")
323 (arguments
324 (substitute-keyword-arguments (package-arguments yosys)
325 ((#:make-flags _ #f)
326 #~(list "CC=clang"
327 "CXX=clang++"
328 (string-append "PREFIX=" #$output)))
329 ((#:phases phases)
330 #~(modify-phases #$phases
331 (replace 'configure
332 (lambda* (#:key make-flags #:allow-other-keys)
333 (apply invoke "make" "config-clang" make-flags)))))))
334 (inputs
335 (modify-inputs (package-inputs yosys)
336 (append clang)))
337 (synopsis "FPGA Verilog RTL synthesizer (Clang variant)")))
338
339(define-public icestorm
340 (let ((commit "3cdcf4b009bb8681ab7e2e09d65043f04334b60e")
341 (revision "5"))
342 (package
343 (name "icestorm")
344 (version (git-version "0.0" revision commit))
345 (source
346 (origin
347 (method git-fetch)
348 (uri (git-reference
349 (url "https://github.com/YosysHQ/icestorm/")
350 (commit commit)))
351 (file-name (git-file-name name version))
352 (sha256
353 (base32 "0ygp6cj7grlnyji572kx215p2mw4crllskif9g795f390bp38g68"))))
354 (build-system gnu-build-system)
355 (arguments
356 (list
357 #:tests? #f ;avoid a cyclic dependency with nextpr-ice40
358 #:make-flags
359 #~(list (string-append "CC="
360 #$(cc-for-target))
361 (string-append "CXX="
362 #$(cxx-for-target))
363 (string-append "PREFIX="
364 #$output)
365 "ICEPROG=1")
366 #:phases
367 #~(modify-phases %standard-phases
368 (add-after 'unpack 'fix-usr-local
369 (lambda* (#:key outputs #:allow-other-keys)
370 (substitute* "icepack/Makefile"
371 (("/usr/local")
372 #$output))
373 (substitute* "icebox/Makefile"
374 (("/usr/local")
375 #$output))
376 (substitute* "icebox/icebox_vlog.py"
377 (("/usr/local")
378 #$output))))
379 (add-after 'build 'make-info
380 (lambda* (#:key outputs #:allow-other-keys)
381 (with-directory-excursion "docs"
382 (invoke "make" "info")
383 (install-file "build/texinfo/projecticestorm.info"
384 (string-append #$output "/share/info"))
385 (copy-recursively "build/texinfo/projecticestorm-figures"
386 (string-append #$output
387 "/share/info/projecticestorm-figures")))))
388 (delete 'configure))))
389 (inputs (list libftdi))
390 (native-inputs (list pkg-config
391 python
392 python-sphinx
393 python-sphinx-rtd-theme
394 texinfo))
395 (home-page "https://prjicestorm.readthedocs.io/")
396 (synopsis "Bitstream tools for Lattice iCE40 FPGAs")
397 (description
398 "Project IceStorm aims at documenting the bitstream format of
399Lattice iCE40 FPGAs and providing simple tools for analyzing and creating bitstream
400files.")
401 (license license:isc))))
402
403(define-public libfst
404 ;; There are no release nor tags.
405 (let ((commit "6a52070cd62ec65c29832bc95e7db493504aa7ac")
406 (revision "0"))
407 (package
408 (name "libfst")
409 (version (git-version "1.0.0" revision commit))
410 (source
411 (origin
412 (method git-fetch)
413 (uri (git-reference
414 (url "https://github.com/gtkwave/libfst/")
415 (commit commit)))
416 (file-name (git-file-name name version))
417 (sha256
418 (base32 "0b1r660m5aib316jjl4nhs10y7vhhqy2mvxjip3ynahig3hpi46z"))))
419 (build-system meson-build-system)
420 (native-inputs (list gobject-introspection pkg-config))
421 (inputs (list bzip2))
422 (propagated-inputs (list zlib)) ;in Requires.private of libfst.pc
423 (synopsis "Fast Signal Trace (FST) format waveforms library")
424 (description "Libfst is a small library used to read and write
425@acronym{FST, Fast Signal Trace} format waveforms.")
426 (home-page "https://github.com/gtkwave/libfst/")
427 (license (list license:expat ;libfst and fastlz-derived sources
428 license:bsd-2))))) ;for lz4-derived sources
429
430(define-public nextpnr
431 ;; Necessary for compatibility with latest apycula.
432 ;; TODO: Remove with release 0.9.
433 (let ((commit "d796cc720b60ccc18580c686d93c8751fe461532")
434 (revision "0"))
435 (package
436 (name "nextpnr")
437 (version (git-version "0.8" revision commit))
438 (source
439 (origin
440 (method git-fetch)
441 (uri (git-reference
442 (url "https://github.com/YosysHQ/nextpnr/")
443 (commit commit)
444 ;; XXX: Fetch some bundled libraries such as QtPropertyBrowser,
445 ;; json11 and python-console, which have custom modifications or
446 ;; no longer have their original upstream.
447 (recursive? #t)))
448 (file-name (git-file-name name version))
449 (modules '((guix build utils)
450 (ice-9 ftw)
451 (srfi srfi-26)))
452 (snippet
453 '(begin
454 ;; XXX: 'delete-all-but' is copied from the turbovnc package.
455 (define (delete-all-but directory . preserve)
456 (with-directory-excursion directory
457 (let* ((pred (negate (cut member <>
458 (cons* "." ".." preserve))))
459 (items (scandir "." pred)))
460 (for-each (cut delete-file-recursively <>) items))))
461 (delete-all-but "3rdparty"
462 ;; The following sources have all been patched, so
463 ;; cannot easily be unbundled.
464 "QtPropertyBrowser"
465 "json11"
466 "python-console"
467 "oourafft")))
468 (patches (search-patches "nextpnr-gtest.patch"
469 "nextpnr-imgui.patch"))
470 (sha256
471 (base32 "1arj25vad76wg6b5yaaky4cby5zp9v92pdd4y3l0kxi7wvxhmmya"))))
472 (build-system qt-build-system)
473 (arguments
474 (list
475 #:cmake cmake ;CMake 3.25 or higher is required.
476 #:configure-flags
477 ;; TODO: enable more architectures?
478 #~(list "-DARCH=generic;ice40;ecp5;himbaechel"
479 "-DBUILD_GUI=ON"
480 "-DUSE_OPENMP=ON"
481 "-DBUILD_TESTS=ON"
482 "-DHIMBAECHEL_UARCH=ng-ultra;gowin"
483 "-DHIMBAECHEL_NGULTRA_DEVICES=ng-ultra"
484 "-DHIMBAECHEL_SPLIT=ON"
485 "-DHIMBAECHEL_PRJBEYOND_DB=/tmp/prjbeyond-db"
486 (string-append "-DCURRENT_GIT_VERSION=nextpnr-" #$version)
487 (string-append "-DICESTORM_INSTALL_PREFIX="
488 #$(this-package-input "icestorm"))
489 (string-append "-DTRELLIS_INSTALL_PREFIX="
490 #$(this-package-input "prjtrellis"))
491 "-DUSE_IPO=OFF")
492 #:phases
493 #~(modify-phases %standard-phases
494 ;; Required by himbaechel architecture, ng-ultra support.
495 (add-after 'unpack 'get-prjbeyond-db
496 (lambda _
497 (copy-recursively
498 #$(origin
499 (method git-fetch)
500 (uri (git-reference
501 (url "https://github.com/yosyshq-GmbH/prjbeyond-db/")
502 ;; We take latest commit, as indicated in nextpnr’s
503 ;; README.md file
504 (commit "06d3b424dd0e52d678087c891c022544238fb9e3")))
505 (sha256
506 (base32
507 "17dd3cgms2fy6xvz7magdmvv92km4cqh2kz9dyjrvz5y8caqav4y")))
508 "/tmp/prjbeyond-db")))
509 (add-after 'unpack 'unbundle-sanitizers-cmake
510 (lambda _
511 (substitute* "CMakeLists.txt"
512 ;; Use the system sanitizers-cmake module. This is made
513 ;; necessary 'sanitizers-cmake' installing a FindPackage
514 ;; module but no CMake config file.
515 (("\\$\\{CMAKE_SOURCE_DIR}/3rdparty/sanitizers-cmake/cmake")
516 (string-append
517 #$(this-package-native-input "sanitizers-cmake")
518 "/share/sanitizers-cmake/cmake"))))))))
519 (native-inputs
520 (list googletest
521 sanitizers-cmake))
522 (inputs
523 (list apycula
524 boost
525 corrosion
526 eigen
527 icestorm
528 prjtrellis
529 pybind11
530 python
531 qtbase-5
532 qtwayland-5
533 qtimgui
534 yosys))
535 (synopsis "Place-and-Route tool for FPGAs")
536 (description "Nextpnr is a portable FPGA place and route tool.")
537 (home-page "https://github.com/YosysHQ/nextpnr/")
538 (license license:isc))))
539
540(define-public nextpnr-ice40
541 (deprecated-package "nextpnr-ice40" nextpnr))
542
543(define-public gtkwave
544 ;; The last release is more than 2 years old, and there are improvements in
545 ;; the master branch, such as GTK 4 support: pick the latest commit that
546 ;; passes their CI.
547 (let ((commit "bb978d9d667d569b9153ffa34007e300302907dc")
548 (revision "0"))
549 (package
550 (name "gtkwave")
551 ;; The version string can be found in meson.build.
552 (version (git-version "3.4.0" revision commit))
553 (source
554 (origin
555 (method git-fetch)
556 (uri (git-reference
557 (url "https://github.com/gtkwave/gtkwave")
558 (commit commit)))
559 (file-name (git-file-name name version))
560 (sha256
561 (base32 "1nv27cpz5937cb6bkhpw8w0ji6hm9xr8f0znvfwzfl1fwwypf23y"))))
562 (build-system meson-build-system)
563 (arguments (list #:glib-or-gtk? #t))
564 (native-inputs (list desktop-file-utils
565 flex
566 `(,glib "bin") ;for glib-mkenums
567 gobject-introspection
568 gperf
569 `(,gtk "bin")
570 pkg-config))
571 (inputs (list gtk gtk+ libfst))
572 (synopsis "Waveform viewer for FPGA simulator trace files")
573 (description "This package is a waveform viewer for @acronym{FST, FPGA
574Simulator Trace} files.")
575 (home-page "https://github.com/gtkwave/gtkwave")
576 ;; Exception against free government use in tcl_np.c and tcl_np.h.
577 (license (list license:gpl2+ license:expat license:tcl/tk)))))
578
579(define-public python-migen
580 ;; XXX: The latest version tag (0.9.2) was placed in 2019, there are latest
581 ;; changes supporting Python 3.11 on master branch, see
582 ;; <https://github.com/m-labs/migen/issues/259>.
583 (let ((commit "6e3a9e150fb006dabc4b55043d3af18dbfecd7e8")
584 (revision "1"))
585 (package
586 (name "python-migen")
587 (version (git-version "0.9.2" revision commit))
588 (source
589 (origin
590 ;; Tests fail in the PyPI tarball due to missing files.
591 (method git-fetch)
592 (uri (git-reference
593 (url "https://github.com/m-labs/migen")
594 (commit commit)))
595 (file-name (git-file-name name version))
596 (sha256
597 (base32 "1hibhjnj5b3ka5y4nnqx9zp5w730gfqfa3r5injpa14i4cz6bj1n"))))
598 (build-system pyproject-build-system)
599 (native-inputs
600 (list python-pytest
601 python-setuptools-next))
602 (propagated-inputs
603 (list python-colorama))
604 (home-page "https://m-labs.hk/gateware/migen/")
605 (synopsis "Python toolbox for building complex digital hardware")
606 (description
607 "Migen FHDL is a Python library that replaces the event-driven paradigm
608of Verilog and VHDL with the notions of combinatorial and synchronous
609statements, has arithmetic rules that make integers always behave like
610mathematical integers, and allows the design's logic to be constructed by a
611Python program.")
612 (license license:bsd-2))))
613
614(define-public python-myhdl
615 (let ((commit "7dc29c242cd33cb835c336a81ffc3a461eaa92f4")
616 (revision "0"))
617 (package
618 (name "python-myhdl")
619 (version (git-version "0.11" revision commit))
620 (source
621 (origin
622 (method git-fetch)
623 (uri (git-reference
624 (url "https://github.com/myhdl/myhdl/")
625 (commit commit)))
626 (file-name (git-file-name name version))
627 (sha256
628 (base32
629 "1b91yvr0ksrw3bx61i7914caf8pyks9c242kwmj4l12zjd06mp56"))))
630 (arguments
631 (list
632 #:phases
633 #~(modify-phases %standard-phases
634 (replace 'check
635 (lambda* (#:key tests? #:allow-other-keys)
636 (when tests?
637 (invoke "make" "iverilog" "core")))))))
638 (build-system pyproject-build-system)
639 (native-inputs
640 (list iverilog python-setuptools-next python-pytest))
641 (home-page "http://www.myhdl.org/")
642 (synopsis "Python as a Hardware Description Language")
643 (description "This package provides a library to turn Python into
644a hardware description and verification language.")
645 (license license:lgpl2.1+))))
646
647(define-public python-vunit
648 (package
649 (name "python-vunit")
650 (version "5.0.0-dev.6") ;v4.7.0 dates back from 2 years ago.
651 (source
652 (origin
653 (method git-fetch)
654 (uri (git-reference
655 (url "https://github.com/VUnit/vunit")
656 (commit (string-append "v" version))
657 (recursive? #t)))
658 (file-name (git-file-name name version))
659 (sha256
660 (base32 "0zm7733g7ivcx6y00bigvqzkxa2i46sw4pb5k1n3lfbqvsjymshh"))))
661 (build-system pyproject-build-system)
662 (arguments
663 (list
664 #:phases
665 #~(modify-phases %standard-phases
666 (add-after 'unpack 'fix-ghdl-jit
667 (lambda _
668 ;; TODO: Remove when fixed upstream (see:
669 ;; https://github.com/VUnit/vunit/pull/1121).
670 (substitute* "vunit/sim_if/ghdl.py"
671 ((": \"llvm\",")
672 (string-append
673 ": \"llvm\",\n\tr\"static elaboration, LLVM JIT code "
674 "generator\": \"llvm-jit\","))))))
675 #:test-flags
676 ;; Skip lint tests which require python-pycodestyle, python-pylint and
677 ;; python-mypy to reduce closoure size; some lint test fails, see
678 ;; <https://github.com/VUnit/vunit/issues/1111>.
679 ;;
680 ;; XXX: Acceptance tests take 10+ minutes to complete, hang on
681 ;; "test_external_run_scripts.py" and fail eventually, consider to
682 ;; improve them; ignore for now.
683 #~(list "tests/unit")))
684 (native-inputs
685 (list nvc
686 python-pytest
687 python-setuptools
688 python-setuptools-scm
689 python-wheel))
690 (propagated-inputs
691 (list python-colorama))
692 (home-page "https://vunit.github.io")
693 (synopsis "Unit testing framework for VHDL/SystemVerilog")
694 (description
695 "VUnit features the functionality needed to realize continuous and
696automated testing of HDL code.")
697 ;; According to 'LICENSE.rst', VUnit itself is under MPL but two
698 ;; subdirectories are under ASL.
699 (license (list license:mpl2.0 license:asl2.0))))
700
701(define-public nvc
702 (package
703 (name "nvc")
704 (version "1.17.2")
705 (source (origin
706 (method git-fetch)
707 (uri (git-reference
708 (url "https://github.com/nickg/nvc")
709 (commit (string-append "r" version))))
710 (file-name (git-file-name name version))
711 (sha256
712 (base32
713 "0hr5y9ys5kf096x18mh10wwqa0hbzlmdj7pyayc6szsjla1d3mk0"))))
714 (build-system gnu-build-system)
715 (arguments
716 (list #:out-of-source? #t
717 #:configure-flags
718 #~(list "--enable-tcl"
719 "--enable-llvm"
720 "--enable-verilog"
721 "--enable-vital"
722 "--enable-server"
723 "--with-ncurses"
724 "--enable-parallel-make"
725 "--enable-vital"
726 (string-append "--with-bash-completion=" #$output
727 "/share/bash-completion/completions"))
728 #:phases #~(modify-phases %standard-phases
729 (add-after 'unpack 'clean-up
730 (lambda _
731 (delete-file "autogen.sh"))))))
732 (native-inputs
733 (list automake
734 autoconf
735 check ; for the tests
736 flex
737 gettext-minimal
738 libtool
739 pkg-config
740 python-minimal
741 which))
742 (inputs
743 (list jansson
744 libffi
745 llvm
746 readline
747 tcl
748 `(,zstd "lib")))
749 (synopsis "VHDL compiler and simulator")
750 (description "This package provides a VHDL compiler and simulator.")
751 (home-page "https://www.nickg.me.uk/nvc/")
752 (license license:gpl3+)))
753
754(define-public systemc
755 (package
756 (name "systemc")
757 (version "3.0.1")
758 (source
759 (origin
760 (method git-fetch)
761 (uri (git-reference
762 (url "https://github.com/accellera-official/systemc")
763 (commit version)))
764 (file-name (git-file-name name version))
765 (sha256
766 (base32 "1c8brlv3702p2ivifai9929bg20y30jb301ap0gdmz305q8mcb33"))))
767 (native-inputs (list perl))
768 (build-system cmake-build-system)
769 (arguments
770 (list
771 #:modules '((guix build cmake-build-system)
772 ((guix build gnu-build-system) #:prefix gnu:)
773 (guix build utils))
774 #:phases
775 #~(modify-phases %standard-phases
776 (replace 'check (assoc-ref gnu:%standard-phases 'check)))))
777 (home-page "https://systemc.org/")
778 (synopsis "Library for event-driven simulation")
779 (description
780 "SystemC is a C++ library for modeling concurrent systems, and the
781reference implementation of IEEE 1666-2011. It provides a notion of timing as
782well as an event-driven simulations environment. Due to its concurrent and
783sequential nature, SystemC allows the description and integration of complex
784hardware and software components. To some extent, SystemC can be seen as
785a Hardware Description Language. However, unlike VHDL or Verilog, SystemC
786provides sophisticated mechanisms that offer high abstraction levels on
787components interfaces. This, in turn, facilitates the integration of systems
788using different abstraction levels.")
789 ;; homepages.cae.wisc.edu/~ece734/SystemC/Esperan_SystemC_tutorial.pdf
790 (license license:asl2.0)))
791
792(define-public verilator
793 (package
794 (name "verilator")
795 (version "5.040")
796 (source
797 (origin
798 (method git-fetch)
799 (uri (git-reference
800 (url "https://github.com/verilator/verilator/")
801 (commit (string-append "v" version))))
802 (file-name (git-file-name name version))
803 (sha256
804 (base32 "0xw2w7fikli3jffwd819rx8bwbh3zsymhrn3zbq34glklff07rsb"))))
805 (native-inputs
806 (list autoconf
807 automake
808 bison
809 cmake-minimal
810 flex
811 gdb/pinned
812 gettext-minimal
813 help2man
814 perl
815 python-distro
816 python-minimal))
817 (inputs
818 (list numactl systemc))
819 (build-system gnu-build-system)
820 (arguments
821 (list
822 #:phases
823 #~(modify-phases %standard-phases
824 (replace 'bootstrap
825 (lambda _ (invoke "autoconf")))
826 (add-after 'unpack 'adjust-source
827 (lambda _
828 (substitute* "bin/verilator"
829 (("/bin/echo") "echo"))))
830 (add-before 'configure 'set-SYSTEMC
831 (lambda _
832 (setenv "SYSTEMC_LIBDIR"
833 (string-append
834 #$(this-package-input "systemc") "/lib"))
835 (setenv "SYSTEMC_INCLUDE"
836 (string-append
837 #$(this-package-input "systemc") "/include"))))
838 (add-before 'check 'disable-gdb-safe-path
839 (lambda _
840 (setenv "HOME" (getcwd))
841 (mkdir-p (string-append (getcwd) "/.config/gdb"))
842 (with-output-to-file
843 (string-append (getcwd) "/.config/gdb/gdbinit")
844 (lambda ()
845 (display "set auto-load safe-path /"))))))
846 #:test-target "test"))
847 (home-page "https://www.veripool.org/verilator/")
848 (synopsis "Verilog/SystemVerilog simulator")
849 (description
850 "Verilator transforms the specified Verilog or SystemVerilog code by
851reading it, performing lint checks, and optionally inserting assertion checks
852and coverage-analysis points. It outputs single- or multi-threaded
853@file{.cpp} and @file{.h} files.")
854 (license license:lgpl3)))
855
856(define-public fftgen
857 (let ((commit "3378b77d83a98b06184656a5cb9b54e50dfe4485") ;no releases
858 (revision "1"))
859 (package
860 (name "fftgen")
861 (version (git-version "0" revision commit))
862 (source
863 (origin
864 (method git-fetch)
865 (uri (git-reference
866 (url "https://github.com/ZipCPU/dblclockfft")
867 (commit commit)))
868 (file-name (git-file-name name version))
869 (sha256
870 (base32
871 "1rvln871wjkbbqnv88jnx328xlhn5sgbr8fglk3ajnd9rwgiq3jg"))))
872 (build-system gnu-build-system)
873 (arguments
874 (list
875 #:test-target "bench-test"
876 #:make-flags #~(list "CFLAGS=-g -O2") ;default flags lack -O2
877 #:phases
878 #~(modify-phases %standard-phases
879 (delete 'configure)
880 (replace 'install
881 (lambda _
882 (install-file "sw/fftgen"
883 (string-append #$output "/bin")))))))
884 (native-inputs (list bc fftw python-minimal verilator which))
885 (synopsis "Generic pipelined FFT core generator")
886 (description "fftgen produces @acronym{FFT, fast-Fourier transforms}
887hardware designs in Verilog.")
888 (home-page "https://github.com/ZipCPU/zipcpu/")
889 (license license:lgpl3+))))
890
891(define-public python-hdlmake
892 (let ((commit "c56cb8efa2000d06cec698f0149bc4ca4ef4e5bc")
893 (revision "3"))
894 (package
895 (name "python-hdlmake")
896 (version (git-version "3.3" revision commit))
897 (source
898 (origin
899 (method git-fetch)
900 (uri (git-reference
901 (url "https://gitlab.com/ohwr/project/hdl-make/")
902 (commit commit)))
903 (file-name (git-file-name name version))
904 (sha256
905 (base32 "1w4b0g015rzfypr8sjyr8xqij6s2p5qxhxraswrhjvg1w86b6s36"))))
906 (build-system pyproject-build-system)
907 (arguments (list #:phases #~(modify-phases %standard-phases
908 (add-before 'check 'chdir
909 (lambda _
910 (chdir "testsuite"))))
911 #:test-flags #~(list "test_all.py")))
912 (native-inputs (list python-pytest python-setuptools-next))
913 (propagated-inputs (list python-networkx python-six))
914 (home-page "https://ohwr.gitlab.io/project/hdl-make/")
915 (synopsis "Generate multi-purpose makefiles for HDL projects")
916 (description
917 "Hdlmake helps manage and share @acronym{HDL, hardware description
918language} code by automatically finding file dependencies, writing synthesis
919and simulation Makefiles.")
920 (license license:gpl3+))))
diff --git a/po/packages/POTFILES.in b/po/packages/POTFILES.in
index 0269722f2e8..9cfa672e695 100644
--- a/po/packages/POTFILES.in
+++ b/po/packages/POTFILES.in
@@ -163,7 +163,6 @@ gnu/packages/fontutils.scm
163gnu/packages/forth.scm 163gnu/packages/forth.scm
164gnu/packages/fortran-check.scm 164gnu/packages/fortran-check.scm
165gnu/packages/fortran-xyz.scm 165gnu/packages/fortran-xyz.scm
166gnu/packages/fpga.scm
167gnu/packages/freedesktop.scm 166gnu/packages/freedesktop.scm
168gnu/packages/freeipmi.scm 167gnu/packages/freeipmi.scm
169gnu/packages/fribidi.scm 168gnu/packages/fribidi.scm