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

[dv,cip] DV alert macro should work with size zero #26196

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

marnovandermaas
Copy link
Contributor

At the moment VCS complains that the size of the arrays in DV_ALERT_IF_CONNECT must not be zero or negative. To solve this I instantiate one of each when NUM_ALERTS is zero but the for loop that connects things up doesn't run.

Let me know if you know of a better solution. I tried a few options and this was the only one I could find that the tool found acceptable.

@marnovandermaas marnovandermaas marked this pull request as ready for review February 10, 2025 16:20
@marnovandermaas marnovandermaas requested a review from a team as a code owner February 10, 2025 16:20
@marnovandermaas marnovandermaas requested review from matutem and removed request for a team February 10, 2025 16:20
Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

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

This looks nice to me. I spent a bit of time thinking about whether we could avoid declaring the variable at all if NUM_ALERTS was zero, but I don't think that works: NUM_ALERTS is a parameter so isn't visible to the preprocessor.

At the moment VCS complains that the size of the arrays in
DV_ALERT_IF_CONNECT must not be zero or negative. To solve this I
instantiate one of each when NUM_ALERTS is zero but the for loop that
connects things up doesn't run.

Signed-off-by: Marno van der Maas <[email protected]>
@marnovandermaas marnovandermaas merged commit 3760387 into lowRISC:master Feb 12, 2025
3 checks passed
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