Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in fofb_sys_id_pkg.f_signed_saturate #32

Open
guilhermerc opened this issue Feb 19, 2024 · 0 comments
Open

Bug in fofb_sys_id_pkg.f_signed_saturate #32

guilhermerc opened this issue Feb 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@guilhermerc
Copy link
Contributor

There's a bug in https://github.com/lnls-dig/fofb-ctrl-gw/blob/2bf44cd5468c1bab727aa1d9276751c3825a7506/hdl/modules/fofb_sys_id/fofb_sys_id_pkg.vhd#L119C1-L119C41. This clause should detect sign extensions, but it only does correctly if x's width is 1 bit larger than trunc_x_len.

This bug doesn't affect prbs_bpm_pos_distort core because there we're shrinking from 33 -> 32 bits, but it does affect prbs_bpm_sp_distort (17 -> 15 bits). If the distorted set point before saturation is smaller than -32768 or greater than 32767, no saturation will be performed and the function would simply truncate the 15LSBs of it.

@guilhermerc guilhermerc added the bug Something isn't working label Feb 19, 2024
@guilhermerc guilhermerc self-assigned this Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant