Closed sriyerg closed 1 year ago
I think the current guidelines give a clear recommendation: https://github.com/lowRISC/style-guides/blob/master/VerilogCodingStyle.md#space-around-keywords recommends adding a space. Simple guidelines are easier to adopt, and with an auto-formatter these issues stop being a concern.
Just as a point of comparison, I think most C++ codebases treat function-like keywords (alignof, decltype, sizeof, const_cast, ..., etc) differently to for
and while
, and don't have a spae after the keyword. Although this isn't an explicitly stated rule (unless I missed it), you can see this in the examples throughout the Google C++ styleguide.
Personally, I'm with @matutem. Note that the full syntax for a wait statement is something like this: wait (foo) bar;
. Using wait (foo);
is just a degenerate case (equivalent to doing something like while (foo());
instead of while (foo()) {}
in C). When you look at it like that, the construct looks a lot like an if
statement (if (foo) bar;
), so should "obviously" have the spaces.
There's also the wait fork;
syntax, which doesn't have the parens.
My preference: Keep the existing recommendation.
Our current style guide does not appear to have a recommendation for whether we should add a space after
wait
and the opening parenthesis. It will be useful to settle on one so that Verible knows what to do.Reason for adding space between wait and parenthesis:
Reason for not adding space:
Interestingly, the LRM also has a mixed usage of both styles. Though, it is of course not the best place to look for style recommendations.
Thanks Sri