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

stream_xbar: Fix non-existing output assertion #204

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Conversation

colluca
Copy link
Contributor

@colluca colluca commented Nov 6, 2023

PR #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:

for (genvar i = 0; unsigned'(i) < NumInp; i++) begin : gen_sel_assertions
assert property (@(posedge clk_i) disable iff (~rst_ni)
(valid_i[i] |-> sel_i[i] < sel_oup_t'(NumOut))) else
$fatal(1, "Non-existing output is selected!");
end

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.

Copy link
Collaborator

@niwis niwis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@niwis niwis merged commit 145e3be into master Dec 14, 2023
5 checks passed
@niwis niwis deleted the fix/stream_xbar branch December 14, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants