EPFL-LAP / dynamatic

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

[handshake] failed to legalize operation 'arith.*' #115

Closed Jiahui17 closed 3 months ago

Jiahui17 commented 3 months ago

Benchmarks (some are in #120 ):

dct.c, cordic.c, matching_2.c, correlation_float.c, path_profiling.c, gemm.c,

Error

In dct.c:

[INFO] Applied Dynamatic transformations to cf
/home/jxu/Repositories/dhls-utils/dynamatic/./integration-test/dct/out/comp/cf_dyn_transformed.mlir:8:10: error: failed to legalize operation 'arith.sitofp'
    %2 = arith.sitofp %1 {handshake.name = "sitofp0"} : i32 to f64
         ^
/home/jxu/Repositories/dhls-utils/dynamatic/./integration-test/dct/out/comp/cf_dyn_transformed.mlir:8:10: note: see current operation: %19 = "arith.sitofp"(%18) {handshake.bb = 1 : ui32, handshake.name = "sitofp0"} : (i32) -> f64
[FATAL] Failed to compile cf to handshake

In cordic.c:

dynamatic> set-dynamatic-path ./dynamatic;   set-src ./dynamatic/integration-test/cordic/cordic.c;   set-clock-period 5;   compile  ;   write-hdl --hdl verilog;   simulate;   synthesize;   exit
[INFO] Compiled source to affine
[INFO] Ran memory analysis
[INFO] Compiled affine to scf
[INFO] Compiled scf to cf
[INFO] Applied standard transformations to cf
[INFO] Applied Dynamatic transformations to cf
/home/jxu/Repositories/dhls-utils/./dynamatic/integration-test/cordic/out/comp/cf_dyn_transformed.mlir:15:10: error: failed to legalize operation 'arith.truncf'
    %7 = arith.truncf %6 {handshake.name = "truncf0"} : f64 to f32
         ^
/home/jxu/Repositories/dhls-utils/./dynamatic/integration-test/cordic/out/comp/cf_dyn_transformed.mlir:15:10: note: see current operation: %59 = "arith.truncf"(%58) {handshake.bb = 1 : ui32, handshake.name = "truncf0"} : (f64) -> f32
[FATAL] Failed to compile cf to handshake
lucas-rami commented 3 months ago

This is related to #102. I did not create Handshake equivalent for these two operations because I am not sure that we have working RTL components for them. If we do then equivalent operations can be added to Handshake super easily, then they may be trivially converted in the CfToHandshake pass, and finally be added to the backend support.

Jiahui17 commented 3 months ago

Closed this because it is a duplicate of #102