3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

WSL2 + Ubuntu 20.04 LTS環境にVivadoをインストール

Posted at

https://qazsedcftf.blogspot.com/2020/08/windows-wsl-vivado.html
を参考に試してみました。

必要なファイルのダウンロード

https://japan.xilinx.com/support/download.html
上記のページからVivado Design Suite-HLx Editionの
「Linux用自己解凍型ウェブインストーラー」をダウンロードします。
ダウンロードしたBINファイルは、${HOME}/downloadの下に置くことにします。

※ダウンロードするためにはXilinxのアカウント登録が必要になります。

GUIの設定

https://astherier.com/blog/2020/08/run-gui-apps-on-wsl2
を参考にWSL2 + Ubuntu 20.04上でGUIが起動するように準備します。

Windows側の設定

まず、Windows上にXサーバ(VcXsrv)をインストールします。
インストールが終わったらXLaunchを開き、起動オプションを以下のように設定します。

  • Display Numberに「-1(自動)」
  • Additional parameters for VcXsrvに「-ac -nowgl」

※各種パラメータの意味は、
 https://sourceforge.net/p/vcxsrv/wiki/Home/ に記載があります。

次に、Windowsのスタートアップに上記設定ファイルを登録しておきます。
Save ConfigurationボタンでVcXsrvの設定ファイル(config.xlaunch)を生成し、
Win+Rで「shell:startup」と打つと開くフォルダに設定ファイルを保存します。

また、Windowsのファイアウォールの設定で、
「VcXsrv windows xserver」のパブリックアクセスを許可しておきます。

WSL2側の設定

WSL2側(Xクライアント)からWindows(Xサーバー)のIPアドレスやディスプレイ番号を指定する必要があります。
これらは、DISPLAYという環境変数に.bashrc等で設定しておきます。

.bashrc
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0

インストール

以下の手順でインストールを行います。


# インストーラの抽出
./Xilinx_Unified_2020.1_0602_1208_Lin64.bin --noexec --target installer

# 認証トークンの生成
# 途中でUser ID(Xilinxアカウントのメールアドレス)とパスワードの入力が必要
./installer/xsetup -b AuthTokenGen

# 設定ファイルの生成
# Select a Product from the listでVivado (2) を選択
# Select an Edition from the listでWebPACK (1) を選択
./installer/xsetup -b ConfigGen

# インストール
sudo ./installer/xsetup --agree XilinxEULA,3rdPartyEULA,WebTalkTerms --batch Install --config ${HOME}/.Xilinx/install_config.txt

expectコマンドを利用して、上記の手順を自動で実行するスクリプトを作成しました。
第1引数の「user id」にはXilinxアカウントのメールアドレスを、
第2引数の「password」にはXilinxアカウントのパスワードを設定します。

※デフォルトでは/xools/Xilinx以下にVivadoのインストールを行うため、
 sudo権限での実行が必要になります。

${HOME}/download/install.sh
#!/bin/bash

if [ $# -ne 2 ]; then
    echo "usage: installer.sh <user id> <password>"
    exit 1
fi

USER=${1}
PASS=${2}

./Xilinx_Unified_2020.1_0602_1208_Lin64.bin --noexec --target installer

expect -c "
set timeout 60
spawn ./installer/xsetup -b AuthTokenGen
expect \"User ID:\"
send \"${USER}\n\"
expect \"Password:\"
send \"${PASS}\n\"
expect eof
"

expect -c "
set timeout 60
spawn ./installer/xsetup -b ConfigGen
expect \"Please choose:\"
send \"2\n\"
expect \"Please choose:\"
send \"1\n\"
expect eof
"

./installer/xsetup --agree XilinxEULA,3rdPartyEULA,WebTalkTerms --batch Install --config ${HOME}/.Xilinx/install_config.txt

実行

以下の手順でVivadoのGUIが起動することを確認します。

source /tools/Xilinx/Vivado/2020.1/settings64.sh
vivado
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?