Skip to content

Bug in fofb_sys_id_pkg.f_signed_saturate #32

@guilhermerc

Description

@guilhermerc

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions