登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
1
Star
0
Fork
0
RV少年 (RV4Kids)
/
fpga-zynq
代码
Issues
3
Pull Requests
0
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
Rocket chip on Zedboard
待办的
#I4P0GI
袁德俊
拥有者
创建于
2022-01-03 00:54
http://venividiwiki.ee.virginia.edu/mediawiki/index.php/Rocket_chip_on_Zedboard  ## FPGA Lab Project - Rocket Chip on Zedboard ## Objective The goal of this project is to implement the RISC-V Rocket Chip on the Zynq-based ZedBoard and run applications on it. This project is based on a project from UC Berkeley Architecture Research: Rocket Chip on Zynq FPGAs ## Introduction ### RISC-V RISC-V is an open instruction set architecture (ISA) based on the reduced instruction set computing (RISC). RISC architectures are characterized by a small set of simple and general instructions. This is contrasted by complex instruction set computing (CISC), which have a large set of complex and specialized instructions. The project began in 2010 at the University of California, Berkeley. You can find more information about the project and the ISA at the [RISK-V Foundation Website](https://riscv.org/) ### The Rocket Chip Generator Rocket Chip is an open-source Sysem-on-Chip (SoC) design generator that emits synthesizable RTL. It uses the Chisel hardware construction language to compose a library of sophisticated generators for cores, caches, and interconnects into an integrated SoC. It generates general-purpose processor cores that use the open RISC-V ISA, and provides both an in-order core generator (Rocket) and an out-of-order core generator (BOOM). The technical details are on the Berkely EECS page: [The Rocket Chip Generator Technical Report](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-17.html) The project is hosted on GitHub: [Rocket Chip Generator Repository](https://github.com/freechipsproject/rocket-chip) The figure below shows an instance of an SoC generated by the Rocket Chip Generator.  ## Project Overview We will implement Rocket Chip on the FPGA and run applications on it. The rough top-down stack is shown below: - **Target Application** This is a binary application compiled with either [riscv-gcc](https://github.com/riscv/riscv-gcc) or [riscv-llvm](https://github.com/riscv/riscv-llvm). - **RISC-V Kernel** Can run the proxy kernel [proxy kernel](https://github.com/riscv/riscv-pk) designed to run single binary applications. Can alternatively run the lightweight [RISC-V Linux](https://github.com/riscv/riscv-linux). - **Rocket Chip** [Rocket Core](https://github.com/freechipsproject/rocket-chip) instantiated on FPGA. It communicates to the host ARM on the Zynq via AXI. - **Front-end Server** [RISC-V Front-end Server](https://github.com/riscv/riscv-fesvr) which runs on the host ARM core and interfaces to the Rocket Chip. - **Zynq ARM Core** Process on the Zynq SoC that runs Linux. - **Development Board** [ZedBoard](http://www.zedboard.org/product/zedboard) Development board with the Zynq SoC. SD Card used to configure the FPGA. - **External Communication** Communication between PC and FPGA board over Ethernet. - **User Interface** SSH Client terminal on PC. ## Step 1: Project Setup ### Download the files needed We will use fpga-zynq repository from UCB. Run the command below in the terminal to download the repository: ``` git clone https://github.com/ucb-bar/fpga-zynq ``` Since fpga-zynq uses files from other repositories such as rocket-chip, we will also need to download those files as well. Run this command to get all the files needed for fpga-zynq: ``` cd fpga-zynq git submodule update --init --recursive ``` ### Project setup First go to fpga-zynq directory and run this command to generate a vivado project for Zedboard: ``` cd fpga-zynq/zedboard make project ``` Then open this project: ``` make vivado ``` If you want to go back to the project later, the project file is located here: ``` cd fpga-zynq/zedboard/zedboard_rocketchip_ZynqSmallConfig vivado zedboard_rocketchip_ZynqSmallConfig.xpr ``` If you create the project successfully, then open the block diagram from the left. You should see something like this:  ## Step 2: Generate the files for zedboard ### Bitstream First generate the bitstream in Vivado. You should see the device diagram and project summary.   ### FSBL(first stage boot loader) Then export the hardware from select File -> Export -> Export Hardware and launch SDK. In SDK, select File -> New -> Application Project. In the new window, type "FSBL" as the Project name. The window should be like this:  Select Next, then select ZYNQ FSBL in the next window and finish. ### u-boot for the Zynq ARM Core To run the command that generates the u-boot file, we need to change the value of SDK environment variable LD_LIBRARY_PATH to 'nothing': ``` export LD_LIBRARY_PATH="" ``` Then generate the u-boot file: The u-boot file is placed in fpga-zynq/zedboard/soft_build/u-boot.elf ``` cd fpga-zynq/zedboard make arm-uboot ``` ### boot.bin Returning to the Xilinx SDK, select Xilinx Tools -> Create Boot Image. Set output BIF file path to fpga-zynq/zedboard/deliver_output. Create the folder if it does not exist.  Next, we will add the individual files that make up BOOT.bin Click on ADD, and then Browse. The file we need is located at fpga-zynq/zedboard/zedboard_rocketchip_ZynqSmallConfig/zedboard_rocketchip_ZynqSmallConfig.sdk/FSBL/Debug/FSBL.elf. And make sure the Partition type is bootloader. Then click on OK.  Similarly, add rocketchip_wrapper.bit and u-boot.elf as well. The Partition type of these two files is datafile. The files are located at:fpga-zynq/zedboard/zedboard_rocketchip_ZynqSmallConfig/zedboard_rocketchip_ZynqSmallConfig.runs/impl_1/rocketchip_wrapper.bit and fpga-zynq/zedboard/soft_build/u-boot.elf. Select Create Image. This will produce a BOOT.bin file in the $REPO/zybo/deliver_output directory. ### Other files We also need some files to boot Linux. Run the following commands: ``` cd fpga-zynq/zedboard make arm-linux make arm-dtb make fetch-ramdisk ``` Now there are four files in /deliver_output: - BOOT.bin - This contains the FSBL, the bitstream with Rocket, and u-boot. - uImage - Linux for the ARM PS. - devicetree.dtb - Contains information about the ARM core's peripherals for linux. - uramdisk.image.gz - The root filesystem for linux on the ARM Core. Copy these files into the root directory of SD card. ### Step 3: Test First connect the ZedBoard to your computer with Ethernet cable. If you are using Linux, go to internet settings. Select the current Ethernet connection and click on Edit. Go to IPv4 Settings tab. Change the addresses as shown below:  Open a new terminal, run this command to get access to the processor. The IP address of zedboard is always 192.168.1.5. The default password is root: ``` ssh root@192.168.1.5 ``` You could also use a terminal with support for SSH such PuTTY. Login with "root" for both username and password. At this point, you are running Linux on the ARM core:  ### Booting Up and Interacting with the RISC-V Rocket Core You can run a compiled application on the RISC-V on top of the proxy kernel.  You can also boot up RISC-V Linux:  RISC-V Linux supports these commands:  ## References - [RISC-V Foundation](https://riscv.org/) - [RISC-V Foundation GitHub](https://github.com/riscv) - [Rocket Chip Generator](https://github.com/freechipsproject/rocket-chip) - [Rocket Chip Generator Technical Report](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-17.html) - [Rocket Chip on Zynq FPGAs](https://github.com/ucb-bar/fpga-zynq#overview)
http://venividiwiki.ee.virginia.edu/mediawiki/index.php/Rocket_chip_on_Zedboard  ## FPGA Lab Project - Rocket Chip on Zedboard ## Objective The goal of this project is to implement the RISC-V Rocket Chip on the Zynq-based ZedBoard and run applications on it. This project is based on a project from UC Berkeley Architecture Research: Rocket Chip on Zynq FPGAs ## Introduction ### RISC-V RISC-V is an open instruction set architecture (ISA) based on the reduced instruction set computing (RISC). RISC architectures are characterized by a small set of simple and general instructions. This is contrasted by complex instruction set computing (CISC), which have a large set of complex and specialized instructions. The project began in 2010 at the University of California, Berkeley. You can find more information about the project and the ISA at the [RISK-V Foundation Website](https://riscv.org/) ### The Rocket Chip Generator Rocket Chip is an open-source Sysem-on-Chip (SoC) design generator that emits synthesizable RTL. It uses the Chisel hardware construction language to compose a library of sophisticated generators for cores, caches, and interconnects into an integrated SoC. It generates general-purpose processor cores that use the open RISC-V ISA, and provides both an in-order core generator (Rocket) and an out-of-order core generator (BOOM). The technical details are on the Berkely EECS page: [The Rocket Chip Generator Technical Report](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-17.html) The project is hosted on GitHub: [Rocket Chip Generator Repository](https://github.com/freechipsproject/rocket-chip) The figure below shows an instance of an SoC generated by the Rocket Chip Generator.  ## Project Overview We will implement Rocket Chip on the FPGA and run applications on it. The rough top-down stack is shown below: - **Target Application** This is a binary application compiled with either [riscv-gcc](https://github.com/riscv/riscv-gcc) or [riscv-llvm](https://github.com/riscv/riscv-llvm). - **RISC-V Kernel** Can run the proxy kernel [proxy kernel](https://github.com/riscv/riscv-pk) designed to run single binary applications. Can alternatively run the lightweight [RISC-V Linux](https://github.com/riscv/riscv-linux). - **Rocket Chip** [Rocket Core](https://github.com/freechipsproject/rocket-chip) instantiated on FPGA. It communicates to the host ARM on the Zynq via AXI. - **Front-end Server** [RISC-V Front-end Server](https://github.com/riscv/riscv-fesvr) which runs on the host ARM core and interfaces to the Rocket Chip. - **Zynq ARM Core** Process on the Zynq SoC that runs Linux. - **Development Board** [ZedBoard](http://www.zedboard.org/product/zedboard) Development board with the Zynq SoC. SD Card used to configure the FPGA. - **External Communication** Communication between PC and FPGA board over Ethernet. - **User Interface** SSH Client terminal on PC. ## Step 1: Project Setup ### Download the files needed We will use fpga-zynq repository from UCB. Run the command below in the terminal to download the repository: ``` git clone https://github.com/ucb-bar/fpga-zynq ``` Since fpga-zynq uses files from other repositories such as rocket-chip, we will also need to download those files as well. Run this command to get all the files needed for fpga-zynq: ``` cd fpga-zynq git submodule update --init --recursive ``` ### Project setup First go to fpga-zynq directory and run this command to generate a vivado project for Zedboard: ``` cd fpga-zynq/zedboard make project ``` Then open this project: ``` make vivado ``` If you want to go back to the project later, the project file is located here: ``` cd fpga-zynq/zedboard/zedboard_rocketchip_ZynqSmallConfig vivado zedboard_rocketchip_ZynqSmallConfig.xpr ``` If you create the project successfully, then open the block diagram from the left. You should see something like this:  ## Step 2: Generate the files for zedboard ### Bitstream First generate the bitstream in Vivado. You should see the device diagram and project summary.   ### FSBL(first stage boot loader) Then export the hardware from select File -> Export -> Export Hardware and launch SDK. In SDK, select File -> New -> Application Project. In the new window, type "FSBL" as the Project name. The window should be like this:  Select Next, then select ZYNQ FSBL in the next window and finish. ### u-boot for the Zynq ARM Core To run the command that generates the u-boot file, we need to change the value of SDK environment variable LD_LIBRARY_PATH to 'nothing': ``` export LD_LIBRARY_PATH="" ``` Then generate the u-boot file: The u-boot file is placed in fpga-zynq/zedboard/soft_build/u-boot.elf ``` cd fpga-zynq/zedboard make arm-uboot ``` ### boot.bin Returning to the Xilinx SDK, select Xilinx Tools -> Create Boot Image. Set output BIF file path to fpga-zynq/zedboard/deliver_output. Create the folder if it does not exist.  Next, we will add the individual files that make up BOOT.bin Click on ADD, and then Browse. The file we need is located at fpga-zynq/zedboard/zedboard_rocketchip_ZynqSmallConfig/zedboard_rocketchip_ZynqSmallConfig.sdk/FSBL/Debug/FSBL.elf. And make sure the Partition type is bootloader. Then click on OK.  Similarly, add rocketchip_wrapper.bit and u-boot.elf as well. The Partition type of these two files is datafile. The files are located at:fpga-zynq/zedboard/zedboard_rocketchip_ZynqSmallConfig/zedboard_rocketchip_ZynqSmallConfig.runs/impl_1/rocketchip_wrapper.bit and fpga-zynq/zedboard/soft_build/u-boot.elf. Select Create Image. This will produce a BOOT.bin file in the $REPO/zybo/deliver_output directory. ### Other files We also need some files to boot Linux. Run the following commands: ``` cd fpga-zynq/zedboard make arm-linux make arm-dtb make fetch-ramdisk ``` Now there are four files in /deliver_output: - BOOT.bin - This contains the FSBL, the bitstream with Rocket, and u-boot. - uImage - Linux for the ARM PS. - devicetree.dtb - Contains information about the ARM core's peripherals for linux. - uramdisk.image.gz - The root filesystem for linux on the ARM Core. Copy these files into the root directory of SD card. ### Step 3: Test First connect the ZedBoard to your computer with Ethernet cable. If you are using Linux, go to internet settings. Select the current Ethernet connection and click on Edit. Go to IPv4 Settings tab. Change the addresses as shown below:  Open a new terminal, run this command to get access to the processor. The IP address of zedboard is always 192.168.1.5. The default password is root: ``` ssh root@192.168.1.5 ``` You could also use a terminal with support for SSH such PuTTY. Login with "root" for both username and password. At this point, you are running Linux on the ARM core:  ### Booting Up and Interacting with the RISC-V Rocket Core You can run a compiled application on the RISC-V on top of the proxy kernel.  You can also boot up RISC-V Linux:  RISC-V Linux supports these commands:  ## References - [RISC-V Foundation](https://riscv.org/) - [RISC-V Foundation GitHub](https://github.com/riscv) - [Rocket Chip Generator](https://github.com/freechipsproject/rocket-chip) - [Rocket Chip Generator Technical Report](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-17.html) - [Rocket Chip on Zynq FPGAs](https://github.com/ucb-bar/fpga-zynq#overview)
评论 (
31
)
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
未关联
master
boom-new-devices
new-devices
tilelink2
mem_upgrade
ZC706_MIG
dma
daisy
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
1
https://gitee.com/RV4Kids/fpga-zynq.git
git@gitee.com:RV4Kids/fpga-zynq.git
RV4Kids
fpga-zynq
fpga-zynq
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册