From patchwork Mon Jan 29 15:01:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gary Wong X-Patchwork-Id: 59553 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1AD3F27BBE2; Mon, 29 Jan 2024 15:02:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED, URIBL_SBL_A autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7CF8927BBE9 for ; Mon, 29 Jan 2024 15:02:14 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUT96-0008GW-8k; Mon, 29 Jan 2024 10:02:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUT92-0008G5-5X for guix-patches@gnu.org; Mon, 29 Jan 2024 10:01:56 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUT91-0003fD-B3 for guix-patches@gnu.org; Mon, 29 Jan 2024 10:01:55 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUT99-00018i-7d for guix-patches@gnu.org; Mon, 29 Jan 2024 10:02:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68791] [PATCH 1/3] gnu: yosys: Update to 0.37. References: <20240129042736.GA13188@flux.utah.edu> Resent-From: Gary Wong Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 29 Jan 2024 15:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68791 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68791@debbugs.gnu.org Received: via spool by 68791-submit@debbugs.gnu.org id=B68791.17065404864304 (code B ref 68791); Mon, 29 Jan 2024 15:02:03 +0000 Received: (at 68791) by debbugs.gnu.org; 29 Jan 2024 15:01:26 +0000 Received: from localhost ([127.0.0.1]:33213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUT8X-00017L-Br for submit@debbugs.gnu.org; Mon, 29 Jan 2024 10:01:26 -0500 Received: from bas.flux.utah.edu ([155.98.60.2]:14726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUT8U-000173-FS for 68791@debbugs.gnu.org; Mon, 29 Jan 2024 10:01:24 -0500 Received: from bas.flux.utah.edu (localhost [127.0.0.1]) by bas.flux.utah.edu (8.15.2/8.15.2) with ESMTP id 40TF17rf083813 for <68791@debbugs.gnu.org>; Mon, 29 Jan 2024 08:01:07 -0700 (MST) (envelope-from gtw@bas.flux.utah.edu) Received: (from gtw@localhost) by bas.flux.utah.edu (8.15.2/8.15.2/Submit) id 40TF17RM083812 for 68791@debbugs.gnu.org; Mon, 29 Jan 2024 08:01:07 -0700 (MST) (envelope-from gtw) Date: Mon, 29 Jan 2024 08:01:07 -0700 From: Gary Wong Message-ID: <20240129150107.GA83516@flux.utah.edu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240129042736.GA13188@flux.utah.edu> User-Agent: Mutt/1.12.1 (2019-06-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/fpga.scm (yosys): Update to 0.37, and disable fragile iverilog invocation in arch/run-test.sh. Change-Id: Ie9ed39ac47fb0a3dde1acd5f699724dc709a00a0 --- gnu/packages/fpga.scm | 162 +++++++++++++++++++++++------------------- 1 file changed, 88 insertions(+), 74 deletions(-) diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index 13ac1a0b..99841fb6 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2021 Andrew Miloradovsky ;;; Copyright © 2022 Christian Gelinek ;;; Copyright © 2022 jgart +;;; Copyright © 2024 Gary Wong ;;; ;;; This file is part of GNU Guix. ;;; @@ -137,84 +138,97 @@ (define-public iverilog (define-public yosys (package (name "yosys") - (version "0.26") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/YosysHQ/yosys") - (commit (string-append "yosys-" version)))) - (sha256 - (base32 - "0s79ljgbcfkm7l9km7dcvlz4mnx38nbyxppscvh5il5lw07n45gx")) - (file-name (git-file-name name version)))) + (version "0.37") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/YosysHQ/yosys") + (commit (string-append "yosys-" version)))) + (sha256 + (base32 "13f8d02n7fibf77nwfqqlbzfwrpc5qcjx059v04cb76vk9k4bkqp")) + (file-name (git-file-name name version)))) (build-system gnu-build-system) (arguments (list #:test-target "test" - #:make-flags #~(list "CC=gcc" - "CXX=g++" - (string-append "PREFIX=" #$output)) - #:phases - #~(modify-phases %standard-phases - (add-before 'configure 'fix-paths - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "./backends/smt2/smtio.py" - (("\\['z3") - (string-append "['" (search-input-file inputs "/bin/z3")))) - (substitute* "./kernel/fstdata.cc" - (("vcd2fst") - (search-input-file inputs "/bin/vcd2fst"))) - (substitute* '("./passes/cmds/show.cc" - "./passes/cmds/viz.cc") - (("exec xdot") - (string-append "exec " (search-input-file inputs - "/bin/xdot"))) - (("dot -") - (string-append (search-input-file inputs "/bin/dot") " -")) - (("fuser") - (search-input-file inputs "/bin/fuser"))))) - (replace 'configure - (lambda* (#:key make-flags #:allow-other-keys) - (apply invoke "make" "config-gcc" make-flags))) - (add-after 'configure 'use-external-abc - (lambda* (#:key inputs #:allow-other-keys) - (substitute* '("./Makefile") - (("ABCEXTERNAL \\?=") - (string-append "ABCEXTERNAL = " - (search-input-file inputs "/bin/abc")))))) - (add-after 'install 'add-symbolic-link - (lambda* (#:key inputs #:allow-other-keys) - ;; Previously this package provided a copy of the "abc" - ;; executable in its output, named "yosys-abc". Create a - ;; symbolic link so any external uses of that name continue to - ;; work. - (symlink (search-input-file inputs "/bin/abc") - (string-append #$output "/bin/yosys-abc")))) - (add-after 'install 'wrap - (lambda* (#:key inputs #:allow-other-keys) - (wrap-program (string-append #$output "/bin/yosys-witness") - `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))))))) - (native-inputs - (list bison - flex - gawk ; for the tests and "make" progress pretty-printing - iverilog ; for the tests - pkg-config - python - tcl)) ; tclsh for the tests - (inputs - (list abc - graphviz - gtkwave - libffi - psmisc - readline - tcl - xdot - z3 - zlib - python - python-click)) + #:make-flags #~(list "CC=gcc" "CXX=g++" + (string-append "PREFIX=" + #$output)) + #:phases #~(modify-phases %standard-phases + (add-before 'configure 'fix-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "./backends/smt2/smtio.py" + (("\\['z3") + (string-append "['" + (search-input-file inputs "/bin/z3")))) + (substitute* "./kernel/fstdata.cc" + (("vcd2fst") + (search-input-file inputs "/bin/vcd2fst"))) + (substitute* '("./passes/cmds/show.cc" + "./passes/cmds/viz.cc") + (("exec xdot") + (string-append "exec " + (search-input-file inputs "/bin/xdot"))) + (("dot -") + (string-append (search-input-file inputs "/bin/dot") + " -")) + (("fuser") + (search-input-file inputs "/bin/fuser"))))) + (add-before 'configure 'fix-tests + (lambda* (#:key inputs #:allow-other-keys) + ;; The arch/run-test.sh script performs a syntax check + ;; on the included simulation models, by running + ;; iverilog over the model source. Unfortunately this + ;; test is prone to false positives, because it is + ;; highly sensitive to the version of iverilog in use. + ;; Disable iverilog invocation for this test. + (substitute* '("./tests/arch/run-test.sh") + (("iverilog") + "# iverilog")))) + (replace 'configure + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "config-gcc" make-flags))) + (add-after 'configure 'use-external-abc + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("./Makefile") + (("ABCEXTERNAL \\?=") + (string-append "ABCEXTERNAL = " + (search-input-file inputs "/bin/abc")))))) + (add-after 'install 'add-symbolic-link + (lambda* (#:key inputs #:allow-other-keys) + ;; Previously this package provided a copy of the "abc" + ;; executable in its output, named "yosys-abc". Create + ;; a symbolic link so any external uses of that name + ;; continue to work. + (symlink (search-input-file inputs "/bin/abc") + (string-append #$output "/bin/yosys-abc")))) + (add-after 'install 'wrap + (lambda* (#:key inputs #:allow-other-keys) + (wrap-program (string-append #$output + "/bin/yosys-witness") + `("GUIX_PYTHONPATH" ":" prefix + (,(getenv "GUIX_PYTHONPATH"))))))))) + (native-inputs (list bison + flex + gawk ;for the tests and "make" progress pretty-printing + iverilog ;for the tests + pkg-config + python + tcl)) ;tclsh for the tests + (inputs (list abc + bash-minimal + graphviz + gtkwave + libffi + psmisc + readline + tcl + xdot + z3 + zlib + python + python-click)) (home-page "https://yosyshq.net/yosys/") (synopsis "FPGA Verilog RTL synthesizer") (description "Yosys synthesizes Verilog-2005.")