-
Notifications
You must be signed in to change notification settings - Fork 178
doc: Reduction operators: .any() vs .bool() #1219
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
Comments
oh, fancy seeing you here :3 they have the exact same semantics, and exist essentially because they are a carbon copy of corresponding distinct yosys cells, which exist because RTLIL is based directly on Verilog language to an insane degree, and thus using ie. don't worry about it, just use whichever you feel makes sense for the code you're writing. |
I would describe the difference as:
Python has a similar ambiguity--you can write both |
We should probably add the explanation above to the doc. |
@meithecatte Does this clarify it? #1263 |
Yes, I think that's a good way to clarify this. |
This section lists, among others, the following two reduction operators:
a.any()
– reduction OR; is any bit set?a.bool()
– conversion to boolean; is non-zero?If I am understanding these descriptions correctly,
a.any() == a.bool()
for alla
. However, the existence of both has me confused – am I missing something?If these two operators are just aliases, this fact should be called out in the docs. Otherwise, the difference between them should be explained.
The text was updated successfully, but these errors were encountered: