Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] [FPGA] Support for Xilinx AXI 1G/2.5 G Ethernet Subsystem #2213

Closed
1 task done
WorldofJARcraft opened this issue Jun 7, 2024 · 14 comments
Closed
1 task done
Assignees
Labels
notCV32A65X It is not an CV32A65X issue

Comments

@WorldofJARcraft
Copy link

Is there an existing CVA6 task for this?

  • I have searched the existing task issues

Task Description

I have a private fork of the cva6 project in which I have added hardware and software support (u-boot and Linux) for the Xilinx AXI 1G/2.5G Ethernet subsystem on the GenesysII FPGA board. I have testing booting with TFTP in u-boot and running SSH in Linux. Are you interested in a pull request?

Required Changes

  • build option to include Xilinx Ethernet instead of LowRISC Ethernet
  • modify existing build options from InclEthernet to InclLowRiscEthernet (and equivalent)
  • add scripts/Makefile entries / etc. for Xilinx Ethernet
  • add Xilinx Ethernet system to ariane_peripherals_xilinx
  • if Ethernet is included, add and connect AXI master buses for the Xilinx DMA controller
  • (this might be controversial) as AXI is not cache coherent, I currently disable the data cache when reading and modifying the DMA descriptors in memory in order to prevent the CPU from working with stale data in the cache (see also How to flush the data cache? #2046). In order to be able to do this directly from Linux, I have added a build option to CVA6 that optionally allows the corresponding CSR to be written in supervisor mode. An alternative to this solution would be adding an SBI call for enabling and disabling the cache.

Current Status

  • I have a private fork of the project in which Ethernet works in u-boot and Linux.
  • There are some differences between my project and upstream cva6: E.g., I am using the Xilinx AXI Interconnect instead of the one from pulp-platform. Thus, if you are interested in a pull request, I will integrate my changes back into this repo, re-test and send a pull request.
  • I have patches that I can clean up and send to https://github.com/openhwgroup/cva6-sdk for software support.

Risks

  • The AXI Ethernet system is proprietary and you need a license for the underlying MAC core (TEMAC). You can generate a free 120-day evaluation license.
  • I am not sure if allowing the supervisor mode to access the cache management CSR has any security or conformity implications.

Prerequisites

No response

KPI (KEY Performance Indicators)

As the AXI Subsystem uses DMA, it should provide higher throughput than the LowRISC Ethernet subsystem. Also, it should reduce the amount of instructions/computation time required for networking.

Description of Done

  • An FPGA bitstream with the existing Ethernet stack can be generated
  • An FPGA bitstream with the Xilinx Ethernet stack can be generated
  • The Ethernet allows TFTP boot in u-boot
  • The Ethernet allows SSH in Linux

Associated PRs

No response

@WorldofJARcraft WorldofJARcraft changed the title [TASK] [FPGA] Support for Xilinx AXI 1G/2.5 G Subsystem [TASK] [FPGA] Support for Xilinx AXI 1G/2.5 G Ethernet Subsystem Jun 7, 2024
@JeanRochCoulon
Copy link
Contributor

Thanks @WorldofJARcraft for your proposal. I do not work myself on FPGA, but @jquevremont would have an opinion on this.

@JeanRochCoulon JeanRochCoulon added the notCV32A65X It is not an CV32A65X issue label Jun 10, 2024
@jquevremont
Copy link
Contributor

jquevremont commented Jun 10, 2024

Thanks @WorldofJARcraft. This delivers more Ethernet performance to CVA6-based processors.
In the CVA6 project, we want to keep CVA6 as much vendor-independent as possible so this implementation cannot replace the existing one.
However, I suggest that this is introduced as a new project concept to test the interest for OpenHW members. Do you work for an OpenHW member (Git nicknames do not make it obvious)?

@WorldofJARcraft
Copy link
Author

Thanks @WorldofJARcraft. This delivers more Ethernet performance to CVA6-based processors. In the CVA6 project, we want to keep CVA6 as much vendor-independent as possible so this implementation cannot replace the existing one. However, I suggest that this is introduced as a new project concept to test the interest for OpenHW members. Do you work for an OpenHW member (Git nicknames do not make it obvious)?

No, my employer (publicly funded German research center) is not a member of the OpenHW group. I am working on a research project for which compatibility with proprietary (DMA) peripherals is crucial, and I am using CVA6 as CPU. This was the main motivation for integrating the Xilinx AXI Ethernet system with CVA6. I am confident I have solved all of the technical challenges in hardware and software, and I would like to give back to the project.
I think it would be fairly easy to adapt the existing build system to make Xilinx Ethernet optional and mutually exclusive with the existing Ethernet, as code to disable the existing Ethernet already exists in the project (e.g., similar to the existing HAS_ETHERNET environment variable in the bootrom, I could introduce a HAS_XILINX_ETHERNET variable and use both of them for ifdef definitions in the verilog sources).

@jquevremont
Copy link
Contributor

Could you join our next CVA6 meeting, on June 18th, 14:00-15:30 CEST?

@WorldofJARcraft
Copy link
Author

Could you join our next CVA6 meeting, on June 18th, 14:00-15:30 CEST?

Yes, that works for me.

@jquevremont
Copy link
Contributor

jquevremont commented Jun 11, 2024

Copy link
Contributor

👋 Hi there!

This issue seems inactive. Need more help? Feel free to update us. If there are no updates within the next few days, we'll go ahead and close this issue. 😊

@github-actions github-actions bot added the Status:Stale Issue or PR is stale and hasn't received any updates. label Jul 13, 2024
@jquevremont
Copy link
Contributor

Hi @WorldofJARcraft. What about adding a reference to your repo in the CVA6 README? (in a new section "related projects" before the acknowledgement section)?

@jquevremont jquevremont removed the Status:Stale Issue or PR is stale and hasn't received any updates. label Jul 16, 2024
@WorldofJARcraft
Copy link
Author

Hi @WorldofJARcraft. What about adding a reference to your repo in the CVA6 README? (in a new section "related projects" before the acknowledgement section)?

Sounds good. I will need a few days to clean up my fork of the project, test it again and set it to public. I will notify you when this is done and send you the link.

@WorldofJARcraft
Copy link
Author

Hello @jquevremont, my fork of the project is now online: https://github.com/cispa/CVA6-Vivado-Project-with-Xilinx-AXI-Ethernet/
In addition to the Xilinx Ethernet in hardware and software, I have added scripts for generating a fully-integrated Xilinx Vivado project. I hope this is useful for FPGA developers.
I would be happy to join another meeting to discuss my changes in more detail if necessary.

Copy link
Contributor

👋 Hi there!

This issue seems inactive. Need more help? Feel free to update us. If there are no updates within the next few days, we'll go ahead and close this issue. 😊

@github-actions github-actions bot added the Status:Stale Issue or PR is stale and hasn't received any updates. label Aug 29, 2024
@jquevremont
Copy link
Contributor

👋 Hi there!

This issue seems inactive. Need more help? Feel free to update us. If there are no updates within the next few days, we'll go ahead and close this issue. 😊

I am quite busy. I need to find time to create a "resources" section to mention this (and a few other).

@github-actions github-actions bot removed the Status:Stale Issue or PR is stale and hasn't received any updates. label Aug 30, 2024
@jquevremont
Copy link
Contributor

First attempt: #2514

@WorldofJARcraft
Copy link
Author

Looks good to me, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notCV32A65X It is not an CV32A65X issue
Projects
None yet
Development

No branches or pull requests

3 participants