lnls-dig / lnls-dig/fofb-ctrl-gw
Bug in fofb_sys_id_pkg.f_signed_saturate
@guilhermerc is already working on this.
Since Feb 19, 2024.
- Dominant language
- VHDL
- Stars
- 1
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.