update readme

unstable
penguin 9 months ago
parent 1065c778e5
commit 7902c75be5

@ -1,38 +1,111 @@
---
author: Penguin
date: 06/19/23
title: PolarFire SoC FPGA
title: Installing Microchip FPGA Tools
---
# About the Board
# <span class="todo TODO">TODO</span> Installing via Portage
<img src="./doc/img/PolarFire-Board.png"
style="width:50.0%;height:50.0%" />
# Installing Manually
# Installing Libero (via portage)
## Prerequisites
# Installing Libero (MANUAL)
``` bash
sudo emerge -a sys-apps/lsb-release
```
## Prerequisites
### Download Libero
## Installation Process
Download the latest version from
[here](https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/fpga/libero-software-later-versions).
``` bash
sudo mkdir -p /opt/Microchip
sudo chown $USER:$USER /opt/Microchip
unzip
mkdir -p ~/Documents/MicrochipInstallers
cd ~/Documents/MicrochipInstallers
mv ~/Downloads/libero_soc_*.*_web_lin.zip .
unzip libero_soc_*.*_web_lin.zip
```
### Download SoftConsole
Download the latest version from
[here](https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/soc-fpga/softconsole).
``` bash
mkdir -p ~/Documents/MicrochipInstallers
cd ~/Documents/MicrochipInstallers
mv ~/Downloads/Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run .
```
## Install
### Setup
``` bash
export INSTALL_DIR=/opt/microchip
sudo mkdir -p $INSTALL_DIR
sudo chown $USER:$USER $INSTALL_DIR
```
### Install Libero
Installer Directions:
- Install Directory: /opt/Microchip/Libero_SoC_v2023.1
- Common Directory: /opt/Microchip/common
- Install Directory:
$INSTALL_DIR/Libero_SoC\_\<version_major\>.\<version_minor\>
- Common Directory: $INSTALL_DIR/common
- Install Set: Everything
``` bash
cd ~/Documents/MicrochipInstallers
./Libero_SoC_*.*_Web.bin
```
1. 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:
``` example
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)
``` bash
cd /opt/microchip/Libero_SoC_*.*
git init
git add .
git commit -m "init"
find . -name "libstdc++.so.6" -type f -or -type l -delete
git add .
git commit -m "removed tool specific libstdc++.so.6 files"
# test it to make sure it launches
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
``` bash
cd ~/Documents/MicrochipInstallers
./Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run
```
## Post-Install
``` bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Logs/req_to_install.sh
sudo $INSTALL_DIR/Libero_SoC_*.*/Logs/req_to_install.sh
```
### Installing FlashPro Drivers
@ -43,35 +116,32 @@ you don't have a FlashPro device.
1. FlashPro 5
``` bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Libero/bin/udev_install
sudo $INSTALL_DIR/Libero_SoC_v2023.1/Libero/bin/udev_install
```
2. FlashPro 6
``` bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Libero/bin/fp6_env_install
sudo $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
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. If you're on windows, just get whatever license
works for you.
floating linux license.
``` bash
mkdir -p /opt/Microchip/Libero_SoC_v2023.1/license
cp /path/to/license /opt/Microchip/Libero_SoC_v2023/license
mkdir -p $INSTALL_DIR/Libero_SoC_v2023.1/license
cp /path/to/license /opt/microchip/Libero_SoC_v2023/license
```
### Installing the Licensing Daemon
``` bash
# install lsb-core
sudo apt install lsb-core
sudo cp scripts/libero-license.service /etc/systemd/user
```
@ -80,8 +150,11 @@ sudo cp scripts/libero-license.service /etc/systemd/user
## Prerequisites
``` bash
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev xterm bmap-utils python3-distutils repo
sudo emerge -pv gawk wget dev-vcs/git diffstat unzip sys-apps/texinfo chrpath socat libsdl xterm bmap-tools repo
```
``` bash
sudo emerge -a
```
## Create the Yocto Workspace
@ -144,11 +217,6 @@ cd $PROOT
bitbake mpfs-dev-cli
```
# References
[PolarFire Yocto
Github](https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp)
# Creating a Bootable Yocto Linux Image
We have two options: Create a new workspace, or we can use this repo as
@ -196,7 +264,5 @@ zcat build/tmp-glibc/deploy/images/icicle-kit-es/mpfs-dev-cli-icicle-kit-es.wic.
# References
[PolarFire SoC
Yocto](https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp)
**\*\***
[PolarFire Yocto
Github](https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp)

@ -0,0 +1,169 @@
= TODO Installing via Portage =
= Installing Manually =
== Prerequisites ==
sudo emerge -a sys-apps/lsb-release app-crypt/mit-krb5
=== Download Libero ===
Download the latest version from [https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/fpga/libero-software-later-versions here].
mkdir -p ~/Documents/MicrochipInstallers
cd ~/Documents/MicrochipInstallers
mv ~/Downloads/libero_soc_*.*_web_lin.zip .
unzip libero_soc_*.*_web_lin.zip
=== Download SoftConsole ===
Download the latest version from [https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/soc-fpga/softconsole here].
mkdir -p ~/Documents/MicrochipInstallers
cd ~/Documents/MicrochipInstallers
mv ~/Downloads/Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run .
{{RootCmd|a command}}
== Install ==
=== Setup ===
export INSTALL_DIR=/opt/microchip
sudo mkdir -p $INSTALL_DIR
sudo 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
cd ~/Documents/MicrochipInstallers
./Libero_SoC_*.*_Web.bin
==== Gentoo Specific Libero Fixes ====
When attempting to run <tt>/opt/microchip/Libero_SoC_v2024.1/Libero/bin64/libero</tt>, you will most likely be met with the following error:
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 <tt>libstdc++.so.6</tt> files that came with the tools and then supplying the system&rsquo;s provides files via $LD\_LIBRARY\_PATH. I&rsquo;ve also chosen to do this with git commits so you don&rsquo;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)
cd /opt/microchip/Libero_SoC_*.*
git init
git add .
git commit -m "init"
find . -name "libstdc++.so.6" -type f -or -type l -delete
git add .
git commit -m "removed tool specific libstdc++.so.6 files"
# test it to make sure it launches
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 ===
cd ~/Documents/MicrochipInstallers
./Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run
== Post-Install ==
sudo $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&rsquo;t have a FlashPro device.
==== FlashPro 5 ====
sudo $INSTALL_DIR/Libero_SoC_v2023.1/Libero/bin/udev_install
==== FlashPro 6 ====
sudo $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&rsquo;ll want to get the '''LIB-PL-MACID-F-EVAL''' license, which is a floating linux license.
mkdir -p $INSTALL_DIR/Libero_SoC_v2023.1/license
cp /path/to/license /opt/microchip/Libero_SoC_v2023/license
=== Installing the Licensing Daemon ===
sudo cp scripts/libero-license.service /etc/systemd/user
= Install Yocto Ecosystem =
== Prerequisites ==
sudo emerge -pv gawk wget dev-vcs/git diffstat unzip sys-apps/texinfo chrpath socat libsdl xterm bmap-tools repo
sudo emerge -a
== Create the Yocto Workspace ==
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
== Update the repo workspace ==
repo sync
repo rebase
== Setup the Bitbake environment ==
. ./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.
mkdir -p ${HOME}/.local/share/yocto/downloads
mkdir -p ${HOME}/.local/share/yocto/sstate-cache
mkdir -p ${HOME}/.local/share/yocto/persistent
cd <project_root>/build/conf/
echo '
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}"
' >> local.conf
== Build the Disk Image ==
cd $PROOT
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) ==
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
== Update the repo workspace ==
repo sync
repo rebase
== Set up the Bitbake environment ==
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
== Building Board Disk Image ==
=== Building a Linux Image with a root file system (RootFS) ===
MACHINE=icicle-kit-es bitbake mpfs-dev-cli
=== Building a RAM-based Root Filestystem ===
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 ===
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 =
==== [https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp PolarFire Yocto Github] ====

