作者
太原市東楓電子科技有限公司 ,代理銷售 USRP,Nvidia,等產品與技術支持,培訓服務。
環境
Ubuntu 20.04
依賴包
sudo apt-get update
sudo apt-get install autoconf automake build-essential ccache cmake cpufrequtils doxygen ethtool \
g++ git inetutils-tools libboost-all-dev libncurses5 libncurses5-dev libusb-1.0-0 libusb-1.0-0-dev \
libusb-dev python3-dev python3-mako python3-numpy python3-requests python3-scipy python3-setuptools \
python3-ruamel.yaml
sudo apt-get -y install autoconf automake build-essential ccache cmake cpufrequtils doxygen ethtool fort77 g++ gir1.2-gtk-3.0 git gobject-introspection gpsd gpsd-clients inetutils-tools libasound2-dev libboost-all-dev libcomedi-dev libcppunit-dev libfftw3-bin libfftw3-dev libfftw3-doc libfontconfig1-dev libgmp-dev libgps-dev libgsl-dev liblog4cpp5-dev libncurses5 libncurses5-dev libpulse-dev libqt5opengl5-dev libqwt-qt5-dev libsdl1.2-dev libtool libudev-dev libusb-1.0-0 libusb-1.0-0-dev libusb-dev libxi-dev libxrender-dev libzmq3-dev libzmq5 ncurses-bin python3-cheetah python3-click python3-click-plugins python3-click-threading python3-dev python3-docutils python3-gi python3-gi-cairo python3-gps python3-lxml python3-mako python3-numpy python3-numpy-dbg python3-opengl python3-pyqt5 python3-requests python3-scipy python3-setuptools python3-six python3-sphinx python3-yaml python3-zmq python3-ruamel.yaml swig wget vim net-tools
pip3安裝
sudo apt install python3-pip
【錯誤】不要安裝的python包
pip3 install dash parse jsonschema
安裝 vivado 2021.1
sudo dpkg-reconfigure dash ##更改dash模式,選擇nosudo apt-get install libstdc++6
sudo apt-get install libncurses5
sudo apt-get install libtinfo5
sudo apt-get install opencl-headers
sudo apt-get install ocl-icd-libopencl1
sudo apt-get install ocl-icd-opencl-dev
安裝nas并掛載
sudo apt?update
sudo apt?install?nfs-common
sudo mount -t nfs 192.168.0.100:/volume2/Software ~/Music
拷貝安裝包到linux里面
解壓vivado安裝包之后,進入命令行,安裝vivado
sudo ./xsetup
安裝序列號
完成安裝。
安裝 vivado 補丁
拷貝補丁到patches下
sudo cp -r AR76780_Vivado_2021_1_preliminary_rev1 /opt/Xilinx/Vivado/2021.1/patches/
驗證ip核
安裝 UHD
git clone https://github.com/EttusResearch/uhd.git
cd uhd
切換版本
git checkout v4.8.0.0
cd host
mkdir build
cd build
cmake -DENABLE_TESTS=ON -DENABLE_C_API=ON -DENABLE_PYTHON_API=ON -DENABLE_MANUAL=ON ..
make -j$(nproc)
sudo make install
sudo ldconfig
安裝鏡像文件,驗證安裝
sudo /usr/local/lib/uhd/utils/uhd_images_downloader.py
//鏡像下載
sudo uhd_images_downloader
//查找設備
sudo uhd_find_devices
//查看設備信息
sudo uhd_usrp_probe
Python 庫索引
cd /usr/lib/python3/dist-packages
sudo vim uhd.pth
文件內容
/usr/local/lib/python3.8/site-packages/
/home/rfnoc/.local/lib/python3.8/site-packages/
保存該文件。
測試python3
python3
import uhd
如果沒有報錯,那么恭喜你搞定安裝了!
安裝 gnu radio
sudo add-apt-repository ppa:gnuradio/gnuradio-releases
sudo apt-get update
sudo apt-get install gnuradio python3-packaging
講解 rfnoc_image_builder 編譯工具
optional arguments:-h, --help show this help message and exit-y YAML_CONFIG, --yaml-config YAML_CONFIGPath to yml configuration file-r GRC_CONFIG, --grc-config GRC_CONFIGPath to grc file to generate config from-C BASE_DIR, --base-dir BASE_DIRPath to the base directory. Defaults to the current directory.-F FPGA_DIR, --fpga-dir FPGA_DIRPath to directory for the FPGA source tree. Defaults to the FPGA source tree of the current repo.-B BUILD_DIR, --build-dir BUILD_DIRPath to directory where the image core and and build artifacts will be generated. Defaults to "build-<image-core-name>"in the base directory.-O BUILD_OUTPUT_DIR, --build-output-dir BUILD_OUTPUT_DIRPath to directory for final FPGA build outputs. Defaults to "build" in the base directory.-E BUILD_IP_DIR, --build-ip-dir BUILD_IP_DIRPath to directory for IP build artifacts. Defaults to "build-ip" in the base directory.-o IMAGE_CORE_OUTPUT, --image-core-output IMAGE_CORE_OUTPUTDEPRECATED! This has been replaced by --build-dir.-x ROUTER_HEX_OUTPUT, --router-hex-output ROUTER_HEX_OUTPUTDEPRECATED! This option will be ignored.-I INCLUDE_DIR, --include-dir INCLUDE_DIRPath to directory of the RFNoC Out-of-Tree module-b GRC_BLOCKS, --grc-blocks GRC_BLOCKSPath to directory of GRC block descriptions (needed for --grc-config only)-l LOG_LEVEL, --log-level LOG_LEVELAdjust log level-R, --reuse Reuse existing files (do not regenerate image core).-G, --generate-only Just generate files without building the FPGA-W, --ignore-warningsRun build even when there are warnings in the build process-S SECURE_CORE, --secure-core SECURE_COREBuild a secure image core instead of a bitfile. This argument provides the name of the generated YAML.-K SECURE_KEY, --secure-key SECURE_KEYPath to encryption key file to use for secure core.-d DEVICE, --device DEVICEDevice to be programmed [x300, x310, e310, e320, n300, n310, n320, x410, x440]. Needs to be specified either here, orin the configuration file.-n IMAGE_CORE_NAME, --image-core-name IMAGE_CORE_NAME, --image_core_name IMAGE_CORE_NAMEName to use for the RFNoC image core. Defaults to name of the image core YML file, without the extension.-t TARGET, --target TARGETBuild target (e.g. X310_HG, N320_XG, ...). Needs to be specified either here, on the configuration file.-g, --GUI Open Vivado GUI during the FPGA building process-Y, --SYNTH Stop the FPGA build process after Synthesis--CHECK Run elaboration only to check HDL syntax-s, --save-project Save Vivado project to disk-P, --ip-only Build only the required IPs-j JOBS, --jobs JOBS Number of parallel jobs to use with make-c, --clean-all Cleans the IP before a new build-p VIVADO_PATH, --vivado-path VIVADO_PATHPath to the base install for Xilinx Vivado if not in default location (e.g., /tools/Xilinx/Vivado).-H, --no-hash Do not include source YAML hash in the generated source code.-D, --no-date Do not include date or time in the generated source code.--color {never,auto,always}Enable colorful output. When set to 'auto' will only show color output in TTY environments (e.g., interactive shells)
參數 | 說明 |
---|---|
-h , --help | 顯示幫助信息并退出 |
-y YAML_CONFIG , --yaml-config YAML_CONFIG | 指定 YAML 配置文件的路徑 |
-r GRC_CONFIG , --grc-config GRC_CONFIG | 指定 GRC 文件路徑(用于自動生成配置) |
-C BASE_DIR , --base-dir BASE_DIR | 設置基礎目錄路徑,默認使用當前目錄 |
-F FPGA_DIR , --fpga-dir FPGA_DIR | 設置 FPGA 源碼路徑,默認使用當前倉庫中的源碼目錄 |
-B BUILD_DIR , --build-dir BUILD_DIR | 設置構建目錄,鏡像核心和構建文件將保存在此處。默認是“base目錄下的 build-<鏡像名稱>” |
-O BUILD_OUTPUT_DIR , --build-output-dir BUILD_OUTPUT_DIR | 設置最終 bit 文件等輸出的路徑,默認是“base目錄下的 build” |
-E BUILD_IP_DIR , --build-ip-dir BUILD_IP_DIR | 指定 IP 構建中間文件的保存路徑,默認是“base目錄下的 build-ip” |
-o IMAGE_CORE_OUTPUT | 已廢棄!已被 --build-dir 替代 |
-x ROUTER_HEX_OUTPUT | 已廢棄!此選項將被忽略 |
-I INCLUDE_DIR , --include-dir INCLUDE_DIR | 指定 RFNoC 自定義模塊的頭文件路徑(Out-of-Tree Module) |
-b GRC_BLOCKS , --grc-blocks GRC_BLOCKS | GRC 模塊描述路徑(僅當使用 --grc-config 時需要) |
-l LOG_LEVEL , --log-level LOG_LEVEL | 設置日志輸出等級(如 DEBUG、INFO 等) |
-R , --reuse | 重用已有文件,不重新生成 image core |
-G , --generate-only | 只生成中間文件,不構建 FPGA(不調用 Vivado) |
-W , --ignore-warnings | 即使出現警告也繼續構建 |
-S SECURE_CORE , --secure-core SECURE_CORE | 構建“安全核心”鏡像(而非普通 bit 文件),此參數為 YAML 輸出名稱 |
-K SECURE_KEY , --secure-key SECURE_KEY | 指定加密所用的密鑰文件路徑 |
-d DEVICE , --device DEVICE | 指定目標設備:[x300, x310, e310, e320, n300, n310, n320, x410, x440],必須在命令或配置文件中指定 |
-n IMAGE_CORE_NAME , --image-core-name | RFNoC 鏡像的名稱,默認使用 YAML 文件名(去除擴展名) |
-t TARGET , --target TARGET | 構建目標(如 X310_HG, N320_XG 等),必須指定(命令或 YAML 文件中) |
-g , --GUI | 構建過程中打開 Vivado GUI |
-Y , --SYNTH | 在綜合(Synthesis)后中止 FPGA 構建流程 |
--CHECK | 僅執行 elaboration(結構展開)檢查 HDL 語法,不生成 bit 文件 |
-s , --save-project | 保存 Vivado 項目到磁盤(用于后續手動打開) |
-P , --ip-only | 只構建所需的 IP 核,不生成完整工程 |
-j JOBS , --jobs JOBS | 設置并行構建使用的線程數 |
-c , --clean-all | 清理 IP 構建緩存,重新構建 |
-p VIVADO_PATH , --vivado-path VIVADO_PATH | 指定 Vivado 安裝路徑(如 /tools/Xilinx/Vivado/2021.1 ) |
-H , --no-hash | 不在生成代碼中包含 YAML 配置的 hash 值 |
-D , --no-date | 不在生成代碼中包含時間戳 |
--color {never,auto,always} | 控制終端輸出是否使用顏色:auto 表示僅在交互終端中啟用顏色 |
編譯 e310鏡像
cd ~/Documents/uhd/fpga/usrp3/top/e31x
source ./setupenv.sh
make E310_SG1_IP
編譯庫文件
編譯鏡像
rfnoc_image_builder -y e310_rfnoc_image_core.yml -t E310_SG1 -j$(nproc)
編譯e320鏡像
編譯 x310鏡像
預編譯
cd ~/Documents/uhd/fpga/usrp3/top/x300
source ./setupenv.sh
make -j$(nproc) X310_IP
編譯
在這里插入代碼片