1 Star 1 Fork 1

RSPwFPGAs / virtio-fpga

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

Table of Contents

  1. Overview of virtio-fpga
  2. Rapid System Prototyping

Overview

virtio-fpga: A platform for emulating Virtio devices with FPGAs

Follow the procedure to run the emulation.

Rapid System Prototyping of Virtio Device DMAs

The Virtio device follows a common structure of PCIe CSR-DMA model. The feature_ram, which is the CSR, is a PCIe target mapped to BAR0; The axi_vip_thread modules, which are the multiple concurrent DMAs, are the PCIe initiators generating read/write transactions to the host memory. The behavior models of the multiple concurrent DMAs are:

 1. dma_transaction_thread00.v  Capture Queue Notify
 2. dma_transaction_thread01.v  Read Available Ring flags+index
 3. dma_transaction_thread02.v  Read Available Ring elements, and Prefetch Descriptor Chain
 4. dma_transaction_thread03.v  Handle ReceiveQueue
 5. dma_transaction_thread04.v  Handle TransmitQueue
 6. dma_transaction_thread05.v  Handle ControlQueue
 7. dma_transaction_thread06.v  Write Used Ring elements and flags+index, and Generate MSI-X interrupt

The rapidly developed SW-like axi_vip_thread modules can be individually disabled and the axi_vip_null placeholders can be correspondingly replaced by synthesizable RTL modules. This enables incremental design and modular debug of the FSMs in each DMA initiator.

Virtio CSR-DMA Block Design

Alt text

QEMU-HDL Co-Simulation Structure

ping -i ens4 10.10.10.10 -c 10
└──virtio-pci
   └──Ubuntu 18.04
      └──QEMU
         └──accelerator_pcie.c

         <- ZeroMQ ->

            dpi-pcie.c

         <- SystemVerilog DPI ->

            axi4_ip_mod.sv
            └──XSim (Vivado Simulator)
               └──IP Integrator
                  └── QEMUPCIeBridge
                      ├── M_AXI
                      │   └── -> feature_ram (virtio_csr.v)
                      └── S_AXI
                          └── <- axi_interconnect
                                 ├── <- axi_vip_thread00 (dma_transaction_thread00.v)
                                 │      └── <- axi_vip_null00
                                 ├── <- axi_vip_thread01 (dma_transaction_thread01.v)
                                 │      └── <- axi_vip_null01
                                 ├── <- axi_vip_thread02 (dma_transaction_thread02.v)
                                 │      └── <- axi_vip_null02
                                 ├── <- axi_vip_thread03 (dma_transaction_thread03.v)
                                 │      └── <- axi_vip_null03
                                 ├── <- axi_vip_thread04 (dma_transaction_thread04.v)
                                 │      └── <- axi_vip_null04
                                 ├── <- axi_vip_thread05 (dma_transaction_thread05.v)
                                 │      └── <- axi_vip_null05
                                 └── <- axi_vip_thread06 (dma_transaction_thread06.v)
                                        └── <- axi_vip_null06

Repository Directory Structure

.
├── doc
│   └── pic
├── hw
│   ├── prj
│   │   └── qemu_hdl_cosim
│   └── src
│       ├── hdl/virtio_csr.v
│       ├── ipi
│       └── qemu_hdl_cosim
│           ├── axi_vip/dma_transaction_thread0x.v
│           └── sim_ip
│               └── QEMUPCIeBridge/hdl/axi4_ip_mod.sv
└── sw
    └── QEMU
        └── qemu_hdl_cosim
            ├── qemu/qemu-2.10.0-rc3/hw/misc/accelerator_pcie.c
            └── scripts
BSD 3-Clause License Copyright (c) 2020, RSPwFPGAs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

A platform for emulating Virtio devices with FPGAs 展开 收起
SystemVerilog 等 6 种语言
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/RSPwFPGAs/virtio-fpga.git
git@gitee.com:RSPwFPGAs/virtio-fpga.git
RSPwFPGAs
virtio-fpga
virtio-fpga
master

搜索帮助