@ -1,93 +1,153 @@
#+title: PolarFire SoC FPGA
#+title: Installing Microchip FPGA Tools
#+author: Penguin
#+date: 06/19/23
#+OPTIONS: ^:nil
* About the Board
# * About the Board
#+attr_html: :width 50%
#+attr_html: :height 50%
[[./doc/img/PolarFire-Board.png]]
# #+attr_html: :width 50%
# #+attr_html: :height 50%
# [[./doc/img/PolarFire-Board.png]]
* Installing Libero (via portage)
* Installing Libero (MANUAL)
* TODO Installing via Portage
* Installing Manually
** Prerequisites
#+begin_src bash :noeval
sudo emerge -a sys-apps/lsb-release
#+end_src
*** Download Libero
Download the latest version from [[https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/fpga/libero-software-later-versions][here]].
#+begin_src bash :noeval
mkdir -p ~/Documents/MicrochipInstallers
cd ~/Documents/MicrochipInstallers
mv ~/Downloads/libero_soc_*.*_web_lin.zip .
unzip libero_soc_*.*_web_lin.zip
#+end_src
*** Download SoftConsole
Download the latest version from [[https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/soc-fpga/softconsole][here]].
#+begin_src bash :noeval
mkdir -p ~/Documents/MicrochipInstallers
cd ~/Documents/MicrochipInstallers
mv ~/Downloads/Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run .
#+end_src
** Installation Process
#+begin_src bash
sudo mkdir -p /opt/Microchip
sudo chown $USER:$USER /opt/Microchip
unzip
** Install
*** Setup
#+begin_src bash :noeval
export INSTALL_DIR=/opt/microchip
sudo mkdir -p $INSTALL_DIR
sudo chown $USER:$USER $INSTALL_DIR
#+end_src
*** Install Libero
Installer Directions:
- Install Directory: /opt/Microchip/Libero_SoC_v2023.1
- Common Directory: /opt/Microchip/common
- Install Directory: $INSTALL_DIR/Libero_SoC_<version_major>.<version_minor>
- Common Directory: $INSTALL_DIR/common
- Install Set: Everything
#+begin_src bash :noeval
cd ~/Documents/MicrochipInstallers
./Libero_SoC_*.*_Web.bin
#+end_src
**** 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:
#+begin_example
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)
#+end_example
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)
#+begin_src bash :noeval
cd /opt/microchip/Libero_SoC_*.*
git init
git add .
git commit -m "init"
find . -name "libstdc++.so.6" -type f -or -type l -delete
git add .
git commit -m "removed tool specific libstdc++.so.6 files"
# test it to make sure it launches
LD_LIBRARY_PATH="/usr/lib/gcc/x86_64-pc-linux-gnu/13" ./Libero/bin64/libero
#+end_src
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
#+begin_src bash :noeval
cd ~/Documents/MicrochipInstallers
./Microchip-SoftConsole-*.*-RISC-V-*-linux-x64-installer.run
#+end_src
** Post-Install
#+begin_src bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Logs/req_to_install.sh
#+begin_src bash :noeval
sudo $INSTALL_DIR/Libero_SoC_*.*/Logs/req_to_install.sh
#+end_src
*** 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
#+begin_src bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Libero/bin/udev_install
#+begin_src bash :noeval
sudo $INSTALL_DIR/Libero_SoC_v2023.1/Libero/bin/udev_install
#+end_src
**** FlashPro 6
#+begin_src bash
sudo /opt/Microchip/Libero_SoC_v2023.1/Libero/bin/fp6_env_install
#+begin_src bash :noeval
sudo $INSTALL_DIR/Libero_SoC_v2023.1/Libero/bin/fp6_env_install
#+end_src
*** 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 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. If you're on windows, just get whatever license works for you.
You'll want to get the *LIB-PL-MACID-F-EVAL* license, which is a floating linux license.
#+begin_src bash
mkdir -p /opt/Microchip/Libero_SoC_v2023.1/license
cp /path/to/license /opt/Microchip/Libero_SoC_v2023/license
#+begin_src bash :noeval
mkdir -p $INSTALL_DIR/Libero_SoC_v2023.1/license
cp /path/to/license /opt/microchip/Libero_SoC_v2023/license
#+end_src
*** Installing the Licensing Daemon
# TODO: Replace these ubuntu instructions with gentoo instructions
#+begin_src bash
# install lsb-core
sudo apt install lsb-core
#+begin_src bash :noeval
sudo cp scripts/libero-license.service /etc/systemd/user
#+end_src
* Install Yocto Ecosystem
** Prerequisites
#+begin_src bash
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev xterm bmap-utils python3-distutils repo
#+begin_src bash :noeval
sudo emerge -pv gawk wget dev-vcs/git diffstat unzip sys-apps/texinfo chrpath socat libsdl xterm bmap-tools repo
#+end_src
#+begin_src bash :noeval
sudo emerge -a
#+end_src
** Create the Yocto Workspace
#+begin_src bash
#+begin_src bash :noeval
mkdir yocto-dev && cd yocto-dev
repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git -b main -m default.xml
#+end_src
** Update the repo workspace
#+begin_src bash
#+begin_src bash :noeval
repo sync
repo rebase
#+end_src
** Setup the Bitbake environment
#+begin_src bash
#+begin_src bash :noeval
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
#+end_src
** Optimize your build environment
Yocto builds take a very long time. We can optimize this.
#+begin_src bash
#+begin_src bash :noeval
mkdir -p ${HOME}/.local/share/yocto/downloads
mkdir -p ${HOME}/.local/share/yocto/sstate-cache
mkdir -p ${HOME}/.local/share/yocto/persistent
@ -117,7 +177,7 @@ EXTRA_OECONF += "${STATICLIBCONF}"
#+end_src
** Build the Disk Image
#+begin_src bash
#+begin_src bash :noeval
cd $PROOT
bitbake mpfs-dev-cli
#+end_src
@ -125,8 +185,6 @@ bitbake mpfs-dev-cli
* References
**** [[https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp][PolarFire Yocto Github]]
* 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.
@ -137,35 +195,33 @@ repo init -u https://github.com/polarfire-soc/polarfire-soc-yocto-manifests.git
#+end_src
** Update the repo workspace
#+begin_src bash
#+begin_src bash :noeval
repo sync
repo rebase
#+end_src
** Set up the Bitbake environment
#+begin_src bash
#+begin_src bash :noeval
. ./meta-polarfire-soc-yocto-bsp/polarfire-soc_yocto_setup.sh
#+end_src
** Building Board Disk Image
*** Building a Linux Image with a root file system (RootFS)
#+begin_src bash
#+begin_src bash :noeval
MACHINE=icicle-kit-es bitbake mpfs-dev-cli
#+end_src
*** Building a RAM-based Root Filestystem
#+begin_src bash
#+begin_src bash :noeval
MACHINE=icicle-kit-es bitbake -R conf/initramfs.conf mpfs-initramfs-image
#+end_src
*** Building a Linux Image for an external QSPI flash memory
*** Flashing an SD Card
#+begin_src bash
#+begin_src bash :noeval
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
#+end_src
* References
**** [[https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp][PolarFire SoC Yocto]]
****
**** [[https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp][PolarFire Yocto Github]]

Loading…
Cancel
Save