RapidWright系列-0.RapidWright环境搭建
花了好几天的时间才参照RapidWrightDoc把RapidWright环境搭建好,问题出在RapidWright所依赖的Java和Gradle版本较老,如果采用最新版本的工具会有问题。在此记录一下配置RapidWright的过程,并分享需要的文件。
本文目前使用的RapidWright版本为2019.2.1
安装Java&Gradle
官网上提到
Download and install Oracle JRE/JDK Java 1.8 or later
到现在为止,Java最信版本是14,在这里我们老老实实地选择Java8,建议手动安装
sudo tar -xvf jdk-8u241-linux-x64.tar.gz -C /opt
sudo unzip gradle-4.1-all.zip -d /opt
wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb && sudo dpkg -i /tmp/libpng12.deb && rm /tmp/libpng12.deb
然后添加环境变量
export JAVA_HOME=/opt/jdk-8u241-linux-x64/jdk1.8.0_241
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:/opt/gradle-4.1/bin
export CLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
配置Jython Kernel
- 安装Jupyter Lab
pip3 install jupyterlab
jupyter lab --generate-config
ipython
from notebook.auth import passwd
passwd()
输入密码并记录输出,修改~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha:f24102cef3c8:5cae0c86258955f8d6e33de51deb8c1b4afb8db0'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 5000
c.NotebookApp.allow_root = True
- 安装Jython
java -jar rapidwright-2019.2.1-standalone-lin64.jar --create_jupyter_kernel
jupyter kernelspec install <path_to_kernel_file_dir>
配置RapidWright
- 1.下载RapidWright
git clone https://github.com/Xilinx/RapidWright.git
- 2.从https://github.com/Xilinx/RapidWright/releases下载 rapidwright_data.zip and rapidwright_jars.zip并解压到RapidWright文件夹,解压后的RapidWright文件夹应如下:
├── CODING_STYLE.md
├── CONTRIBUTING.md
├── LICENSE.TXT
├── README.md
├── RELEASE_NOTES.TXT
├── bin
├── build.gradle
├── data
├── doc
├── gradle
├── gradlew
├── gradlew.bat
├── images
├── jars
├── ltx_templates
├── src
└── tcl
- 3.添加环境变量
export RAPIDWRIGHT_PATH=/mnt/d/2020/RapidWright/RapidWright
export CLASSPATH=:$RAPIDWRIGHT_PATH/bin:$(echo $RAPIDWRIGHT_PATH/jars/*.jar | tr ' ' ':')
注意,这里的CLASSPATH与RapidWrightDoc里提供的CLASSPATH不一样,前边多了一个:
- 4.编译工程
gradle build -p $RAPIDWRIGHT_PATH
- 5.验证工程是否成功编译
java com.xilinx.rapidwright.device.browser.DeviceBrowser
如果成功会出现如下界面