calyx icon indicating copy to clipboard operation
calyx copied to clipboard

xclrun.py does not correctly handle fixedpoint programs.

Open nathanielnrn opened this issue 2 years ago • 2 comments
trafficstars

In exploring what kinds of programs work/don't work well on fpgas as part of going through the calyx -> FPGA flow we currently have, it was found that xclrun.py does not currently handle fixedpoint inputs correctly.

Specifically, trying to run the calyx output of the systolic array tests fails to execute due to trying to coerce an array into a scalar. This was an easy fix, but even with that there seem to be more issues. And the output after execution looks like this:

  "memories": {
    "l0": [
      null,
      null,
      null
    ],
    "l1": [
      null,
      null,
      null
    ],
  //... more memories

I suspect that this may be due to a a type conversion mismatch happening here.

nathanielnrn avatar Sep 09 '23 23:09 nathanielnrn

Oh, that’s funky! Maybe it would be useful to see what the raw dumped data looks like. The right thing to do would be to use the same infrastructure that the simulation stuff uses (#1715).

rachitnigam avatar Sep 10 '23 12:09 rachitnigam

Argh; that is annoying! And probably my fault (as the person who introduced xclrun to replace the funky built-in fud stuff).

One upside to xclrun being independent is that, hopefully, this should make the debugging loop a little faster. Namely, it should be possible to do this:

  • Use fud to produce an xclbin from a given benchmark.
  • Directly invoke xclrun on that xclbin, not using fud, to try running the simulation.
  • Make a change to xclrun (e.g., to dump out the raw input/output data, as @rachitnigam suggests) to see what happens and repeat.

Happy to help with this!

sampsyo avatar Sep 10 '23 13:09 sampsyo