EPFL-LAP / dynamatic

DHLS (Dynamic High-Level Synthesis) compiler based on MLIR
Other
49 stars 14 forks source link

Open Source Floating-point Arithmetic #76

Closed sevkobat closed 4 months ago

sevkobat commented 4 months ago

This PR adds open source floating-point arithmetic generated by FloPoCo to the library of Dynamatic as an alternative to Vivado floating-point arithmetic units.

The following files were added to data/vhdl/:

There is also a new simple integration test for testing certain floating-point operations at integration_test/float_basic. Note that the new operators are intended support a frequency of 250 MHz. Note also that this PR merely introduces some open source floating-point arithmetic units, which are not used by default by Dynamatic.

How to test In order to test the new VHDL code, the arithmetic units in the generated VHDL code need to be replaced manually and the simulation.do file needs to be modified.

  1. Generate VHDL code for the integration test float_basic.
  2. Copy float_arithmetic_flopoco.vhd to integration-test/float_basic/out/sim/VHDL_SRC/.
  3. Modify the file integration-test/float_basic/out/sim/HLS_VERIFY/simulation.do. Add the following lines: project addfile ../VHDL_SRC/float_arithmetic_flopoco.vhd Make sure arithmetic_units.vhd does not contain duplicate floating-point units.
  4. Remove the directory integration-test/float_basic/out/sim/HLS_VERIFY/work.
  5. Change directory to integration-test/float_basic/out/sim/HLS_VERIFY and run the simulation with vsim -c -do simulation.do. The simulation should complete successfully.
  6. Compare the contents of the directories integration-test/float_basic/out/sim/VHDL_OUT and integration-test/float_basic/out/sim/C_OUT and make sure the contents of the files are identical.