GithubHelp home page GithubHelp logo

rspwfpgas / virtio-fpga Goto Github PK

View Code? Open in Web Editor NEW
23.0 3.0 11.0 884 KB

A platform for emulating Virtio devices with FPGAs

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.10% Tcl 16.51% Shell 0.27% SystemVerilog 68.63% C 1.94% Pascal 0.05% Verilog 12.51%
virtio fpga pcie qemu cosim msix

virtio-fpga's Introduction

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

virtio-fpga's People

Contributors

rspwfpgas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.