Google ColaboratoryでいつでもどこでもFPGA開発(Vivado2019.1編)
これまで、Google ColaboratoryでVivadoを実行する方法をいくつか紹介してきました。 Vivado 2019.1からはWebインストーラがコマンドラインに対応しました。 これにより、いままで必要だったGoogle Drive等への巨大なインストールファイル保存が不要になります。 (Google Driveへの保存はWebインストーラの100MB程度になります)
手順
1. Google Driveのマウント
from google.colab import drive drive.mount('/content/drive')
2. インストーラのコピー
例ではGoogle Driveの Xilinx/Xilinx_Vivado_SDK_Web_2019.1_0524_1430_Lin64.bin
にインストーラを置いています。
!cp "/content/drive/My Drive/Xilinx/Xilinx_Vivado_SDK_Web_2019.1_0524_1430_Lin64.bin" .
!chmod a+x Xilinx_Vivado_SDK_Web_2019.1_0524_1430_Lin64.bin
3. インストーラの展開
カレントディレクトリに vivado
というディレクトリを作成して、インストーラ本体の展開をします。
!./Xilinx_Vivado_SDK_Web_2019.1_0524_1430_Lin64.bin --noexec --target vivado %cd vivado
4. トークンの生成
実行するとIDとパスワードを聞かれるので入力します。トークンは有効期限は1週間のようです。
!./xsetup -b AuthTokenGen
5. コンフィグファイルの生成
途中でエディションを聞かれるので「1」のWebPACKを選択します。
!./xsetup -b ConfigGen
6. コンフィグファイルの修正
!cat /root/.Xilinx/install_config.txt
表示内容を確認して、修正が必要であれば修正します。私の場合はいらないデバイスはインストールしない設定にしています。
%%writefile install_config.txt #### Vivado HL WebPACK Install Configuration #### Edition=Vivado HL WebPACK # Path where Xilinx software will be installed. Destination=/tools/Xilinx # Choose the Products/Devices the you would like to install. Modules=DocNav:0,Kintex UltraScale:0,Spartan-7:0,Artix-7:0,Model Composer:0,ARM Cortex-A53:0,Zynq UltraScale+ MPSoC:0,Zynq-7000:1,SDK Core Tools:1,ARM Cortex-A9:1,ARM Cortex R5:0,System Generator for DSP:0,Kintex-7:0,Kintex UltraScale+:0,MicroBlaze:1 # Choose the post install scripts you'd like to run as part of the finalization step. Please note that some of these scripts may require user interaction during runtime. InstallOptions=Enable WebTalk for SDK to send usage statistics to Xilinx:1 ## Shortcuts and File associations ## # Choose whether Start menu/Application menu shortcuts will be created or not. CreateProgramGroupShortcuts=0 # Choose the name of the Start menu/Application menu shortcut. This setting will be ignored if you choose NOT to create shortcuts. ProgramGroupFolder=Xilinx Design Tools # Choose whether shortcuts will be created for All users or just the Current user. Shortcuts can be created for all users only if you run the installer as administrator. CreateShortcutsForAllUsers=0 # Choose whether shortcuts will be created on the desktop or not. CreateDesktopShortcuts=0 # Choose whether file associations will be created or not. CreateFileAssociation=0 # Choose whether disk usage will be optimized (reduced) after installation EnableDiskUsageOptimization=1
7. インストール
!./xsetup -a XilinxEULA,3rdPartyEULA,WebTalkTerms -b Install -c install_config.txt
あとは待つだけ
8. 動作確認
!source /tools/Xilinx/Vivado/2019.1/settings64.sh && vivado -mode tcl
まとめ
これまで、Google Driveの容量が足りず課金していたのをやめられます。 しかし、ダウンロードの時間がちょっと長いなぁ。インストールを含めると1時間掛かってしまった。 ログを確認するとダウンロードに36分。
INFO : Downloaded successfully 262 archives representing 7.6 GiB in 36 min, 36 sec