mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	opt_reduce: add test for constant $reduce_and/or not being zero width
This commit is contained in:
		
							parent
							
								
									023f029dcf
								
							
						
					
					
						commit
						0572f8806f
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								tests/opt/opt_reduce_andor.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								tests/opt/opt_reduce_andor.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
# Check that opt_reduce doesn't produce zero width $reduce_or/$reduce_and,
 | 
			
		||||
 | 
			
		||||
read_verilog <<EOT
 | 
			
		||||
module reduce_const(output wire o, output wire a);
 | 
			
		||||
    wire [3:0] zero = 4'b0000;
 | 
			
		||||
    wire [3:0] ones = 4'b1111;
 | 
			
		||||
    assign o = |zero;
 | 
			
		||||
    assign a = &ones;
 | 
			
		||||
endmodule
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
equiv_opt -assert opt_reduce
 | 
			
		||||
design -load postopt
 | 
			
		||||
select -assert-none r:A_WIDTH=0
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue