Given the following code:
#include "dynamatic/Integration.h"
#include <stdint.h>
double test8(double var6) { return ((-var6 * -6.082002e-01) - -var6); }
void test_bench() {
double var6 = 1.797693e+308;
CALL_KERNEL(test8, var6);
}
int main() { test_bench(); }
Dynamatic and C disagree on the result. C produces positive infinity while Dynamatic produces a NaN value. This is with flopoco generated FPUs:
dynamatic> set-dynamatic-path /home/mboeck/dynamatic
dynamatic> set-src test8.c
dynamatic> compile
[INFO] Compiled to LLVM IR
[INFO] Optimized LLVM IR
[INFO] Applied memory dependency analysis to LLVM IR
[INFO] Converted to std dialect
[INFO] Applied CF transformations
[INFO] Marked memory accesses with the corresponding interfaces in cf
[INFO] Compiled cf to handshake
[INFO] Applied transformations to handshake
[INFO] Running simple buffer placement (on-merges).
[INFO] Placed simple buffers
[INFO] Canonicalized handshake
[INFO] Created test8 DOT
[INFO] Converted test8 DOT to PNG
[INFO] Created test8_CFG DOT
[INFO] Converted test8_CFG DOT to PNG
[INFO] Lowered to HW
[INFO] Compilation succeeded
dynamatic> write-hdl
[INFO] Exported RTL (vhdl)
[INFO] HDL generation succeeded
dynamatic> simulate --timeout 20000
[INFO] Built kernel for IO gen.
[INFO] Ran kernel for IO gen.
[INFO] Launching simulation (vsim)
[FATAL] Simulation failed
FP64 comparison of [var6] : Pass
[ERROR COMPARE] Token mismatch: [0x7ff0000000000000] and [0x7ff9bb3001a3f535] are not equal (at transaction id 0).
FP64 comparison of [out0] : Fail
[ERROR HLS_VERIFIER] C and VHDL outputs do not match
Given the following code:
Dynamatic and C disagree on the result. C produces positive infinity while Dynamatic produces a NaN value. This is with flopoco generated FPUs: