mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	equiv_make: Add -make_assert option
This adds a -make_assert flag to equiv_make. When used, the pass generates $eqx and $assert cells to encode equivalence instead of $equiv.
This commit is contained in:
		
							parent
							
								
									34804f3fb6
								
							
						
					
					
						commit
						fbf5d89587
					
				
					 2 changed files with 97 additions and 27 deletions
				
			
		
							
								
								
									
										32
									
								
								tests/various/equiv_make_make_assert.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								tests/various/equiv_make_make_assert.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,32 @@
 | 
			
		|||
read_verilog <<EOT
 | 
			
		||||
module gold(
 | 
			
		||||
	input wire [7:0] a,
 | 
			
		||||
	input wire [7:0] b,
 | 
			
		||||
	output wire [7:0] c
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
wire [7:0] b_neg;
 | 
			
		||||
assign b_neg = -b;
 | 
			
		||||
assign c = a + b_neg;
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
module gate(
 | 
			
		||||
	input wire [7:0] a,
 | 
			
		||||
	input wire [7:0] b,
 | 
			
		||||
	output wire [7:0] c
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
wire [7:0] b_neg;
 | 
			
		||||
assign b_neg = ~b + 1;
 | 
			
		||||
assign c = a + b_neg;
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
equiv_make -make_assert gold gate miter
 | 
			
		||||
 | 
			
		||||
select -assert-count 0 t:$equiv
 | 
			
		||||
select -assert-count 2 t:$assert
 | 
			
		||||
 | 
			
		||||
prep -top miter
 | 
			
		||||
sat -prove-asserts -verify
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue