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

Non-Xilinx AXI test harness #1104

Closed
sampsyo opened this issue Jul 15, 2022 · 5 comments
Closed

Non-Xilinx AXI test harness #1104

sampsyo opened this issue Jul 15, 2022 · 5 comments
Labels
C: FPGA Changes for the FPGA backend C: fud Calyx Driver Summer 22 Projects being worked on during Summer '22

Comments

@sampsyo
Copy link
Contributor

sampsyo commented Jul 15, 2022

Currently, we have two ways of running Calyx-generated RTL:

  • Simple hardware, open-source simulator: This is the "normal" way of running Calyx programs. We compile the core design to Verilog and use Verilator or Icarus Verilog to run them with a very minimal test harness that just consists of "magically" loading in the contents of memories via Verilog's readmemh.
  • AXI-wrapped hardware, Xilinx simulator: This is what our Xilinx toolchain stuff does. We compile the design with a big complicated AXI wrapper, and we simulate it with our PyOpenCL or PYNQ harness and the XRT emulation mode (which uses xsim underneath). This is important because it's closer to "real" hardware execution, but it's inconvenient and slow because it has to use Xilinx stuff.

These two modes couple two dimensions:

  • Is the hardware simple (just the core design) or AXI-wrapped?
  • Do we use open-source simulators or Xilinx tools?

It would be really nice to decouple these choices, creating a third mode where we run AXI-wrapped hardware on open-source simulators. This would make it much faster and less painful to debug the AXI wrapper itself—as conveniently as we currently debug just the "core" hardware.

This would entail, as discussed in #1022 (reply in thread) and thereafter, writing a testbench that implements the "host side" of the AXI protocol for a given design. There are several options on the table for doing that:

@sampsyo sampsyo added C: fud Calyx Driver C: FPGA Changes for the FPGA backend labels Jul 15, 2022
@rachitnigam
Copy link
Contributor

This would be great and is something we should prioritize doing before the end of the summer!

@rachitnigam rachitnigam added the Summer 22 Projects being worked on during Summer '22 label Jul 18, 2022
@andrewb1999
Copy link
Collaborator

FYI, this exists: https://github.com/alexforencich/cocotbext-axi. I've used it before with some success but it can be a little challenging to get working. My main suggestion here is to connect the m_axi ports to pre-existing axiram IPs that are initialized with the correct test data and only use cocotbext-axi for communicating with the axilite control.

@nathanielnrn
Copy link
Contributor

After discussing with @rachitnigam, the goal is to write a cocotb AXI test harness that would use Icarus Verilog (Verilator is only supported on version 4.106).

@nathanielnrn
Copy link
Contributor

Bumping this because this might be able to be closed as runt now contains tests that emulates AXI-wrapped hardware using cocotb on our vectorized-add and dot-product examples.

The runt tests are here:
https://github.com/cucapra/calyx/blob/c6f750af5793e3e090d901e48194c5156884d787/runt.toml#L291-L310

@sampsyo
Copy link
Contributor Author

sampsyo commented Jan 3, 2023

Awesome!! Yep, I think we are done here. This is incredibly useful to have!

@sampsyo sampsyo closed this as completed Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: FPGA Changes for the FPGA backend C: fud Calyx Driver Summer 22 Projects being worked on during Summer '22
Projects
None yet
Development

No branches or pull requests

4 participants