User:Penguin/Installing Microchip FPGA Tools

From Gentoo Wiki
Jump to:navigation Jump to:search
Important
This page is still a major work in progress. There are missing steps.

TODO Installing via Portage

Installing Manually

Prerequisites

root #emerge -a sys-apps/lsb-release

Download Libero

Download the latest version from here.

user $mkdir -p ~/Documents/MicrochipInstallers
user $cd ~/Documents/MicrochipInstallers
user $mv ~/Downloads/libero_soc_*.*_web_lin.zip .
user $unzip libero_soc_*.*_web_lin.zip

Download SoftConsole

Download the latest version from here.

user $mkdir -p ~/Documents/MicrochipInstallers
user $cd ~/Documents/MicrochipInstallers
user $mv ~/Downloads/Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run .

Install

Setup

user $export INSTALL_DIR=/opt/microchip
root #mkdir -p $INSTALL_DIR
root #chown $USER:$USER $INSTALL_DIR

Install Libero

Installer Directions:

  • Install Directory: $INSTALL_DIR/Libero_SoC_<version_major>.<version_minor>
  • Common Directory: $INSTALL_DIR/common
  • Install Set: Everything
user $cd ~/Documents/MicrochipInstallers
user $./Libero_SoC_*.*_Web.bin

Gentoo Specific Libero Fixes

When attempting to run /opt/microchip/Libero_SoC_v2024.1/Libero/bin64/libero, you will most likely be met with the following error:

user $/opt/microchip/Libero_SoC_v2024.1/Libero/bin64/libero
Warning: You are running a version of Suse Linux that is not supported.
Please refer to Libero SoC Release Note for the detail of supported operating systems.
/opt/microchip/Libero_SoC_v2024.1/Libero/bin64/libero_bin: /opt/microchip/Libero_SoC_v2024.1/Libero/lib64/rhel/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib64/libicuuc.so.74) 

The way I chose to combat this was to delete all of the libstdc++.so.6 files that came with the tools and then supplying the system’s provides files via $LD_LIBRARY_PATH. I’ve also chosen to do this with git commits so you don’t have to start all over if you mess up. The git parts are optional but recommended. (Thanks to sam for helping me figure this out)

user $cd /opt/microchip/Libero_SoC_*.*
user $git init
user $git add .
user $git commit -m "init"
user $find . -name "libstdc++.so.6" -type f -or -type l -delete
user $git add .
user $git commit -m "removed tool specific libstdc++.so.6 files"
user $# test it to make sure it launches
user $LD_LIBRARY_PATH="/usr/lib/gcc/x86_64-pc-linux-gnu/13" ./Libero/bin64/libero


This should launch and then give you an error saying license not found. This is normal and will be fixed later in the guide.

Install SoftConsole

user $cd ~/Documents/MicrochipInstallers
user $./Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run

Post-Install

root #$INSTALL_DIR/Libero_SoC_*.*/Logs/req_to_install.sh

Installing FlashPro Drivers

You need to have the FlashPro device to install these, so ignore this if you don’t have a FlashPro device.

FlashPro 5

root #$INSTALL_DIR/Libero_SoC_v2023.1/Libero/bin/udev_install

FlashPro 6

root #$INSTALL_DIR/Libero_SoC_v2023.1/Libero/bin/fp6_env_install

Installing Your License

You can register for a microchip and request a year-long evaluation license here: https://www.microchipdirect.com/login?redirectTo=%2Ffpga-software-products

You’ll want to get the LIB-PL-MACID-F-EVAL license, which is a floating linux license.

user $mkdir -p $INSTALL_DIR/Libero_SoC_v2023.1/license
user $cp /path/to/license /opt/microchip/Libero_SoC_v2023/license

Installing the Licensing Daemon

root #cp scripts/libero-license.service /etc/systemd/user

Install Yocto Ecosystem

Prerequisites

root #emerge -av gawk wget dev-vcs/git diffstat unzip sys-apps/texinfo chrpath socat libsdl xterm bmap-tools repo

Create the Yocto Workspace

user $mkdir yocto-dev && cd yocto-dev

Update the repo workspace

user $repo sync
user $repo rebase

Setup the Bitbake environment

user $. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh

Optimize your build environment

Yocto builds take a very long time. We can optimize this.

user $mkdir -p "$HOME/.local/share/yocto/downloads"
user $mkdir -p "$HOME/.local/share/yocto/sstate-cache"
user $mkdir -p "$HOME/.local/share/yocto/persistent"
user $cd <project_root>/build/conf


Append the following to =<project_root>/build/conf/local.conf= to disable static dependencies and set up non-temporary directories for your yocto build artifacts to live.

FILE local.conf
BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count() - 1}"
DL_DIR = "${HOME}/.local/share/yocto/downloads"
SSTATE_DIR = ${HOME}/.local/share/yocto/sstate-cache"
PERSISTENT_DIR="${HOME}/.local/share/yocto/persistent"
SOURCE_MIRROR_URL ?= "file://${HOME}/.local/share/yocto/downloads"
INHERIT += "own-mirrors"
BB_GENERATE_MIRROR_TARBALLS = "1"
# uncomment to test sources
# BB_NO_NETWORK = "1"

# remove static deps
STATICLIBCONF = "--disable-static"
DISABLE_STATIC:pn-openssl = ""
DISABLE_STATIC:pn-openssl-native = ""
DISABLE_STATIC:pn-nativesdk-openssl = ""
DISABLE_STATIC:pn-libtalloc = ""
EXTRA_OECONF += "${STATICLIBCONF}"

Build the Disk Image

user $cd $PROOT
user $bitbake mpfs-dev-cli

Creating a Bootable Yocto Linux Image

We have two options: Create a new workspace, or we can use this repo as a workspace because this repo is my working workspace.

Create a workspace (OPTIONAL)

user $mkdir yocto-dev && cd yocto-dev

Update the repo workspace

user $repo sync
user $repo rebase

Set up the Bitbake environment

user $. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh

Building Board Disk Image

Building a Linux Image with a root file system (RootFS)

user $MACHINE=icicle-kit-es bitbake mpfs-dev-cli

Building a RAM-based Root Filestystem

user $MACHINE=icicle-kit-es bitbake -R conf/initramfs.conf mpfs-initramfs-image

Building a Linux Image for an external QSPI flash memory

Flashing an SD Card

user $zcat build/tmp-glibc/deploy/images/icicle-kit-es/mpfs-dev-cli-icicle-kit-es.wic.gz | sudo dd of=/dev/sdX bs=4096 iflag=fullblock oflag=direct conv=fsync status=progress

References

PolarFire Yocto Github