gnu: Add python-cocotb.

* gnu/packages/electronics.scm (python-cocotb): New variable.

Change-Id: I8816e137002ad6763a466c8c79353489d3d3cc2e
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Cayetano Santos 2025-05-26 16:41:44 +02:00 committed by Sharlatan Hellseher
parent 356cc64411
commit 8730c8f3a8
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -561,6 +561,52 @@ formats.")
for sigrok.") for sigrok.")
(license license:gpl3+))) (license license:gpl3+)))
(define-public python-cocotb
(package
(name "python-cocotb")
(version "1.9.2")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/cocotb/cocotb")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "19mybnhqa2jz134jj8686310fniav5nldiq0y7kbgml81ppai87c"))))
(build-system pyproject-build-system)
(arguments
(list
#:test-flags
;; Tests requiring a verilog simulator.
#~(list "-k" (string-join
(list "not parallel_cocotb"
"cocotb"
"vhdl_libraries_multiple")
" and not "))
#:phases
#~(modify-phases %standard-phases
;; Tests requiring a vhdl simulator.
(add-after 'check 'check-vhdl
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(setenv "SIM" "nvc")
(invoke "pytest" "-vv" "-k" "vhdl_libraries_multiple")))))))
(native-inputs
(list iverilog
nvc
python-pytest
python-setuptools
python-wheel))
(propagated-inputs
(list python-find-libpython))
(home-page "https://github.com/cocotb/cocotb")
(synopsis "Library for writing HDL test benches in Python")
(description
"Coroutine based cosimulation test bench environment for verifying VHDL
and Verilog RTL using Python.")
(license license:bsd-3)))
(define-public python-edalize (define-public python-edalize
(package (package
(name "python-edalize") (name "python-edalize")