EPFL-LAP / dynamatic

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

Using the bash script to test Resource Sharing: Simulation Error for float_basic.c #166

Open udareechk opened 5 days ago

udareechk commented 5 days ago

Hi,

I am trying to use the provided bash script in merged PR [Sharing][hdl] Resource sharing support in VHDL backend #85. When I test the script with "polyn_mult.c" & "float_basic.c" given as benchmarks in the script, the generated DOT diagrams do not show any operations being shared. Is this the expected behaviour for these two applications or should they exhibit a resource-sharing output? (For "gsum.c" the output DOT diagram shows a resource-sharing wrapper)

Also, with the float_basic.c application, after compilation and RTL generation completes, I get an error in simulation with the application with the below error message:

[INFO] Launching Modelsim simulation
** Warning: setting ADDR NO RANDOMIZE failed - Success.
[ERROR COMPARE] Token mismatch: [oxffc00000] and [0x7f800001] are not equal (at transaction id 0).
FATAL Simulation failed

What is the cause of the simulation failure and how to solve this?

Thanks.

Jiahui17 commented 5 days ago

Hi, thanks for reporting the issue!

Q1: The unit connected directly to the sharing wrapper is the one that is being shared. For example, if you run the script as it is, in gsum there will be two sharing_wrappers and a float adder and a float mul---the latter two are shared between multiple operations.

Q2: This this a duplicate of #125: the two numbers are both undefined (NaN); we haven't implemented the logic for comparing two float numbers in the cosimulation tool.

udareechk commented 5 days ago

Hi, Thanks for the information!

Regarding Q1: Thanks for clarifying about the gsum application output. Just to clarify, do you mean polyn_mult & basic_float are not relevant example applications that will show sharing? Only gsum will show sharing when run with the sharing script?

Thanks!

Jiahui17 commented 4 days ago

Just to clarify, do you mean polyn_mult & basic_float are not relevant example applications that will show sharing?

They are---I think we also share some integer multipliers there

udareechk commented 1 day ago

Hi,

Thank you for this information. How can I get information or find out which units are being shared with which operations in these two applications? In my compilation, I do not see a sharing wrapper generated for these two applications as seen in the gsum application.

Thanks.

Jiahui17 commented 1 day ago

Oh i see, probably because the algorithm discovered that sharing muls in these apps will penalize performance. Could you change SIMPLE_BUFFERS="--simple-buffers" in the script? This will tell the optimization tool to ignore throughput and share all the resources

udareechk commented 1 day ago

Hi, Thanks for your reply and the given information.

I'm sorry, but isn't this what's already being used in the script? I'm using your script in PR [Sharing][hdl] Resource sharing support in VHDL backend https://github.com/EPFL-LAP/dynamatic/pull/85. So, it seems to be already using SIMPLE_BUFFERS="--simple-buffers" in the compilation.

Can you kindly verify this on your side and let me know if I am missing anything else in the tool configuration/ compilation ?

Thanks!

Jiahui17 commented 1 day ago

Sorry, it was my bad, forgot that I removed integer multipliers from the list of sharable ops before doing the PR. It is now supported in main