mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	opt_expr: Fix crash on $mul optimization with more zeros removed than Y has.
Fixes #2221.
This commit is contained in:
		
							parent
							
								
									b004f09018
								
							
						
					
					
						commit
						7afcb72c98
					
				
					 2 changed files with 24 additions and 0 deletions
				
			
		
							
								
								
									
										16
									
								
								tests/opt/bug2221.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								tests/opt/bug2221.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
read_verilog <<EOT
 | 
			
		||||
module test (
 | 
			
		||||
        input [1:0] a,
 | 
			
		||||
        input [1:0] b,
 | 
			
		||||
        output [5:0] y
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
wire [5:0] aa = {a, 4'h0};
 | 
			
		||||
wire [5:0] bb = {b, 4'h0};
 | 
			
		||||
 | 
			
		||||
assign y = aa * bb;
 | 
			
		||||
 | 
			
		||||
endmodule
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
equiv_opt -assert opt_expr
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue