{"id":28710964,"url":"https://github.com/arm-software/revere-demo","last_synced_at":"2025-07-12T07:05:35.999Z","repository":{"id":74210144,"uuid":"197761370","full_name":"ARM-software/revere-demo","owner":"ARM-software","description":"Example program demonstrating the use of the Revere-AMU System Architecture from userspace, with VFIO","archived":false,"fork":false,"pushed_at":"2020-09-15T10:12:12.000Z","size":43,"stargazers_count":5,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-14T21:08:39.493Z","etag":null,"topics":["accelerator","revere-amu","vfio","vfio-pci"],"latest_commit_sha":null,"homepage":"https://developer.arm.com/architectures/system-architectures/accelerators","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ARM-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-19T11:29:56.000Z","updated_at":"2024-04-28T08:49:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"43f3ae46-be04-45f8-8f26-fcde536b34f0","html_url":"https://github.com/ARM-software/revere-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ARM-software/revere-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Frevere-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Frevere-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Frevere-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Frevere-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ARM-software","download_url":"https://codeload.github.com/ARM-software/revere-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2Frevere-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264952494,"owners_count":23688084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accelerator","revere-amu","vfio","vfio-pci"],"created_at":"2025-06-14T21:08:38.551Z","updated_at":"2025-07-12T07:05:35.991Z","avatar_url":"https://github.com/ARM-software.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Revere VFIO demo\n================\n\nPrinciples\n----------\n\nThe Revere VFIO demo is a standalone example using a Revere device, originally\nfrom userspace through VFIO.\nIt establishes a connection with a hardware inversion \"accelerator\". Data is\nexchanged with the accelerator through Revere messages.\nAlternatively, the demo can also run in loopback mode, where the data is looped\nback directly, bypassing the accelerator.\n\nLicense\n-------\n\nThis code is licensed under the open source BSD, clause 3 license. See LICENSE\nfor more information.\n\nBuild\n-----\n\nTo build:\n\n```\n  $ ./autogen.sh\n  $ ./configure\n  $ make\n```\n\nRun\n---\n\nWhen using VFIO, run the demo as root to avoid permissions issues.\n\nTo run:\n\n```\n  # modprobe vfio_iommu_type1 allow_unsafe_interrupts=1\n  # modprobe vfio-pci ids=13b5:ff81\n  # revere-vfio-demo --vfio-group /dev/vfio/2 --device 0000:00:03.0\n```\n\nNote: you need to adapt the vfio group and device to those corresponding to the\nRevere PF on your platform.\n\nRunning with VFIO in loop back mode is done with:\n\n```\n  # revere-vfio-demo --vfio-group /dev/vfio/2 --device 0000:00:03.0 --loopback\n```\n\nCommand line options allow to change various other parameters of the demo, such\nas the total number of packets or the packet size. See all supported command\nline options in the online help with:\n\n```\n  $ revere-vfio-demo -h\n```\n\nDetails\n-------\n\nDetails of the files for this demo:\n\n```\n  +-- autogen.sh\n  +-- cmdline.c\n  +-- cmdline.h\n  +-- configure.ac\n  +-- LICENSE\n  +-- main.c ............. Demo top level\n  +-- platform.c ......... Platform abstraction layer\n  +-- platform.h\n  +-- Makefile.am\n  +-- README\n  +-- regs.h ............. Registers access functions\n  +-- revere_dev.c ....... Function for Revere setup\n  +-- revere_dev.h\n  +-- revere.h ........... Revere-AMU generated header\n  +-- revere_hw.h ........ A few Revere registers aliases\n  +-- vfio.c ............. VFIO functions\n  `-- vfio.h\n```\n\nThe demo goes through the following steps:\n\n1. Allocate memory for all i/o buffers, which are shared with the Revere device.\n2. With VFIO, open the device and map memory into Revere IOVA space. Also, map\n   BAR0 into our process address space.\n   Also, turn on BME.\n3. Setup the Revere device: setup Revere management interface, then using the\n   management interface, setup the AMI-HWs in the accelerator, an AMI-SW and\n   connect them with sessions.\n4. Exchange data with the inversion agent and verify that it has been inverted.\n5. Teardown everything and exit.\n\nHere is the Revere setup configured by the demo (omitting the management\ninterface):\n\n```\n  Rings in memory\n                                           +-----------------------+\n .---------------.                         | Inversion accelerator |\n |  +-+-+-+-+-+  |                         |       (AHA 0)         |\n `-\u003e| | | | | |--'                         |                       |\n    +-+-+-+-+-+       AMI-SW 0             |  AMI-HW 0             |\n         |         +-----------+   ASN 0   +-----------+           |\n         `........\u003e| TX AMS 0  @----------\u003e@  RX AMS 0 |--.        |\n                   |           |           |           |  |        |\n                   |           |           |           | Invert    |\n                   |           |           |           |  |        |\n         ..........| RX AMS 0  @\u003c----------@  TX AMS 0 |\u003c-'        |\n         V         +-----------+   ASN 1   +-----------+           |\n    +-+-+-+-+-+                            |                       |\n .-\u003e| | | | | |--.                         +-----------------------+\n |  +-+-+-+-+-+  |\n `---------------'\n```\n\nCommand line options allow to select different AMI-HWs in the accelerator for Tx\nand Rx, and change the AHA ID.\n\nIn dma mode, the sw selects a different accelerator (called the DMA agent, AHA 3).\nIt receives a revere message with this format:\n\n```\nstruct DMAPacket {\n            uint64_t of_buf_stash_ctl;\n            uint64_t src;\n            uint64_t dst;\n            uint32_t len;\n            uint32_t rsvd0;\n            uint32_t invert;\n}\n```\n\nand copies len bytes from src to dst buffers, inverted if invert == 1.\nFinally the DMA agent sends a response message back to notify of the DMA completion.\n\nIn loopback mode a single session is setup. No AMI-HW is setup and the inversion\naccelerator is bypassed. The data is received \"as is\" without inversion:\n\n```\n  Rings in memory\n\n .---------------.\n |  +-+-+-+-+-+  |\n `-\u003e| | | | | |--'\n    +-+-+-+-+-+       AMI-SW 0\n         |         +-----------+\n         `........\u003e| TX AMS 0  @-----------.\n                   |           |           |\n                   |           |           | ASN 0\n                   |           |           |\n         ..........| RX AMS 0  @\u003c----------'\n         V         +-----------+\n    +-+-+-+-+-+\n .-\u003e| | | | | |--.\n |  +-+-+-+-+-+  |\n `---------------'\n```\n\nSee Also\n--------\n\nhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/vfio.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farm-software%2Frevere-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farm-software%2Frevere-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farm-software%2Frevere-demo/lists"}