pulp-platform / common_cells

Common SystemVerilog components
Other
488 stars 138 forks source link

`stream_xbar`: Fix non-existing output assertion #204

Closed colluca closed 8 months ago

colluca commented 10 months ago

PR https://github.com/pulp-platform/common_cells/pull/200 fixed an issue in the stream_xbar assertions, effectively enabling them when reset is not asserted: https://github.com/pulp-platform/common_cells/pull/200/files#diff-872c7e67b01645ac7cc6cecf1dbb01b73f1b1882d8bb77089dcb27570c35ac23L169

Thanks to this, a bug in one of the assertions was revealed: https://github.com/pulp-platform/common_cells/blob/52f83eed3e92ed4ea5f79774854b0cb68618dcbb/src/stream_xbar.sv#L172-L176 sel_oup_t can represent values in the range [0, NumOut). Because of this, if for example NumOut is 32, the comparison will reduce to sel_i[i] < 0 which will never be satisfied.

This PR fixes this issue.