mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	- Add support for: *=, /=, %=, <<=, >>=, <<<=, >>>= - Unify existing support for: +=, -=, &=, |=, ^=
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			380 B
		
	
	
	
		
			Systemverilog
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			380 B
		
	
	
	
		
			Systemverilog
		
	
	
	
	
	
`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, >>>=)
 |