You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an unsigned operation is applied to the result of an arithmetic shift-right in the generated SystemVerilog, it may perform as a logical (unsigned) right-shift instead.
For example, if generated SystemVerilog looks like this:
assign x ={32{c}}& ($signed(a) >>> b) ;
This actually performs an unsigned shift right.
To Reproduce
Perform an unsigned bitwise operation on the result of an arithmetic shift-right.
Expected behavior
Generated verilog for arithmetic shift right is consistent always.
Actual behavior
Depending on surrounding logic, a logical shift-right may occur instead.
Additional: Dart SDK info
No response
Additional: pubspec.yaml
No response
Additional: Context
Present in v0.4.2
The text was updated successfully, but these errors were encountered:
Can you try this one? Note the curly braces instead of the parenthesis.
assignx= {32{c}} & {$signed(a) >>> b} ;
The reason for this is because the curly braces makes it self-determined. I suspect that the & operator causes it to think that the result type should be unsigned and thus the arithmetic shift makes a zero extend.
Can you try this one? Note the curly braces instead of the parenthesis.
assignx= {32{c}} & {$signed(a) >>> b} ;
The reason for this is because the curly braces makes it self-determined. I suspect that the & operator causes it to think that the result type should be unsigned and thus the arithmetic shift makes a zero extend.
Good call @saw235, I like this better. Tests pass, updated PR with that adjusted. Look good to you? #296
Describe the bug
If an unsigned operation is applied to the result of an arithmetic shift-right in the generated SystemVerilog, it may perform as a logical (unsigned) right-shift instead.
For example, if generated SystemVerilog looks like this:
This actually performs an unsigned shift right.
To Reproduce
Perform an unsigned bitwise operation on the result of an arithmetic shift-right.
Expected behavior
Generated verilog for arithmetic shift right is consistent always.
Actual behavior
Depending on surrounding logic, a logical shift-right may occur instead.
Additional: Dart SDK info
No response
Additional: pubspec.yaml
No response
Additional: Context
Present in v0.4.2
The text was updated successfully, but these errors were encountered: