Subject: [bug#78390] [PATCH electronics-team] gnu: nextpnr: Add ecp5 and himbaechel architectures.

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 15 May 2025 10:49:04 +0900

tags 78390 + moreinfo
thanks

Hello!

Cayetano Santos <[email-masked]> writes:

> * gnu/packages/fpga.scm (nextpnr): Add ecp5 and himbaechel architectures.
>
> Change-Id: Ia4b92f6cd1693b844b35949fdc23369e958e73c1
>
> ---
>
> [arguments] <#:configure-flags>: Add Add ecp5 and himbaechel.
> <#:phases> {get-prjbeyond-db}: New phase.
> {unbundle-sanitizers-cmake}: Simplify lambda.
> [native-inputs]: Add prjtrellis.
>
>  gnu/packages/fpga.scm | 24 ++++++++++++++++++++++--
>  1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm
> index 2019700d72..4d767340cb 100644
> --- a/gnu/packages/fpga.scm
> +++ b/gnu/packages/fpga.scm
> @@ -54,6 +54,7 @@ (define-module (gnu packages fpga)
>    #:use-module (gnu packages cmake)
>    #:use-module (gnu packages compression)
>    #:use-module (gnu packages cpp)
> +  #:use-module (gnu packages electronics)
>    #:use-module (gnu packages elf)
>    #:use-module (gnu packages flex)
>    #:use-module (gnu packages gawk)
> @@ -408,18 +409,36 @@ (define-public nextpnr
>       (list
>        #:cmake cmake                     ;CMake 3.25 or higher is required.
>        #:configure-flags
> -      #~(list "-DARCH=generic;ice40"    ;TODO: enable more architectures?
> +      ;;TODO: enable more architectures?

punctuation nitpick: should be ';; TODO: Enable more architectures?'

> +      #~(list "-DARCH=generic;ice40;ecp5;himbaechel"
>                "-DBUILD_GUI=ON"
>                "-DUSE_OPENMP=ON"
>                "-DBUILD_TESTS=ON"
> +              "-DHIMBAECHEL_UARCH=ng-ultra" ;gowin requires python-apycula.

Feel free to drop punctuation for margin commits, such as the trailing
dot here.

> +              "-DHIMBAECHEL_NGULTRA_DEVICES=ng-ultra"
> +              "-DHIMBAECHEL_PRJBEYOND_DB=/tmp/prjbeyond-db"
>                (string-append "-DCURRENT_GIT_VERSION=nextpnr-" #$version)
>                (string-append "-DICESTORM_INSTALL_PREFIX="
>                               #$(this-package-input "icestorm"))
> +              (string-append "-DTRELLIS_INSTALL_PREFIX="
> +                             #$(this-package-input "prjtrellis"))
>                "-DUSE_IPO=OFF")
>        #:phases
>        #~(modify-phases %standard-phases
> +          (add-after 'unpack 'get-prjbeyond-db
> +            (lambda _

It'd be nice to add a comment explaining why this is useful here, and
perhaps mentioning which commit should be used when updating (the latest
one?) nextpnr.

Otherwise, LGTM!

-- 
Thanks,
Maxim