mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	Add sub-assign and and-assign tests
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
This commit is contained in:
		
							parent
							
								
									470df03f3d
								
							
						
					
					
						commit
						39c39848a2
					
				
					 1 changed files with 34 additions and 0 deletions
				
			
		|  | @ -47,3 +47,37 @@ equiv_opt -assert opt_expr -fine | |||
| design -load postopt | ||||
| 
 | ||||
| select -assert-count 1 t:$xor r:A_WIDTH=4 r:B_WIDTH=4 r:Y_WIDTH=4 %i %i %i | ||||
| 
 | ||||
| design -reset | ||||
| read_verilog -sv <<EOT | ||||
| module opt_expr_sub_test(input [3:0] i, input [7:0] j, output [8:0] o); | ||||
| wire[8:0] a = 8'b0; | ||||
| initial begin | ||||
|         a -= i; | ||||
|         a -= j; | ||||
| end | ||||
|     assign o = a; | ||||
| endmodule | ||||
| EOT | ||||
| proc | ||||
| equiv_opt -assert opt_expr -fine | ||||
| design -load postopt | ||||
| 
 | ||||
| select -assert-count 1 t:$sub r:A_WIDTH=9 r:B_WIDTH=8 r:Y_WIDTH=9 %i %i %i | ||||
| 
 | ||||
| design -reset | ||||
| read_verilog -sv <<EOT | ||||
| module opt_expr_and_test(input [3:0] i, input [7:0] j, output [8:0] o); | ||||
| wire[8:0] a = 8'b11111111; | ||||
| initial begin | ||||
|         a &= i; | ||||
|         a &= j; | ||||
| end | ||||
|     assign o = a; | ||||
| endmodule | ||||
| EOT | ||||
| proc | ||||
| equiv_opt -assert opt_expr -fine | ||||
| design -load postopt | ||||
| 
 | ||||
| select -assert-count 1 t:$and r:A_WIDTH=4 r:B_WIDTH=4 r:Y_WIDTH=4 %i %i %i | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue