cornell-zhang/hcl-dialect

[Backend] Support different quantization and overflow mode for fixed point

Opened this issue · 0 comments

Currently we are using "wrap overflow mode + round zero quantization mode" for fixed point simulation (See the code snippet below).
https://github.com/cornell-zhang/heterocl/blob/95f3509a3df50c4e621f82a96ef10c0af388de48/python/heterocl/tensor.py#L321-L329

But we may need different quantization and overflow mode for different scenario, so we need to expose this API for users to select, and also generate correct code for both LLVM and HLS backend.

Based on the HLS manual, we have the following modes.
Screen Shot 2022-10-31 at 10 57 42 AM