cornell-zhang / rosetta

Rosetta: A Realistic High-level Synthesis Benchmark Suite for Software Programmable FPGAs
BSD 3-Clause "New" or "Revised" License
159 stars 38 forks source link

Checking if output result is correct #6

Closed rachitnigam closed 5 years ago

rachitnigam commented 5 years ago

We're trying to port Rosetta to the newest AWS AMI machines using SDAccel. Does the host code perform any sort of checking to make sure that the output generated by the accelerator is correct? For example, in face_detect, we see the call to check_results but are not sure if it's performing any sort of checking. Is there a "golden file" with the correct, expected output?

zhouyuan1119 commented 5 years ago

The current version of the code does not "check" whether the output is correct or not. The check_results function only prints the output onto the screen. You can compare the output with the pure software version (make sw) to make sure that the error is within some reasonable margin. Notice that in many cases you won't get exactly the same result because of quantization errors.

zhangzhiru commented 5 years ago

We should do the check. We just need to save the results from the software sim (fixed point version) as the golden reference and do a diff through system("diff").

zhouyuan1119 commented 5 years ago

The repo is now updated with a golden result output outputs_golden.txt for each benchmark. I also updated the makefile so that we can run with the latest AWS FPGA AMI (v1.7.0). Notice that this means our code may not be compatible with the older versions.