UCLA-VAST / tapa

TAPA is a dataflow HLS framework that features fast compilation, expressive programming model and generates high-frequency FPGA accelerators.
https://tapa.rtfd.io
MIT License
144 stars 27 forks source link

TAPA doesn't pick up .dat files #133

Closed mvanbeirendonck closed 1 year ago

mvanbeirendonck commented 1 year ago

Vitis HLS synthesizes large ROM memories into .dat files that are loaded in with $readmemh(). These files are currently not picked up by TAPA, but they are necessary for the RTL to synthesize and simulate correctly.

As far as I know, the problem is twofold:

First, the file is not part of the generated .xo:

https://github.com/Blaok/haoda/blob/b5af6aba17c706e62ee43d19d05939f81a9d2353/haoda/backend/xilinx.py#L92

Second, in TAPA fast cosim the file is not included in the simulation sources:

https://github.com/UCLA-VAST/tapa-fast-cosim/blob/0c23c285150eca4efaa4224237c17f11d1c6214d/tapa_fast_cosim/vivado.py#L13

Both can be simply fixed by adding *.dat to the included files.

add_files -norecurse [glob {hdl_dir}/*.v {hdl_dir}/*/*.v {hdl_dir}/*.dat]
for suffix in ('.v', '.sv', '.dat'):
Blaok commented 1 year ago

Thanks for reporting. Are you interested in PRs?

mvanbeirendonck commented 1 year ago

Sure! Created both.

Blaok commented 1 year ago

Both PRs are merged, thank you!