3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

sv: support remaining assignment operators

- Add support for: *=, /=, %=, <<=, >>=, <<<=, >>>=
- Unify existing support for: +=, -=, &=, |=, ^=
This commit is contained in:
Zachary Snow 2021-03-27 15:59:48 -04:00 committed by Zachary Snow
parent 3514c92dc4
commit 15f35d6754
3 changed files with 64 additions and 42 deletions

View file

@ -0,0 +1,23 @@
`define TEST(name, asgnop)\
module test_``name ( \
input logic [3:0] a, b, \
output logic [3:0] c \
); \
always @* begin \
c = a; \
c asgnop b; \
end \
endmodule
`TEST(add, +=)
`TEST(sub, -=)
`TEST(mul, *=)
`TEST(div, /=)
`TEST(mod, %=)
`TEST(bit_and, &=)
`TEST(bit_or , |=)
`TEST(bit_xor, ^=)
`TEST(shl, <<=)
`TEST(shr, >>=)
`TEST(sshl, <<<=)
`TEST(sshr, >>>=)