projects/guix·blob rust-team · refs

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