~csantosb/guix.channel-electronics

Guix channel for digital electronic design
fix error in 7be3f58
pnr: add nextpnr-himbaechel-gowin.
prn: add python-apycula 0.17.

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~csantosb/guix.channel-electronics
read/write
git@git.sr.ht:~csantosb/guix.channel-electronics

You can also use your local clone with git send-email.

builds.sr.ht status

#Guix channel for digital electronics design

This repository (a guix channel) contains custom package definitions related to digital electronics development.

It includes some utilities (compilers, synthesizers, etc.), as well as verification and testing libraries, useful when dealing with HDL designs.

It also includes ip modules to be used as a library of HDL firmware, seen as project dependencies.

This list of package definitions may be seen here.

This repository lives here, with a mirror.

#Usage

#get guix

Install guix as a foreign package manager, on top of any (systemd compatible) linux distribution, following instructions.

Use orbstack on MacOS to get a linux layer.

Windows user, consider using a real OS.

#via load-path

The simplest way to use this channel is to temporarily add it to Guix's load-path:

git clone --depth=1 https://git.sr.ht/~csantosb/guix.channel-electronics \
    /tmp/guix.channel-electronics

guix install \
     -p "$GUIX_ENVIRONMENT" \
     -L /tmp/guix.channel-electronics \
     PACKAGES

#via channels.scm

A more permanent solution is to configure Guix to use this channel as an additional channel. This will extend your package collection with definitions from this channel. Updates will be received (and authenticated) with guix pull.

To use the channel, add it to your configuration in ~/.config/guix/channels.scm:

(cons* (channel
        (name 'electronics)
        (url "https://git.sr.ht/~csantosb/guix.channel-electronics")
        (branch "main")
        (introduction
         (make-channel-introduction
          "ba1a85b31202a711d3e3ed2f4adca6743e0ecce2"
          (openpgp-fingerprint
           "DA15 A1FC 975E 5AA4 0B07 EF76 F1B4 CAD1 F94E E99A"))))
       %default-channels)

With the channel configured, it can be used as follows:

guix pull
guix search ghdl-clang
guix install -p $GUIX_ENVIRONMENT ghdl-clang

#Example workflow

Consider a PROJECT, and a local $PROJECT/_deps folder where to install all of its dependencies.

With …

hdl_profile () {
    [ ! -d "$PWD/_deps/guix-profile" ] && mkdir -p "$PWD/_deps"
    export GUIX_PROFILE="$PWD/_deps/guix-profile"
    [ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile"
    printf 'Current profile set to %s\n' "$GUIX_PROFILE"
}

… get to project

cd "$PROJECT"
hdl_profile

As an alternative, use direnv and a .direnv file

export GUIX_PROFILE="$(git rev-parse --show-toplevel)/_deps/guix-profile"
[ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile"
printf 'Current profile set to %s\n' "$GUIX_PROFILE"

Finally, install required dependencies

guix install -p $GUIX_PROFILE PACKAGES

Optionally, check installed and generations

guix package -p $GUIX_PROFILE --list-installed
guix package -p $GUIX_PROFILE --list-generations

#using OSVVM

Install, for example, with

guix install -p $GUIX_PROFILE osvvm-uart

Compile

guix install -p $GUIX_PROFILE \
     ghdl-clang \               # compiler
     osvvm-scripts           # necessary to compile the library

Use the following compile_osvvm.tcl under $PROJECT/_deps, for example, to compile osvvm libraries with ghdl

source ../_deps/guix-profile/share/osvvm/osvvm-scripts/StartGHDL.tcl
include ../_deps/guix-profile/share/osvvm/osvvm/osvvm.pro
include ../_deps/guix-profile/share/osvvm/osvvm-common/Common.pro
include ../_deps/guix-profile/share/osvvm/osvvm-uart/UART.pro

Then

cd _deps
tclsh compile_osvvm.tcl

A new VHDL_LIBS/GHDL-VERSION is created with compiled libraries. At this point, one may use these libraries with the following ghdl flag

-P$PROJECT/_depsc/VHDL_LIBS/GHDL-VERSION

#References

#Contributing

New packages, bug fixes and upgrades are more than welcomed. Feel free to contribute, but before submitting perform a minimun testing of your proposed changes upstream.

  • a single commit per package

  • check indentation, white spaces, etc., and more generally, avoid any innecesary modification in source code

  • debug and build the package definition you’re contributing to within a controlled environment with

    guix shell -DCPWN
    $ guix pack -L . style PACKAGE
    $ guix pack -L . lint PACKAGE
    $ guix pack -L . refresh --list-dependent PACKAGE
    $ guix pack -L . build --dependents PACKAGE
    $ guix pack -L . build rounds=4 PACKAGE
    

Once you’re happy with your contribution, proceed to send it upstream using any of the two available forges.

#codeberg

Follow habitual pull request standards.

#sourcehut

Send and email with your patch using git-send-email

git send-email -1 --annotate --to="~csantosb/patches@lists.sr.ht"

Don’t forget to set the subject to [ PATCH guix.channel-electronics ]: commit message.

#License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/gpl.html.

Do not follow this link