mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Distinguish between the A, B input ports of `$_ANDNOT_`, `$_ORNOT_` gates when considering those for sharing. Unlike the input ports of the other supported single-bit gates, those are not interchangeable. Fixes #3848.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			517 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			517 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| read_verilog -icells <<EOF
 | |
| module test(a, b, s, y);
 | |
|   input a, b, s;
 | |
|   output y;
 | |
|   wire f, g;
 | |
| 
 | |
|   $_ANDNOT_ g1(.A(a), .B(b), .Y(f));
 | |
|   $_ANDNOT_ g2(.A(b), .B(a), .Y(g));
 | |
|   $_MUX_ m(.A(f), .B(g), .S(s), .Y(y));
 | |
| endmodule
 | |
| EOF
 | |
| 
 | |
| equiv_opt -assert opt_share
 | |
| 
 | |
| design -reset
 | |
| read_verilog -icells <<EOF
 | |
| module test(a, b, s, y);
 | |
|   input a, b, s;
 | |
|   output y;
 | |
|   wire f, g;
 | |
| 
 | |
|   $_ORNOT_ g1(.A(a), .B(b), .Y(f));
 | |
|   $_ORNOT_ g2(.A(b), .B(a), .Y(g));
 | |
|   $_MUX_ m(.A(f), .B(g), .S(s), .Y(y));
 | |
| endmodule
 | |
| EOF
 | |
| 
 | |
| equiv_opt -assert opt_share
 |