projects/guix·blob javascript-team · refs

5610 lines · 215.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <[email protected]>
3;;; Copyright © 2018-2021, 2023 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2019 Clément Lassieur <[email protected]>
5;;; Copyright © 2018-2019 Arun Isaac <[email protected]>
6;;; Copyright © 2017-2018, 2021, 2023-2024 Efraim Flashner <[email protected]>
7;;; Copyright © 2021 Leo Famulari <[email protected]>
8;;; Copyright © 2021-2023, 2025, 2026 Maxim Cournoyer <[email protected]>
9;;; Copyright © 2024 Juliana Sims <[email protected]>
10;;; Copyright © 2025, 2026 Cayetano Santos <[email protected]>
11;;; Copyright © 2025-2026 Sharlatan Hellseher <[email protected]>
12;;; Copyright © 2022 Konstantinos Agiannis <[email protected]>
13;;; Copyright © 2015-2025 Ricardo Wurmus <[email protected]>
14;;; Copyright © 2022, 2024, 2025 Artyom V. Poptsov <[email protected]>
15;;; Copyright © 2016, 2018 Danny Milosavljevic <[email protected]>
16;;; Copyright © 2019 Amin Bandali <[email protected]>
17;;; Copyright © 2020-2025 Vinicius Monego <[email protected]>
18;;; Copyright © 2021 Andrew Miloradovsky <[email protected]>
19;;; Copyright © 2022 Christian Gelinek <[email protected]>
20;;; Copyright © 2022 jgart <[email protected]>
21;;; Copyright © 2023 Simon South <[email protected]>
22;;; Copyright © 2024 Jakob Kirsch <[email protected]>
23;;; Copyright © 2025 Zheng Junjie <[email protected]>
24;;; Copyright © 2022, 2025 Evgeny Pisemsky <[email protected]>
25;;; Copyright © 2025, Ekaitz Zarraga <[email protected]>
26;;; Copyright © 2021, 2022 Guillaume Le Vaillant <[email protected]>
27;;; Copyright © 2018, 2020-2023 Marius Bakke <[email protected]>
28;;; Copyright © 2020 Vincent Legoll <[email protected]>
29;;; Copyright © 2025, 2026 Gabriel Wicki <[email protected]>
30;;; Copyright © 2026 Thomas Kramer <[email protected]>
31;;; Copyright © 2023 pinoaffe <[email protected]>
32;;; Copyright © 2018, 2020-2021 Ludovic Courtès <[email protected]>
33;;; Copyright © 2020 Brice Waegeneire <[email protected]>
34;;; Copyright © 2025 Greg Hogan <[email protected]>
35;;; Copyright © 2018 Jonathan Brielmaier <[email protected]>
36;;; Copyright © 2021 Julien Lepiller <[email protected]>
37;;; Copyright © 2021 Mathieu Othacehe <[email protected]>
38;;; Copyright © 2025 Nicolas Graves <[email protected]>
39;;; Copyright © 2021-2026 Peter Polidoro <[email protected]>
40;;; Copyright © 2022 Petr Hodina <[email protected]>
41;;; Copyright © 2025 Thomas Guillermo Albers Raviola <[email protected]>
42;;; Copyright © 2019 Vagrant Cascadian <[email protected]>
43;;; Copyright © 2026 Thiago Negri <[email protected]>
44;;; Copyright © 2020 Morgan Smith <[email protected]>
45;;;
46;;; This file is part of GNU Guix.
47;;;
48;;; GNU Guix is free software; you can redistribute it and/or modify it
49;;; under the terms of the GNU General Public License as published by
50;;; the Free Software Foundation; either version 3 of the License, or (at
51;;; your option) any later version.
52;;;
53;;; GNU Guix is distributed in the hope that it will be useful, but
54;;; WITHOUT ANY WARRANTY; without even the implied warranty of
55;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56;;; GNU General Public License for more details.
57;;;
58;;; You should have received a copy of the GNU General Public License
59;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
60
61;;; Packages for electronic design automation, including electronic circuit
62;;; capture and simulation, printed circuit board design, chip design tools,
63;;; and electronic test and instrumentation software.
64
65(define-module (gnu packages electronics)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix build-system cargo)
68 #:use-module (guix build-system cmake)
69 #:use-module (guix build-system copy)
70 #:use-module (guix build-system glib-or-gtk)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system meson)
73 #:use-module (guix build-system pyproject)
74 #:use-module (guix build-system qt)
75 #:use-module (guix deprecation)
76 #:use-module (guix download)
77 #:use-module (guix gexp)
78 #:use-module (guix git-download)
79 #:use-module (guix packages)
80 #:use-module (guix utils)
81 #:use-module (gnu packages)
82 #:use-module (gnu packages algebra)
83 #:use-module (gnu packages autotools)
84 #:use-module (gnu packages backup)
85 #:use-module (gnu packages base)
86 #:use-module (gnu packages bash)
87 #:use-module (gnu packages bison)
88 #:use-module (gnu packages boost)
89 #:use-module (gnu packages c)
90 #:use-module (gnu packages check)
91 #:use-module (gnu packages cmake)
92 #:use-module (gnu packages compression)
93 #:use-module (gnu packages cpp)
94 #:use-module (gnu packages curl)
95 #:use-module (gnu packages databases)
96 #:use-module (gnu packages dns)
97 #:use-module (gnu packages documentation)
98 #:use-module (gnu packages elf)
99 #:use-module (gnu packages embedded)
100 #:use-module (gnu packages engineering)
101 #:use-module (gnu packages compiler-tools)
102 #:use-module (gnu packages fontutils)
103 #:use-module (gnu packages freedesktop)
104 #:use-module (gnu packages gawk)
105 #:use-module (gnu packages gcc)
106 #:use-module (gnu packages gd)
107 #:use-module (gnu packages gdb)
108 #:use-module (gnu packages gettext)
109 #:use-module (gnu packages ghostscript)
110 #:use-module (gnu packages gl)
111 #:use-module (gnu packages glib)
112 #:use-module (gnu packages gnome)
113 #:use-module (gnu packages gperf)
114 #:use-module (gnu packages graph)
115 #:use-module (gnu packages graphviz)
116 #:use-module (gnu packages groff)
117 #:use-module (gnu packages gtk)
118 #:use-module (gnu packages guile)
119 #:use-module (gnu packages haskell-xyz)
120 #:use-module (gnu packages image)
121 #:use-module (gnu packages java)
122 #:use-module (gnu packages jupyter)
123 #:use-module (gnu packages libedit)
124 #:use-module (gnu packages libffi)
125 #:use-module (gnu packages libftdi)
126 #:use-module (gnu packages libusb)
127 #:use-module (gnu packages linux)
128 #:use-module (gnu packages llvm)
129 #:use-module (gnu packages logging)
130 #:use-module (gnu packages m4)
131 #:use-module (gnu packages man)
132 #:use-module (gnu packages markup)
133 #:use-module (gnu packages maths)
134 #:use-module (gnu packages mpi)
135 #:use-module (gnu packages multiprecision)
136 #:use-module (gnu packages networking)
137 #:use-module (gnu packages pdf)
138 #:use-module (gnu packages perl)
139 #:use-module (gnu packages pkg-config)
140 #:use-module (gnu packages pretty-print)
141 #:use-module (gnu packages protobuf)
142 #:use-module (gnu packages python)
143 #:use-module (gnu packages python-build)
144 #:use-module (gnu packages python-check)
145 #:use-module (gnu packages python-compression)
146 #:use-module (gnu packages python-crypto)
147 #:use-module (gnu packages python-graphics)
148 #:use-module (gnu packages python-science)
149 #:use-module (gnu packages python-web)
150 #:use-module (gnu packages python-xyz)
151 #:use-module (gnu packages qt)
152 #:use-module (gnu packages readline)
153 #:use-module (gnu packages regex)
154 #:use-module (gnu packages ruby)
155 #:use-module (gnu packages ruby-xyz)
156 #:use-module (gnu packages rust-sources)
157 #:use-module (gnu packages sdl)
158 #:use-module (gnu packages serialization)
159 #:use-module (gnu packages shells)
160 #:use-module (gnu packages sphinx)
161 #:use-module (gnu packages sqlite)
162 #:use-module (gnu packages stb)
163 #:use-module (gnu packages swig)
164 #:use-module (gnu packages tcl)
165 #:use-module (gnu packages texinfo)
166 #:use-module (gnu packages textutils)
167 #:use-module (gnu packages tls)
168 #:use-module (gnu packages toolkits)
169 #:use-module (gnu packages version-control)
170 #:use-module (gnu packages web)
171 #:use-module (gnu packages wxwidgets)
172 #:use-module (gnu packages xdisorg)
173 #:use-module (gnu packages xml)
174 #:use-module (gnu packages xorg))
175
176(define delkw (@@ (guix utils) delkw))
177
178(define-public aacircuit
179 ;; No release in PyPI or version tag on Git, use the latest commit.
180 (let ((commit "18635c846754b6219da1a2ceb8977714f70004d0")
181 (revision "0"))
182 (package
183 (name "aacircuit")
184 (version (git-version "0" revision commit))
185 (source
186 (origin
187 (method git-fetch)
188 (uri (git-reference
189 (url "https://github.com/Blokkendoos/AACircuit")
190 (commit commit)))
191 (file-name (git-file-name name version))
192 (sha256
193 (base32 "07agb7fbpbq74zm27j9b00imr46q6kpwhxzmmffw2s9scv80c1km"))))
194 (build-system pyproject-build-system)
195 (arguments
196 (list
197 #:imported-modules `((guix build glib-or-gtk-build-system)
198 ,@%pyproject-build-system-modules)
199 #:modules '(((guix build glib-or-gtk-build-system)
200 #:prefix glib-or-gtk:)
201 (guix build pyproject-build-system)
202 (guix build utils))
203 #:phases
204 #~(modify-phases %standard-phases
205 (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
206 (assoc-ref glib-or-gtk:%standard-phases
207 'generate-gdk-pixbuf-loaders-cache-file))
208 (add-after 'unpack 'fix-python-incompatibilities
209 (lambda _
210 (substitute* (find-files "." "\\.py$")
211 (("assertEquals") "assertEqual"))))
212 (add-before 'build 'set-home-env
213 (lambda _
214 (setenv "HOME" "/tmp")))
215 (replace 'check
216 (lambda* (#:key tests? #:allow-other-keys)
217 (when tests?
218 ;; Delete develompent test file.
219 (delete-file "tests/test_flake.py")
220 ;; Exclude tests intended for visual review.
221 (setenv "NOSE_EXCLUDE"
222 (string-join '("test_export_pdf"
223 "test_import_aacircuit_export_pdf")
224 ","))
225 (invoke "xvfb-run" "./testrunner.sh"))))
226 (add-after 'wrap 'glib-or-gtk-wrap
227 (assoc-ref glib-or-gtk:%standard-phases
228 'glib-or-gtk-wrap))
229 (add-after 'glib-or-gtk-wrap 'wrap-aacircuit
230 (lambda _
231 (wrap-program (string-append #$output "/bin/aacircuit")
232 `("GDK_PIXBUF_MODULE_FILE" =
233 (,(getenv "GDK_PIXBUF_MODULE_FILE")))
234 `("GI_TYPELIB_PATH" ":" prefix
235 (,(getenv "GI_TYPELIB_PATH")))))))))
236 (native-inputs
237 (list python-pynose
238 python-setuptools
239 xvfb-run))
240 (inputs
241 (list bash-minimal
242 gtk+
243 python-bresenham
244 python-platformdirs
245 python-pycairo
246 python-pyclip
247 python-pygobject-3.50
248 python-pypubsub))
249 (home-page "https://github.com/Blokkendoos/AACircuit")
250 (synopsis "Draw electronic circuits with ASCII characters")
251 (description
252 "This is a pythonized, kind of reverse engineered version of original
253AACircuit written by Andreas Weber in Borland Delphi. The idea and GUI layout
254are also taken from the original.")
255 (license license:gpl3+))))
256
257(define-public abc
258 (let ((commit "8e224cd794a10e578d6dc3ee76e504c5c3edbdbe")
259 (revision "2")
260 (version "1.01")) ;see ABC_VERSION in src/base/main/mainInt.h
261 (package
262 (name "abc")
263 (version (git-version version revision commit))
264 (source (origin
265 (method git-fetch)
266 (uri (git-reference
267 (url "https://github.com/berkeley-abc/abc")
268 (commit commit)))
269 (file-name (git-file-name name version))
270 ;; Remove *.dll and *.lib binaries.
271 (snippet
272 #~(begin
273 (use-modules (guix build utils))
274 (with-directory-excursion "lib"
275 (for-each delete-file-recursively '("x64" "x86")))))
276 (sha256
277 (base32
278 "09rp8b1wm629a32xd2apx6x29nb1bryd56vjhzdk67bnzlgzp1kc"))
279 (patches
280 (search-patches "abc-tests.patch"))))
281 (build-system cmake-build-system)
282 (arguments
283 (list #:configure-flags
284 #~(list "-DCMAKE_C_COMPILER=clang"
285 "-DCMAKE_CXX_COMPILER=clang++")
286 #:phases
287 #~(modify-phases %standard-phases
288 (replace 'install
289 (lambda _
290 (install-file "abc" (string-append #$output "/bin"))))
291 (add-after 'install 'install-license
292 (lambda _
293 (install-file
294 "../source/copyright.txt"
295 (string-append
296 #$output "/share/doc/" #$name "-" #$version)))))))
297 (inputs
298 (list readline))
299 (native-inputs
300 (list clang googletest perl))
301 (home-page "https://people.eecs.berkeley.edu/~alanmi/abc/")
302 (synopsis "Sequential logic synthesis and formal verification")
303 (description "ABC is a program for sequential logic synthesis and
304formal verification.")
305 (license
306 (list license:expat ;abc - the mit-modern-variant is used
307 license:expat ;btor, glucose, glucose2, kissat,
308 ;bsat2, cadical, bsat
309 license:bsd-3 ;bzlib
310 license:bsd-2 ;satoko
311 license:zlib))))) ;zlib
312
313(define-public abc-yosyshq
314 (package
315 (inherit abc)
316 (name "abc-yosyshq")
317 (version "0.69")
318 (source (origin
319 (method git-fetch)
320 (uri (git-reference
321 (url "https://github.com/YosysHQ/abc/")
322 (commit (string-append "v" version))))
323 (file-name (git-file-name name version))
324 ;; Remove *.dll and *.lib binaries.
325 (snippet
326 #~(begin
327 (use-modules (guix build utils))
328 (with-directory-excursion "lib"
329 (for-each delete-file-recursively '("x64" "x86")))))
330 (sha256
331 (base32
332 "12v5qf184im8mi37ph3863sx5p5238fqd3bfvqhg33gv5mwi5xqs"))
333 (patches
334 (search-patches "abc-tests.patch"))))
335 (arguments
336 (substitute-keyword-arguments arguments
337 ((#:phases phases #~%standard-phases)
338 #~(modify-phases #$phases
339 (replace 'install-license
340 (lambda _
341 (install-file
342 "../source/copyright.txt"
343 (string-append
344 #$output "/share/doc/" #$name "-" #$version))))))))
345 (home-page "https://github.com/YosysHQ/abc/")
346 (description "ABC is a program for sequential logic synthesis and
347formal verification. This is the Yosyshq fork of ABC.")
348 (license (license:non-copyleft "file:///copyright.txt"))))
349
350(define-public adms
351 (package
352 (name "adms")
353 (version "2.3.7")
354 (source (origin
355 (method git-fetch)
356 (uri (git-reference
357 (url "https://github.com/Qucs/ADMS")
358 (commit (string-append "release-" version))))
359 (file-name (git-file-name name version))
360 (sha256
361 (base32
362 "0i37c9k6q1iglmzp9736rrgsnx7sw8xn3djqbbjw29zsyl3pf62c"))))
363 (build-system gnu-build-system)
364 (arguments
365 (list #:phases
366 #~(modify-phases %standard-phases
367 (add-after 'unpack 'patch-shebang
368 (lambda _
369 (substitute* "bootstrap.sh"
370 (("# !/bin/sh")
371 (string-append "#!" (which "sh")))))))))
372 (native-inputs
373 (list autoconf
374 automake
375 bison
376 flex
377 libtool
378 perl
379 perl-xml-libxml))
380 (home-page "https://github.com/Qucs/ADMS")
381 (synopsis "Automatic device model synthesizer")
382 (description
383 "ADMS is a code generator that converts electrical compact device models
384specified in high-level description language into ready-to-compile C code for
385the API of spice simulators. Based on transformations specified in XML
386language, ADMS transforms Verilog-AMS code into other target languages.")
387 (license license:gpl3)))
388
389(define-public apycula
390 (package
391 (name "apycula")
392 (version "0.34")
393 ;; The pypi tar.gz file includes the necessary .pickle files, not available
394 ;; in the home-page repository.
395 (source
396 (origin
397 (method url-fetch)
398 (uri (pypi-uri "apycula" version))
399 (sha256
400 (base32 "0b5jg0bgknka0xzg0w6zhs9f8fqv5nk6yk2x72x9wa75bf3m3cdh"))))
401 (build-system pyproject-build-system)
402 (arguments
403 (list #:tests? #f ;requires Gowin EDA tools
404 #:phases
405 #~(modify-phases %standard-phases
406 (add-after 'unpack 'patch-setup
407 (lambda _
408 ;; Acceptable, but degraded performance.
409 (substitute* "setup.py"
410 ((".*fastcrc.*") ""))))))) ;TODO: Package python-fastcrc
411 (propagated-inputs
412 (list python-cattrs
413 python-numpy
414 python-msgpack
415 python-msgspec))
416 (native-inputs (list python-setuptools python-setuptools-scm))
417 (home-page "https://github.com/YosysHQ/apicula/")
418 (synopsis "Gowin FPGA bitstream format")
419 (description
420 "The project Apycula provides tools to support development and
421generating bitstreams with Gowin FPGAs.")
422 (license license:expat)))
423
424(define-public bender
425 (package
426 (name "bender")
427 (version "0.31.0")
428 (source
429 (origin
430 (method url-fetch)
431 (uri (crate-uri "bender" version))
432 (file-name (string-append name "-" version ".tar.gz"))
433 (sha256
434 (base32 "1ddrzn6ggwqsrxrkblsissyrmjbbgb90w1irpd0hrbjxwmsgv8gq"))))
435 (build-system cargo-build-system)
436 (inputs (cargo-inputs 'bender))
437 (home-page "https://github.com/pulp-platform/bender")
438 (synopsis "dependency management tool for hardware projects.")
439 (description
440 "This package provides a dependency management tool for hardware projects.")
441 (license (list license:asl2.0 license:expat))))
442
443(define-public camv-rnd
444 (package
445 (name "camv-rnd")
446 (version "1.1.7")
447 (source
448 (origin
449 (method url-fetch)
450 (uri (string-append "http://repo.hu/projects/camv-rnd/"
451 "releases/camv-rnd-" version ".tar.gz"))
452 (sha256
453 (base32
454 "0l61z35q1k6aixbq2sxdqzi7km7nk2d4z3n71z1my3nhiszhyzdm"))))
455 (build-system glib-or-gtk-build-system)
456 (arguments
457 (list
458 #:tests? #f
459 #:phases
460 #~(modify-phases %standard-phases
461 (replace 'configure
462 ;; The configure script doesn't tolerate most of our configure
463 ;; flags.
464 (lambda _
465 (setenv "CC" #$(cc-for-target))
466 (setenv "LIBRND_PREFIX" #$(this-package-input "librnd"))
467 (invoke "./configure" (string-append "--prefix=" #$output)))))))
468 (inputs (list librnd))
469 (home-page "http://repo.hu/projects/route-rnd/")
470 (synopsis "Viewer for electronic boards in CAM file formats")
471 (description
472 "@code{Camv-rnd} is a viewer for @acronym{PCB, Printed Circuit Board}
473supporting gerber, excellon and g-code. It is part of the RiNgDove EDA
474suite.")
475 (license license:gpl2+)))
476
477(define-public charlib
478 (package
479 (name "charlib")
480 (version "2.0.0")
481 (source
482 (origin
483 (method git-fetch)
484 (uri (git-reference
485 (url "https://github.com/stineje/CharLib")
486 (commit version)))
487 (sha256
488 (base32 "0phklm6wcpvwdfx00k0q8qvpvdqf6wjvzirkfji7vc7ils7wz2sl"))
489 (file-name (git-file-name name version))))
490 (build-system pyproject-build-system)
491 (inputs
492 (list ngspice
493 pyspice
494 python-liberty-parser
495 python-matplotlib
496 python-numpy
497 python-ply
498 python-pyyaml
499 python-requests
500 python-schema
501 python-scipy
502 python-tqdm))
503 (native-inputs
504 (list python-poetry-core
505 python-pytest
506 python-setuptools))
507 (home-page "https://stineje.github.io/CharLib")
508 (synopsis "CMOS standard-cell characterization")
509 (description
510 "@code{Charlib} is an @acronym{EDA, Electronic Design Automation} tool used to
511extract timing and power characteristics from CMOS combinational and sequential
512standard-cells. It is compatible with @code{ngspice} and @code{Xyce}.")
513 (license license:gpl2)))
514
515(define-public ciel
516 (package
517 (name "ciel")
518 (version "2.6.1")
519 (source
520 (origin
521 (method git-fetch)
522 (uri (git-reference
523 (url "https://github.com/fossi-foundation/ciel")
524 (commit version)))
525 (file-name (git-file-name name version))
526 (sha256
527 (base32 "1aqc68v57sx9grl311f5j6sg72a0rajbjrz40b9zchymvy51pyxc"))))
528 (arguments
529 (list
530 ;; No unit tests, there are some integration tests, see:
531 ;; <.github/workflows/ci.yml>.
532 #:tests? #f
533 #:phases
534 #~(modify-phases %standard-phases
535 (add-after 'unpack 'relax-requirements
536 (lambda _
537 (substitute* "pyproject.toml"
538 ;; rich = ">=12,<15"
539 ((">=12,<15") ">=12"))))
540 (add-after 'wrap 'wrap-ciel
541 (lambda* (#:key inputs #:allow-other-keys)
542 (wrap-program (string-append #$output "/bin/ciel")
543 `("PATH" ":" prefix
544 (,(string-append
545 (assoc-ref inputs "git-minimal") "/bin")))))))))
546 (build-system pyproject-build-system)
547 (native-inputs
548 (list python-poetry-core))
549 (inputs
550 (list bash-minimal
551 git-minimal/pinned))
552 (propagated-inputs
553 (list python-click
554 python-httpx
555 python-pcpp
556 python-rich
557 python-zstandard))
558 (home-page "https://github.com/fossi-foundation/ciel")
559 (synopsis
560 "Version manager for open-source @acronym{PDKs, Process Design Kits}")
561 (description
562 "@code{ciel} downloads and installs open-source PDKs which are used for
563chip design and @acronym{EDA, Electronic Design Automation}.")
564 (license license:asl2.0)))
565
566(define-public comedilib
567 (package
568 (name "comedilib")
569 (version "0.13.0")
570 (source (origin
571 (method url-fetch)
572 (uri (string-append "https://www.comedi.org/download/comedilib-"
573 version ".tar.gz"))
574 (sha256
575 (base32
576 "0jdw5gp02d8q3p4ldjrc3zaw0v435kmn3c95pv094gyxj3pwhacm"))))
577 (build-system gnu-build-system)
578 (synopsis "Library for Comedi")
579 (description "Comedilib is a user-space library that provides a
580developer-friendly interface to Comedi devices. Comedi is a collection of
581drivers for a variety of common data acquisition plug-in boards. The drivers
582are implemented as a core Linux kernel module providing common functionality and
583individual low-level driver modules.")
584 (home-page "https://www.comedi.org/")
585 (license license:lgpl2.1)))
586
587(define-public eqy
588 (package
589 (name "eqy")
590 (version "0.69")
591 (source
592 (origin
593 (method git-fetch)
594 (uri (git-reference
595 (url "https://github.com/YosysHQ/eqy/")
596 (commit (string-append "v" version))))
597 (file-name (git-file-name name version))
598 (sha256
599 (base32 "1zfhqr3ga7x63yx7p51wdqm2zj4ai3fdx95ma3r9virzwc7la07y"))))
600 (build-system gnu-build-system)
601 (arguments
602 (list
603 #:imported-modules %pyproject-build-system-modules
604 #:modules '((guix build gnu-build-system)
605 ((guix build pyproject-build-system) #:prefix py:)
606 (guix build utils))
607 #:make-flags
608 #~(list (string-append "PREFIX=" #$output))
609 #:phases
610 #~(modify-phases %standard-phases
611 (delete 'configure)
612 (delete 'build)
613 (delete 'check)
614 (add-after 'unpack 'build-info
615 (lambda _
616 (invoke "make" "-C" "docs" "info")
617 (install-file "docs/build/texinfo/yosyshqeqy.info"
618 (string-append #$output "/share/info"))))
619 (add-after 'unpack 'patch-/usr/bin/env
620 (lambda _
621 (substitute* "src/eqy_job.py"
622 (("\"/usr/bin/env\", ") ""))))
623 (add-after 'install 'check-after-install
624 (lambda* (#:key tests? #:allow-other-keys)
625 (when tests?
626 (setenv "PATH"
627 (string-append #$output "/bin:" (getenv "PATH")))
628 ;; make test fails on upstream, see:
629 ;; https://github.com/YosysHQ/eqy/actions/runs/18767539188/job/53545383858
630 (invoke "make" "-C" "examples/spm")
631 (invoke "make" "-C" "examples/simple"))))
632 (add-after 'install 'python:wrap
633 (assoc-ref py:%standard-phases 'wrap)))))
634 (native-inputs
635 (list
636 clang ;same as yosys
637 python-minimal-wrapper
638 python-sphinx
639 texinfo
640 yosys
641 `(,yosys "config")))
642 (inputs
643 (list python-click python-json5 readline))
644 (home-page "https://yosyshq.readthedocs.io/projects/eqy/en/latest/")
645 (synopsis "Equivalence checking using formal verification with Yosys")
646 (description
647 "@command{Eqy} is an @acronym{EDA, Electronic Design Automation}
648front-end driver program for Yosys-based formal hardware equivalence
649checking. It performs formal verification on two designs, such as ensuring
650that a synthesis tool has not introduced functional changes into a design, or
651ensuring that a design refactor preserves correctness in all conditions.")
652 (license license:isc)))
653
654(define-public fftgen
655 (let ((commit "3378b77d83a98b06184656a5cb9b54e50dfe4485") ;no releases
656 (revision "1"))
657 (package
658 (name "fftgen")
659 (version (git-version "0" revision commit))
660 (source
661 (origin
662 (method git-fetch)
663 (uri (git-reference
664 (url "https://github.com/ZipCPU/dblclockfft")
665 (commit commit)))
666 (file-name (git-file-name name version))
667 (sha256
668 (base32
669 "1rvln871wjkbbqnv88jnx328xlhn5sgbr8fglk3ajnd9rwgiq3jg"))))
670 (build-system gnu-build-system)
671 (arguments
672 (list
673 #:test-target "bench-test"
674 #:make-flags #~(list "CFLAGS=-g -O2") ;default flags lack -O2
675 #:phases
676 #~(modify-phases %standard-phases
677 (delete 'configure)
678 (replace 'install
679 (lambda _
680 (install-file "sw/fftgen"
681 (string-append #$output "/bin")))))))
682 (native-inputs (list bc fftw python-minimal verilator which))
683 (synopsis "Generic pipelined FFT core generator")
684 (description "fftgen produces @acronym{FFT, fast-Fourier transforms}
685hardware designs in Verilog.")
686 (home-page "https://github.com/ZipCPU/zipcpu/")
687 (license license:lgpl3+))))
688
689(define-public gdstk
690 (package
691 (name "gdstk")
692 (version "1.0.0")
693 (source
694 (origin
695 (method git-fetch)
696 (uri (git-reference
697 (url "https://github.com/heitzmann/gdstk")
698 (commit (string-append "v" version))))
699 (sha256
700 (base32 "0if4i71gsx5p8hspmxhhdf1pj7ynkpdq74rybb1nbpjwg26fsd30"))
701 (file-name (git-file-name name version))
702 (snippet '(begin
703 ;; This snippet is also inherited by python-gdstk.
704 (use-modules (guix build utils))
705 ;; Disable 'external' source code directory.
706 (substitute* "CMakeLists.txt"
707 (("add_subdirectory\\(external\\)")
708 ""))
709 (delete-file-recursively "external")
710 (substitute* "src/CMakeLists.txt"
711 (("clipper)")
712 "polyclipping)"))
713 (substitute* "src/clipper_tools.cpp"
714 (("clipper/")
715 "polyclipping/"))))))
716 (build-system cmake-build-system)
717 (arguments
718 (list
719 #:phases
720 #~(modify-phases %standard-phases
721 (add-before 'check 'build-examples
722 (lambda* (#:key tests? #:allow-other-keys)
723 (when tests?
724 (invoke "make" "examples")))))))
725 (native-inputs (list python-minimal-wrapper))
726 (inputs (list clipper qhull zlib))
727 (home-page "https://heitzmann.github.io/gdstk/")
728 (synopsis "Library for creation and manipulation of GDSII files")
729 (description
730 "@code{gdstk} is a library for creation and manipulation of GDSII
731layout files which are commonly used for
732@acronym{EDA, elecronic design automation} and chip design.")
733 (license license:boost1.0)))
734
735(define-public gerbv
736 (package
737 (name "gerbv")
738 (version "2.13.0")
739 (source
740 (origin
741 (method git-fetch)
742 (uri (git-reference
743 (url "https://github.com/gerbv/gerbv")
744 (commit (string-append "v" version))))
745 (file-name (git-file-name name version))
746 (sha256
747 (base32 "1vm5i5rnajvz1wv6kbinyrp6bfwqcvf34l492xyvn75589xal72c"))))
748 (build-system cmake-build-system)
749 (arguments
750 (list
751 ;; TODO: See tests/README.md.
752 #:tests? #f ;passed 94, failed 11, skipped 0 out of 105 tests
753 #:configure-flags #~(list
754 (string-append "-DCMAKE_C_FLAGS="
755 "-Wno-implicit-function-declaration"
756 " -Wno-int-conversion"))))
757 (native-inputs (list desktop-file-utils
758 gettext-minimal
759 ;; Version generator needs git to work properly:
760 ;; https://github.com/gerbv/gerbv/issues/244
761 git-minimal/pinned
762 pkg-config))
763 (inputs (list cairo
764 ;; As of 2.13.0 gerbv is still GTK+2 only. GTK 3/4 porting
765 ;; issue: https://github.com/gerbv/gerbv/issues/71.
766 gtk+-2))
767 (home-page "https://gerbv.github.io/")
768 (synopsis "Gerber file viewer")
769 (description
770 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
771is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
772you load several files on top of each other, do measurements on the displayed
773image, etc. Besides viewing Gerbers, you may also view Excellon drill files
774as well as pick-place files.")
775 (license license:gpl2+)))
776
777(define-public gnucap
778 (package
779 (name "gnucap")
780 (version "20260329")
781 (source
782 (origin
783 (method git-fetch)
784 (uri (git-reference
785 (url "https://git.git.savannah.gnu.org/git/gnucap.git")
786 (commit (string-append version "-dev"))))
787 (file-name (git-file-name name version))
788 (sha256
789 (base32
790 "0lgsjpi158kdvc3mq20i120d71ql4qdsz4pcm732d9babc84jq8y"))))
791 (build-system gnu-build-system)
792 (arguments
793 (list
794 #:validate-runpath? #f
795 #:phases
796 #~(modify-phases %standard-phases
797 (add-after 'unpack 'fixes
798 (lambda _
799 (substitute* "configure"
800 (("force_in_tree=no") "force_in_tree=yes"))
801 (substitute* "tests/Make.test"
802 (("SHELL=/bin/bash")
803 (string-append "SHELL=" (which "sh"))))))
804 (add-before 'validate-runpath 'wrap
805 (lambda _
806 (for-each
807 (lambda (program)
808 (wrap-program (string-append #$output "/bin/" program)
809 `("LD_LIBRARY_PATH" ":" prefix
810 (,(string-append #$output "/lib")))))
811 (list "gnucap" "gnucap-modelgen")))))))
812 (native-inputs (list which))
813 (inputs (list readline))
814 (home-page "https://www.gnu.org/software/gnucap/")
815 (synopsis "Mixed analog and digital circuit simulator")
816 (description "GNUcap is a circuit analysis package used for @acronym{EDA,
817Electronic Design Automation}. It offers a general purpose circuit simulator
818and can perform DC and transient analyses, fourier analysis and AC analysis.
819The engine is designed to do true mixed-mode simulation.")
820 (license license:gpl3+)))
821
822(define-public gtkwave
823 ;; The last release is more than 2 years old, and there are improvements in
824 ;; the master branch, such as GTK 4 support: pick the latest commit that
825 ;; passes their CI.
826 (let ((commit "7d7b4db9e2f5485afe2aeeab0ad112f5b6a9b94b")
827 (revision "0"))
828 (package
829 (name "gtkwave")
830 ;; The version string can be found in meson.build.
831 (version (git-version "4.0.0" revision commit))
832 (source
833 (origin
834 (method git-fetch)
835 (uri (git-reference
836 (url "https://github.com/gtkwave/gtkwave")
837 (commit commit)))
838 (file-name (git-file-name name version))
839 (sha256
840 (base32 "18k3axnnpj0zfmwfg6anm09niyyzv7323m7yppm19xz4w7y9chll"))))
841 (build-system meson-build-system)
842 (arguments (list #:glib-or-gtk? #t))
843 (native-inputs (list desktop-file-utils
844 flex
845 `(,glib "bin") ;for glib-mkenums
846 gobject-introspection
847 gperf
848 `(,gtk "bin")
849 pkg-config))
850 (inputs (list gtk gtk+ json-glib libfst))
851 (synopsis "Waveform viewer for FPGA simulator trace files")
852 (description "This package is a waveform viewer for @acronym{FST, FPGA
853Simulator Trace} files.")
854 (home-page "https://github.com/gtkwave/gtkwave")
855 ;; Exception against free government use in tcl_np.c and tcl_np.h.
856 (license (list license:gpl2+ license:expat license:tcl/tk)))))
857
858(define-public hal
859 (package
860 (name "hal")
861 (version "4.5.0")
862 (source
863 (origin
864 (method git-fetch)
865 (uri (git-reference
866 (url "https://github.com/emsec/hal")
867 (commit (string-append "v" version))))
868 (file-name (git-file-name name version))
869 (sha256
870 (base32 "1mb8mdrw8kp9mxj7ayv9gw59ghkbaj4jy1pbba8ia3s2nbzwqwp0"))
871 (patches
872 (search-patches "hal-disable-googletest.patch"))
873 (modules '((guix build utils)))
874 (snippet #~(delete-all-but "deps" "abc" "subprocess"))))
875 (build-system qt-build-system)
876 (arguments
877 (list
878 #:tests? #f ;too many failures in this release
879 #:configure-flags
880 #~(list "-DBUILD_ALL_PLUGINS=ON"
881 "-DBUILD_TESTS=ON"
882 (string-append
883 "-DLIBRARY_INSTALL_DIRECTORY_FULL="
884 #$output "/lib;" #$output "/lib/hal_plugins")
885 "-DUSE_VENDORED_PYBIND11=OFF"
886 "-DUSE_VENDORED_SPDLOG=OFF"
887 "-DUSE_VENDORED_QUAZIP=OFF"
888 "-DUSE_VENDORED_IGRAPH=OFF"
889 "-DUSE_VENDORED_NLOHMANN_JSON=OFF"
890 "-DHAL_VERSION_MAJOR=4"
891 "-DHAL_VERSION_MINOR=5"
892 "-DHAL_VERSION_PATCH=0"
893 "-DHAL_VERSION_TWEAK=0"
894 "-DHAL_VERSION_ADDITIONAL_COMMITS=0"
895 "-DHAL_VERSION_DIRTY=false"
896 "-DHAL_VERSION_BROKEN=false"
897 "-DENABLE_PPA=OFF"
898 (string-append "-DCMAKE_MODULE_PATH="
899 #$(this-package-native-input "sanitizers-cmake")
900 "/share/sanitizers-cmake/cmake"))
901 #:phases
902 #~(modify-phases %standard-phases
903 (add-after 'unpack 'fix-cmake-release-detection
904 (lambda _
905 (substitute* '("cmake/detect_dependencies.cmake"
906 "plugins/gui/CMakeLists.txt")
907 (("IMPORTED_LOCATION_RELEASE\\)") "LOCATION)"))))
908 (add-before 'check 'set-home
909 (lambda _ (setenv "HOME" "/tmp"))))))
910 (native-inputs
911 (list googletest
912 pkg-config
913 pybind11
914 python-wrapper
915 sanitizers-cmake
916 verilator))
917 (inputs
918 (list bitwuzla
919 boost
920 gmp
921 graphviz
922 igraph
923 nlohmann-json
924 mpfr
925 qtbase-5
926 qtsvg-5
927 quazip-5
928 rapidjson
929 spdlog
930 symfpu
931 z3))
932 (home-page "https://github.com/emsec/hal")
933 (synopsis "Hardware analyzer for netlists")
934 (description "HAL is an @acronym{EDA, Electronic Design Automation}
935comprehensive netlist reverse engineering and manipulation framework. It
936provides a framework to parse netlists of arbitrary sources, e.g., FPGAs or
937ASICs, into a graph-based netlist representation, providing the necessary
938built-in tools for traversal and analysis of the included gates and nets.")
939 (license license:expat)))
940
941(define-public horizon-eda
942 (package
943 (name "horizon-eda")
944 (version "2.7.2")
945 ;; TODO: try to unbundle some of the 3rd parties.
946 ;; We have packages for nlohmann-json, range-v3, catch2 and clipper.
947 (source
948 (origin
949 (method git-fetch)
950 (uri (git-reference
951 (url "https://github.com/horizon-eda/horizon")
952 (commit (string-append "v" version))))
953 (file-name (git-file-name name version))
954 (sha256
955 (base32 "16q22yf407820430cva8i2b3dcmwpjdsbx0wlarj8v2mj5ixs932"))))
956 (build-system meson-build-system)
957 (arguments
958 (list
959 #:tests? #f ; no tests
960 #:glib-or-gtk? #t))
961 (native-inputs (list cmake-minimal ;; OpenCASCADE is only found by cmake
962 `(,glib "bin")
963 gobject-introspection
964 pkg-config))
965 (inputs (list boost
966 cairomm
967 cppzmq
968 curl
969 glib
970 glibmm
971 glm
972 gsettings-desktop-schemas
973 gtk+
974 gtkmm-3
975 libarchive
976 libgit2-glib
977 librsvg
978 libspnav
979 libzip
980 opencascade-occt
981 podofo
982 sqlite
983 `(,util-linux "lib")
984 zeromq))
985 (home-page "https://horizon-eda.org/")
986 (synopsis "@acronym{PCB, Printed Circuit Board} design tool")
987 (description "Horizon is an @acronym{EDA, Electronic Design Automation}
988package supporting an integrated end-to-end workflow for PCB design, including
989from parts management and schematic entry to gerber export.")
990 (license license:gpl3+)))
991
992;; Deprecated on 2026-07-13.
993(define-deprecated/public-alias input-leap
994 (@ (gnu packages hardware) input-leap))
995
996(define-public iverilog
997 (package
998 (name "iverilog")
999 (version "13_0")
1000 (source
1001 (origin
1002 (method git-fetch)
1003 (uri (git-reference
1004 (url "https://github.com/steveicarus/iverilog")
1005 (commit
1006 (string-append "v" version))))
1007 (file-name (git-file-name name version))
1008 (sha256
1009 (base32 "0vjja9vlnia42wb5l6vg7zv2v3n6d70nr0l26b3v0lmpnb3q7ws9"))))
1010 (build-system gnu-build-system)
1011 (arguments
1012 (list
1013 #:bootstrap-scripts #~(list "autoconf.sh")
1014 #:make-flags
1015 #~(list (string-append "CC=" #$(cc-for-target))
1016 (string-append "CXX=" #$(cxx-for-target))
1017 (string-append "PREFIX=" #$output))
1018 #:phases #~(modify-phases %standard-phases
1019 (add-after 'unpack 'ensure-native-baked-CC/CXX
1020 (lambda _
1021 ;; The compilers used to build are retained in
1022 ;; bin/iverilog-vpi, which is a Makefile
1023 ;; script. Normalize these to just 'gcc' and 'g++' to
1024 ;; avoid having these set to cross compilers.
1025 (substitute* "Makefile.in"
1026 (("s;@IVCC@;\\$\\(CC);")
1027 "s;@IVCC@;gcc;")
1028 (("s;@IVCXX@;\\$\\(CXX);")
1029 "s;@IVCXX@;g++;")))))))
1030 (native-inputs (list autoconf bison flex gperf perl tcsh))
1031 (inputs (list zlib))
1032 (home-page "https://steveicarus.github.io/iverilog/")
1033 (synopsis "Verilog/SystemVerilog HDL compiler")
1034 (description
1035 "Icarus Verilog is a Verilog/SystemVerilog @acronym{EDA, Electronic
1036Design Automation} compiler that generates code employed by back-end
1037tools. It operates compiling source code written in Verilog
1038(IEEE-1364) and SystemVerilog (IEEE-1800) into some target format.
1039For batch simulation, the compiler can generate an intermediate form
1040called vvp assembly. This intermediate form is executed by @command{vvp}.
1041For synthesis, the compiler generates netlists in the desired format.")
1042 ;; GPL2 only because of:
1043 ;; - ./driver/iverilog.man.in
1044 ;; - ./iverilog-vpi.man.in
1045 ;; - ./tgt-fpga/iverilog-fpga.man
1046 ;; - ./vvp/vvp.man.in
1047 ;; Otherwise would be GPL2+.
1048 ;; You have to accept both GPL2 and LGPL2.1+.
1049 (license (list license:gpl2 license:lgpl2.1+))))
1050
1051(define-public icestorm
1052 (package
1053 (name "icestorm")
1054 (version "1.1")
1055 (source
1056 (origin
1057 (method git-fetch)
1058 (uri (git-reference
1059 (url "https://github.com/YosysHQ/icestorm/")
1060 (commit (string-append "v" version))))
1061 (file-name (git-file-name name version))
1062 (sha256
1063 (base32 "0yh36kd23y4sk65g34r1h244ax9fj5c668y6pwqwaq3c0nmb3d28"))))
1064 (build-system gnu-build-system)
1065 (arguments
1066 (list
1067 #:tests? #f ;no tests
1068 #:make-flags
1069 #~(list (string-append "CC=" #$(cc-for-target))
1070 (string-append "CXX=" #$(cxx-for-target))
1071 (string-append "PREFIX=" #$output)
1072 "ICEPROG=1")
1073 #:phases
1074 #~(modify-phases %standard-phases
1075 (add-after 'unpack 'fix-usr-local
1076 (lambda _
1077 (substitute* "config.mk"
1078 (("/usr/local")
1079 #$output))
1080 (substitute* "icepack/Makefile"
1081 (("/usr/local")
1082 #$output))
1083 (substitute* "icebox/Makefile"
1084 (("/usr/local")
1085 #$output))
1086 (substitute* "icebox/icebox_vlog.py"
1087 (("/usr/local")
1088 #$output))))
1089 (add-after 'build 'make-info
1090 (lambda _
1091 (with-directory-excursion "docs"
1092 (invoke "make" "info")
1093 (install-file "build/texinfo/projecticestorm.info"
1094 (string-append #$output "/share/info"))
1095 (copy-recursively
1096 "build/texinfo/projecticestorm-figures"
1097 (string-append #$output
1098 "/share/info/projecticestorm-figures")))))
1099 (delete 'configure))))
1100 (inputs
1101 (list libftdi))
1102 (native-inputs
1103 (list pkg-config
1104 python-minimal
1105 python-sphinx-rtd-theme
1106 python-sphinxcontrib-svg2pdfconverter
1107 texinfo))
1108 (home-page "https://prjicestorm.readthedocs.io/")
1109 (synopsis "Bitstream tools for Lattice iCE40 FPGAs")
1110 (description
1111 "Project IceStorm aims at documenting the bitstream format of Lattice
1112iCE40 FPGAs and providing simple tools for analyzing and creating bitstream
1113files.")
1114 (license license:isc)))
1115
1116(define-public klayout
1117 (package
1118 (name "klayout")
1119 (version "0.30.12")
1120 (source
1121 (origin (method git-fetch)
1122 (uri (git-reference
1123 (url "https://github.com/KLayout/klayout")
1124 (commit (string-append "v" version))))
1125 (file-name (git-file-name name version))
1126 (sha256
1127 (base32
1128 "05clrr88g3d7rh2m53xv6h384kdif2nfmp0clfy09k7v2m4n7nb4"))))
1129 (build-system copy-build-system)
1130 (arguments
1131 (list
1132 #:install-plan
1133 #~'(("output/klayout" "bin/")
1134 ("output/" "bin/" #:include-regexp ("strm.*"))
1135 ("output/" "lib/" #:include-regexp ("lib.*\\.so.*"))
1136 ("output/pymod" "lib/"))
1137 #:phases
1138 #~(modify-phases %standard-phases
1139 (add-before 'install 'patch-build-script ;; ensure reproducibility
1140 (lambda _
1141 (substitute* "build.sh"
1142 (("KLAYOUT_VERSION_DATE=\"\\$KLAYOUT_VERSION_DATE\"")
1143 "KLAYOUT_VERSION_DATE=1970-01-01"))))
1144 (add-after 'patch-build-script 'disable-failing-tests
1145 (lambda _
1146 (substitute* "src/tl/unit_tests/unit_tests.pro"
1147 ;; These need internet connection.
1148 ((" tlWebDAVTests\\.cc")
1149 "# tlWebDAVTests.cc \\")
1150 ((" tlGitTests\\.cc")
1151 "# tlGitTests.cc \\")
1152 ((" tlHttpStreamTests\\.cc")
1153 "# tlHttpStreamTests.cc \\")
1154 ;; The threaded tests are reportedly flaky.
1155 ((" tlThreadedWorkersTests\\.cc")
1156 "# tlThreadedWorkersTests\\.cc \\"))
1157 (substitute* "src/rba/rba.pro"
1158 ;; There are issues of non-detereminism involved with Ruby's GC
1159 ;; implementation. https://github.com/KLayout/klayout/issues/2251
1160 (("SUBDIRS = rba unit_tests")
1161 "SUBDIRS = rba")
1162 (("unit_tests.depends += rba")
1163 ""))))
1164 (add-after 'disable-failing-tests 'build
1165 (lambda _
1166 (invoke "bash" "build.sh"
1167 "-prefix" "output"
1168 "-option"
1169 (string-append "-j" (number->string (parallel-job-count))))))
1170 (add-after 'install 'patch-elfs
1171 (lambda _
1172 (let* ((lib (string-append #$output "/lib"))
1173 (layout-lib (string-append lib "/lay_plugins"))
1174 (db-lib (string-append lib "/db_plugins"))
1175 (bin (string-append #$output "/bin"))
1176 (executables (filter executable-file? (find-files #$output)))
1177 (ut-runner "build-release/ut_runner")
1178 (unit-tests (cons* ut-runner
1179 (find-files "build-release" "\\.ut")))
1180 (patchem (lambda (elf)
1181 (when (not (string-suffix? ".py" elf))
1182 (invoke "patchelf" "--add-rpath" lib elf)
1183 (invoke "patchelf" "--add-rpath" layout-lib elf)
1184 (invoke "patchelf" "--add-rpath" db-lib elf)))))
1185 (map patchem executables)
1186 (map patchem unit-tests)
1187 (patchem ut-runner))))
1188 (add-after 'patch-elfs 'check-after-install
1189 (lambda* (#:key tests? #:allow-other-keys)
1190 (when tests?
1191 (with-directory-excursion "build-release"
1192 (mkdir "testtmp")
1193 (setenv "TESTTMP" "testtmp")
1194 (setenv "TESTSRC" "..")
1195 (setenv "LD_LIBRARY_PATH" ".")
1196 (setenv "QT_QPA_PLATFORM" "offscreen")
1197 (setenv "HOME" "/tmp/home") ;; Fontconfig needs a writable cache.
1198 (invoke "./ut_runner"))))))))
1199 (native-inputs (list perl python qtsvg ruby tcl))
1200 (inputs
1201 (list bash-minimal
1202 libgit2
1203 patchelf
1204 qt5compat
1205 qtbase
1206 qtmultimedia
1207 qtsvg
1208 qttools))
1209 (home-page "https://www.klayout.de")
1210 (synopsis "Mask layout editor")
1211 (description "KLayout is @acronym{EDA, Electronic Design Automation}
1212software. It is a scriptable @acronym{VLSI, Very Large Scale Integration}
1213layout editor used for visualizing and editing mask data, transcoding between
1214different file formats (GDSII and OASIS), executing @acronym{DRC, Design rule
1215checking}, @acronym{LVS, Layout Versus Schematic} verification, and drawing of
1216chip cross-sections basked on mask data.")
1217 ;; The license version will be clarified with the next version bump.
1218 (license license:gpl3+)))
1219
1220(define-public lctime
1221 (package
1222 (name "lctime")
1223 (version "0.0.28")
1224 (source
1225 (origin
1226 (method git-fetch)
1227 (uri (git-reference
1228 (url "https://codeberg.org/librecell/lctime")
1229 (commit version)))
1230 (sha256
1231 (base32 "18s7by4ndxxha1yr6sns389smgrz9df5sgqwvvxcw8wwv8v7mpjd"))
1232 (file-name (git-file-name name version))))
1233 (build-system pyproject-build-system)
1234 (arguments
1235 (list
1236 #:phases
1237 #~(modify-phases %standard-phases
1238 (add-after 'unpack 'patch-ngspice-path
1239 (lambda* (#:key inputs #:allow-other-keys)
1240 (substitute* "src/lctime/characterization/ngspice_subprocess.py"
1241 (("= 'ngspice'")
1242 (format #f "= ~s"
1243 (search-input-file inputs "bin/ngspice"))))))
1244 (replace 'check
1245 (lambda* (#:key tests? #:allow-other-keys)
1246 (when tests?
1247 (invoke "bash" "./run_tests.sh")))))))
1248 (inputs (list ngspice
1249 pyspice
1250 python-joblib
1251 python-klayout
1252 python-liberty-parser
1253 python-networkx
1254 python-numpy
1255 python-ply
1256 python-requests
1257 python-scipy
1258 python-sympy))
1259 (native-inputs (list bash-minimal python-pytest python-setuptools))
1260 (home-page "https://codeberg.org/librecell/lctime")
1261 (synopsis "CMOS standard-cell characterization tool")
1262 (description
1263 "lctime extracts timing and power characteristics of CMOS standard-cells.
1264It simulates the netlists of the cells with ngspice and writes the
1265characterization result in a liberty library file.")
1266 (license license:agpl3+)))
1267
1268(define-public kicad
1269 (package
1270 (name "kicad")
1271 (version "10.0.6")
1272 (source (origin
1273 (method git-fetch)
1274 (uri (git-reference
1275 (url "https://gitlab.com/kicad/code/kicad.git")
1276 (commit version)))
1277 (sha256
1278 (base32
1279 "0x9376x4nigqnx4d82qixz41p779svjdsgkxv6l0kmn3snvwbcgk"))
1280 ;; See: https://gitlab.com/kicad/code/kicad/-/merge_requests/2659.
1281 (patches
1282 (search-patches "kicad-disable-updates.patch"))
1283 (file-name (git-file-name name version))))
1284 (build-system cmake-build-system)
1285 (arguments
1286 `(#:out-of-source? #t
1287 #:tests? #f ;no tests
1288 #:build-type "Release"
1289 #:configure-flags
1290 ,#~(list (string-append "-DOCC_INCLUDE_DIR="
1291 #$(file-append opencascade-occt
1292 "/include/opencascade"))
1293 ;; Guix uses 'wxwidgets-sans-egl' for KiCad because
1294 ;; wxWidgets' EGL canvas support breaks with glew-2.2.
1295 "-DKICAD_WAYLAND=OFF"
1296 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
1297 "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
1298 #:phases
1299 (modify-phases %standard-phases
1300 (add-after 'unpack 'fix-ngspice-detection
1301 (lambda* (#:key inputs #:allow-other-keys)
1302 (substitute* "eeschema/CMakeLists.txt"
1303 (("NGSPICE_DLL_FILE=\"\\$\\{NGSPICE_DLL_FILE\\}\"")
1304 (string-append "NGSPICE_DLL_FILE=\"libngspice.so\""))
1305 (("NGSPICE_DLL_DIR=\"\\$\\{NGSPICE_DLL_DIR\\}\"")
1306 (string-append "NGSPICE_DLL_DIR=\""
1307 (dirname
1308 (search-input-file inputs
1309 "lib/libngspice.so"))
1310 "\"")))))
1311 (add-after 'install 'wrap-programs
1312 ;; Set up proxy discovery and Python for standalone editors too.
1313 (lambda* (#:key inputs outputs #:allow-other-keys)
1314 (let* ((out (assoc-ref outputs "out"))
1315 (python (assoc-ref inputs "python"))
1316 (schemas (assoc-ref inputs "gsettings-desktop-schemas"))
1317 (gtk (assoc-ref inputs "gtk+"))
1318 (networking (assoc-ref inputs "glib-networking"))
1319 (mime (assoc-ref inputs "shared-mime-info"))
1320 (path (string-append out "/lib/python"
1321 ,(version-major+minor (package-version
1322 python))
1323 "/site-packages:"
1324 (getenv "GUIX_PYTHONPATH"))))
1325 (for-each
1326 (lambda (file)
1327 (wrap-program file
1328 `("GUIX_PYTHONPATH" ":" prefix (,path))
1329 `("PATH" ":" prefix (,(string-append python "/bin")))
1330 ;; GdkPixbuf needs MIME data to recognize image formats.
1331 `("XDG_DATA_DIRS" ":" prefix
1332 (,(string-append schemas "/share")
1333 ,(string-append gtk "/share")
1334 ,(string-append mime "/share")))
1335 `("GIO_EXTRA_MODULES" ":" prefix
1336 (,(string-append networking "/lib/gio/modules")))))
1337 ;; The launchers have no extension. Do not wrap the .kiface
1338 ;; shared libraries installed alongside them.
1339 (find-files (string-append out "/bin") "^[^.]+$"))))))))
1340 (native-search-paths
1341 ;; Currently, KiCad environment variables are single-valued
1342 ;; (see https://gitlab.com/kicad/code/kicad/-/issues/14792).
1343 (list (search-path-specification
1344 (variable "KICAD") ;to find kicad-doc
1345 (files '(""))
1346 (separator #f))
1347 (search-path-specification
1348 (variable "KICAD10_TEMPLATE_DIR")
1349 (files '("share/kicad/template"))
1350 (separator #f))
1351 (search-path-specification
1352 (variable "KICAD10_SYMBOL_DIR")
1353 (files '("share/kicad/symbols"))
1354 (separator #f))
1355 (search-path-specification
1356 (variable "KICAD10_FOOTPRINT_DIR")
1357 (files '("share/kicad/footprints"))
1358 (separator #f))
1359 (search-path-specification
1360 (variable "KICAD10_3DMODEL_DIR")
1361 (files '("share/kicad/3dmodels"))
1362 (separator #f))
1363 (search-path-specification
1364 (variable "KICAD_STOCK_DATA_HOME")
1365 (files '("share/kicad"))
1366 (separator #f))))
1367 (native-inputs (list boost
1368 desktop-file-utils
1369 gettext-minimal
1370 pkg-config
1371 swig-4.4
1372 unixodbc
1373 zlib))
1374 (inputs (list bash-minimal
1375 cairo
1376 curl
1377 gdk-pixbuf
1378 glew
1379 glib-networking
1380 glm
1381 gsettings-desktop-schemas
1382 hicolor-icon-theme
1383 gtk+
1384 libgit2
1385 libngspice
1386 libspnav
1387 libsecret
1388 libsm
1389 mesa
1390 nng
1391 opencascade-occt
1392 openssl
1393 poppler
1394 protobuf
1395 python-wrapper
1396 python-wxpython
1397 shared-mime-info
1398 wxwidgets-sans-egl
1399 (list zstd "lib")))
1400 (home-page "https://www.kicad.org/")
1401 (synopsis "Electronics Design Automation Suite")
1402 (description
1403 "Kicad is a program for the formation of printed circuit
1404boards and electrical circuits. The software has a number of programs that
1405perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
1406electrical diagrams), gerbview (viewing Gerber files) and others. To use
1407SQLite-backed database libraries, install the optional @code{sqliteodbc}
1408package.")
1409 (license license:gpl3+)))
1410
1411(define-public kicad-doc
1412 (package
1413 (name "kicad-doc")
1414 (version (package-version kicad))
1415 (source (origin
1416 (method git-fetch)
1417 (uri (git-reference
1418 (url "https://gitlab.com/kicad/services/kicad-doc.git")
1419 (commit version)))
1420 (file-name (git-file-name name version))
1421 (sha256
1422 (base32
1423 "0y82qkks3l003d7fka3aicmrx8qa7ch819y8kgghpxc5nqzw8nz8"))))
1424 (build-system cmake-build-system)
1425 (arguments
1426 `(#:configure-flags (list "-DBUILD_FORMATS=html"
1427 "-DLANGUAGES=en")
1428 #:tests? #f)) ;no test suite
1429 (native-inputs (list asciidoc
1430 gettext-minimal
1431 git-minimal/pinned
1432 perl
1433 perl-unicode-linebreak
1434 perl-yaml-tiny
1435 po4a
1436 ruby-asciidoctor/minimal
1437 source-highlight))
1438 (home-page "https://kicad.org")
1439 (synopsis "KiCad official documentation")
1440 (description "This repository contains the official KiCad documentation.")
1441 (license license:gpl3+)))
1442
1443(define-public kicad-symbols
1444 (package
1445 (name "kicad-symbols")
1446 (version (package-version kicad))
1447 (source (origin
1448 (method git-fetch)
1449 (uri (git-reference
1450 (url "https://gitlab.com/kicad/libraries/kicad-symbols.git")
1451 (commit version)))
1452 (file-name (git-file-name name version))
1453 (sha256
1454 (base32
1455 "0ynmi6qg5cac37vn0q986vh2a560ab8vb24yg7bfbkyj8b5xk353"))))
1456 (build-system cmake-build-system)
1457 (native-inputs (list python-wrapper))
1458 (arguments
1459 `(#:tests? #f)) ; no tests exist
1460 (home-page (package-home-page kicad))
1461 (synopsis "Official KiCad schematic symbol libraries")
1462 (description "This package contains the official KiCad schematic symbol
1463libraries.")
1464 ;; TODO: Exception: "To the extent that the creation of electronic designs
1465 ;; that use 'Licensed Material' can be considered to be 'Adapted Material',
1466 ;; then the copyright holder waives article 3 of the license with respect to
1467 ;; these designs and any generated files which use data provided as part of
1468 ;; the 'Licensed Material'."
1469 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
1470 (license license:cc-by-sa4.0)))
1471
1472(define-public kicad-footprints
1473 (package
1474 (inherit kicad-symbols)
1475 (name "kicad-footprints")
1476 (version (package-version kicad))
1477 (source (origin
1478 (method git-fetch)
1479 (uri (git-reference
1480 (url "https://gitlab.com/kicad/libraries/kicad-footprints.git")
1481 (commit version)))
1482 (file-name (git-file-name name version))
1483 (sha256
1484 (base32
1485 "11hhdk8g7hsm50817x7204lzm1qpjpfjr82gyrnhdshnnzd0hbf7"))))
1486 (synopsis "Official KiCad footprint libraries")
1487 (description "This package contains the official KiCad footprint libraries.")))
1488
1489(define-public kicad-packages3d
1490 (package
1491 (inherit kicad-symbols)
1492 (name "kicad-packages3d")
1493 (version (package-version kicad))
1494 (source (origin
1495 (method git-fetch)
1496 (uri (git-reference
1497 (url "https://gitlab.com/kicad/libraries/kicad-packages3D.git")
1498 (commit version)))
1499 (file-name (git-file-name name version))
1500 (sha256
1501 (base32
1502 "1mkcf6yn64pqjk51srnv5cidcji0hrx8nfh0q5zyc4ca7p7984li"))))
1503 (synopsis "Official KiCad 3D model libraries")
1504 (description "This package contains the official KiCad 3D model libraries.")))
1505
1506(define-public kicad-templates
1507 (package
1508 (inherit kicad-symbols)
1509 (name "kicad-templates")
1510 (version (package-version kicad))
1511 (source (origin
1512 (method git-fetch)
1513 (uri (git-reference
1514 (url "https://gitlab.com/kicad/libraries/kicad-templates.git")
1515 (commit version)))
1516 (file-name (git-file-name name version))
1517 (sha256
1518 (base32
1519 "0zs29zn8qjgxv0w1vyr8yxmj02m8752zagn4vcraqgik46dwg2id"))))
1520 (synopsis "Official KiCad project and worksheet templates")
1521 (description "This package contains the official KiCad project and
1522worksheet templates.")))
1523
1524(define-public kicad-cern-libraries
1525 ;; Upstream does not tag releases.
1526 (let ((commit "980670fefdf71965aae6c56194d7f2a68c3e6a68")
1527 (revision "0"))
1528 (package
1529 (name "kicad-cern-libraries")
1530 (version (git-version "0" revision commit))
1531 (source
1532 (origin
1533 (method git-fetch)
1534 (uri (git-reference
1535 (url "https://gitlab.com/ohwr/cern-kicad-libs.git")
1536 (commit commit)))
1537 (file-name (git-file-name name version))
1538 (sha256
1539 (base32 "0lr1p28gknbgsr86hbzh87plagcyc040v6141xmha280n78h2l62"))))
1540 (build-system copy-build-system)
1541 (arguments
1542 (list
1543 #:install-plan
1544 #~'(("SchLib" "share/kicad/cern/")
1545 ("PcbLib" "share/kicad/cern/")
1546 ("CERN.sqlite" "share/kicad/cern/")
1547 ("CERN_Linux.kicad_dbl" "share/kicad/cern/")
1548 ("fp-lib-table" "share/kicad/cern/")
1549 ("sym-lib-table" "share/kicad/cern/")
1550 ("README.md" "share/doc/kicad-cern-libraries/")
1551 ("LICENSE" "share/doc/kicad-cern-libraries/")
1552 ("LICENSES" "share/doc/kicad-cern-libraries/")
1553 ("CHECKSUMS" "share/doc/kicad-cern-libraries/")
1554 ("pcblib_conversion_log.txt" "share/doc/kicad-cern-libraries/")
1555 ("schlib_conversion_log.txt" "share/doc/kicad-cern-libraries/"))
1556 #:phases
1557 #~(modify-phases %standard-phases
1558 (add-after 'unpack 'adapt-library-tables
1559 (lambda _
1560 (substitute* "sym-lib-table"
1561 (("\\$\\{KICAD9_SYMBOL_DIR\\}")
1562 "${KICAD10_SYMBOL_DIR}")))))))
1563 (propagated-inputs (list sqliteodbc))
1564 (native-search-paths
1565 (list (search-path-specification
1566 (variable "CERN_LIB_DIR")
1567 (files '("share/kicad/cern"))
1568 (separator #f))))
1569 (home-page "https://gitlab.com/ohwr/cern-kicad-libs")
1570 (synopsis "CERN component libraries for KiCad")
1571 (description
1572 "This package provides CERN's KiCad component libraries, including
1573schematic symbols, footprints, a SQLite-backed database library, and KiCad
1574library tables. The libraries are generated from CERN's Altium Designer
1575libraries.")
1576 (license license:ohl2-p))))
1577
1578(define-public lepton-eda
1579 (package
1580 (name "lepton-eda")
1581 (version "1.9.18-20220529")
1582 (source (origin
1583 (method git-fetch)
1584 (uri (git-reference
1585 (url "https://github.com/lepton-eda/lepton-eda/")
1586 (commit version)))
1587 (sha256
1588 (base32
1589 "06plrcab3s2rpyf0qv2gzc1yp33627xi8105niasgixckk6glnc2"))
1590 (file-name (git-file-name name version))))
1591 (build-system gnu-build-system)
1592 (arguments
1593 (list
1594 #:configure-flags
1595 #~(list
1596 ;; When running "make", the POT files are built with the build time as
1597 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
1598 ;; files were updated and goes on to run "msgmerge"; as a result, the
1599 ;; non-deterministic POT-Creation-Date finds its way into .po files,
1600 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
1601 ;; never runs. See <https://bugs.debian.org/792687>.
1602 "ac_cv_path_MSGMERGE=true"
1603 (string-append "--with-pcb-datadir="
1604 #$(this-package-input "pcb")
1605 "/share")
1606 (string-append "--with-pcb-lib-path="
1607 #$(this-package-input "pcb")
1608 "/share/pcb/pcblib-newlib:"
1609 #$(this-package-input "pcb")
1610 "/share/pcb/newlib")
1611 "--with-gtk3"
1612 "CFLAGS=-fcommon"
1613 "--enable-guild"
1614 "--enable-contrib")
1615 #:phases
1616 #~(modify-phases %standard-phases
1617 (add-after 'unpack 'fix-tests
1618 (lambda _
1619 ;; For logs and auto-compilation
1620 (setenv "HOME" "/tmp")
1621
1622 ;; Ensure that readline is found by lepton-shell
1623 (substitute* "script.in"
1624 (("\\(eval-when \\(expand load eval\\)" m)
1625 (string-append "
1626(add-to-load-path \"" #$(this-package-input "guile-readline")
1627"/share/guile/site/3.0\")
1628(set! %load-compiled-path (cons \""
1629#$(this-package-input "guile-readline")
1630"/lib/guile/3.0/site-ccache/"
1631"\" %load-compiled-path))
1632" m)))))
1633 (add-before 'build 'fix-dynamic-link
1634 (lambda* (#:key inputs #:allow-other-keys)
1635 (substitute* "liblepton/scheme/lepton/ffi/lib.scm"
1636 (("\"liblepton\"")
1637 (string-append "\"" #$output "/lib/liblepton.so" "\""))
1638 (("\"libleptonattrib\"")
1639 (string-append "\"" #$output "/lib/libleptonattrib.so" "\""))
1640 (("\"libleptongui\"")
1641 (string-append "\"" #$output "/lib/libleptongui.so" "\""))
1642 (("\"libglib-2.0\"")
1643 (string-append
1644 "\"" (search-input-file inputs "/lib/libglib-2.0.so") "\""))
1645 (("\"libgobject-2.0\"")
1646 (string-append
1647 "\"" (search-input-file inputs "/lib/libgobject-2.0.so") "\""))
1648 (("\"libgtk-3\"")
1649 (string-append
1650 "\"" (search-input-file inputs "/lib/libgtk-3.so") "\"")))
1651
1652 ;; For finding libraries when running tests before installation.
1653 (setenv "LIBLEPTONGUI"
1654 (string-append (getcwd)
1655 "/libleptongui/src/.libs/libleptongui.so"))
1656 (setenv "LIBLEPTON"
1657 (string-append (getcwd)
1658 "/libleptongui/src/.libs/liblepton.so"))
1659 (setenv "LD_LIBRARY_PATH"
1660 (string-append (getcwd)
1661 "/libleptonattrib/src/.libs/:"
1662 (getenv "LIBRARY_PATH")))))
1663 (add-before 'bootstrap 'prepare
1664 (lambda _
1665 ;; Some of the scripts there are invoked by autogen.sh.
1666 (for-each patch-shebang
1667 (find-files "build-tools"))
1668
1669 ;; Make sure 'msgmerge' can modify the PO files.
1670 (for-each (lambda (po)
1671 (chmod po #o666))
1672 (find-files "." "\\.po$"))
1673
1674 ;; This would normally be created by invoking 'git', but it
1675 ;; doesn't work here.
1676 (call-with-output-file "version.h"
1677 (lambda (port)
1678 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
1679 #$(string-drop version
1680 (+ 1
1681 (string-index version #\-))))
1682 (format port
1683 "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
1684 #$(string-take version
1685 (string-index version #\-)))
1686 (format port
1687 "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))))
1688 (add-after 'install 'compile-scheme-files
1689 (lambda _
1690 (unsetenv "LIBLEPTONGUI")
1691 (unsetenv "LIBLEPTON")
1692 (unsetenv "LD_LIBRARY_PATH")
1693 (invoke "make" "precompile"))))))
1694 (native-inputs
1695 (list autoconf
1696 automake
1697 desktop-file-utils
1698 flex
1699 gettext-minimal
1700 groff
1701 gawk
1702 libtool
1703 pkg-config
1704 m4
1705 perl
1706 texinfo))
1707 (inputs
1708 (list glib
1709 gtk+
1710 gtksheet
1711 guile-3.0
1712 guile-readline
1713 pcb
1714 shared-mime-info))
1715 (home-page "https://lepton-eda.github.io/")
1716 (synopsis
1717 "Suite of tools for designing @acronym{PCB, Printed Circuit Boards}")
1718 (description
1719 "Lepton is an @acronym{EDA, Electronic Design Automation} tool set
1720forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
1721design, schematic capture, simulation, prototyping, and production. Lepton
1722EDA includes tools for schematic capture, attribute management, bill of
1723materials (BOM) generation, netlisting into over 20 netlist formats, analog
1724and digital simulation, and PCB layout, and many other features.")
1725 (license license:gpl2+)))
1726
1727(define-public libngspice
1728 ;; Note: The ngspice's build system does not allow us to build both the
1729 ;; library and the executables in one go. Thus, we have two packages.
1730 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1731 (package
1732 (name "libngspice")
1733 (version "45.2")
1734 (source
1735 (origin
1736 (method git-fetch)
1737 (uri (git-reference
1738 (url "https://git.code.sf.net/p/ngspice/ngspice")
1739 (commit (string-append "ngspice-" version))))
1740 (file-name (git-file-name name version))
1741 (sha256
1742 (base32 "0k32v64dhnv1abbgxd782qx0gzbwcfg3ijz9549j7bskik6kl2zr"))))
1743 (build-system gnu-build-system)
1744 (arguments
1745 (list
1746 #:tests? #f ;there are no tests for libngspice
1747 #:phases
1748 #~(modify-phases %standard-phases
1749 (add-after 'install 'delete-scripts
1750 (lambda _
1751 (delete-file-recursively
1752 (string-append #$output "/share/ngspice/scripts")))))
1753 #:configure-flags
1754 #~(list "--enable-openmp"
1755 "--enable-cider"
1756 "--enable-xspice"
1757 "--with-ngshared")))
1758 (native-inputs
1759 (list autoconf-2.71
1760 automake
1761 bison
1762 flex
1763 libtool))
1764 (home-page "https://ngspice.sourceforge.io/")
1765 (synopsis "Mixed-level/mixed-signal circuit simulator")
1766 (description
1767 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1768@code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1769provides code modeling support and simulation of digital components through
1770an embedded event driven algorithm.")
1771 (license (list license:lgpl2.0+ ;code in frontend/numparam
1772 (license:non-copyleft "file:///COPYING") ;spice3 bsd-style
1773 license:bsd-3 ;ciderlib
1774 license:public-domain)))) ;xspice
1775
1776(define-public librelane
1777 (package
1778 (name "librelane")
1779 (version "3.0.16")
1780 (source (origin
1781 (method git-fetch)
1782 (uri (git-reference
1783 (url "https://github.com/librelane/librelane")
1784 (commit version)))
1785 (file-name (git-file-name name version))
1786 (sha256
1787 (base32
1788 "1ikmc3ah7rcskm0rpzkp66gq3ar64gi935klkaf91hmsf7q0iy0s"))))
1789 (build-system pyproject-build-system)
1790 (arguments
1791 (list
1792 #:phases
1793 #~(modify-phases %standard-phases
1794 (add-after 'compress-documentation 'wrap-program
1795 (lambda _
1796 (wrap-program (string-append #$output "/bin/librelane")
1797 `("PATH" ":" prefix
1798 (,(string-append
1799 #$(this-package-input "ciel") "/bin")
1800 ,(string-append
1801 #$(this-package-input "klayout") "/bin")
1802 ,(string-append
1803 #$(this-package-input "magic") "/bin")
1804 ,(string-append
1805 #$(this-package-input "netgen") "/bin")
1806 ,(string-append
1807 #$(this-package-input "openroad") "/bin")
1808 ,(string-append
1809 #$(this-package-input "python") "/bin")
1810 ,(string-append
1811 #$(this-package-input "ruby") "/bin")
1812 ,(string-append
1813 #$(this-package-input "yosys") "/bin")
1814 ,(string-append
1815 #$(this-package-input "verilator") "/bin")))))))))
1816 (native-inputs
1817 (list python-customtkinter
1818 python-poetry-core
1819 python-pyfakefs
1820 python-pytest
1821 python-setuptools))
1822 (inputs
1823 (list ciel
1824 klayout
1825 magic
1826 netgen
1827 openroad
1828 python
1829 python-click-8.1
1830 python-cloup
1831 python-deprecated
1832 python-httpx
1833 python-klayout
1834 python-lln-libparse
1835 python-lxml
1836 python-psutil
1837 python-pyyaml
1838 python-rapidfuzz
1839 python-rich
1840 python-semver
1841 python-yamlcore
1842 ruby
1843 verilator
1844 yosys))
1845 (home-page "https://librelane.readthedocs.io/")
1846 (synopsis "ASIC implementation flow infrastructure")
1847 (description "LibreLane is an @acronym{EDA, Electronic Design Automation}
1848ASIC infrastructure library based on several components including OpenROAD,
1849Yosys, Magic, Netgen, CVC, KLayout and a number of custom scripts for design
1850exploration and optimization.")
1851 (license license:asl2.0)))
1852
1853(define-public librepcb
1854 (package
1855 (name "librepcb")
1856 (version "1.2.0")
1857 (source
1858 (origin
1859 (method git-fetch)
1860 (uri (git-reference
1861 (url "https://github.com/LibrePCB/LibrePCB")
1862 (commit version)
1863 (recursive? #t)))
1864 (file-name (git-file-name name version))
1865 (sha256 (base32 "1g3k2g2p5yy7zk971bg7qh4k38p30aydp27c5bfb02gn7djknz7w"))
1866 (modules '((guix build utils)))
1867 (snippet
1868 #~(delete-all-but "libs"
1869 "delaunay-triangulation"
1870 "dxflib"
1871 ;; "fontobene-qt"
1872 ;; "googletest"
1873 ;; "hoedown"
1874 "librepcb"
1875 ;; "muparser"
1876 "optional"
1877 "parseagle"
1878 ;; "polyclipping"
1879 ;; "quazip"
1880 "type_safe"))))
1881 (build-system qt-build-system)
1882 (arguments
1883 (list
1884 #:qtbase qtbase ;for Qt 6
1885 #:configure-flags
1886 #~(list "-DUNBUNDLE_FONTOBENE_QT=ON"
1887 "-DUNBUNDLE_GTEST=ON"
1888 "-DUNBUNDLE_HOEDOWN=ON"
1889 "-DUNBUNDLE_MUPARSER=ON"
1890 "-DUNBUNDLE_POLYCLIPPING=ON"
1891 "-DUNBUNDLE_QUAZIP=ON")
1892 #:phases
1893 #~(modify-phases %standard-phases
1894 (replace 'check
1895 (lambda* (#:key tests? #:allow-other-keys)
1896 (when tests?
1897 (let ((test-include (list "*"))
1898 (test-exclude
1899 (list
1900 "ApplicationTest.testGetCacheDir"
1901 ;; These tests all fail when run by the build
1902 ;; process even though they pass when manually
1903 ;; run as a normal user.
1904
1905 ;; TODO: verify that the failing tests don't
1906 ;; point to any actual underlying issues
1907 "SystemInfoTest.testGetUsername"
1908 "OrderPcbDialogTest.testAutoOpenBrowser"
1909 "DxfImportDialogTest.testLayerName"
1910 "DxfImportDialogTest.testCirclesAsDrills"
1911 "DxfImportDialogTest.testJoinTangentPolylines"
1912 "DxfImportDialogTest.testLineWidth"
1913 "DxfImportDialogTest.testScaleFactor"
1914 "DxfImportDialogTest.testPlacementPosition"
1915 "GraphicsExportDialogTest.testPageSize"
1916 "GraphicsExportDialogTest.testOrientation"
1917 "GraphicsExportDialogTest.testMargins"
1918 "GraphicsExportDialogTest.testShowPinNumbers"
1919 "GraphicsExportDialogTest.testRotate"
1920 "GraphicsExportDialogTest.testMirror"
1921 "GraphicsExportDialogTest.testScale"
1922 "GraphicsExportDialogTest.testPixmapDpi"
1923 "GraphicsExportDialogTest.testBlackWhite"
1924 "GraphicsExportDialogTest.testBackgroundColor"
1925 "GraphicsExportDialogTest.testMinLineWidth"
1926 "GraphicsExportDialogTest.testLayerColors"
1927 "GraphicsExportDialogTest.testOpenExportedFiles"
1928 "AddComponentDialogTest.testAddMore")))
1929 (setenv "QT_QPA_PLATFORM" "offscreen")
1930 (setenv "QT_QUICK_BACKEND" "software")
1931 (display "Running unittests...\n")
1932 (invoke "./tests/unittests/librepcb-unittests"
1933 (string-append
1934 "--gtest_filter="
1935 (string-join test-include ":")
1936 "-"
1937 (string-join test-exclude ":"))))))))))
1938 (inputs
1939 (list clipper
1940 fontconfig
1941 fontobene-qt
1942 glu
1943 hoedown
1944 muparser
1945 opencascade-occt
1946 qt5compat
1947 qtbase
1948 qtdeclarative
1949 qtsvg
1950 qttools
1951 qtwayland
1952 quazip
1953 zlib))
1954 (native-inputs
1955 (list googletest
1956 pkg-config
1957 python-minimal-wrapper
1958 qttools-5
1959 unzip))
1960 (home-page "https://librepcb.org/")
1961 (synopsis
1962 "@acronym{EDA, Electronic Design Automation} suite for PCB development")
1963 (description "LibrePCB is software to develop @acronym{PCB, Printed
1964Circuit Boards}. It features human readable file formats and complete project
1965management with library, schematic and board editors.")
1966 (license (list license:gpl3+
1967 license:boost1.0 ; libs/optional/tests/catch.hpp,
1968 license:expat ; libs/delaunay-triangulation,
1969 ; libs/parseagle, libs/type_safe
1970 license:asl2.0 ; libs/parseagle
1971 license:cc0 ; libs/optional
1972 license:bsd-2)))) ; libs/optional/tests/catch.hpp
1973
1974(define librnd
1975 (package
1976 (name "librnd")
1977 (version "4.5.0")
1978 (source (origin
1979 (method url-fetch)
1980 (uri (string-append "http://www.repo.hu/projects/librnd/"
1981 "releases/librnd-" version ".tar.bz2"))
1982 (sha256
1983 (base32
1984 "197gjd3a0q51ib4s7cfndls0hwc783wrjhqrm49p0kjicx2pxr6s"))))
1985 (build-system glib-or-gtk-build-system)
1986 (arguments
1987 (list
1988 #:tests? #false ;no check target
1989 #:phases
1990 #~(modify-phases %standard-phases
1991 ;; The configure script doesn't tolerate most of our configure
1992 ;; flags.
1993 (replace 'configure
1994 (lambda _
1995 (setenv "CC" #$(cc-for-target))
1996 (invoke "./configure" (string-append "--prefix=" #$output)))))))
1997 (inputs
1998 (list gd glib glu gtk gtkglext libepoxy))
1999 (native-inputs
2000 (list pkg-config))
2001 (home-page "http://repo.hu/projects/librnd/")
2002 (synopsis "Two-dimensional CAD engine")
2003 (description "This is a flexible, modular two-dimensional CAD engine
2004@itemize
2005@item with transparent multiple GUI toolkit support;
2006@item a flexible, dynamic menu system;
2007@item a flexible, dynamic configuration system; and
2008@item support for user scripting in a dozen languages.
2009@end itemize")
2010 (license license:gpl2+)))
2011
2012(define-public libfst
2013 ;; There are no release nor tags.
2014 (let ((commit "6a52070cd62ec65c29832bc95e7db493504aa7ac")
2015 (revision "0"))
2016 (package
2017 (name "libfst")
2018 (version (git-version "1.0.0" revision commit))
2019 (source
2020 (origin
2021 (method git-fetch)
2022 (uri (git-reference
2023 (url "https://github.com/gtkwave/libfst/")
2024 (commit commit)))
2025 (file-name (git-file-name name version))
2026 (sha256
2027 (base32 "0b1r660m5aib316jjl4nhs10y7vhhqy2mvxjip3ynahig3hpi46z"))))
2028 (build-system meson-build-system)
2029 (native-inputs (list gobject-introspection pkg-config))
2030 (inputs (list bzip2))
2031 (propagated-inputs (list zlib)) ;in Requires.private of libfst.pc
2032 (synopsis "Fast Signal Trace (FST) format waveforms library")
2033 (description "Libfst is a small library used to read and write
2034@acronym{FST, Fast Signal Trace} format waveforms.")
2035 (home-page "https://github.com/gtkwave/libfst/")
2036 (license (list license:expat ;libfst and fastlz-derived sources
2037 license:bsd-2))))) ;for lz4-derived sources
2038
2039(define-public python-lln-libparse
2040 (package
2041 (name "python-lln-libparse")
2042 (version "0.56.0")
2043 (source (origin
2044 (method url-fetch)
2045 (uri (pypi-uri "lln_libparse" version))
2046 (sha256
2047 (base32
2048 "0b6srlpgrfs7hfapnzfhxyy9zzgxlk943s3y78jzq3cf656448kn"))))
2049 (build-system pyproject-build-system)
2050 (arguments
2051 (list
2052 #:tests? #f)); There are no tests.
2053 (native-inputs
2054 (list python-setuptools))
2055 (inputs
2056 (list pybind11))
2057 (home-page "https://www.yosyshq.com/")
2058 (synopsis "Wrapper around Yosys' libparse module")
2059 (description "lln-libparse is a SWIG-based Python wrapper around Yosys'
2060libparse, enabling dotlib file parsing.")
2061 (license license:asl2.0)))
2062
2063(define-public libpsf
2064 ;; There are no release nor tags.
2065 (let ((commit "001dc734e01725e739847c8cde6480a0cf35a082")
2066 (revision "0"))
2067 (package
2068 (name "libpsf")
2069 (version (git-version "0.2" revision commit)) ;0.2 from configure.ac
2070 (source
2071 (origin
2072 (method git-fetch)
2073 (uri (git-reference
2074 (url "https://gitlab.com/libpsf/libpsf-core")
2075 (commit commit)))
2076 (file-name (git-file-name name version))
2077 (sha256
2078 (base32 "19k03hwwz4pkb98hd7vf15x6dnhfd48iqj62n90s7ycx1y5a378r"))
2079 (modules '((guix build utils)))
2080 ;; remove broken psftest binary using hardcoded paths
2081 (snippet '(substitute* "src/Makefile.am"
2082 (("bin_PROGRAMS = psftest") "bin_PROGRAMS =")))))
2083 ;; tests are broken due to missing test/data/tran.tran file
2084 (arguments (list #:tests? #f))
2085 (build-system gnu-build-system)
2086 (native-inputs (list autoconf automake libtool))
2087 (inputs (list boost))
2088 (synopsis "PSF simulation data c++ library")
2089 (description "@code{libpsf} is a c++ library that reads Cadence
2090@acronym{PSF, Parameter Storage Format} binary waveform files.")
2091 (home-page "https://gitlab.com/libpsf/libpsf-core")
2092 (license license:lgpl3))))
2093
2094(define-public libserialport
2095 (package
2096 (name "libserialport")
2097 (version "0.1.2")
2098 (source (origin
2099 (method git-fetch)
2100 (uri (git-reference
2101 (url "git://sigrok.org/libserialport")
2102 (commit (string-append name "-" version))))
2103 (file-name (git-file-name name version))
2104 (sha256
2105 (base32
2106 "0dn10gmm3rwdsiw1psaczb9m52x6cfkfrbywm4f5y8fsmghh7dsy"))))
2107 (build-system gnu-build-system)
2108 (native-inputs (list autoconf automake libtool))
2109 (home-page "https://sigrok.org/wiki/Libserialport")
2110 (synopsis "Library for using serial ports")
2111 (description "Libserialport is a minimal shared library written in C that is intended
2112to take care of the OS-specific details when writing software that uses serial ports.")
2113 (license license:lgpl3+)))
2114
2115(define-public libsigrok
2116 (let ((commit "f06f788118191d19fdbbb37046d3bd5cec91adb1")
2117 (revision "2"))
2118 (package
2119 (name "libsigrok")
2120 (version (git-version "0.5.2" revision commit))
2121 (source
2122 (origin
2123 (method git-fetch)
2124 (uri (git-reference
2125 (url "git://sigrok.org/libsigrok")
2126 (commit commit)))
2127 (sha256
2128 (base32 "1ahgpa0gaa4fl8c6frpgamvgxg0fisfwlqddr5x25456vkk2i9zi"))
2129 (file-name (git-file-name name version))))
2130 (outputs '("out" "doc"))
2131 (arguments
2132 (list
2133 #:tests? #f ; tests need USB access
2134 #:phases
2135 #~(modify-phases %standard-phases
2136 (add-before 'configure 'change-udev-group
2137 (lambda _
2138 (substitute* (find-files "contrib" "\\.rules$")
2139 (("plugdev") "dialout"))))
2140 (add-after 'build 'build-doc
2141 (lambda _
2142 (invoke "doxygen")))
2143 (add-after 'install 'install-doc
2144 (lambda _
2145 (copy-recursively
2146 "doxy/html-api"
2147 (string-append #$output:doc "/share/doc/libsigrok"))))
2148 (add-after 'install-doc 'install-udev-rules
2149 (lambda _
2150 (for-each
2151 (lambda (file)
2152 (install-file
2153 file
2154 (string-append #$output "/lib/udev/rules.d/")))
2155 (find-files "contrib" "\\.rules$"))))
2156 (add-after 'install-udev-rules 'install-fw
2157 (lambda* (#:key inputs outputs #:allow-other-keys)
2158 (let* ((fx2lafw (assoc-ref inputs "sigrok-firmware-fx2lafw"))
2159 (dir-suffix "/share/sigrok-firmware/")
2160 (input-dir (string-append fx2lafw dir-suffix))
2161 (output-dir (string-append #$output dir-suffix)))
2162 (for-each
2163 (lambda (file)
2164 (install-file file output-dir))
2165 (find-files input-dir "."))))))))
2166 (native-inputs
2167 (list autoconf automake doxygen graphviz libtool
2168 sigrok-firmware-fx2lafw pkg-config))
2169 (inputs
2170 (list python zlib))
2171 ;; libsigrokcxx.pc lists "glibmm" in Requires libsigrok.pc lists
2172 ;; "libserialport", "libusb", "libftdi" and "libzip" in Requires.private
2173 ;; and "glib" in Requires
2174 (propagated-inputs
2175 (list glib
2176 glibmm-2.66
2177 libserialport
2178 libusb
2179 libftdi
2180 libzip))
2181 (build-system gnu-build-system)
2182 (home-page "https://www.sigrok.org/wiki/Libsigrok")
2183 (synopsis "Basic hardware access drivers for logic analyzers")
2184 (description "@code{libsigrok} is a shared library written in C which
2185provides the basic hardware access drivers for logic analyzers and other
2186supported devices, as well as input/output file format support.")
2187 (license license:gpl3+))))
2188
2189(define-public libsigrokdecode
2190 (let ((commit "71f451443029322d57376214c330b518efd84f88")
2191 (revision "1"))
2192 (package
2193 (name "libsigrokdecode")
2194 (version (git-version "0.5.3" revision commit))
2195 (source (origin
2196 (method git-fetch)
2197 (uri (git-reference
2198 (url "git://sigrok.org/libsigrokdecode")
2199 (commit commit)))
2200 (file-name (git-file-name name version))
2201 (sha256
2202 (base32
2203 "11l8vnf2khqbaqas7cfnq3f8q5w7am6nbkkd5mqj5kpb3ya2avb9"))))
2204 (outputs '("out" "doc"))
2205 (arguments
2206 (list
2207 #:phases
2208 #~(modify-phases %standard-phases
2209 (add-after 'build 'build-doc
2210 (lambda _
2211 (invoke "doxygen")))
2212 (add-after 'install 'install-doc
2213 (lambda _
2214 (copy-recursively
2215 "doxy/html-api"
2216 (string-append #$output:doc
2217 "/share/doc/libsigrokdecode")))))))
2218 (native-inputs
2219 (list check doxygen graphviz pkg-config automake autoconf libtool))
2220 ;; libsigrokdecode.pc lists "python" in Requires.private, and "glib" in
2221 ;; Requires.
2222 (propagated-inputs
2223 (list glib python))
2224 (build-system gnu-build-system)
2225 (home-page "https://www.sigrok.org/wiki/Libsigrokdecode")
2226 (synopsis
2227 "Library providing (streaming) protocol decoding functionality")
2228 (description
2229 "Libsigrokdecode is a shared library written in C, which provides
2230(streaming) protocol decoding functionality.")
2231 (license license:gpl3+))))
2232
2233(define-public m8c
2234 (package
2235 (name "m8c")
2236 (version "2.2.3")
2237 (source
2238 (origin
2239 (method git-fetch)
2240 (uri (git-reference
2241 (url "https://github.com/laamaa/m8c")
2242 (commit (string-append "v" version))))
2243 (file-name (git-file-name name version))
2244 (sha256
2245 (base32 "1ib751mfrz6ni6imx0gwbm7zjpw1c5x8l15hrdxm4f69vrm6vgkj"))))
2246 (build-system cmake-build-system)
2247 (arguments
2248 (list
2249 #:tests? #f ;no tests
2250 #:configure-flags
2251 #~(list "-DUSE_LIBUSB=ON")))
2252 (native-inputs
2253 (list pkg-config))
2254 (inputs
2255 (list libdecor libusb sdl3))
2256 (home-page "https://github.com/laamaa/m8c")
2257 (synopsis "Cross-platform M8 tracker headless client - usb backend")
2258 (description
2259 "The @url{https://dirtywave.com/products/m8-tracker,Dirtywave M8 Tracker}
2260is a portable sequencer and synthesizer, featuring 8 tracks of assignable
2261instruments such as FM, waveform synthesis, virtual analog, sample playback, and
2262MIDI output. It is powered by a @url{https://www.pjrc.com/teensy/,Teensy}
2263micro-controller and inspired by the Gameboy tracker
2264@url{https://www.littlesounddj.com/lsd/index.php,Little Sound DJ}. m8c is a
2265client for @url{https://github.com/Dirtywave/M8HeadlessFirmware,M8 Headless}
2266which allows one to install the M8 firmware on any Teensy.")
2267 (license (list license:cc-by-sa3.0
2268 license:expat
2269 license:public-domain
2270 license:zlib))))
2271
2272(define-public m8c-serial
2273 (package
2274 (inherit m8c)
2275 (name "m8c-serial")
2276 (arguments
2277 (substitute-keyword-arguments arguments
2278 ((#:configure-flags flags)
2279 #~(cons* "-DUSE_LIBSERIAL=ON"
2280 (delete "-DUSE_LIBUSB=ON" #$flags)))))
2281 (inputs
2282 (modify-inputs inputs
2283 (replace "libusb" libserialport)))
2284 (synopsis "Cross-platform M8 tracker headless client - serial backend")))
2285
2286(define-public magic
2287 (package
2288 (name "magic")
2289 (version "8.3.684")
2290 (source
2291 (origin
2292 (method git-fetch)
2293 (uri (git-reference
2294 (url "https://github.com/RTimothyEdwards/magic")
2295 (commit version)))
2296 (file-name (git-file-name name version))
2297 (sha256
2298 (base32 "1zgmxl0xqq31q0cd9x3rip0vk7lllwbnnrvgkwmb1ni219cccily"))))
2299 (build-system gnu-build-system)
2300 (arguments
2301 (list
2302 #:tests? #f ;no tests
2303 #:configure-flags
2304 #~(list (string-append
2305 "--with-tcl=" #$(this-package-input "tcl"))
2306 (string-append
2307 "--with-tk=" #$(this-package-input "tk")))))
2308 (inputs (list cairo
2309 glu
2310 libx11
2311 mesa
2312 python
2313 readline
2314 tcl
2315 tk))
2316 (home-page "http://opencircuitdesign.com/magic/index.html")
2317 (synopsis "@acronym{VLSI, Very-large-scale integration} layout tool")
2318 (description
2319 "Magic is an interactive @acronym{EDA, Electronic Design Automation} layout
2320tool. It can run @acronym{DRC, design rule check} and @acronym{LVS, layout
2321versus schematic} tests and can assist with automatic routing.")
2322 (license license:bsd-0)))
2323
2324;; TODO: Unbundle scintilla when ScintillaEdit.h is available.
2325(define-public mcy
2326 (package
2327 (name "mcy")
2328 (version "0.69")
2329 (source
2330 (origin
2331 (method git-fetch)
2332 (uri (git-reference
2333 (url "https://github.com/YosysHQ/mcy/")
2334 (commit (string-append "v" version))))
2335 (file-name (git-file-name name version))
2336 (sha256
2337 (base32 "1di2a4hryiwcy4v644lc36yx7wd3ybd6ws0vhardcbxagcc0ahp7"))))
2338 (build-system qt-build-system)
2339 (arguments
2340 (list
2341 #:tests? #f ;there are no tests
2342 #:imported-modules (append %qt-build-system-modules
2343 %pyproject-build-system-modules)
2344 #:modules '((guix build qt-build-system)
2345 ((guix build pyproject-build-system) #:prefix py:)
2346 (guix build utils))
2347 #:phases
2348 #~(modify-phases %standard-phases
2349 (add-after 'unpack 'build-info-documentation
2350 (lambda _
2351 (invoke "make" "-C" "docs" "info")
2352 (install-file "docs/build/texinfo/yosyshqmcy.info"
2353 (string-append #$output "/share/info"))))
2354 (add-before 'configure 'chdir
2355 (lambda _
2356 (chdir "gui")))
2357 ;; As per main Makefile install target.
2358 (add-after 'install 'make-install
2359 (lambda _
2360 (chdir "..")
2361 (copy-recursively
2362 "scripts" (string-append #$output "/share/mcy/scripts"))
2363 (copy-recursively
2364 "dash" (string-append #$output "/share/mcy/dash"))
2365 (define (install-it filename)
2366 (let* ((bin (format #f "~a/bin" #$output))
2367 (bin_ (format #f "~a/~a" bin filename)))
2368 (install-file (format #f "~a.py" filename) bin)
2369 (rename-file (format #f "~a/~a.py" bin filename) bin_)
2370 (chmod bin_ #o755)))
2371 (install-it "mcy")
2372 (install-it "mcy-dash")))
2373 (add-after 'make-install 'python:wrap
2374 (assoc-ref py:%standard-phases 'wrap)))))
2375 (native-inputs
2376 (list pkg-config
2377 python-sphinx
2378 python-minimal-wrapper ;remove with unbundling of scintilla
2379 texinfo))
2380 (inputs
2381 (list boost python python-click python-flask))
2382 (home-page "https://yosyshq.readthedocs.io/projects/mcy/en/latest/")
2383 (synopsis "Mutation Cover with Yosys")
2384 (description
2385 "@command{Mcy} is an @acronym{EDA, Electronic Design Automation} tool to
2386help digital designers and project managers understand and improve testbench
2387coverage.")
2388 (license license:isc)))
2389
2390(define-public netgen
2391 (package
2392 (name "netgen")
2393 (version "1.5.324")
2394 (source
2395 (origin
2396 (method git-fetch)
2397 (uri (git-reference
2398 (url "https://github.com/RTimothyEdwards/netgen")
2399 (commit version)))
2400 (file-name (git-file-name name version))
2401 (sha256
2402 (base32 "1477yy34szz9nqkyjjj6f1nl0kzvc4gv4cv7b6g4cgg438s3c4qb"))))
2403 (build-system gnu-build-system)
2404 (arguments
2405 (list
2406 #:tests? #f ; no tests
2407 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
2408 (string-append "PREFIX=" #$output))
2409 #:configure-flags
2410 #~(list (string-append "--with-tcl=" #$(this-package-input "tcl"))
2411 (string-append "--with-tk=" #$(this-package-input "tk")))))
2412 (inputs (list libx11 libxt readline tcl tk))
2413 (native-inputs (list python-minimal-wrapper))
2414 (home-page "http://opencircuitdesign.com/netgen/")
2415 (synopsis "Netlist system for @acronym{EDA, electronic design automation}")
2416 (description
2417 "@code{netgen} is a general purpose @acronym{LVS, layout versus
2418schematic} management tool. It compares netlists of SPICE or verilog netlists
2419circuits. This is commonly used as a part of toolchains in a process called
2420@acronym{LVS, layout versus schematic} with the intent to verify that the
2421layout of a circuit corresponds to the desired netlists.")
2422 (license license:gpl1)))
2423
2424(define-public nextpnr
2425 (package
2426 (name "nextpnr")
2427 (version "0.11.1")
2428 (source
2429 (origin
2430 (method git-fetch)
2431 (uri (git-reference
2432 (url "https://github.com/YosysHQ/nextpnr/")
2433 (commit (string-append "nextpnr-" version))
2434 ;; XXX: Fetch some bundled libraries such as QtPropertyBrowser,
2435 ;; json11 and python-console, which have custom modifications or
2436 ;; no longer have their original upstream.
2437 (recursive? #t)))
2438 (file-name (git-file-name name version))
2439 (modules '((guix build utils)))
2440 (snippet #~(delete-all-but "3rdparty"
2441 ;; The following sources have all been patched, so
2442 ;; cannot easily be unbundled.
2443 "QtPropertyBrowser"
2444 "json11"
2445 "python-console"
2446 "oourafft"
2447 "imgui"
2448 "qtimgui"))
2449 (sha256
2450 (base32 "1mb2dywv4gd52vzmml7rlyqdv4psw0l0gfy0mgwsknxblps3aha1"))))
2451 (outputs '("out" "bba"))
2452 (build-system qt-build-system)
2453 (arguments
2454 (list
2455 #:qtbase qtbase ;for Qt 6
2456 #:configure-flags
2457 #~(list "-DARCH=generic;ice40;ecp5;himbaechel"
2458 "-DBUILD_GUI=ON"
2459 "-DUSE_OPENMP=ON"
2460 "-DBUILD_TESTS=ON"
2461 "-DHIMBAECHEL_UARCH=ng-ultra;gowin;gatemate"
2462 "-DHIMBAECHEL_NGULTRA_DEVICES=ng-ultra"
2463 "-DHIMBAECHEL_SPLIT=ON"
2464 (string-append "-DHIMBAECHEL_PRJBEYOND_DB="
2465 (search-input-directory
2466 %build-inputs "share/prjbeyond-db"))
2467 (string-append "-DHIMBAECHEL_PEPPERCORN_PATH="
2468 (search-input-directory
2469 %build-inputs "share/prjpeppercorn"))
2470 (string-append
2471 "-DEXPORT_BBA_FILES=" #$output:bba "/share/nextpnr/bba-files")
2472 (string-append "-DCURRENT_GIT_VERSION=nextpnr-" #$version)
2473 (string-append "-DICESTORM_INSTALL_PREFIX="
2474 #$(this-package-native-input "icestorm"))
2475 (string-append "-DTRELLIS_INSTALL_PREFIX="
2476 #$(this-package-native-input "prjtrellis")))
2477 #:phases
2478 #~(modify-phases %standard-phases
2479 (add-after 'unpack 'fix-test
2480 (lambda _
2481 (substitute* "himbaechel/uarch/gatemate/tests/lut.cc"
2482 (("9LU") "8LU"))))
2483 (add-after 'unpack 'unbundle-googletest
2484 (lambda _
2485 (substitute* "CMakeLists.txt"
2486 (("add_subdirectory\\(3rdparty\\/googletest.*")
2487 (string-append "find_package(GTest)\n"
2488 "add_library(gtest_main ALIAS "
2489 "GTest::gtest_main)\n"))
2490 (("\\$\\{CMAKE_SOURCE_DIR}/3rdparty/googletest.*")
2491 (string-append
2492 #$(this-package-native-input "googletest") "/include)")))))
2493 (add-after 'unpack 'unbundle-sanitizers-cmake
2494 (lambda _
2495 (substitute* "CMakeLists.txt"
2496 ;; Use the system sanitizers-cmake module. This is made
2497 ;; necessary 'sanitizers-cmake' installing a FindPackage
2498 ;; module but no CMake config file.
2499 (("\\$\\{CMAKE_SOURCE_DIR}/3rdparty/sanitizers-cmake/cmake")
2500 (string-append
2501 #$(this-package-native-input "sanitizers-cmake")
2502 "/share/sanitizers-cmake/cmake")))))
2503 (add-after 'install 'run-tests
2504 (lambda* (#:key tests? #:allow-other-keys)
2505 (when tests?
2506 (setenv "PATH"
2507 (string-append #$output "/bin:" (getenv "PATH")))
2508 ;; ice40
2509 (invoke "./nextpnr-ice40-test")
2510 (chdir "../source")
2511 (setenv "NEXTPNR" "nextpnr-ice40")
2512 (with-directory-excursion "ice40/smoketest/attosoc"
2513 (invoke "./smoketest.sh"))
2514 (with-directory-excursion "tests/ice40/regressions"
2515 (invoke "make" (string-append
2516 "NPNR=" #$output "/bin/nextpnr-ice40")))
2517 ;; generic
2518 (setenv "NPNR" "nextpnr-generic")
2519 (invoke "nextpnr-generic" "--uarch" "example" "--test")
2520 (with-directory-excursion "tests/generic/flow/bel-pin"
2521 (invoke "./run.sh"))
2522 ;; ecp5
2523 (invoke "nextpnr-ecp5"
2524 "--um5g-25k" "--package" "CABGA381" "--test")
2525 (with-directory-excursion "tests/ecp5/regressions"
2526 (invoke "make"
2527 (string-append
2528 "NPNR=" #$output "/bin/nextpnr-ecp5")))))))))
2529 (native-inputs
2530 (list apycula
2531 googletest
2532 icestorm
2533 iverilog
2534 gzip
2535 prjbeyond-db
2536 `(,prjpeppercorn "db")
2537 prjtrellis
2538 python-minimal-wrapper
2539 sanitizers-cmake
2540 yosys
2541 `(,yosys "config")))
2542 (inputs
2543 (list boost
2544 eigen
2545 pybind11))
2546 (synopsis
2547 "Place-and-Route tool for @acronym{FPGA, Field Programmable Gate Array}")
2548 (description "@code{nextpnr} is an @acronym{EDA, Electronic Design
2549Automation}, portable and vendor neutral FPGA place and route tool.")
2550 (home-page "https://github.com/YosysHQ/nextpnr/")
2551 (license license:isc)))
2552
2553(define-public nextpnr-cli
2554 (package
2555 (inherit nextpnr)
2556 (name "nextpnr-cli")
2557 (build-system cmake-build-system)
2558 (arguments
2559 (delkw
2560 #:qtbase
2561 (substitute-keyword-arguments arguments
2562 ((#:configure-flags flags '())
2563 #~(delete! "-DBUILD_GUI=ON" #$flags)))))
2564 (synopsis
2565 (string-append (package-synopsis nextpnr) " Cli only version."))))
2566
2567(define-public ngspice
2568 ;; The ngspice executables (see libngpsice above.)
2569 (package
2570 (inherit libngspice)
2571 (name "ngspice")
2572 (arguments
2573 (substitute-keyword-arguments arguments
2574 ;; Tests require a X server running, so we keep them disabled
2575 ((#:configure-flags flags)
2576 #~(cons* "--enable-rpath" "--with-x" "--with-readline=yes"
2577 (delete "--with-ngshared" #$flags)))
2578 ((#:phases phases)
2579 #~(modify-phases #$phases
2580 (delete 'delete-scripts)))))
2581 (native-inputs
2582 (modify-inputs native-inputs
2583 (append perl)))
2584 (inputs (list libngspice readline libxaw libx11))))
2585
2586(define-public nvc
2587 (package
2588 (name "nvc")
2589 (version "1.23.0")
2590 (source (origin
2591 (method git-fetch)
2592 (uri (git-reference
2593 (url "https://github.com/nickg/nvc")
2594 (commit (string-append "r" version))))
2595 (file-name (git-file-name name version))
2596 (sha256
2597 (base32
2598 "1977j0gzxx4gmhhdbdmyqwp1f3wzld4qlhcxggx52hr8fxvcignl"))))
2599 (build-system gnu-build-system)
2600 (arguments
2601 (list #:out-of-source? #t
2602 #:configure-flags
2603 #~(list "--enable-tcl"
2604 "--enable-llvm"
2605 "--enable-vital"
2606 "--enable-server"
2607 "--with-ncurses"
2608 "--enable-parallel-make"
2609 "--enable-vital"
2610 (string-append "--with-bash-completion=" #$output
2611 "/share/bash-completion/completions"))
2612 #:phases #~(modify-phases %standard-phases
2613 (add-after 'unpack 'fix-autogen
2614 (lambda _
2615 (substitute* "autogen.sh"
2616 (("cd") "# cd"))))
2617 ;; This scripts is necessary for testing osvvm.
2618 (add-after 'install 'keep-osvvm-tests
2619 (lambda _
2620 (mkdir-p (string-append #$output "/test"))
2621 (install-file
2622 "../source/test/test-osvvm.tcl"
2623 (string-append #$output "/test")))))))
2624 (native-inputs
2625 (list automake
2626 autoconf
2627 check ; for the tests
2628 flex
2629 gettext-minimal
2630 libtool
2631 pkg-config
2632 python-minimal
2633 which))
2634 (inputs
2635 (list capstone
2636 jansson
2637 libffi
2638 llvm
2639 readline
2640 tcl
2641 `(,zstd "lib")))
2642 (synopsis "Mix language HDL compiler and simulator")
2643 (description "@code{Nvc} is an @acronym{EDA, electronic design automation}
2644HDL compiler, with support for almost all of VHDL-2008 with the exception of
2645PSL. It includes experimental support for Verilog and VHDL-2019.")
2646 (home-page "https://www.nickg.me.uk/nvc/")
2647 (license license:gpl3+)))
2648
2649(define-public openboardview
2650 ;; There are a few important fixes not yet released.
2651 (let ((commit "cc76e697c85efd2285134dfe2df0b7809e4a49d0")
2652 (revision "0"))
2653 (package
2654 (name "openboardview")
2655 (version (git-version "10.0.0" revision commit))
2656 (source (origin
2657 (method git-fetch)
2658 (uri (git-reference
2659 (url "https://github.com/OpenBoardView/OpenBoardView")
2660 (commit commit)))
2661 (file-name (git-file-name name version))
2662 (modules '((ice-9 ftw)
2663 (srfi srfi-26)
2664 (guix build utils)))
2665 (snippet
2666 '(with-directory-excursion "src"
2667 (define keep (list "." ".." "openboardview"))
2668 (for-each (lambda (f)
2669 (when (eq? 'directory (stat:type (lstat f)))
2670 (delete-file-recursively f)))
2671 (scandir "." (negate (cut member <> keep))))))
2672 (patches
2673 (search-patches "openboardview-remove-glad-dependency.patch"
2674 "openboardview-use-system-imgui.patch"
2675 "openboardview-use-system-mpc.patch"))
2676 (sha256
2677 (base32
2678 "1dm7pvqawixikk7xiywhalxq53v65295wsq41g8357g5b4if01p6"))))
2679 (build-system cmake-build-system)
2680 (arguments
2681 (list
2682 #:tests? #f ;no test suite
2683 #:imported-modules `((guix build glib-or-gtk-build-system)
2684 ,@%cmake-build-system-modules)
2685 #:modules '((guix build cmake-build-system)
2686 (guix build utils)
2687 ((guix build glib-or-gtk-build-system) #:prefix gtk:))
2688 #:phases
2689 #~(modify-phases %standard-phases
2690 (add-before 'configure 'dynamically-load-gtk-via-absolute-path
2691 ;; The GTK library is not linked thus not present in the RUNPATH of
2692 ;; the produced binary; the absolute path of the libraries must to
2693 ;; the dynamic loader otherwise they aren't found.
2694 (lambda* (#:key inputs #:allow-other-keys)
2695 (substitute* "src/openboardview/unix.cpp"
2696 (("libgtk-3.so")
2697 (search-input-file inputs "lib/libgtk-3.so")))))
2698 ;; Add the two extra phases from `glib-or-gtk-build-system'.
2699 (add-after 'install 'glib-or-gtk-compile-schemas
2700 (assoc-ref gtk:%standard-phases 'glib-or-gtk-compile-schemas))
2701 (add-after 'install 'glib-or-gtk-wrap
2702 (assoc-ref gtk:%standard-phases 'glib-or-gtk-wrap)))))
2703 (native-inputs
2704 (list pkg-config
2705 python-minimal-wrapper
2706 stb-image
2707 utf8-h))
2708 (inputs
2709 (list fontconfig
2710 gtk+
2711 imgui-with-sdl2
2712 orangeduck-mpc
2713 sdl2
2714 sqlite
2715 zlib))
2716 (home-page "https://github.com/OpenBoardView/OpenBoardView")
2717 (synopsis "Viewer for BoardView files")
2718 (description "OpenBoardView is a viewer for BoardView files, which present
2719the details of a printed circuit board (PCB). It comes with features
2720such as:
2721@itemize
2722@item Dynamic part outline rendering, including complex connectors
2723@item Annotations, for leaving notes about parts, nets, pins or location
2724@item Configurable colour themes
2725@item Configurable DPI to facilitate usage on 4K monitors
2726@item Configurable for running on slower systems
2727@item Reads FZ (with key), BRD, BRD2, BDV and BV* formats.
2728@end itemize")
2729 (license license:expat))))
2730
2731(define-public opencircuitx
2732 (package
2733 (name "opencircuitx")
2734 (version "1.1.0")
2735 (source
2736 (origin
2737 (method git-fetch)
2738 (uri (git-reference
2739 (url "https://github.com/openlab-x/OpenCircuitX")
2740 (commit (string-append "v" version))))
2741 (sha256
2742 (base32 "1h6pgdaa2h056knm9ff1ydvr6lxgjmjp198mi2nzp0rlzvvmkhdv"))
2743 (file-name (git-file-name name version))
2744 (snippet
2745 #~(begin
2746 (use-modules (guix build utils)
2747 (ice-9 ftw)
2748 (srfi srfi-26))
2749 (for-each (cut delete-file-recursively <>)
2750 (list "installer" "screenshots"))))))
2751 (build-system cmake-build-system)
2752 (arguments
2753 (list
2754 #:tests? #f)) ;no tests
2755 (native-inputs (list pkg-config))
2756 (inputs (list curl wxwidgets))
2757 (home-page "https://github.com/openlab-x/OpenCircuitX")
2758 (synopsis "IDE for FPGA development")
2759 (description
2760 "OpenCircuitX is a @acronym{EDA, Electronic Design Automation} platform
2761for @acronym{HDL, Hardware Description Languages} used to design digital
2762logic. It unifies an IDE HDL editor, a visual circuit canvas, an RTL
2763schematic viewer, a waveform viewer, and a full FPGA toolchain in one
2764window, for hardware engineers, students, and FPGA hobbyists alike.")
2765 (license license:expat)))
2766
2767(define-public pcb-rnd
2768 (package
2769 (name "pcb-rnd")
2770 (version "3.1.8")
2771 (source (origin
2772 (method url-fetch)
2773 (uri (string-append "http://repo.hu/projects/pcb-rnd/"
2774 "releases/pcb-rnd-" version ".tar.gz"))
2775 (sha256
2776 (base32
2777 "1q8zq8w11rjlwddrqz2w5jcq3rmxqv2scgapgfjy6bw2660c9k8z"))))
2778 (build-system glib-or-gtk-build-system)
2779 (arguments
2780 (list
2781 #:test-target "test"
2782 #:phases
2783 #~(modify-phases %standard-phases
2784 (replace 'configure
2785 ;; The configure script doesn't tolerate most of our configure
2786 ;; flags.
2787 (lambda _
2788 (setenv "CC" #$(cc-for-target))
2789 (setenv "LIBRND_PREFIX" #$(this-package-input "librnd"))
2790 (invoke "./configure" (string-append "--prefix=" #$output)))))))
2791 (inputs (list librnd))
2792 (home-page "http://repo.hu/projects/pcb-rnd/")
2793 (synopsis "Modular layout editor")
2794 (description "@code{Pcb-rnd} is a @acronym{Printed Circuit Board} layout
2795editor, part of the RiNgDove EDA suite.")
2796 (license license:gpl2+)))
2797
2798(define prjbeyond-db
2799 ;; Projects doesn’t include any tag or release.
2800 (let ((commit "f49f66be674d9857c657930353b867ba94bcbdd7")
2801 (revision "0"))
2802 (package
2803 (name "prjbeyond-db")
2804 (version (git-version "0" revision commit))
2805 (source
2806 (origin
2807 (method git-fetch)
2808 (uri (git-reference
2809 (url "https://github.com/yosyshq-GmbH/prjbeyond-db/")
2810 (commit commit)))
2811 (file-name (git-file-name name version))
2812 (sha256
2813 (base32 "1q5dfg0s21q8aw63fz28h0av958g0vcgi179yacgvs9f0cm6dx87"))))
2814 (build-system copy-build-system)
2815 (arguments
2816 (list
2817 #:install-plan
2818 #~'(("NG-ULTRA" "share/prjbeyond-db/")
2819 ("devices.json" "share/prjbeyond-db/"))))
2820 (home-page "https://github.com/yosyshq-GmbH/prjbeyond-db/")
2821 (synopsis "Chip database for FPGA NG-Ultra architecture")
2822 (description "This package includes data needed to create @code{nextpnr}
2823chip database for NG-Ultra architecture from NanoXplore.")
2824 (license license:expat))))
2825
2826(define-public prjpeppercorn
2827 (package
2828 (name "prjpeppercorn")
2829 (version "1.13")
2830 (source
2831 (origin
2832 (method git-fetch)
2833 (uri (git-reference
2834 (url "https://github.com/YosysHQ/prjpeppercorn/")
2835 (commit (string-append "v" version))))
2836 (file-name (git-file-name name version))
2837 (sha256
2838 (base32 "1igdljp70492qm9d0nldd7nrxawf7g7i73wiyx44flcmapz1np5y"))))
2839 (outputs (list "out"
2840 "db")) ;FPGA database files
2841 (build-system cmake-build-system)
2842 (arguments
2843 (list
2844 #:tests? #f ;no test suite
2845 #:configure-flags
2846 #~(list "-DBUILD_SHARED=ON"
2847 "-DSTATIC_BUILD=OFF")
2848 #:phases
2849 #~(modify-phases %standard-phases
2850 (add-after 'unpack 'chdir
2851 (lambda _
2852 (chdir "libgm")))
2853 (add-before 'chdir 'install-db-files
2854 (lambda _
2855 (let ((datadir
2856 (string-append #$output:db "/share/prjpeppercorn")))
2857 (mkdir-p datadir)
2858 (copy-recursively "delay" (string-append datadir "/delay"))
2859 (copy-recursively "gatemate"
2860 (string-append datadir "/gatemate"))
2861 (copy-recursively "tools"
2862 (string-append datadir "/tools"))))))))
2863 (inputs
2864 (list boost))
2865 (synopsis "GateMate FPGAs bitstream tools")
2866 (description
2867 "@code{Prjpeppercorn} includes programming tools for GateMate
2868architecture from Cologne Chip. It also provides data needed to produce a
2869@code{nextpnr} chip database Cologne Chip's GateMate architecture.")
2870 (home-page "https://github.com/YosysHQ/prjpeppercorn/")
2871 (license license:isc)))
2872
2873(define-public prjtrellis
2874 ;; The last release is 2 years old; use the latest commit for now.
2875 (let ((commit "73bd411731808d80ead650bbc9840d9e02911e9e")
2876 (revision "2"))
2877 (package
2878 (name "prjtrellis")
2879 (version (git-version "1.4" revision commit))
2880 (source
2881 (origin
2882 (method git-fetch)
2883 (uri (git-reference
2884 (url "https://github.com/YosysHQ/prjtrellis/")
2885 (commit commit)
2886 ;; Pull the bitstream database for ECP5 devices; this is useful
2887 ;; only by prjtrellis: there is no need to package it separately.
2888 (recursive? #t)))
2889 (file-name (git-file-name name version))
2890 (modules '((guix build utils)))
2891 (snippet
2892 ;; Remove bundled source code for which Guix has packages.
2893 '(with-directory-excursion "libtrellis/3rdparty"
2894 (for-each delete-file-recursively
2895 '("pybind11"))))
2896 (sha256
2897 (base32 "1a425n1kqz1f3ai0n7igfrfmq7xskg70775v88292v3baaiidvx0"))))
2898 (build-system cmake-build-system)
2899 (arguments
2900 (list
2901 #:tests? #f ;no test suite
2902 #:configure-flags
2903 #~(list (string-append "-DPYBIND11_INCLUDE_DIR="
2904 (search-input-directory %build-inputs
2905 "include/pybind11")))
2906 #:phases
2907 #~(modify-phases %standard-phases
2908 (add-after 'unpack 'chdir
2909 (lambda _
2910 (chdir "libtrellis"))))))
2911 (native-inputs (list python-minimal-wrapper))
2912 (inputs (list openocd boost pybind11))
2913 (synopsis "Placement and routing for ECP5 FPGAs")
2914 (description
2915 "Project Trellis is a Nextpnr backend compatible with ECP5 FPGAs.
2916The following features are currently available:
2917@itemize
2918@item logic slice functionality, including carries
2919@item distributed RAM inside logic slices
2920@item all internal interconnect
2921@item basic IO, including tristate
2922@item block RAM, using inference or manual instantiation
2923@item multipliers using manual instantiation
2924@item global networks and PLLs
2925@item transcievers (DCUs.)
2926@end itemize")
2927 (home-page "https://github.com/YosysHQ/prjtrellis/")
2928 (license license:expat))))
2929
2930(define-public opensta
2931 ;; There are no releases, we use last commit.
2932 (let ((commit "dc5ccd2d6941289a6a7d3c918b10b493f44a7f56")
2933 (revision "1"))
2934 (package
2935 (name "opensta")
2936 ;; The version string is taken from the CMakeLists.txt.
2937 (version (git-version "3.1.0" revision commit))
2938 (source
2939 (origin
2940 (method git-fetch)
2941 (uri (git-reference
2942 (url "https://github.com/parallaxsw/OpenSTA/")
2943 (commit commit)))
2944 (file-name (git-file-name name version))
2945 (sha256
2946 (base32 "1fjafwxwknr029z87nq48mzgzhy61aadhd6nkras62f6p2rw6sjr"))))
2947 (build-system cmake-build-system)
2948 (arguments
2949 (list
2950 #:phases
2951 #~(modify-phases %standard-phases
2952 (add-before 'check 'symlink-test-dir
2953 (lambda _
2954 (symlink "../build" "../source/build")))
2955 (replace 'check
2956 (lambda* (#:key tests? #:allow-other-keys)
2957 (when tests?
2958 (invoke "../source/test/regression")))))
2959 #:configure-flags
2960 #~(list
2961 (string-append "-DCUDD_DIR=" #$(this-package-input "cudd"))
2962 (string-append "-DBUILD_SHARED_LIBS=YES"))))
2963 (native-inputs (list bison flex swig-4.4))
2964 (inputs (list cudd eigen tcl tclreadline zlib))
2965 (synopsis "Parallax Static Timing Analyzer")
2966 (description
2967 "OpenSTA is an @acronym{EDA, electronic design automation} gate level
2968static timing verifier. As a stand-alone executable it can be used to verify
2969the timing of a design using standard file formats.")
2970 (home-page "https://github.com/parallaxsw/OpenSTA/")
2971 (license license:gpl3+))))
2972
2973(define-public openroad
2974 (package
2975 (name "openroad")
2976 (version "26Q4")
2977 (source
2978 (origin
2979 (method git-fetch)
2980 (uri (git-reference
2981 (url "https://github.com/The-OpenROAD-Project/OpenROAD")
2982 (commit version)
2983 ;; 26Q4 Uses:
2984 ;; - forked, custom opensta
2985 ;; - forked, custom (berkeley) abc
2986 ;; - magic commit number of yosys-slang
2987 (recursive? #t)))
2988 (file-name (git-file-name name version))
2989 (sha256
2990 (base32 "0vapzjq1r2xq4vql2pkznvr6jbmwk4ydsc8mlrhwrjhib17dfd78"))))
2991 (build-system qt-build-system)
2992 (arguments
2993 (list
2994 #:configure-flags
2995 #~(list "-DBUILD_GUI=ON"
2996 (string-append "-DOPENROAD_VERSION=" #$version)
2997 "-DBUILD_PYTHON=ON"
2998 "-DBUILD_MAN=ON"
2999 "-DUSE_SYSTEM_ABC=OFF" ;uses a custom fork
3000 "-DUSE_SYSTEM_OPENSTA=OFF" ;uses a custom fork
3001 "-DUSE_SYSTEM_BOOST=ON")
3002 #:phases
3003 #~(modify-phases %standard-phases
3004 (add-before 'check 'symlink-test-dir
3005 (lambda _
3006 (symlink "../build" "../source/build"))))))
3007 (native-inputs
3008 (list bison
3009 flex
3010 googletest
3011 groff-minimal ;for nroff
3012 pandoc
3013 pkg-config
3014 swig-4.4
3015 util-linux)) ;for col
3016 (inputs
3017 (list abseil-cpp
3018 boost
3019 cudd
3020 eigen
3021 fmt-12
3022 glpk
3023 gmp
3024 lemon-graph
3025 libdeflate
3026 libomp
3027 mpfr
3028 or-tools
3029 protobuf-6
3030 python
3031 qtcharts-5
3032 qtimageformats-5
3033 qtsvg-5
3034 qtwayland-5
3035 re2-next
3036 scip
3037 spdlog
3038 tcl
3039 yaml-cpp
3040 zlib))
3041 (home-page "https://theopenroadproject.org/")
3042 (synopsis "Collection of tools for semiconductor digital design")
3043 (description
3044 "OpenROAD is an @acronym{EDA, electronic design automation} toolkit for
3045@acronym{RTL, Register Transfert Logic} to GDS design flows. It provides all
3046necessary steps from @acronym{VLSI, Very Large Scale of Integration} designs
3047to implement integrated chip physical designs, from RTL design to synthesized
3048Verilog and routed layout. It includes tools for floorplanning, placement,
3049clock tree synthesis, routing, parasitic extraction, and timing analysis.")
3050 (license license:bsd-3)))
3051
3052(define-public openroad-cli
3053 (package
3054 (inherit openroad)
3055 (name "openroad-cli")
3056 (arguments
3057 (delkw
3058 #:qtbase
3059 (substitute-keyword-arguments arguments
3060 ((#:configure-flags flags '())
3061 #~(cons* "-DBUILD_GUI=OFF"
3062 (delete! "-DBUILD_GUI=ON" #$flags))))))
3063 (inputs
3064 (modify-inputs (package-inputs openroad)
3065 (delete "qtcharts-5" "qtimageformats-5" "qtsvg-5" "qtwayland-5")))
3066 (synopsis
3067 "Collection of tools for semiconductor digital design, cli version.")))
3068
3069(define-public pulseview
3070 (package
3071 (name "pulseview")
3072 (version "0.4.2")
3073 (source
3074 (origin
3075 (method url-fetch)
3076 (uri (string-append
3077 "https://sigrok.org/download/source/pulseview/pulseview-"
3078 version ".tar.gz"))
3079 (sha256
3080 (base32
3081 "1jxbpz1h3m1mgrxw74rnihj8vawgqdpf6c33cqqbyd8v7rxgfhph"))
3082 (patches (search-patches "pulseview-qt515-compat.patch"
3083 "pulseview-glib-2.68.patch"))))
3084 (build-system qt-build-system)
3085 (arguments
3086 (list
3087 #:tests? #f ;format_time_minutes_test is failing
3088 #:phases
3089 #~(modify-phases %standard-phases
3090 (add-after 'install 'remove-empty-doc-directory
3091 (lambda _
3092 (with-directory-excursion (string-append #$output "/share")
3093 ;; Use RMDIR to never risk silently deleting files.
3094 (rmdir "doc/pulseview")
3095 (rmdir "doc")))))))
3096 (native-inputs
3097 (list pkg-config qttools-5))
3098 (inputs
3099 (list boost-1.83
3100 glib
3101 glibmm
3102 libsigrok
3103 libsigrokdecode
3104 qtbase-5
3105 qtsvg-5
3106 qtwayland-5))
3107 (home-page "https://www.sigrok.org/wiki/PulseView")
3108 (synopsis "Qt based logic analyzer, oscilloscope and MSO GUI for sigrok")
3109 (description "PulseView is a Qt based logic analyzer, oscilloscope and MSO
3110GUI for sigrok.")
3111 (license license:gpl3+)))
3112
3113(define-public osvvm
3114 (package
3115 (name "osvvm")
3116 (version "2026.08")
3117 (source
3118 (origin
3119 (method git-fetch)
3120 (uri (git-reference
3121 (url "https://github.com/osvvm/OsvvmLibraries/")
3122 (commit version)
3123 ;; OsvvmLibraries repository gathers all osvvm libraries as
3124 ;; submodules.
3125 (recursive? #t)))
3126 (file-name (git-file-name name version))
3127 (sha256
3128 (base32 "03nsdb5h6qsjq9lr0nsyv9yn4y6cd8435rgsacdqp0flbz9lbjwz"))))
3129 (outputs
3130 '("out" "osvvm"))
3131 (properties
3132 `((output-synopsis "out" "Instance this design library as work")
3133 (output-synopsis "osvvm" "Instance this design library as osvvm")))
3134 (build-system copy-build-system)
3135 (arguments
3136 (list
3137 #:install-plan
3138 #~'(;; Library work.
3139 ("osvvm" "share/osvvm/work/osvvm/"
3140 #:include ("vhd" "pro" "md"))
3141 ("Common" "share/osvvm/work/Common/"
3142 #:include ("vhd" "pro" "md"))
3143 ("Scripts" "share/osvvm/work/Scripts/"
3144 #:include ("tcl" "md"))
3145 ("UART" "share/osvvm/work/UART"
3146 #:include ("vhd" "pro" "md")
3147 #:exclude-regexp ("GHDL_Debug"))
3148 ("AXI4" "share/osvvm/work/AXI4"
3149 #:include ("vhd" "pro" "md"))
3150 ("Ethernet" "share/osvvm/work/Ethernet"
3151 #:include ("vhd" "pro" "md"))
3152 ("Wishbone" "share/osvvm/work/Wishbone"
3153 #:include ("vhd" "pro" "md"))
3154 ;; Library osvvm.
3155 ("osvvm" "share/osvvm/osvvm/osvvm/"
3156 #:include ("vhd" "pro" "md") #:output "osvvm")
3157 ("Common" "share/osvvm/osvvm/Common/"
3158 #:include ("vhd" "pro" "md") #:output "osvvm")
3159 ("Scripts" "share/osvvm/osvvm/Scripts/"
3160 #:include ("tcl" "md") #:output "osvvm")
3161 ("UART" "share/osvvm/osvvm/UART"
3162 #:include ("vhd" "pro" "md")
3163 #:exclude-regexp ("GHDL_Debug")
3164 #:output "osvvm")
3165 ("AXI4" "share/osvvm/osvvm/AXI4"
3166 #:include ("vhd" "pro" "md")
3167 #:output "osvvm")
3168 ("Ethernet" "share/osvvm/osvvm/Ethernet"
3169 #:include ("vhd" "pro" "md")
3170 #:output "osvvm")
3171 ("Wishbone" "share/osvvm/osvvm/Wishbone"
3172 #:include ("vhd" "pro" "md")
3173 #:output "osvvm"))
3174 #:phases
3175 #~(modify-phases %standard-phases
3176 (add-before 'install 'check
3177 (lambda* (#:key tests? #:allow-other-keys)
3178 (when tests?
3179 (setenv "OSVVM_DIR" (getcwd))
3180 (setenv "OSVVM_MUST_BUILD" (getcwd))
3181 (invoke "tclsh"
3182 (string-append #$(this-package-native-input "nvc")
3183 "/test/test-osvvm.tcl")))))
3184 (add-after 'install 'build
3185 (lambda _
3186 (define (build dir)
3187 (chdir dir)
3188 (call-with-output-file "build.tcl"
3189 (lambda (port)
3190 (format port "source Scripts/StartNVC.tcl;\n")
3191 (format port "include osvvm/osvvm.pro;\n")
3192 (format port "include Common/build.pro;\n")
3193 (format port "include UART/build.pro\n")
3194 (format port "include AXI4/build.pro\n")
3195 (format port "include Ethernet/build.pro\n")
3196 (format port "include Wishbone/build.pro\n")))
3197 (invoke "tclsh" "build.tcl")
3198 (rename-file
3199 (string-append "VHDL_LIBS/" "NVC-" #$(package-version nvc))
3200 "Compiled")
3201 (for-each delete-file-recursively
3202 (list "OsvvmTemp_NVC" "VHDL_LIBS")))
3203 (build (string-append #$output "/share/osvvm/work"))
3204 (build (string-append #$output:osvvm "/share/osvvm/osvvm")))))))
3205 (native-inputs
3206 (list nvc tcl tcllib which))
3207 (native-search-paths
3208 (list (search-path-specification
3209 (variable "FW_OSVVM")
3210 (separator #f)
3211 (files (list "share/osvvm")))))
3212 (home-page "https://osvvm.github.io")
3213 (synopsis "The OSVVM VHDL Verification Libraries and Scripts")
3214 (description "OSVVM is a verification methodology that defines a VHDL
3215verification framework, verification utility library, verification component
3216library, scripting API, and co-simulation capability for FPGA or ASIC
3217verification.")
3218 (license license:asl2.0)))
3219
3220;;; Required by python-vunit.
3221(define osvvm-2023.04
3222 (package
3223 (inherit osvvm)
3224 (name "osvvm")
3225 (version "2023.04")
3226 (source
3227 (origin
3228 (method git-fetch)
3229 (uri (git-reference
3230 (url "https://github.com/osvvm/OsvvmLibraries/")
3231 (commit version)
3232 ;; OsvvmLibraries repository gathers all osvvm libraries as
3233 ;; submodules.
3234 (recursive? #t)))
3235 (file-name (git-file-name name version))
3236 (sha256
3237 (base32 "1kn18ibvm7bzdyw2d914284wriravyh5qwfarj06pb052x1yblyx"))))
3238 (arguments
3239 (substitute-keyword-arguments arguments
3240 ((#:tests? _ #t)
3241 #f)
3242 ((#:install-plan _)
3243 #~'(("osvvm" "share/osvvm/work/osvvm/"
3244 #:include ("vhd" "pro" "md"))))
3245 ((#:phases phases #~%standard-phases)
3246 #~(modify-phases #$phases
3247 (delete 'build)
3248 (delete 'fix-scripts)))))))
3249
3250(define-public pyspice
3251 (package
3252 (name "pyspice")
3253 (version "1.5")
3254 (source
3255 (origin
3256 (method git-fetch)
3257 (uri (git-reference
3258 (url "https://github.com/PySpice-org/PySpice")
3259 (commit (string-append "v" version))))
3260 (file-name (git-file-name name version))
3261 (sha256
3262 (base32 "02z35gyx27npqg7g0m1gdy8wid93iy335pc72j90ycx998xf2r5k"))))
3263 (build-system pyproject-build-system)
3264 (arguments
3265 (list
3266 #:test-flags
3267 #~(list "unit-test")
3268 #:phases
3269 #~(modify-phases %standard-phases
3270 (add-before 'build 'patch-libngspice
3271 (lambda* (#:key inputs #:allow-other-keys)
3272 (substitute* "PySpice/Spice/NgSpice/Shared.py"
3273 ((" path = .*" _)
3274 (format #f " path = '~a/lib/libngspice.so'"
3275 (search-input-file inputs "lib/libngspice.so")))))))))
3276 (native-inputs
3277 (list python-pytest
3278 python-setuptools))
3279 (inputs
3280 (list libngspice
3281 python-invoke
3282 python-matplotlib
3283 python-ply
3284 python-pyyaml
3285 python-requests
3286 python-scipy))
3287 (home-page "https://pyspice.fabrice-salvaire.fr/")
3288 (synopsis "Circuit simulator Python interface")
3289 (description "PySpice implements a Ngspice binding and provides an
3290oriented object API on top of SPICE, the simulation output is converted to
3291Numpy arrays for convenience.")
3292 (license license:gpl3+)))
3293
3294(define-public python-amaranth
3295 (package
3296 (name "python-amaranth")
3297 (version "0.5.10")
3298 (source
3299 (origin
3300 (method git-fetch)
3301 (uri (git-reference
3302 (url "https://github.com/amaranth-lang/amaranth/")
3303 (commit (string-append "v" version))))
3304 (sha256
3305 (base32 "1zgyvpcbksyhfk9rp04wgkxcja4f1dda8mmcifv0l60k6c29k680"))
3306 (file-name (git-file-name name version))))
3307 (build-system pyproject-build-system)
3308 (arguments
3309 (list
3310 #:phases
3311 #~(modify-phases %standard-phases
3312 (add-after 'unpack 'relax-requirements
3313 (lambda _
3314 (substitute* "pyproject.toml"
3315 (("pyvcd>=0.2.2,<0.5")"pyvcd>=0.2.2,<=0.5"))))
3316 (add-before 'build 'set-version
3317 (lambda _
3318 (setenv "PDM_BUILD_SCM_VERSION" #$version))))))
3319 (native-inputs
3320 (list python-pdm-backend
3321 python-setuptools
3322 python-setuptools-scm
3323 sby
3324 yices
3325 yosys))
3326 (propagated-inputs
3327 (list python-jinja2 python-jschon python-pyvcd))
3328 (home-page "https://amaranth-lang.org/docs/amaranth/latest/")
3329 (synopsis "Amaranth hardware definition language")
3330 (description "The Amaranth project provides an open-source toolchain for
3331developing hardware based on synchronous digital logic using the Python
3332programming language, as well as evaluation board definitions and a System on
3333Chip toolkit.")
3334 (license license:bsd-3)))
3335
3336(define-public python-gdsfactory
3337 (package
3338 (name "python-gdsfactory")
3339 (version "9.45.0")
3340 (source
3341 (origin
3342 (method git-fetch)
3343 (uri (git-reference
3344 (url "https://github.com/gdsfactory/gdsfactory")
3345 (commit (string-append "v" version))))
3346 (file-name (git-file-name name version))
3347 (sha256
3348 (base32 "0bd8i385z83hvgrbbksyqrrrkdwi54rja4bc6kgj7agnh15givq4"))))
3349 (build-system pyproject-build-system)
3350 (arguments
3351 (list
3352 #:test-flags
3353 #~(list
3354 ;; FileNotFoundError: No such file or directory.
3355 "--deselect=tests/test_path.py::test_gds[transition]"
3356 "--deselect=tests/test_path.py::test_settings[transition]"
3357 "--deselect=tests/test_port.py::test_rename_ports[electrical]"
3358 "--deselect=tests/test_port.py::test_rename_ports[optical]"
3359 "--deselect=tests/test_port.py::test_rename_ports[placement]"
3360 "--deselect=tests/test_schematic.py::test_schematic"
3361 "--deselect=tests/test_write_cells.py::test_write_cells_recursively"
3362 "--deselect=tests/test_write_cells.py::test_write_cells"
3363 ;; Failed: File not found in data directory, created.
3364 "--deselect=tests/components"
3365 "--deselect=tests/read/test_component_from_yaml.py"
3366 "--deselect=tests/read/test_component_from_yaml2.py"
3367 "--deselect=tests/read/test_import_gds.py"
3368 ;; Reference GDS file for 'sample_fiber_array' not found.
3369 "--deselect=tests/routing")
3370 #:phases
3371 #~(modify-phases %standard-phases
3372 (add-after 'unpack 'relax-requirements
3373 (lambda _
3374 (substitute* "pyproject.toml"
3375 (("kfactory\\[ipy\\]~=2.6.1") "kfactory~=2.6.0"))))
3376 (add-before 'check 'pre-check
3377 (lambda _
3378 (setenv "HOME" "/tmp")))
3379 (replace 'check
3380 (lambda* (#:key tests? test-flags #:allow-other-keys)
3381 ;; Running tests together fails with error:
3382 ;;
3383 ;; import file mismatch:
3384 ;; imported module 'conftest' has this __file__ attribute:
3385 ;; /<...>/source/tests/backend/conftest.py
3386 ;; which is not the same as the test file we want to collect:
3387 ;; /<...>/source/tests/conftest.py
3388 ;;
3389 ;; HINT: remove __pycache__ / .pyc files and/or use a unique
3390 ;; basename for your test file modules
3391 (when tests?
3392 (apply invoke "pytest" "-vv" "tests" test-flags)))))))
3393 (native-inputs
3394 (list python-flit-core
3395 python-jsondiff
3396 python-pytest
3397 python-pytest-regressions))
3398 (propagated-inputs
3399 (list python-aenum
3400 python-attrs
3401 python-freetype-py
3402 python-graphviz
3403 python-ipykernel
3404 python-jinja2
3405 python-kfactory
3406 python-klayout
3407 python-loguru
3408 python-matplotlib
3409 python-natsort
3410 python-networkx
3411 python-mapbox-earcut
3412 python-numpy
3413 python-orjson
3414 python-pandas
3415 python-pydantic
3416 python-pydantic-settings
3417 python-pygit2
3418 python-pyglet
3419 python-pyyaml
3420 python-qrcode
3421 python-rectpack
3422 python-rich
3423 python-scikit-image
3424 python-scipy
3425 python-shapely
3426 python-toolz
3427 python-trimesh
3428 python-typer
3429 python-types-pyyaml
3430 python-typing-extensions
3431 python-watchdog))
3432 (home-page "https://gdsfactory.github.io/gdsfactory/")
3433 (synopsis "Python library for chip design automation")
3434 (description
3435 "GDSFactory is a Python library for designing chips including
3436photonics, analog, quantum, and MEMS devices. It provides tools for creating,
3437manipulating, and validating designs, outputting industry-standard GDSII and
3438OASIS formats. GDSFactory leverages the KLayout library for high-performance
3439geometry operations.")
3440 (license license:expat)))
3441
3442(define-public python-gdstk
3443 (package
3444 (inherit gdstk)
3445 (name "python-gdstk")
3446 (build-system pyproject-build-system)
3447 (arguments (list #:test-flags #~(list ".")))
3448 (native-inputs (list cmake-minimal python-pytest python-minimal-wrapper
3449 python-scikit-build-core))
3450 (inputs (modify-inputs inputs
3451 (prepend python-numpy)))
3452 (synopsis "Python module for creation and manipulation of GDSII files")
3453 (description
3454 "@code{python-gdstk} is a Python library for creation
3455and manipulation of GDSII layout files which are commonly used
3456for @acronym{EDA, elecronic design automation} and chip design.")))
3457
3458(define-public python-kfactory
3459 (package
3460 (name "python-kfactory")
3461 (version "2.6.0")
3462 (source
3463 (origin
3464 (method git-fetch)
3465 (uri (git-reference
3466 (url "https://github.com/gdsfactory/kfactory")
3467 (commit (string-append "v" version))))
3468 (file-name (git-file-name name version))
3469 (sha256
3470 (base32 "0aa3q638ajrardn0fyp20bwwnz0y2jywfx8hn1irx1bk6dmj5y9g"))))
3471 (build-system pyproject-build-system)
3472 (arguments
3473 (list
3474 #:tests? #f ;requires python-kfnetlist, which depends on klayout.
3475 #:phases
3476 #~(modify-phases %standard-phases
3477 (add-after 'unpack 'relax-requirements
3478 (lambda _
3479 (substitute* "pyproject.toml"
3480 (("cachetools >= 6.2.4") "cachetools >= 6.1.0")
3481 (("pydantic-extra-types>=2.11") "pydantic-extra-types>=2.10")
3482 (("pygit2 >= 1.19.1, < 2") "pygit2 >= 1.18.2, < 2")
3483 (("ruamel.yaml >= 0.19.1, < 0.20") "ruamel.yaml >= 0.18.4, < 0.20")
3484 (("typer >= 0.21.1, < 0.25") "typer >= 0.21.1, <= 0.26.4")))))))
3485 (native-inputs
3486 (list python-setuptools))
3487 (propagated-inputs
3488 (list python-aenum
3489 python-cachetools
3490 python-klayout
3491 python-loguru
3492 python-pydantic
3493 python-pydantic-extra-types
3494 python-pydantic-settings
3495 python-pygit2
3496 python-rapidfuzz
3497 python-rectangle-packer
3498 python-requests
3499 python-ruamel.yaml
3500 python-ruamel.yaml.string
3501 python-scipy
3502 python-semver
3503 python-toolz
3504 python-typer))
3505 (home-page "https://gdsfactory.github.io/kfactory")
3506 (synopsis "Gdsfactory with a KLayout backend")
3507 (description
3508 "KFactory is a Python framework for photonic and electronic chip layout,
3509built on KLayout's C++ geometry engine. It provides parametric cells with
3510caching, optical and electrical routing, enclosures via Minkowski sums, and
3511schematic-driven design with LVS.")
3512 (license license:expat)))
3513
3514(define-public python-klayout
3515 (package
3516 (name "python-klayout")
3517 (version (package-version klayout))
3518 (source (package-source klayout))
3519 (build-system pyproject-build-system)
3520 (arguments
3521 (list
3522 #:phases
3523 #~(modify-phases %standard-phases
3524 (replace 'check
3525 (lambda* (#:key tests? #:allow-other-keys)
3526 ;; Run the tests as specified in pyproject.toml.
3527 (when tests?
3528 (substitute* "pyproject.toml"
3529 ;; Fix failing test
3530 (("TESTSRC=\\{package\\} ")
3531 ""))
3532 (setenv "TESTSRC" ".")
3533 (invoke "python"
3534 #$(plain-file "python-klayout-test-runner.py"
3535 "import tomllib, subprocess
3536with open(\"pyproject.toml\", \"rb\") as f:
3537 config = tomllib.load(f)
3538
3539commands = config['tool']['cibuildwheel']['test-command']
3540
3541for command in commands:
3542 subprocess.run(command.format(package=\".\").split())"))))))))
3543 (native-inputs (list curl
3544 expat
3545 libpng
3546 python-setuptools
3547 python-tomli
3548 python-wrapper)) ;; The test commands invoke "python".
3549 (home-page "https://klayout.de")
3550 (synopsis "Mask layout library for Python")
3551 (description
3552 "python-klayout is a standalone Python API of KLayout.
3553This library supports OASIS and GDS2 file formats,
3554editing of mask layouts, and verification such as
3555@acronym{DRC, Design rule checking} and @acronym{LVS, Layout Versus Schematic}.")
3556 (license license:gpl3+)))
3557
3558(define-public python-liberty-parser
3559 (package
3560 (name "python-liberty-parser")
3561 (version "0.0.29")
3562 (source
3563 (origin
3564 (method git-fetch)
3565 (uri (git-reference
3566 (url "https://codeberg.org/tok/liberty-parser")
3567 (commit version)))
3568 (sha256
3569 (base32 "0x3y1rp0hwcbncgjnkpdjn6gf56qxxp39y2h9p1xm63g3hhikwdc"))
3570 (file-name (git-file-name name version))))
3571 (build-system pyproject-build-system)
3572 (propagated-inputs (list python-lark python-numpy python-sympy))
3573 (native-inputs (list python-pytest python-setuptools))
3574 (home-page "https://codeberg.org/tok/liberty-parser")
3575 (synopsis "Parser for Liberty timing libraries")
3576 (description
3577 "The @code{liberty-parser} Python library provides a parser
3578and data structures for the Liberty format,
3579a standard file format used in @acronym{EDA, Electronic Design Automation}
3580for example for timing information of digital circuits.")
3581 (license license:gpl3+)))
3582
3583(define-public python-hdlconvertorast
3584 (package
3585 (name "python-hdlconvertorast")
3586 (version "1.2")
3587 (source
3588 (origin
3589 (method git-fetch)
3590 (uri (git-reference
3591 (url "https://github.com/Nic30/hdlConvertorAst")
3592 (commit (string-append "v" version))))
3593 (file-name (git-file-name name version))
3594 (sha256
3595 (base32 "1zv067imbdihyqwy7f0j80x9a2857vifhky60vc91dffjl1zjg1i"))))
3596 (build-system pyproject-build-system)
3597 (native-inputs
3598 (list python-pytest
3599 python-setuptools))
3600 (home-page "https://github.com/Nic30/hdlConvertorAst")
3601 (synopsis "@acronym{AST, Abstract Syntax Tree} library for VHDL and
3602SystemVerilog")
3603 (description
3604 "This package provides a library of @acronym{AST, Abstract Syntax Tree} nodes
3605for @acronym{VHDL, Very high speed integrated circuit Hardware Description Language},
3606SystemVerilog, and SystemC, with conversion between languages and to JSON.")
3607 (license license:expat)))
3608
3609;; Yosys source pinned to hdlConvertor v2.3 submodule commit for parsing tests.
3610(define yosys-src-for-hdlconvertor-tests
3611 (origin
3612 (method git-fetch)
3613 (uri (git-reference
3614 (url "https://github.com/YosysHQ/yosys")
3615 (commit "a299e606f864942c7edf90c4ad3998f4f4a346cf")))
3616 (file-name "yosys-src-for-hdlconvertor-tests")
3617 (sha256
3618 (base32 "106bzlljn6843740r8rbaqf5ivkyfcgp25dgzds97j48ypmv6fih"))))
3619
3620(define-public python-hdlconvertor
3621 (package
3622 (name "python-hdlconvertor")
3623 (version "2.3")
3624 (source
3625 (origin
3626 (method git-fetch)
3627 (uri (git-reference
3628 (url "https://github.com/Nic30/hdlConvertor")
3629 (commit (string-append "v" version))))
3630 (file-name (git-file-name name version))
3631 (sha256
3632 (base32 "0xa7wm324dwp4wks8l9njpd2bz4gn7dfygdc3a78lxy1prvzbyyz"))))
3633 (build-system pyproject-build-system)
3634 (arguments
3635 (list
3636 #:test-flags
3637 ;; Ignore tests inside yosys source tree (they're unrelated yosys tests).
3638 #~(list "--ignore=tests/yosys")
3639 #:phases
3640 #~(modify-phases %standard-phases
3641 (add-before 'build 'setup-antlr
3642 (lambda* (#:key inputs #:allow-other-keys)
3643 ;; Build classpath from input jars.
3644 (let* ((st4 (search-input-file inputs
3645 "share/java/java-stringtemplate-4.0.8.jar"))
3646 (antlr4 (search-input-file inputs
3647 "share/java/antlr4.jar"))
3648 (antlr4-rt (search-input-file inputs
3649 "share/java/java-antlr4-runtime.jar"))
3650 (antlr3 (search-input-file inputs
3651 "share/java/antlr3-3.5.2.jar"))
3652 (treelayout (search-input-file inputs
3653 "share/java/java-treelayout-1.0.3.jar"))
3654 (classpath (string-join (list st4 antlr4 antlr4-rt
3655 antlr3 treelayout)
3656 ":"))
3657 (antlr4cpp-include (search-input-directory
3658 inputs "include/antlr4-runtime"))
3659 (antlr4cpp-lib (search-input-file
3660 inputs "lib/libantlr4-runtime.so"))
3661 (python-include
3662 (search-input-directory
3663 inputs
3664 (string-append
3665 "include/python"
3666 #$(version-major+minor (package-version python))))))
3667 ;; Patch CMake to use our paths directly.
3668 (substitute* "src/CMake_antlr4.txt"
3669 (("set\\(ANTLR_CLASSPATH \"\"\\)")
3670 (string-append "set(ANTLR_CLASSPATH \"" classpath "\")"))
3671 ;; Skip the jar search loop.
3672 (("FOREACH\\(antlr_jar \\$\\{ANTLR_JARS\\}\\)")
3673 "FOREACH(antlr_jar )")
3674 ;; Set C++ runtime paths before find commands.
3675 (("# search for antlr4 include dir and library")
3676 (string-append
3677 "# search for antlr4 include dir and library\n"
3678 "set(ANTLR4CPP_INCLUDE_DIRS \"" antlr4cpp-include "\")\n"
3679 "set(ANTLR4CPP_LIBRARIES \"" antlr4cpp-lib "\")\n")))
3680 ;; hdlConvertor/CMakeLists.txt is a sibling subdirectory to src/
3681 ;; so variables set in src/CMake_antlr4.txt aren't visible here;
3682 ;; inject both ANTLR and Python include paths before
3683 ;; include_directories.
3684 (substitute* "hdlConvertor/CMakeLists.txt"
3685 (("include_directories\\(")
3686 (string-append
3687 "set(ANTLR4CPP_INCLUDE_DIRS \"" antlr4cpp-include "\")\n"
3688 "set(PYTHON_INCLUDE_DIRS \"" python-include "\")\n"
3689 "include_directories(")))
3690 ;; ANTLR4 4.10+ changed from .as<T>() to std::any_cast<T>().
3691 ;; Upstream fixed this in commit 8b07c10 using preprocessor
3692 ;; conditionals to support both old and new APIs, but that
3693 ;; commit also includes unrelated changes (Block statement
3694 ;; support). We apply a simplified fix for ANTLR 4.10+
3695 ;; only.
3696 (substitute* "src/verilogPreproc/verilogPreproc.cpp"
3697 (("visitMacro_call\\(mc, false\\)\\.as<string>\\(\\)")
3698 "std::any_cast<string>(visitMacro_call(mc, false))")
3699 (("params = visitDefine_args\\(da\\);")
3700 (string-append "params = std::any_cast<"
3701 "vector<MacroDefVerilog::param_info_t>*"
3702 ">(visitDefine_args(da));"))))))
3703 (add-before 'check 'prepare-tests
3704 (lambda* (#:key inputs #:allow-other-keys)
3705 ;; Symlink yosys source for yosys testsuite.
3706 (delete-file-recursively "tests/yosys")
3707 (symlink (assoc-ref inputs "yosys-src-for-hdlconvertor-tests")
3708 "tests/yosys")
3709 ;; Remove source hdlConvertor/ which shadows the installed package.
3710 (delete-file-recursively "hdlConvertor")
3711 ;; Replace tests/__init__.py which imports all.py that requires
3712 ;; git submodules; also delete tests requiring external tools.
3713 (call-with-output-file "tests/__init__.py"
3714 (lambda (port)
3715 (display "" port)))
3716 (delete-file "tests/all.py")
3717 (for-each delete-file
3718 (find-files "tests" "test_ghdl"))
3719 (for-each delete-file
3720 (find-files "tests" "test_icarus"))
3721 (for-each delete-file
3722 (find-files "tests" "test_verilator"))
3723 (for-each delete-file
3724 (find-files "tests" "test_uvvm"))
3725 (for-each delete-file
3726 (find-files "tests" "test_vunit"))
3727 (for-each delete-file
3728 (find-files "tests" "test_notebook"))
3729 (for-each delete-file
3730 (find-files "tests" "test_basic_hdl_sim")))))))
3731 (native-inputs
3732 (list antlr4 ; parser generator tool (antlr4.jar)
3733 antlr3 ; antlr3-runtime.jar required by hdlConvertor build
3734 java-antlr4-runtime ; antlr4-runtime.jar required by hdlConvertor build
3735 java-stringtemplate ; stringtemplate4.jar required by hdlConvertor build
3736 java-treelayout ; treelayout.jar required by hdlConvertor build
3737 (list openjdk "jdk") ; Java runtime to execute ANTLR4
3738 ;;; Python build dependencies:
3739 python-cython ; compiles .pyx extension files to C++
3740 python-scikit-build ; CMake-based Python build system
3741 python-setuptools
3742 python-wrapper ; Python interpreter for build scripts
3743 python ; Python headers for C extension building
3744 python-pytest
3745 ;; Yosys source for parsing tests.
3746 yosys-src-for-hdlconvertor-tests))
3747 (inputs
3748 (list cpp-antlr4-runtime))
3749 (propagated-inputs
3750 (list python-hdlconvertorast))
3751 (home-page "https://github.com/Nic30/hdlConvertor")
3752 (synopsis "VHDL and System Verilog parser")
3753 (description "This package provides a @acronym{VHDL, Very high speed
3754integrated circuit Hardware Description Language} and SystemVerilog
3755parser library for Python.")
3756 (license license:expat)))
3757
3758(define-public python-pyrtl
3759 (package
3760 (name "python-pyrtl")
3761 (version "1.0.0")
3762 (source
3763 (origin
3764 (method git-fetch)
3765 (uri (git-reference
3766 (url "https://github.com/UCSBarchlab/PyRTL")
3767 (commit version)))
3768 (file-name (git-file-name name version))
3769 (sha256
3770 (base32 "0r42yh9ncrb6k9z35skw35dba4173lmb7xxka13iwwwghnl935vy"))))
3771 (build-system pyproject-build-system)
3772 (native-inputs
3773 (list python-hatchling python-hatch-vcs python-pytest))
3774 (propagated-inputs
3775 (list python-graphviz python-pyparsing))
3776 (synopsis
3777 "@acronym{RTL, Register Transfert Level} hardware design and simulation")
3778 (description
3779 "PyRTL provides a collection of classes for Pythonic @acronym{RTL,
3780Register Transfer Logic}-level design, simulation, tracing, and testing,
3781suitable for teaching and research.")
3782 (home-page "https://UCSBarchlab.github.io/PyRTL")
3783 (license license:bsd-3)))
3784
3785(define-public python-pyucis
3786 (package
3787 (name "python-pyucis")
3788 (version "0.1.5")
3789 (source
3790 (origin
3791 (method git-fetch)
3792 (uri (git-reference
3793 (url "https://github.com/fvutils/pyucis/")
3794 (commit (string-append "v" version))))
3795 (file-name (git-file-name name version))
3796 (sha256
3797 (base32 "19bxmhqkdmhbibkbzcjqvzvcni1kzg28nqz9vh6zj73hl26lf2ij"))))
3798 (build-system pyproject-build-system)
3799 (native-inputs
3800 (list python-pytest
3801 python-setuptools))
3802 (propagated-inputs
3803 (list python-jsonschema-objects
3804 python-lxml
3805 python-pyyaml))
3806 (home-page "https://fvutils.github.io/pyucis//")
3807 (synopsis "Python interface to UCIS data")
3808 (description
3809 "The code{PyUCIS} library provides two APIs for creating and accessing
3810coverage data via the @acronym{UCIS, Unified Coverage Interoperability
3811Standard} data mode.")
3812 (license license:asl2.0)))
3813
3814(define-public python-pyuvm
3815 (package
3816 (name "python-pyuvm")
3817 (version "5.0.0")
3818 (source
3819 (origin
3820 (method git-fetch)
3821 (uri (git-reference
3822 (url "https://github.com/pyuvm/pyuvm")
3823 (commit version)))
3824 (file-name (git-file-name name version))
3825 (sha256
3826 (base32 "12xfc9kxr7pw8f9wmk3lblly9hmabpdxlh4228wl1a0i4x4nzf3v"))))
3827 (build-system pyproject-build-system)
3828 (native-inputs
3829 (list python-pytest python-setuptools))
3830 (propagated-inputs
3831 (list python-cocotb))
3832 (home-page "https://github.com/pyuvm/pyuvm")
3833 (synopsis "@acronym{UVM, Universal Verification Methodology} in Python")
3834 (description
3835 "PyUVM is a Python implementation of the @acronym{UVM, Universal
3836Verification Methodology}, as defined in the IEEE 1800.2 standard. It uses
3837@code{cocotb} to interact with simulators and schedule simulation
3838events. It implements the most commonly used sections of the IEEE 1800.2
3839standard.")
3840 (license license:asl2.0)))
3841
3842(define-public python-pyvcd
3843 (package
3844 (name "python-pyvcd")
3845 (version "0.5.0")
3846 (source
3847 (origin
3848 (method git-fetch)
3849 (uri (git-reference
3850 (url "https://github.com/SanDisk-Open-Source/pyvcd")
3851 (commit version)))
3852 (file-name (git-file-name name version))
3853 (sha256
3854 (base32 "0c0i3dvbza481ykp8vvghb1yl23rab9250z0n7b3zf897125chsi"))))
3855 (build-system pyproject-build-system)
3856 (arguments
3857 (list
3858 #:build-backend "setuptools.build_meta")) ;requires uv_build
3859 (native-inputs
3860 (list python-pytest python-setuptools python-setuptools-scm))
3861 (home-page "http://pyvcd.readthedocs.io/")
3862 (synopsis "Library to manipulate digital wave files")
3863 (description
3864 "The code{PyVcd} Python library writes @acronym{VCD, Value Change Dump}
3865files as specified in IEEE 1364-2005.")
3866 (license license:expat)))
3867
3868(define-public python-cocotb
3869 (package
3870 (name "python-cocotb")
3871 (version "2.1.0")
3872 (source
3873 (origin
3874 (method git-fetch)
3875 (uri (git-reference
3876 (url "https://github.com/cocotb/cocotb")
3877 (commit (string-append "v" version))))
3878 (file-name (git-file-name name version))
3879 (sha256
3880 (base32 "1x2jcnp31c30dnzr5zayaac5ac1hw2fbhjb0hixnjb0jp80caw3a"))))
3881 (build-system pyproject-build-system)
3882 (arguments
3883 (list
3884 #:phases
3885 #~(modify-phases %standard-phases
3886 (add-after 'unpack 'set-version
3887 (lambda _
3888 (substitute* "pyproject.toml"
3889 (("dynamic.*")
3890 (string-append "version = \"" #$version "\"")))))
3891 (replace 'check
3892 (lambda* (#:key tests? #:allow-other-keys)
3893 (when tests?
3894 (for-each delete-file-recursively
3895 (map
3896 (lambda (test) (string-append "tests/test_cases/" test))
3897 (list "test_logic_array_indexing"
3898 ;; requires ghdl
3899 "test_vhdl_libraries"
3900 "test_vhdl_libraries_multiple")))
3901 (invoke "make" "-k" "-C" "tests")))))))
3902 (native-inputs
3903 (list iverilog
3904 nvc
3905 python-psutil
3906 python-setuptools
3907 verilator))
3908 (propagated-inputs
3909 (list python-find-libpython python-pytest))
3910 (home-page "https://github.com/cocotb/cocotb")
3911 (synopsis "Library for writing HDL test benches in Python")
3912 (description
3913 "Coroutine based cosimulation test bench environment for verifying VHDL
3914and Verilog RTL using Python.")
3915 (license license:bsd-3)))
3916
3917(define-public python-cocotb-bus
3918 (package
3919 (name "python-cocotb-bus")
3920 ;; Version from src/cocotb_bus/_version.py
3921 (version "0.3.0")
3922 (source
3923 (origin
3924 (method git-fetch)
3925 (uri (git-reference
3926 (url "https://github.com/cocotb/cocotb-bus/")
3927 (commit (string-append "v" version))))
3928 (file-name (git-file-name name version))
3929 (sha256
3930 (base32 "0aqk78w5gg23rwf93gidw8yazmidwgmahqcmm3x0qx380mbdxjl4"))))
3931 (build-system pyproject-build-system)
3932 ;; TODO: Build documentation from <docs>.
3933 (arguments
3934 (list
3935 #:phases
3936 #~(modify-phases %standard-phases
3937 (replace 'check
3938 (lambda* (#:key tests? #:allow-other-keys)
3939 (when tests?
3940 (invoke "make" "-k" "-C" "examples")))))))
3941 (native-inputs
3942 (list iverilog
3943 nvc
3944 python-setuptools))
3945 (propagated-inputs
3946 (list python-cocotb
3947 python-scapy))
3948 (home-page "https://github.com/cocotb/cocotb-bus/")
3949 (synopsis "Cocotb reusable tools")
3950 (description "@code{Cocotb-bus} provides a set of utilities, test benches
3951and reusable bus interfaces to be used with @code{cocotb}.")
3952 (license license:bsd-3)))
3953
3954(define-public python-cocotb-test
3955 (package
3956 (name "python-cocotb-test")
3957 (version "0.3.0")
3958 (source
3959 (origin
3960 (method git-fetch)
3961 (uri (git-reference
3962 (url "https://github.com/themperek/cocotb-test")
3963 (commit (string-append "v" version))))
3964 (file-name (git-file-name name version))
3965 (sha256
3966 (base32 "1lac8cgjllsrfycqql6xjhvca9w620j299vv5gnf54vsb7l89sf0"))))
3967 (build-system pyproject-build-system)
3968 (arguments
3969 (list
3970 #:phases
3971 #~(modify-phases %standard-phases
3972 (add-before 'check 'delete-failing-tests
3973 (lambda* (#:key tests? #:allow-other-keys)
3974 (when tests?
3975 (for-each delete-file-recursively
3976 (map
3977 (lambda (test) (string-append "tests/" test))
3978 (list
3979 ;; Requires tests folder from python-cocotb
3980 "test_cocotb_tests.py"
3981 ;; Requires examples folder from python-cocotb
3982 "test_cocotb_examples.py")))))))
3983 #:test-flags
3984 #~(list
3985 ;; Fail with "This simulator does not support VHDL".
3986 "--deselect=tests/test_compile_errors.py::test_invalid_vhdl"
3987 "--deselect=tests/test_dff.py::test_dff_vhdl"
3988 "--deselect=tests/test_parallel.py::test_dff_vhdl_param[0]"
3989 "--deselect=tests/test_parallel.py::test_dff_vhdl_param[1]"
3990 "--deselect=tests/test_parallel.py::test_dff_vhdl_param[2]"
3991 "--deselect=tests/test_parallel.py::test_dff_vhdl_param[3]"
3992 "--deselect=tests/test_parallel.py::test_dff_vhdl_param[4]"
3993 "--deselect=tests/test_parallel.py::test_dff_vhdl_param[5]"
3994 "--deselect=tests/test_parallel.py::test_dff_vhdl_param[6]"
3995 "--deselect=tests/test_parallel.py::test_dff_vhdl_param[7]"
3996 (string-append "--deselect=tests/test_parameters.py::"
3997 "test_dff_vhdl_testcase[parameters0]")
3998 (string-append "--deselect=tests/test_parameters.py::"
3999 "test_dff_vhdl_testcase[parameters1]"))))
4000 (propagated-inputs
4001 (list python-cocotb))
4002 (native-inputs
4003 (list iverilog python-setuptools))
4004 (home-page "https://github.com/themperek/cocotb-test")
4005 (synopsis
4006 "Standard python unit testing cababilities for @code{python-cocotb}")
4007 (description "This package provides the look and feel of Python unit
4008testing to @code{cocotb}, removing the need of manipulating Makefiles.")
4009 (license license:bsd-3)))
4010
4011(define-public python-cocotbext-axi
4012 (package
4013 (name "python-cocotbext-axi")
4014 (version "0.1.28")
4015 (source
4016 (origin
4017 (method git-fetch)
4018 (uri (git-reference
4019 (url "https://github.com/alexforencich/cocotbext-axi/")
4020 (commit (string-append "v" version))))
4021 (file-name (git-file-name name version))
4022 (sha256
4023 (base32 "0kwdzz0mq134m0kxhwwj0d1nr1cbrzv36844476knna34xi2riyg"))))
4024 (build-system pyproject-build-system)
4025 (propagated-inputs
4026 (list python-cocotb python-cocotb-bus))
4027 (native-inputs
4028 (list iverilog python-cocotb-test python-pytest python-setuptools))
4029 (home-page "https://github.com/alexforencich/cocotbext-axi/")
4030 (synopsis
4031 "Extra @acronym{AXI, Advanced Extensible Interface} modules for cocotb")
4032 (description "This package provides an extension to @code{cocotb} in the
4033form of AXI, AXI lite, and AXI stream modules.")
4034 (license license:expat)))
4035
4036(define-public python-forastero
4037 (package
4038 (name "python-forastero")
4039 (version "1.2.1")
4040 (source
4041 (origin
4042 (method git-fetch)
4043 (uri (git-reference
4044 (url "https://github.com/Intuity/forastero")
4045 (commit version)))
4046 (file-name (git-file-name name version))
4047 (sha256
4048 (base32 "0j6mrh435xknx055llzqikh1bcrxjcn0difa6g1bflr4nxd2498g"))))
4049 (build-system pyproject-build-system)
4050 (arguments (list #:tests? #f)) ; No tests.
4051 (propagated-inputs (list python-cocotb python-tabulate python-yappi))
4052 (native-inputs (list python-poetry-core))
4053 (home-page "https://forastero.intuity.io/")
4054 (synopsis "Cocotb verification framework")
4055 (description "Forastero is a Python library for writing testbenches with cocotb
4056a Python framework for writing testbenches for hardware designs written in a
4057@acronym{HDL, Hardware Description Language}, taking inspiration from the
4058@acronym{UVM, Unified Verification Methodology}.")
4059 (license license:asl2.0)))
4060
4061(define-public python-edalize
4062 (package
4063 (name "python-edalize")
4064 (version "0.6.8")
4065 (source
4066 (origin
4067 (method git-fetch)
4068 (uri (git-reference
4069 (url "https://github.com/olofk/edalize/")
4070 (commit (string-append "v" version))))
4071 (file-name (git-file-name name version))
4072 (sha256
4073 (base32 "04m2lhkclw9fj92k43c06j003qnq9i1yhy2131fvcnkkr0d9438m"))))
4074 (build-system pyproject-build-system)
4075 (arguments
4076 (list
4077 #:test-flags
4078 #~(list "-k" (string-join
4079 ;; XXX: Tests failing with assertion not equal, find out
4080 ;; why.
4081 (list "not test_gatemate"
4082 "test_vcs_tool_options"
4083 "test_vcs_no_tool_options"
4084 "test_vcs_minimal"
4085 "test_xcelium")
4086 " and not "))
4087 #:phases
4088 #~(modify-phases %standard-phases
4089 ;; Fixes #6530.
4090 (add-after 'install 'copy-templates
4091 (lambda _
4092 (copy-recursively
4093 "edalize/templates"
4094 (string-append #$output "/lib/python"
4095 #$(version-major+minor (package-version python))
4096 "/site-packages/edalize/templates")))))))
4097 (native-inputs
4098 (list python-pyparsing
4099 python-pytest
4100 python-setuptools
4101 python-setuptools-scm))
4102 (propagated-inputs
4103 (list python-importlib-metadata python-jinja2 python-pandas))
4104 (home-page "https://github.com/olofk/edalize/")
4105 (synopsis "Python Library for interacting with EDA tools")
4106 (description
4107 "This package can create project files for supported tools and run them in
4108batch or GUI mode. All EDA tools such as Icarus, Yosys, ModelSim, Vivado,
4109Verilator, GHDL, Quartus etc get input HDL files (Verilog and VHDL) and some
4110tool-specific files (constraint files,memory initialization files, IP
4111description files etc). Together with the files, perhaps a couple of Verilog
4112`defines, some top-level parameters/generics or some tool-specific options are
4113set.")
4114 (license license:bsd-2)))
4115
4116(define-public fusesoc
4117 (package
4118 (name "fusesoc")
4119 (version "2.4.6")
4120 (source
4121 (origin
4122 (method git-fetch)
4123 (uri (git-reference
4124 (url "https://github.com/olofk/fusesoc/")
4125 (commit version)))
4126 (file-name (git-file-name name version))
4127 (sha256
4128 (base32 "11bmvk10mszv65ws84jmm220ivwn55v8664kkdm9d4m99pryi2kp"))))
4129 (build-system pyproject-build-system)
4130 (arguments
4131 (list
4132 #:test-flags
4133 ;; These tests require network access.
4134 #~(list
4135 "--deselect=tests/test_coremanager.py::test_export"
4136 "--deselect=tests/test_libraries.py::test_library_add"
4137 (string-append
4138 "--deselect=tests/test_libraries.py::"
4139 "test_library_update_with_initialize")
4140 "--deselect=tests/test_libraries.py::test_library_update"
4141 "--deselect=tests/test_provider.py::test_git_provider"
4142 "--deselect=tests/test_provider.py::test_github_provider"
4143 "--deselect=tests/test_signatures.py::test_signature_single_standalone"
4144 (string-append
4145 "--deselect=tests/test_usecases.py::"
4146 "test_git_library_with_default_branch_is_added_and_updated")
4147 (string-append
4148 "--deselect=tests/test_usecases.py::"
4149 "test_update_git_library_with_fixed_version")
4150 "--deselect=tests/test_provider.py::test_url_provider")
4151 #:phases
4152 #~(modify-phases %standard-phases
4153 (add-before 'check 'set-home-env
4154 (lambda _
4155 (setenv "HOME" "/tmp"))))))
4156 (propagated-inputs
4157 (list python-argcomplete
4158 python-edalize
4159 python-fastjsonschema
4160 python-pyparsing
4161 python-pyyaml
4162 python-pyaml
4163 python-simplesat))
4164 (native-inputs
4165 (list python-pytest python-setuptools python-setuptools-scm))
4166 (home-page "https://fusesoc.net/")
4167 (synopsis
4168 "Package manager and build abstraction tool for HDL code")
4169 (description
4170 "Fusesoc allows management and reuse of @acronym{IP, Intellectual
4171Property} cores. It also aids for creating, building and simulating
4172@acronym{Soc, System on Chip} solutions in @acronym{EDA, Electronic Design
4173Automation}.")
4174 (license license:bsd-3)))
4175
4176(define-public python-hdlmake
4177 (package
4178 (name "python-hdlmake")
4179 (version "4.0")
4180 (source
4181 (origin
4182 (method git-fetch)
4183 (uri (git-reference
4184 (url "https://gitlab.com/ohwr/project/hdl-make/")
4185 (commit (string-append "v" version))))
4186 (file-name (git-file-name name version))
4187 (sha256
4188 (base32 "1mbsm1j058j3wjp0hypd7a9d1xh3xsmy9p3jl9xcpnzjmncm34xr"))))
4189 (build-system pyproject-build-system)
4190 (arguments
4191 (list
4192 #:phases #~(modify-phases %standard-phases
4193 (add-before 'check 'chdir
4194 (lambda _
4195 (chdir "testsuite")))
4196 (add-before 'chdir 'build-info
4197 (lambda _
4198 (invoke "make" "-C" "docs" "info")
4199 (install-file
4200 "docs/_build/texinfo/hdlmake.info"
4201 (string-append #$output "/share/info"))
4202 (copy-recursively
4203 "docs/_build/texinfo/hdlmake-figures"
4204 (string-append
4205 #$output "/share/info/hdlmake-figures")))))
4206 #:test-flags #~(list "test_all.py")))
4207 (native-inputs
4208 (list python-pytest python-setuptools python-sphinx texinfo))
4209 (propagated-inputs (list python-networkx))
4210 (home-page "https://ohwr.gitlab.io/project/hdl-make/")
4211 (synopsis "Generate multi-purpose makefiles for HDL projects")
4212 (description
4213 "Hdlmake helps manage and share @acronym{HDL, hardware description
4214language} code by automatically finding file dependencies, writing synthesis
4215and simulation Makefiles.")
4216 (license license:gpl3+)))
4217
4218(define-public python-migen
4219 ;; XXX: The latest version tag (0.9.2) was placed in 2019, there are latest
4220 ;; changes supporting Python 3.11 on master branch, see
4221 ;; <https://github.com/m-labs/migen/issues/259>.
4222 (let ((commit "3dcfedd0b9e533e073228bb3eb0f973d22074919")
4223 (revision "2"))
4224 (package
4225 (name "python-migen")
4226 (version (git-version "0.9.2" revision commit))
4227 (source
4228 (origin
4229 ;; Tests fail in the PyPI tarball due to missing files.
4230 (method git-fetch)
4231 (uri (git-reference
4232 (url "https://git.m-labs.hk/M-Labs/migen")
4233 (commit commit)))
4234 (file-name (git-file-name name version))
4235 (sha256
4236 (base32 "1nygx1p468109b2rmfsfqaqqgbgzn9r5d78fnb304fj96brx4b0x"))))
4237 (build-system pyproject-build-system)
4238 (native-inputs
4239 (list python-pytest
4240 python-setuptools))
4241 (propagated-inputs
4242 (list python-colorama))
4243 (home-page "https://m-labs.hk/gateware/migen/")
4244 (synopsis "Python toolbox for building complex digital hardware")
4245 (description
4246 "Migen FHDL is a Python library that replaces the event-driven paradigm
4247of Verilog and VHDL with the notions of combinatorial and synchronous
4248statements, has arithmetic rules that make integers always behave like
4249mathematical integers, and allows the design's logic to be constructed by a
4250Python program.")
4251 (license license:bsd-2))))
4252
4253(define-public python-myhdl
4254 (let ((commit "7dc29c242cd33cb835c336a81ffc3a461eaa92f4")
4255 (revision "0"))
4256 (package
4257 (name "python-myhdl")
4258 (version (git-version "0.11" revision commit))
4259 (source
4260 (origin
4261 (method git-fetch)
4262 (uri (git-reference
4263 (url "https://github.com/myhdl/myhdl/")
4264 (commit commit)))
4265 (file-name (git-file-name name version))
4266 (sha256
4267 (base32
4268 "1b91yvr0ksrw3bx61i7914caf8pyks9c242kwmj4l12zjd06mp56"))))
4269 (arguments
4270 (list
4271 #:phases
4272 #~(modify-phases %standard-phases
4273 (replace 'check
4274 (lambda* (#:key tests? #:allow-other-keys)
4275 (when tests?
4276 (invoke "make" "iverilog" "core")))))))
4277 (build-system pyproject-build-system)
4278 (native-inputs
4279 (list iverilog python-setuptools python-pytest))
4280 (home-page "http://www.myhdl.org/")
4281 (synopsis "Python as a Hardware Description Language")
4282 (description "This package provides a library to turn Python into
4283a hardware description and verification language.")
4284 (license license:lgpl2.1+))))
4285
4286(define-public python-pydigitalwavetools
4287 (package
4288 (name "python-pydigitalwavetools")
4289 (version "1.2")
4290 (source
4291 (origin
4292 (method git-fetch)
4293 (uri (git-reference
4294 (url "https://github.com/Nic30/pyDigitalWaveTools/")
4295 (commit (string-append "v" version))))
4296 (file-name (git-file-name name version))
4297 (sha256
4298 (base32 "0fll8anz3i1j1nngsij1psp8766kvdfpls655lbxn2ykypv3633m"))))
4299 (build-system pyproject-build-system)
4300 (native-inputs
4301 (list python-pytest
4302 python-setuptools
4303 python-wheel))
4304 (home-page "https://github.com/Nic30/pyDigitalWaveTools/")
4305 (synopsis "Library to manipulate digital wave files")
4306 (description
4307 "Pydigitalwavetools is a Python library to parse, write and format digital
4308wave files in @acronym{VCD, Value Change Dump} format, a standardized ASCII
4309format used to store simulation data from Verilog and other hardware description
4310languages.")
4311 (license license:expat)))
4312
4313(define-public python-surf
4314 (package
4315 (name "python-surf")
4316 (version "2.57.0")
4317 (source
4318 (origin
4319 (method git-fetch)
4320 (uri (git-reference
4321 (url "https://github.com/slaclab/surf/")
4322 (commit (string-append "v" version))))
4323 (file-name (git-file-name name version))
4324 (sha256
4325 (base32 "0ncb34mdxaw0m6cnk7kvl7mkhwa6hpcxkc2lgarwcmmnfydr8kg3"))))
4326 (build-system pyproject-build-system)
4327 (arguments
4328 (list
4329 #:tests? #f
4330 #:phases
4331 #~(modify-phases %standard-phases
4332 (add-after 'unpack 'remove-deps
4333 (lambda _
4334 (invoke "git" "init") ;expects a git repo
4335 ;; fix version
4336 (substitute* "setup.py"
4337 (("rawVer .*")
4338 (string-append "rawVer = \"v"
4339 #$version "\""))))))))
4340 (native-inputs
4341 (list python-setuptools python-gitpython git-minimal/pinned))
4342 (home-page "https://slaclab.github.io/surf/")
4343 (synopsis "SLAC Ultimate RTL Framework")
4344 (description
4345 "Surf is a python library with support functions for VHDL gateware
4346digital design. It provides implementation modules compatible with FPGA and ASIC
4347design.")
4348 (license (license:non-copyleft "file://LICENSE.txt"
4349 "See LICENSE.txt in the distribution."))))
4350
4351(define-public python-vsg
4352 (package
4353 (name "python-vsg")
4354 (version "3.35.0")
4355 (source
4356 (origin
4357 (method git-fetch)
4358 (uri (git-reference
4359 (url "https://github.com/jeremiah-c-leary/vhdl-style-guide/")
4360 (commit version)))
4361 (file-name (git-file-name name version))
4362 (sha256
4363 (base32 "01hwida51bdyzv6wy71nby9cllf6nbvin5a0lhl4dizvnp3h4mb4"))))
4364 (build-system pyproject-build-system)
4365 (arguments
4366 (list
4367 #:test-flags
4368 ;; Tests are expensive and may introduce race condition on systems with
4369 ;; high (more than 16) threads count; limit parallel jobs to 8x.
4370 #~(list
4371 "--numprocesses" (number->string (min 8 (parallel-job-count))))))
4372 (native-inputs
4373 (list python-pytest
4374 python-pytest-xdist
4375 python-setuptools))
4376 (propagated-inputs
4377 (list python-pyyaml))
4378 (home-page "https://github.com/jeremiah-c-leary/vhdl-style-guide/")
4379 (synopsis "Coding style enforcement for VHDL")
4380 (description
4381 "VSG lets you define a VHDL coding style and provides a command-line tool
4382to enforce it.")
4383 (license license:gpl3+)))
4384
4385(define-public python-pyxhdl
4386 (package
4387 (name "python-pyxhdl")
4388 (version "0.53")
4389 (source
4390 (origin
4391 (method git-fetch)
4392 (uri (git-reference
4393 (url "https://github.com/davidel/pyxhdl")
4394 (commit version)))
4395 (file-name (git-file-name name version))
4396 (sha256
4397 (base32 "16dqqhbg5q6fxlhnfcjimxv1zgziw5g46askjhfg8g2hn7i3vfal"))))
4398 (build-system pyproject-build-system)
4399 (arguments
4400 (list
4401 #:test-backend #~'custom
4402 #:test-flags #~(list "tests/test_runner.py")))
4403 (native-inputs
4404 (list python-setuptools))
4405 (propagated-inputs
4406 (list python-numpy python-misc-utils))
4407 (home-page "https://github.com/davidel/pyxhdl")
4408 (synopsis
4409 "Python frontend for @acronym{HDL, Hardware Description Languages}")
4410 (description
4411 "PyXHDL replaces HDL code by Python, generating VHDL (>= 2008) and
4412Verilog (SystemVerilog >= 2012) code to be used for synthesis and simulation.")
4413 (license license:asl2.0)))
4414
4415(define-public python-vunit
4416 (package
4417 (name "python-vunit")
4418 (version "5.0.0-dev.13") ;v4.7.0 dates back from 2023.
4419 (source
4420 (origin
4421 (method git-fetch)
4422 (uri (git-reference
4423 (url "https://github.com/VUnit/vunit")
4424 (commit (string-append "v" version))))
4425 (file-name (git-file-name name version))
4426 (sha256
4427 (base32 "0jsx593qp16a76k5aydp47p9704w4crhh389g6qba310xzrl8ph6"))))
4428 (build-system pyproject-build-system)
4429 (arguments
4430 (list
4431 #:modules '((guix build pyproject-build-system)
4432 (guix build utils)
4433 (ice-9 ftw)
4434 (srfi srfi-26))
4435 #:phases
4436 #~(modify-phases %standard-phases
4437 (add-after 'unpack 'fix-ghdl-version
4438 (lambda _
4439 ;; Guix uses ghdl 6.0.0.
4440 (substitute* "tests/unit/test_ghdl_interface.py"
4441 (("GHDL 5\\.0\\.1") "GHDL 6.0.0")
4442 (("GNAT Version: 14\\.2\\.0") "GNAT Version: 16.1.0"))))
4443 (add-after 'install 'unbundle
4444 (lambda* (#:key inputs outputs #:allow-other-keys)
4445 (let ((site-packages
4446 (string-append (site-packages inputs outputs)
4447 "/vunit/vhdl/")))
4448 (symlink
4449 (search-input-directory inputs "share/osvvm/work/osvvm")
4450 (string-append site-packages "osvvm")))))
4451 (add-after 'check 'run-examples
4452 ;; Run examples as an extra check.
4453 (lambda* (#:key tests? parallel-build? #:allow-other-keys)
4454 (when tests?
4455 (with-directory-excursion "examples/vhdl"
4456 (for-each
4457 (lambda (dir)
4458 (invoke "python3" (string-append dir "/run.py")
4459 "-p" (if parallel-build?
4460 (number->string (parallel-job-count))
4461 "1"))
4462 (delete-file-recursively "vunit_out"))
4463 (scandir "."
4464 (negate
4465 (cut member <>
4466 '("data_types" ;no run.py
4467 "docker_runall.sh" ;not a test
4468 "vivado" ;requires external tool
4469 ;; Fails with nvc
4470 "array_axis_vcs"
4471 "osvvm_log_integration"
4472 "run"
4473 "third_party_integration"
4474 "user_guide"
4475 "." ".."))))))))))
4476 #:test-flags
4477 ;; Skip lint tests which require python-pycodestyle, python-pylint and
4478 ;; python-mypy to reduce closoure size; some lint test fails, see
4479 ;; <https://github.com/VUnit/vunit/issues/1111>.
4480 ;;
4481 ;; XXX: Acceptance tests take 10+ minutes to complete, hang on
4482 ;; "test_external_run_scripts.py" and fail eventually, consider to
4483 ;; improve them; ignore for now.
4484 #~(list "tests/unit")))
4485 (native-inputs
4486 (list nvc
4487 python-pytest
4488 python-setuptools
4489 python-setuptools-scm))
4490 (inputs
4491 (list osvvm-2023.04))
4492 (propagated-inputs
4493 (list python-colorama))
4494 (home-page "https://vunit.github.io")
4495 (synopsis "Unit testing framework for VHDL/SystemVerilog")
4496 (description
4497 "VUnit features the functionality needed to realize continuous and
4498automated testing of HDL code.")
4499 ;; According to 'LICENSE.rst', VUnit itself is under MPL but two
4500 ;; subdirectories are under ASL.
4501 (license (list license:mpl2.0 license:asl2.0))))
4502
4503(define-public python-vunit-bridge
4504 (package
4505 (name "python-vunit-bridge")
4506 (version "0.1.0")
4507 (source
4508 (origin
4509 (method git-fetch)
4510 (uri (git-reference
4511 (url "https://github.com/vunit/vunit-python-bridge")
4512 (commit (string-append "v" version))))
4513 (file-name (git-file-name name version))
4514 (sha256
4515 (base32 "0hx4w2949cgyrqnxh76v34laihafwwchm5c9bcimm9rs9iazn99m"))))
4516 (build-system pyproject-build-system)
4517 (native-inputs
4518 (list python-pytest python-setuptools))
4519 (propagated-inputs
4520 (list python-numpy python-vunit))
4521 (home-page "https://github.com/vunit/vunit-python-bridge")
4522 (synopsis "@code{VUnit} package making Python callable from VHDL")
4523 (description
4524 "This package embeds a Python interpreter in the simulator process so
4525that a VHDL testbench can execute Python code and call Python functions
4526without leaving the simulation.")
4527 (license license:mpl2.0)))
4528
4529(define-public qrouter
4530 (package
4531 (name "qrouter")
4532 (version "1.4.90")
4533 (source
4534 (origin
4535 (method git-fetch)
4536 (uri (git-reference
4537 (url "https://github.com/RTimothyEdwards/qrouter")
4538 (commit version)))
4539 (file-name (git-file-name name version))
4540 (sha256
4541 (base32 "1djqbli6bs0cqmcvrh3m9i94bncm3bvjs2iz5y7yszcagjq51wja"))))
4542 (build-system gnu-build-system)
4543 (arguments
4544 (list
4545 #:tests? #f ;no tests
4546 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
4547 (string-append "PREFIX=" #$output))
4548 #:configure-flags
4549 #~(list (string-append "--with-tcl=" #$(this-package-input "tcl"))
4550 (string-append "--with-tk=" #$(this-package-input "tk")))))
4551 (inputs (list libx11 libxt readline tcl tk))
4552 (home-page "http://opencircuitdesign.com/qrouter/")
4553 (synopsis "Visual @acronym{EDA, electronic design automation} router")
4554 (description
4555 "@code{qrouter} is an @acronym{ASIC, application specific integrated
4556circuits}s tool intended for digital chip design. It creates the detailed
4557routes for layouts of digital circuits and generates metal layers and vias.")
4558 (license license:gpl2)))
4559
4560(define-public qucsrflayout-cli
4561 (package
4562 (name "qucsrflayout-cli")
4563 (version "2.1.2")
4564 (source
4565 (origin
4566 (method git-fetch)
4567 (uri (git-reference
4568 (url "https://github.com/thomaslepoix/Qucs-RFlayout/")
4569 (commit version)))
4570 (file-name (git-file-name name version))
4571 (sha256
4572 (base32
4573 "1nhqhb5x5giv8ck9y9aib6vh6kvnfrycsbdzh6fnzng046aq67aq"))))
4574 (build-system cmake-build-system)
4575 (arguments
4576 (list
4577 #:tests? #f ;no tests
4578 #:configure-flags
4579 #~(list "-DQRFL_MINIMAL=ON"
4580 "-DCMAKE_BUILD_TYPE=Release")))
4581 (home-page "https://github.com/thomaslepoix/Qucs-RFlayout/")
4582 (synopsis "Produce layouts from Qucs RF schematics")
4583 (description
4584 "@code{qucsrflayout} command exports @acronym{RF, Radio Frequency}
4585schematics to KiCad layouts and OpenEMS scripts.")
4586 (license license:gpl3+)))
4587
4588(define-public qucsator-rf
4589 (package
4590 (name "qucsator-rf")
4591 (version "1.0.7") ;required by qucs-s, keep in sync
4592 (source
4593 (origin
4594 (method git-fetch)
4595 (uri (git-reference
4596 (url "https://github.com/ra3xdh/qucsator_rf/")
4597 (commit version)))
4598 (file-name (git-file-name name version))
4599 (sha256
4600 (base32
4601 "1qyih418r0jcrpk1ja4p7v9v5iqvri8iszg7s3vaf1d2agwblzb4"))))
4602 (build-system cmake-build-system)
4603 (arguments
4604 (list
4605 #:tests? #f ;no tests
4606 #:phases
4607 #~(modify-phases %standard-phases
4608 (add-after 'install 'run-tests
4609 (lambda* (#:key tests? #:allow-other-keys)
4610 (when tests?
4611 ;; Qucs-test is a collection of python scripts and data test
4612 ;; cases. Its purpose is to test Qucs (GUI) and Qucsator;
4613 ;; tests are under `testsuite` directory.
4614 (copy-recursively
4615 #$(origin
4616 (method git-fetch)
4617 (uri
4618 ;; Using latest revision; refer to
4619 ;; .github/workflows/cmake.yml to keep up to date.
4620 (git-reference
4621 (url "https://github.com/ra3xdh/qucs-test/")
4622 (commit "ce69e05ceecab910175e6ea36b6e021a6d279947")))
4623 (sha256
4624 (base32
4625 (string-append "1r3hx43wvd0s11mzsvj1chylzv"
4626 "0lk9qhaw7205j9x316ly03bl08"))))
4627 "qucs-test")
4628 (with-directory-excursion "qucs-test"
4629 (invoke "python3" "run.py" "--qucsator"
4630 (format #f "--prefix=~a/bin" #$output)
4631 "--exclude=skip.txt"))))))
4632 #:configure-flags
4633 #~(list (format #f "-DBISON_DIR=~a/bin"
4634 #$(this-package-native-input "bison"))
4635 (format #f "-DADMSXML_DIR=~a/bin"
4636 #$(this-package-native-input "adms")))))
4637 (native-inputs
4638 (list adms bison dos2unix flex gperf python python-looseversion
4639 python-numpy python-matplotlib))
4640 (synopsis "RF and microwave circuits simulator")
4641 (description
4642 "@code{Qucsator-rf} is a command line driven circuit simulator targeted
4643for RF and microwave circuits. It takes a network list in a certain format as
4644input and outputs an XML dataset.")
4645 (home-page "https://ra3xdh.github.io//")
4646 (license license:gpl2+)))
4647
4648(define-public qucs-s
4649 (package
4650 (name "qucs-s")
4651 (version "26.1.1") ;update qucsator-rf accordingly
4652 (source
4653 (origin
4654 (method git-fetch)
4655 (uri (git-reference
4656 (url "https://github.com/ra3xdh/qucs_s")
4657 (commit version)))
4658 (file-name (git-file-name name version))
4659 (sha256
4660 (base32
4661 "009siqmn76r2l17hnjqmr6ap8nw969hd5fyqigb4p3i8cvjq7gmx"))))
4662 (build-system qt-build-system)
4663 (arguments
4664 (list
4665 #:qtbase qtbase ;for Qt 6
4666 #:tests? #f ;no tests
4667 #:phases
4668 #~(modify-phases %standard-phases
4669 (add-after 'unpack 'adjust-default-settings
4670 (lambda* (#:key inputs #:allow-other-keys)
4671 (substitute* "qucs/settings.cpp"
4672 (("\"Xyce\"")
4673 (format #f "~s" (search-input-file inputs "bin/Xyce")))
4674 (("\"qucsrflayout\"")
4675 (format #f "~s" (search-input-file inputs "bin/qucsrflayout")))
4676 (("\"ngspice\"")
4677 (format #f "~s" (search-input-file inputs "bin/ngspice")))
4678 (("\"octave\"")
4679 (format #f "~s" (search-input-file inputs "bin/octave"))))))
4680 (add-after 'install 'wrap-program
4681 (lambda _
4682 (wrap-program (string-append #$output "/bin/qucs-s")
4683 `("PATH" ":" prefix
4684 (,(string-append #$(this-package-input "ngspice") "/bin")
4685 ,(string-append
4686 #$(this-package-input "qucsator-rf") "/bin")
4687 ,(string-append
4688 #$(this-package-input "qucsrflayout-cli") "/bin")
4689 ,(string-append
4690 #$(this-package-input "xyce-serial") "/bin")))))))))
4691 (native-inputs (list qttools))
4692 (inputs
4693 (list bash-minimal
4694 ngspice
4695 octave-cli
4696 qtbase
4697 qtcharts
4698 qtsvg
4699 qtwayland
4700 qucsator-rf
4701 qucsrflayout-cli
4702 xyce-serial))
4703 (synopsis "GUI for different circuit simulation kernels")
4704 (description
4705 "@acronym{Qucs-S, Quite universal circuit simulator with SPICE} provides
4706a fancy graphical user interface for a number of popular circuit simulation
4707engines. The package contains libraries for schematic capture, visualization
4708and components. The following simulation kernels are supported:
4709@itemize
4710@item Ngspice (recommended)
4711@item Xyce
4712@item SpiceOpus
4713@item Qucsator (non-SPICE)
4714@end itemize\n")
4715 (home-page "https://ra3xdh.github.io/")
4716 (license license:gpl2+)))
4717
4718(define-public xschem
4719 (package
4720 (name "xschem")
4721 (version "3.4.7")
4722 (source
4723 (origin
4724 (method git-fetch)
4725 (uri (git-reference
4726 (url "https://codeberg.org/stef_xschem/xschem/")
4727 (commit version)))
4728 (file-name (git-file-name name version))
4729 (sha256
4730 (base32
4731 "0g9qrzm2mjd7nfg8iyc5az2bs8n5gjv1mrjjdja5vn1yjia7pvy9"))))
4732 (native-inputs (list flex bison pkg-config))
4733 (inputs (list gawk
4734 tcl
4735 tk
4736 libxpm
4737 cairo
4738 libjpeg-turbo
4739 libxrender
4740 libxcb)) ; Last 4 are optional, but good to have.
4741 (build-system gnu-build-system)
4742 (arguments
4743 (list
4744 #:tests? #f
4745 #:phases
4746 #~(modify-phases %standard-phases
4747 (replace 'configure
4748 (lambda _
4749 (setenv "CC" #$(cc-for-target))
4750 (invoke "./configure" (string-append "--prefix=" #$output)))))))
4751 (synopsis "Hierarchical schematic editor")
4752 (description
4753 "Xschem is an X11 schematic editor written in C and focused on
4754hierarchical and parametric design. It can generate VHDL, Verilog or Spice
4755netlists from the drawn schematic, allowing the simulation of the circuit.")
4756 (home-page "http://repo.hu/projects/xschem/")
4757 (license license:gpl2+)))
4758
4759(define-public route-rnd
4760 (package
4761 (name "route-rnd")
4762 (version "0.9.3")
4763 (source
4764 (origin
4765 (method url-fetch)
4766 (uri (string-append "http://repo.hu/projects/route-rnd/"
4767 "releases/route-rnd-" version ".tar.gz"))
4768 (sha256
4769 (base32
4770 "0fy3b48s72lpicyap3y6jr9fyvb2ri42jb0gqxk6s927a278bfhc"))))
4771 (build-system gnu-build-system)
4772 (arguments
4773 (list
4774 #:tests? #f
4775 #:make-flags #~(list (string-append "PREFIX=" #$output))
4776 #:phases
4777 #~(modify-phases %standard-phases
4778 (replace 'configure
4779 ;; The configure script doesn't tolerate most of our configure
4780 ;; flags.
4781 (lambda _
4782 (setenv "CC" #$(cc-for-target))
4783 (setenv "LIBRND_PREFIX" #$(this-package-input "librnd"))
4784 (invoke "./configure" (string-append "--prefix=" #$output)))))))
4785 (inputs (list librnd))
4786 (home-page "http://repo.hu/projects/route-rnd/")
4787 (synopsis "Automatic routing for electronics boards")
4788 (description
4789 "@code{Route-rnd} is a generic external autorouter for @acronym{PCB,
4790Printed Circuit Board} using tEDAx file format, part of the RiNgDove EDA
4791suite.")
4792 (license license:gpl2+)))
4793
4794(define-public sch-rnd
4795 (package
4796 (name "sch-rnd")
4797 (version "1.0.11")
4798 (source
4799 (origin
4800 (method url-fetch)
4801 (uri (string-append "http://repo.hu/projects/sch-rnd/"
4802 "releases/sch-rnd-" version ".tar.gz"))
4803 (sha256
4804 (base32
4805 "1zckj0if1kfdqagama55zcp9nlvkppnfcqh7r99a1wlcc5s921y1"))))
4806 (build-system glib-or-gtk-build-system)
4807 (arguments
4808 (list
4809 #:test-target "test"
4810 #:phases
4811 #~(modify-phases %standard-phases
4812 (replace 'configure
4813 ;; The configure script doesn't tolerate most of our configure
4814 ;; flags.
4815 (lambda _
4816 (setenv "CC" #$(cc-for-target))
4817 (setenv "LIBRND_PREFIX" #$(this-package-input "librnd"))
4818 (invoke "./configure" (string-append "--prefix=" #$output)))))))
4819 (inputs (list librnd))
4820 (home-page "http://repo.hu/projects/sch-rnd/")
4821 (synopsis "Scriptable editor of schematics for electronics boards")
4822 (description
4823 "@code{Sch-rnd} is a standalone and workflow agnostic schematics capture
4824tool for @acronym{PCB, Printed Circuit Board}, part of the RiNgDove EDA
4825suite.")
4826 (license license:gpl2+)))
4827
4828(define-public sigrok-cli
4829 (package
4830 (name "sigrok-cli")
4831 (version "0.7.2")
4832 (source (origin
4833 (method url-fetch)
4834 (uri (string-append
4835 "http://sigrok.org/download/source/sigrok-cli/sigrok-cli-"
4836 version ".tar.gz"))
4837 (sha256
4838 (base32
4839 "1f0a2k8qdcin0pqiqq5ni4khzsnv61l21v1dfdjzayw96qzl9l3i"))))
4840 (native-inputs
4841 (list pkg-config))
4842 (inputs
4843 (list glib libsigrok libsigrokdecode))
4844 (build-system gnu-build-system)
4845 (home-page "https://sigrok.org/wiki/Sigrok-cli")
4846 (synopsis "Command-line frontend for sigrok")
4847 (description "Sigrok-cli is a command-line frontend for sigrok.")
4848 (license license:gpl3+)))
4849
4850(define-public sigrok-firmware-fx2lafw
4851 ;; The project's last formal release was in 2019.
4852 ;;
4853 ;; The changes since then allow it to build with the latest version of SDCC,
4854 ;; 4.3.0.
4855 (let ((commit "96b0b476522c3f93a47ff8f479ec08105ba6a2a5")
4856 (revision "1"))
4857 (package
4858 (name "sigrok-firmware-fx2lafw")
4859 (version (git-version "0.1.7" revision commit))
4860 (source (origin
4861 (method git-fetch)
4862 (uri (git-reference
4863 (url "git://sigrok.org/sigrok-firmware-fx2lafw")
4864 (commit commit)))
4865 (file-name (git-file-name name version))
4866 (sha256
4867 (base32
4868 "1n5nj2g2m5ih59591ny2drrv25zviqcwyx1cfdhy8ijl82yxjkmb"))))
4869 (build-system gnu-build-system)
4870 (arguments
4871 (list #:tests? #f)) ; no test suite
4872 (native-inputs
4873 (list autoconf automake sdcc))
4874 (home-page "https://www.sigrok.org/wiki/Fx2lafw")
4875 (synopsis "Firmware for Cypress FX2 chips")
4876 (description "Fx2lafw is free firmware for Cypress FX2 chips which makes
4877them usable as simple logic analyzer and/or oscilloscope hardware.")
4878 (license license:gpl2+))))
4879
4880(define-public sby
4881 (package
4882 (name "sby")
4883 (version "0.69")
4884 (source
4885 (origin
4886 (method git-fetch)
4887 (uri (git-reference
4888 (url "https://github.com/YosysHQ/sby/")
4889 (commit (string-append "v" version))))
4890 (file-name (git-file-name name version))
4891 (sha256
4892 (base32 "153mhnbrxkk9zam758j20xjkc85bhd9hbzcga34snbrlfvqzpp7k"))))
4893 (build-system gnu-build-system)
4894 (arguments
4895 (list
4896 #:parallel-tests? #f
4897 #:test-target "test"
4898 #:imported-modules %pyproject-build-system-modules
4899 #:modules `((guix build gnu-build-system)
4900 ((guix build pyproject-build-system) #:prefix python:)
4901 (guix build utils))
4902 #:make-flags #~(list (string-append "PREFIX=" #$output))
4903 #:phases
4904 #~(modify-phases %standard-phases
4905 (delete 'configure)
4906 (delete 'build)
4907 ;; TODO: build docs, after furo-ys is packaged.
4908 ;; (add-after 'install 'build-info
4909 ;; (lambda _
4910 ;; (invoke "make" "-C" "docs" "info")))
4911 (add-after 'unpack 'patch-/usr/bin/env
4912 (lambda* (#:key inputs #:allow-other-keys)
4913 (substitute* "sbysrc/sby_core.py"
4914 (("\"/usr/bin/env\", ")
4915 ""))
4916 (substitute* "sbysrc/sby.py"
4917 (("/usr/bin/env python3")
4918 (search-input-file inputs "bin/python3")))))
4919 (add-after 'install 'python:wrap
4920 (assoc-ref python:%standard-phases 'wrap)))))
4921 (inputs (list abc-yosyshq
4922 python
4923 python-click
4924 python-xmlschema
4925 z3
4926 yices
4927 yosys))
4928 ;; TODO: see above build-info phase comment.
4929 ;; (native-inputs (list
4930 ;; python-sphinx python-sphinx-argparse texinfo))
4931 (home-page "https://yosyshq.readthedocs.io/projects/sby/en/latest/")
4932 (synopsis "Formal hardware verification with Yosys")
4933 (description
4934 "@command{sby} is an @acronym{EDA, Electronic Design Automation}
4935front-end program for Yosys-based formal hardware verification flows.")
4936 (license license:isc)))
4937
4938(define-public sby-gui
4939 (let ((commit "0a89301bf347c9f42932186e49ba2c0014ff3661")
4940 (revision "1"))
4941 (package
4942 (name "sby-gui")
4943 (version (git-version "0" revision commit))
4944 (source
4945 (origin
4946 (method git-fetch)
4947 (uri (git-reference
4948 (url "https://github.com/YosysHQ/sby-gui/")
4949 (commit commit)))
4950 (file-name (git-file-name name version))
4951 (sha256
4952 (base32 "1zp2c7zqclsfvl5xhb8zlc1dclp2s36w2nd0x80fazsxp7ksw5gr"))))
4953 (build-system qt-build-system)
4954 (arguments
4955 (list
4956 #:qtbase qtbase ;for Qt 6
4957 #:tests? #f)) ;no tests
4958 (native-inputs (list python-minimal-wrapper))
4959 (propagated-inputs (list sby))
4960 (home-page "https://github.com/YosysHQ/sby-gui/")
4961 (synopsis "Graphical user interface for code{sby}")
4962 (description
4963 "@code{sby-gui} is a GUI for front-end driver program for
4964code{yosys}-based formal hardware verification flows.")
4965 (license license:isc))))
4966
4967(define-public surelog
4968 (package
4969 (name "surelog")
4970 (version "1.87")
4971 (source
4972 (origin
4973 (method git-fetch)
4974 (uri (git-reference
4975 (url "https://github.com/chipsalliance/Surelog/")
4976 (commit (string-append "v" version))
4977 ;; Custom verion of the antlr4; see third_party/README.
4978 (recursive? #t)))
4979 (file-name (git-file-name name version))
4980 (sha256 (base32 "0hgapp33jv4i08x8n436fhkgk1f4fwzbd3cfb03fbv2y4c717nx0"))
4981 (modules '((guix build utils)))
4982 (snippet #~(delete-all-but "third_party"
4983 "antlr4" "antlr4_bin" "tests" "UVM"))))
4984 (build-system cmake-build-system)
4985 (arguments
4986 (list
4987 #:configure-flags
4988 #~(list "-DBUILD_SHARED_LIBS=ON"
4989 "-DSURELOG_BUILD_TESTS=ON"
4990 "-DSURELOG_USE_HOST_JSON=ON"
4991 "-DSURELOG_USE_HOST_GTEST=ON"
4992 "-DSURELOG_USE_HOST_UHDM=ON"
4993 "-DSURELOG_USE_HOST_ANTLR=OFF"
4994 "-DSURELOG_WITH_ZLIB=ON"
4995 "-DSURELOG_WITH_TCMALLOC=ON")
4996 #:phases
4997 #~(modify-phases %standard-phases
4998 (add-before 'check 'check-setup
4999 (lambda* (#:key tests? #:allow-other-keys)
5000 (when tests?
5001 (invoke "cmake" "--build" "." "--target" "UnitTests")))))))
5002 (native-inputs
5003 (list googletest
5004 nlohmann-json
5005 perl
5006 pkg-config
5007 python-minimal-wrapper
5008 python-psutil
5009 swig-4.4
5010 tcl
5011 tcsh
5012 uhdm))
5013 (inputs
5014 (list capnproto openjdk python-orderedmultidict zlib))
5015 (home-page "https://github.com/chipsalliance/Surelog/")
5016 (synopsis "Pre-procesor and parser for SystemVerilog 2017")
5017 (description
5018 "Surelog is a pre-processor, parser, elaborator and @acronym{UHDM,
5019Universal Hardware Data Model} compiler. It provides IEEE design, a C/C++
5020@acronym{VPI, Verilog Procedural Interface} and a Python @acronym{AST,
5021Abstract Syntax Trees} API.")
5022 (license license:asl2.0)))
5023
5024(define-public surfer
5025 (package
5026 (name "surfer")
5027 (version "0.7.0")
5028 (source
5029 (origin
5030 (method git-fetch)
5031 (uri (git-reference
5032 (url "https://gitlab.com/surfer-project/surfer")
5033 (commit (string-append "v" version))
5034 ;; needed for f128 which seems bundled in later rust versions
5035 ;; and instruction-decoder
5036 (recursive? #t)))
5037 (file-name (git-file-name name version))
5038 (sha256
5039 (base32 "146dah9j3rgwwkc331srvibphv3by5xf9yraz0hsaahscmd17vaq"))
5040 (modules '((guix build utils)))
5041 (snippet
5042 '(begin
5043 ;; The dependency is not available through crates.io.
5044 ;; Add it manually.
5045 (substitute* "libsurfer/Cargo.toml"
5046 (("^egui_skia_renderer = .*$")
5047 ""))))))
5048 (build-system cargo-build-system)
5049 (arguments
5050 (list
5051 #:install-source? #f
5052 #:tests? #f ;No tests.
5053 #:cargo-package-crates ''("surfer" "surver")
5054 #:cargo-install-paths ''("surfer" "surver")
5055 #:phases
5056 #~(modify-phases %standard-phases
5057 (add-after 'install 'wrap-graphical-libraries
5058 (lambda* (#:key inputs #:allow-other-keys)
5059 (for-each (lambda (lib)
5060 (wrap-program (string-append #$output "/bin/surfer")
5061 `("LD_LIBRARY_PATH" ":" prefix
5062 (,lib))))
5063 (map (lambda (pkg)
5064 (string-append (assoc-ref inputs pkg) "/lib"))
5065 '("libx11" "libxcursor" "libxi" "libxkbcommon"
5066 "mesa" "wayland"))))))))
5067 (native-inputs (list pkg-config
5068 (list zstd "lib")))
5069 (inputs (cons* bash-minimal
5070 libx11
5071 libxcursor
5072 libxi
5073 libxkbcommon
5074 mesa
5075 rust-egui-skia-renderer-source
5076 python
5077 wayland
5078 (cargo-inputs 'surfer)))
5079 (home-page "https://surfer-project.org")
5080 (synopsis "Waveform viewer")
5081 (description
5082 "Surfer is a waveform viewer used in @acronym{EDA, Electronic Design
5083Automation} with a focus on usability and extensibility.")
5084 (license license:eupl1.2)))
5085
5086(define-deprecated-package symbiyosys
5087 sby)
5088
5089(define-public sv-lang
5090 (package
5091 (name "sv-lang")
5092 (version "11.0")
5093 (source
5094 (origin
5095 (method git-fetch)
5096 (uri (git-reference
5097 (url "https://github.com/MikePopoloski/slang")
5098 (commit (string-append "v" version))))
5099 (file-name (git-file-name name version))
5100 (sha256
5101 (base32
5102 "1362w0scxiqdm7nwv8366bgbcgwv1iz2svkd9whl0wmlhqmky362"))))
5103 (build-system cmake-build-system)
5104 (arguments
5105 (list
5106 #:configure-flags
5107 #~(list "-DBUILD_SHARED_LIBS=ON"
5108 "-DSLANG_INCLUDE_TOOLS=ON"
5109 "-DSLANG_INCLUDE_TESTS=ON"
5110 "-DSLANG_INCLUDE_INSTALL=ON"
5111 "-DSLANG_USE_THREADS=ON"
5112 "-DSLANG_INCLUDE_PYLIB=ON"
5113 "-DSLANG_INCLUDE_DOCS=OFF"))) ;requires author’s m.css repository
5114 (native-inputs
5115 (list pkg-config python-minimal-wrapper))
5116 (inputs
5117 (list boost catch2 cpptrace fmt-12 mimalloc pybind11))
5118 (synopsis "SystemVerilog compiler and language services")
5119 (description "Slang is a software library that provides various components
5120for lexing, parsing, type checking, and elaborating SystemVerilog code. It
5121comes with an executable tool that can compile and lint any SystemVerilog
5122project, but it is also intended to be usable as a front end for synthesis
5123tools, simulators, linters, code editors, and refactoring tools.")
5124 (home-page "https://sv-lang.com/")
5125 (license license:expat)))
5126
5127(define-public systemc
5128 (package
5129 (name "systemc")
5130 (version "3.0.2")
5131 (source
5132 (origin
5133 (method git-fetch)
5134 (uri (git-reference
5135 (url "https://github.com/accellera-official/systemc")
5136 (commit version)))
5137 (file-name (git-file-name name version))
5138 (sha256
5139 (base32 "0gbk8ma0nhaf02alcxk808isvk74b5wadaazdvzwbmj0ybx06ml1"))))
5140 (native-inputs (list perl))
5141 (build-system cmake-build-system)
5142 (arguments
5143 (list
5144 #:modules '((guix build cmake-build-system)
5145 ((guix build gnu-build-system) #:prefix gnu:)
5146 (guix build utils))
5147 #:phases
5148 #~(modify-phases %standard-phases
5149 (replace 'check (assoc-ref gnu:%standard-phases 'check)))))
5150 (home-page "https://systemc.org/")
5151 (synopsis "Library for event-driven simulation")
5152 (description
5153 "SystemC is a C++ library for modeling concurrent systems, and the
5154reference implementation of IEEE 1666-2011. It provides a notion of timing as
5155well as an event-driven simulations environment. Due to its concurrent and
5156sequential nature, SystemC allows the description and integration of complex
5157hardware and software components. To some extent, SystemC can be seen as
5158a Hardware Description Language. However, unlike VHDL or Verilog, SystemC
5159provides sophisticated mechanisms that offer high abstraction levels on
5160components interfaces. This, in turn, facilitates the integration of systems
5161using different abstraction levels.")
5162 ;; homepages.cae.wisc.edu/~ece734/SystemC/Esperan_SystemC_tutorial.pdf
5163 (license license:asl2.0)))
5164
5165(define-public uhdm
5166 (package
5167 (name "uhdm")
5168 (version "1.87")
5169 (source
5170 (origin
5171 (method git-fetch)
5172 (uri (git-reference
5173 (url "https://github.com/chipsalliance/UHDM/")
5174 (commit (string-append "v" version))))
5175 (file-name (git-file-name name version))
5176 (sha256
5177 (base32 "18lf9mxk41092pimrfad4z2878y0f7sbd063fcqq2rm5axxqs84h"))))
5178 (build-system cmake-build-system)
5179 (arguments
5180 (list
5181 #:configure-flags
5182 #~(list "-DUHDM_USE_HOST_CAPNP=ON"
5183 "-DCMAKE_CXX_FLAGS=-fPIC"
5184 "-DCMAKE_C_FLAGS=-fPIC"
5185 "-DUHDM_USE_HOST_GTEST=ON")))
5186 (native-inputs
5187 (list googletest python-minimal-wrapper))
5188 (inputs
5189 (list capnproto python-orderedmultidict))
5190 (home-page "https://github.com/chipsalliance/UHDM/")
5191 (synopsis "Universal Hardware Data Model")
5192 (description
5193 "UHDM is a complete modeling of the IEEE SystemVerilog Object Model with
5194VPI Interface, Elaborator, Serialization, Visitor and Listener.")
5195 (license license:asl2.0)))
5196
5197(define trilinos-serial-xyce
5198 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
5199 ;; keep it private. See
5200 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
5201 ;; TODO: Remove when we have modular Trilinos packages?
5202 (package
5203 (name "trilinos-serial-xyce")
5204 (version "14.4.0") ;version used by xyce, sync updates
5205 (source
5206 (origin
5207 (method git-fetch)
5208 (uri (git-reference
5209 (url "https://github.com/trilinos/Trilinos")
5210 (commit (string-append "trilinos-release-"
5211 (string-map (lambda (chr)
5212 (case chr
5213 ((#\.) #\-)
5214 (else chr)))
5215 version)))))
5216 (file-name (git-file-name name version))
5217 (sha256
5218 (base32
5219 "19ny75z1x2sfa9jv20prq4wqxznkzqryxj4gv12rzzlz9ihd1dcd"))))
5220 (build-system cmake-build-system)
5221 (arguments
5222 (list
5223 #:configure-flags
5224 #~(list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
5225 "-DCMAKE_C_FLAGS=-O3 -fPIC"
5226 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
5227 "-DBUILD_SHARED_LIBS=ON"
5228 "-DTrilinos_ENABLE_TESTS=ON"
5229 (string-append "-DBLAS_LIBRARY_DIRS="
5230 #$(this-package-input "openblas") "/lib")
5231 (string-append "-DLAPACK_LIBRARY_DIRS="
5232 #$(this-package-input "lapack") "/lib")
5233 ;; From xyce configure phase:
5234 ;; ...
5235 ;; -- Looking for Trilinos
5236 ;; Required packages:
5237 ;; Amesos Epetra EpetraExt Ifpack NOX Teuchos Sacado
5238 ;; Triutils AztecOO Belos TrilinosCouplings
5239 ;; Optional packages:
5240 ;; Isorropia Zoltan ShyLU ShyLU_DDCore Amesos2 Stokhos ROL MKL
5241 ;; ...
5242 ;; List from TRILINOS_SERIAL_ARGS in XyceSuperBuild.cmake.
5243 "-DTrilinos_ENABLE_NOX=ON"
5244 "-DNOX_ENABLE_LOCA=ON"
5245 "-DTrilinos_ENABLE_EpetraExt=ON"
5246 "-DEpetraExt_BUILD_BTF=ON"
5247 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
5248 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
5249 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
5250 "-DTrilinos_ENABLE_Ifpack=ON"
5251 ;; "-DTrilinos_ENABLE_Isorropia=OFF"
5252 "-DTrilinos_ENABLE_AztecOO=ON"
5253 "-DTrilinos_ENABLE_Belos=ON"
5254 "-DTrilinos_ENABLE_Teuchos=ON"
5255 "-DTeuchos_ENABLE_COMPLEX=ON"
5256 "-DTrilinos_ENABLE_Amesos=ON"
5257 "-DAmesos_ENABLE_KLU=ON"
5258 "-DTrilinos_ENABLE_Sacado=ON"
5259 ;; "-DTrilinos_ENABLE_Kokkos=OFF"
5260 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
5261 "-DTrilinos_ENABLE_CXX11=ON"
5262 "-DTPL_ENABLE_AMD=ON"
5263 "-DTPL_ENABLE_BLAS=ON"
5264 "-DTPL_ENABLE_LAPACK=ON"
5265 "-DTPL_ENABLE_DLlib:BOOL=OFF")))
5266 (native-inputs (list gfortran perl python-minimal-wrapper swig-4.4 tcsh))
5267 (inputs (list boost lapack openblas suitesparse-amd))
5268 (home-page "https://trilinos.github.io/")
5269 (synopsis "Engineering and scientific problems algorithms")
5270 (description
5271 "The Trilinos Project is an effort to develop algorithms and enabling
5272technologies within an object-oriented software framework for the solution of
5273large-scale, complex multi-physics engineering and scientific problems. A
5274unique design feature of Trilinos is its focus on packages.")
5275 ;; The Trilinos project is a collection of open-source packages licensed
5276 ;; individually under multiple open-source licenses. Licensing terms are
5277 ;; available at the Trilinos website:
5278 ;; https://trilinos.github.io/license.html
5279 ;; For information about the software license for a particular package,
5280 ;; see package-specific documentation (e.g., Trilinos/packages/<package
5281 ;; name>/LICENSE).
5282 ;; Only found these two licenses:
5283 (license (list license:lgpl2.1+
5284 license:bsd-3))))
5285
5286(define trilinos-parallel-xyce
5287 (package
5288 (inherit trilinos-serial-xyce)
5289 (name "trilinos-parallel-xyce")
5290 (arguments
5291 (substitute-keyword-arguments
5292 (package-arguments trilinos-serial-xyce)
5293 ((#:configure-flags flags)
5294 ;; List from TRILINOS_PARALLEL_ARGS in XyceSuperBuild.cmake.
5295 #~(cons* "-DTrilinos_ENABLE_ShyLU=ON"
5296 "-DTrilinos_ENABLE_Zoltan=ON"
5297 "-DTrilinos_ENABLE_Isorropia=ON"
5298 "-DTPL_ENABLE_MPI=ON"
5299 "-DCMAKE_C_COMPILER=mpicc"
5300 "-DCMAKE_CXX_COMPILER=mpicxx"
5301 "-DCMAKE_Fortran_COMPILER=mpifort"
5302 "-DCMAKE_CXX_FLAGS=-O3 -fPIC -lmpi"
5303 "-DCMAKE_C_FLAGS=-O3 -fPIC -lmpi"
5304 (delete "-DCMAKE_C_FLAGS=-O3 -fPIC"
5305 (delete
5306 "-DCMAKE_CXX_FLAGS=-O3 -fPIC" #$flags))))))
5307 (inputs
5308 (modify-inputs inputs
5309 (prepend openmpi)))))
5310
5311(define-public verilator
5312 (package
5313 (name "verilator")
5314 (version "5.052")
5315 (source
5316 (origin
5317 (method git-fetch)
5318 (uri (git-reference
5319 (url "https://github.com/verilator/verilator/")
5320 (commit (string-append "v" version))))
5321 (file-name (git-file-name name version))
5322 (sha256
5323 (base32 "1zcjzxgcm38sc70ciyh2zkpvyiw5dmczfx60nlmzg5qsp5sah5yz"))))
5324 (native-inputs
5325 (list autoconf
5326 automake
5327 bison
5328 cmake-minimal
5329 flex
5330 gdb/pinned
5331 gettext-minimal
5332 help2man
5333 python-distro
5334 python-minimal
5335 which
5336 z3))
5337 (inputs
5338 (list perl python systemc))
5339 (build-system gnu-build-system)
5340 (arguments
5341 (list
5342 #:phases
5343 #~(modify-phases %standard-phases
5344 (replace 'bootstrap
5345 (lambda _ (invoke "autoconf")))
5346 (add-after 'unpack 'adjust-source
5347 (lambda _
5348 (substitute* "bin/verilator"
5349 (("/bin/echo") "echo"))))
5350 (add-before 'check 'set-SYSTEMC_ROOT
5351 (lambda _
5352 (setenv "SYSTEMC_ROOT" #$(this-package-input systemc))))
5353 (add-before 'check 'disable-gdb-safe-path
5354 (lambda _
5355 (setenv "HOME" (getcwd))
5356 (mkdir-p (string-append (getcwd) "/.config/gdb"))
5357 (with-output-to-file
5358 (string-append (getcwd) "/.config/gdb/gdbinit")
5359 (lambda ()
5360 (display "set auto-load safe-path /"))))))
5361 #:test-target "test"))
5362 (home-page "https://www.veripool.org/verilator/")
5363 (synopsis "Verilog/SystemVerilog HDL simulator and lint system")
5364 (description
5365 "Verilator is an @acronym{EDA, Electronic Design Automation} tool
5366intended to transform the specified Verilog or SystemVerilog HDL code by
5367reading it, performing lint checks, and optionally inserting assertion checks
5368and coverage-analysis points. It outputs single or multi-threaded
5369@file{.cpp} and @file{.h} files.")
5370 (license license:lgpl3)))
5371
5372(define-public xoscope
5373 (let ((revision "0.0.0")
5374 (commit "d97b9b186a4137582ae27fce1da73f51c06f852e"))
5375 (package
5376 (name "xoscope")
5377 (version (git-version "2.3" revision commit))
5378 (source (origin
5379 (method git-fetch)
5380 (uri (git-reference
5381 (url "https://git.code.sf.net/p/xoscope/code")
5382 (commit commit)))
5383 (file-name (git-file-name name version))
5384 (sha256
5385 (base32
5386 "1jaz14pb8lx1y34f979v507dmkrq3wdczi0hkqzb64zg76cdkwya"))))
5387 (build-system gnu-build-system)
5388 (native-inputs
5389 (list m4 pkg-config automake libtool autoconf))
5390 (inputs
5391 (list alsa-lib comedilib fftw gtk+ gtkdatabox))
5392 (synopsis "Digital oscilloscope")
5393 (description "Xoscope is a digital oscilloscope that can acquire signals
5394from ALSA, ESD, and COMEDI sources. This package currently does not include
5395support for ESD or COMEDI sources.")
5396 (home-page "https://xoscope.sourceforge.net/")
5397 (license license:gpl2+))))
5398
5399(define-public xyce-serial
5400 (package
5401 (name "xyce-serial")
5402 (version "7.10.0")
5403 (source
5404 (origin
5405 (method git-fetch)
5406 (uri (git-reference
5407 (url "https://github.com/Xyce/Xyce")
5408 (commit (string-append "Release-" version))))
5409 (file-name (git-file-name name version))
5410 (sha256
5411 (base32
5412 "05wlrk554ajsl8n1q4608ckxy9df6x8yshvhjd89b4dj22af1jzi"))))
5413 (build-system cmake-build-system)
5414 (arguments
5415 (list
5416 #:configure-flags
5417 #~(list
5418 (string-append
5419 "-DTrilinos_ROOT=" #$(this-package-input "trilinos-serial-xyce"))
5420 "-DXyce_PLUGIN_SUPPORT=ON"
5421 "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
5422 "-DCMAKE_C_FLAGS=-O3 -fPIC"
5423 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC")))
5424 (native-inputs
5425 (list bison
5426 flex
5427 gfortran))
5428 (inputs
5429 (list adms fftw lapack openblas suitesparse-amd trilinos-serial-xyce))
5430 (home-page "https://xyce.sandia.gov/")
5431 (synopsis "High-performance analog circuit simulator")
5432 (description
5433 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
5434capable of solving extremely large circuit problems by supporting large-scale
5435parallel computing platforms. It also supports serial execution.")
5436 (license license:gpl3+)))
5437
5438(define-public xyce-parallel
5439 (package
5440 (inherit xyce-serial)
5441 (name "xyce-parallel")
5442 (arguments
5443 (substitute-keyword-arguments
5444 (package-arguments xyce-serial)
5445 ((#:configure-flags flags)
5446 #~(cons* "-DTPL_ENABLE_MPI=ON"
5447 "-DCMAKE_C_COMPILER=mpicc"
5448 "-DCMAKE_CXX_COMPILER=mpicxx"
5449 "-DCMAKE_Fortran_COMPILER=mpifort"
5450 "-DCMAKE_CXX_FLAGS=-O3 -fPIC -lmpi"
5451 "-DCMAKE_C_FLAGS=-O3 -fPIC -lmpi"
5452 (delete "-DCMAKE_C_FLAGS=-O3 -fPIC"
5453 (delete
5454 "-DCMAKE_CXX_FLAGS=-O3 -fPIC" #$flags))))))
5455 (inputs
5456 (modify-inputs inputs
5457 (prepend openmpi)
5458 (replace "trilinos-serial-xyce" trilinos-parallel-xyce)))))
5459
5460(define-public yosys
5461 (package
5462 (name "yosys")
5463 (version "0.69")
5464 (source
5465 (origin
5466 (method git-fetch)
5467 (uri (git-reference
5468 (url "https://github.com/YosysHQ/yosys")
5469 (commit (string-append "v" version))
5470 ;; Deeply related vendored dependencies.
5471 (recursive? #t)))
5472 (sha256
5473 (base32 "1gi07v3py1zfpdl2b933kiy1f1sri9246vbf2d275hhalgls8g2n"))
5474 (file-name (git-file-name name version))
5475 (snippet
5476 #~(begin
5477 (use-modules (guix build utils)
5478 (srfi srfi-26))
5479 (delete-file-recursively "abc")
5480 (delete-file-recursively "libs/dlfcn-win32")
5481 (substitute* "libs/CMakeLists.txt"
5482 (("add_subdirectory\\(dlfcn-win32\\)") ""))))))
5483 (build-system cmake-build-system)
5484 (outputs '("out" "doc" "config"))
5485 (properties
5486 `((output-synopsis "config" "Yosys configuration file")))
5487 (arguments
5488 (list
5489 #:configure-flags
5490 #~(list "-DYOSYS_ENABLE_FUNCTIONAL_TESTS=ON"
5491 (string-append "-DYOSYS_CHECKOUT_INFO=" #$version)
5492 "-DYOSYS_WITHOUT_EDITLINE=ON"
5493 "-DYOSYS_ENABLE_READLINE=ON"
5494 "-DCMAKE_C_COMPILER=clang"
5495 "-DCMAKE_CXX_COMPILER=clang++"
5496 (string-append "-DYOSYS_ABC_EXECUTABLE="
5497 #$(this-package-input "abc-yosyshq") "/bin/abc")
5498 "-DYOSYS_INSTALL_DRIVER=ON"
5499 "-DYOSYS_INSTALL_LIBRARY=ON"
5500 "-DYOSYS_INSTALL_PYTHON=ON"
5501 ;; Python
5502 "-DYOSYS_ENABLE_PYTHON=ON"
5503 "-DYOSYS_WITH_PYTHON=ON"
5504 "-DYOSYS_INSTALL_PYTHON=ON"
5505 (string-append "-DYOSYS_INSTALL_PYTHON_SITEDIR="
5506 #$output "/lib/python"
5507 #$(version-major+minor (package-version python))
5508 "/site-packages"))
5509 #:phases
5510 #~(modify-phases %standard-phases
5511 (add-after 'unpack 'reduce-closure
5512 (lambda _
5513 (substitute* "cmake/YosysVersion.cmake"
5514 (("\\$\\{CMAKE_CXX_COMPILER\\}") "clang++"))))
5515 ;; TODO: Remove when fixed.
5516 (add-after 'unpack 'remove-aiger
5517 (lambda _
5518 (substitute* "tests/Makefile"
5519 ((".*aiger.*") ""))))
5520 (add-before 'configure 'fix-paths
5521 (lambda* (#:key inputs #:allow-other-keys)
5522 (substitute* "backends/smt2/smtio.py"
5523 (("\\['yices-smt2")
5524 (string-append
5525 "['" (search-input-file inputs "bin/yices-smt2")))
5526 (("\\['z3")
5527 (string-append
5528 "['" (search-input-file inputs "bin/z3"))))
5529 (substitute* '("passes/cmds/show.cc" "passes/cmds/viz.cc")
5530 (("fuser")
5531 (search-input-file inputs "bin/fuser")))))
5532 (add-after 'install 'add-symbolic-link
5533 (lambda* (#:key inputs #:allow-other-keys)
5534 ;; Previously this package provided a copy of the "abc"
5535 ;; executable in its output, named "yosys-abc". Create a
5536 ;; symbolic link so any external uses of that name continue to
5537 ;; work.
5538 (symlink (search-input-file inputs "/bin/abc")
5539 (string-append #$output "/bin/yosys-abc"))))
5540 (add-after 'install 'wrap
5541 (lambda* (#:key inputs #:allow-other-keys)
5542 (wrap-program (string-append #$output "/bin/yosys-witness")
5543 `("GUIX_PYTHONPATH" ":" prefix
5544 (,(getenv "GUIX_PYTHONPATH"))))))
5545 (add-after 'install 'build-config
5546 (lambda _
5547 (mkdir-p (string-append #$output:config "/bin"))
5548 (rename-file
5549 (string-append #$output "/bin/yosys-config")
5550 (string-append #$output:config "/bin/yosys-config"))))
5551 (add-before 'build 'build-info
5552 (lambda _
5553 (with-directory-excursion "../source/docs"
5554 (substitute* "Makefile"
5555 (("SPHINXOPTS = -W --keep-going")
5556 "SPHINXOPTS = --keep-going"))
5557 (invoke "make" "info")
5558 (install-file "build/texinfo/yosyshqyosys.info"
5559 (string-append #$output:doc "/share/info"))
5560 (copy-recursively
5561 "build/texinfo/yosyshqyosys-figures"
5562 (string-append
5563 #$output:doc "/share/info/yosyshqyosys-figures")))))
5564 (replace 'check
5565 (lambda* (#:key tests? (parallel-tests? #t) #:allow-other-keys)
5566 (when tests?
5567 (apply invoke "cmake" "--build" "." "-t" "test"
5568 `(,@(if parallel-tests?
5569 `("-j" ,(number->string (parallel-job-count)))
5570 '("-j" "1"))))))))))
5571 (native-inputs
5572 (list bison
5573 clang
5574 flex
5575 gawk ;for the tests and "make" progress pretty-printing
5576 googletest
5577 gtkwave ;for the tests
5578 iverilog ;for the tests
5579 perl
5580 pkg-config
5581 python-pytest
5582 python-sphinxcontrib-bibtex
5583 python-sphinx-inline-tabs
5584 texinfo))
5585 ;; Optional dependencies increase considerably package closure.
5586 ;; - gtkwave: required only for vcd2fst binary, used by ‘sim’ command.
5587 ;; - graphviz, xdot: used by ‘show’ command to display schematics.
5588 (inputs
5589 (list abc-yosyshq
5590 bash-minimal
5591 libffi
5592 psmisc
5593 pybind11
5594 python-wrapper
5595 python-click
5596 python-cxxheaderparser
5597 readline
5598 tcl
5599 yices
5600 z3
5601 zlib))
5602 (home-page "https://yosyshq.net/yosys/")
5603 (synopsis "Open synthesis suite for RTL code")
5604 (description "Yosys consist on a framework of RTL synthesis tools. It
5605currently has extensive Verilog-2005 support, and performs synthesis of VHDL
5606code using external plugins. It provides a basic set of synthesis algorithms
5607for various application domains, including FPGAs and ASICs.")
5608 (license license:isc)))
5609
5610(define-deprecated-package yosys-clang yosys)