mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Merge pull request #4612 from georgerennie/george/opt_demorgan_zero_width
opt_demorgan: skip zero width cells
This commit is contained in:
		
						commit
						cc17d5bb70
					
				
					 2 changed files with 19 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -39,6 +39,10 @@ void demorgan_worker(
 | 
			
		|||
		return;
 | 
			
		||||
 | 
			
		||||
	auto insig = sigmap(cell->getPort(ID::A));
 | 
			
		||||
 | 
			
		||||
	if (GetSize(insig) < 1)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	log("Inspecting %s cell %s (%d inputs)\n", log_id(cell->type), log_id(cell->name), GetSize(insig));
 | 
			
		||||
	int num_inverted = 0;
 | 
			
		||||
	for(int i=0; i<GetSize(insig); i++)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										15
									
								
								tests/opt/bug4610.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								tests/opt/bug4610.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
read_ilang <<EOT
 | 
			
		||||
autoidx 1
 | 
			
		||||
module \top
 | 
			
		||||
  wire output 1 \Y
 | 
			
		||||
  cell $reduce_or $reduce_or$rtl.v:29$20
 | 
			
		||||
    parameter \A_SIGNED 0
 | 
			
		||||
    parameter \A_WIDTH 0
 | 
			
		||||
    parameter \Y_WIDTH 1
 | 
			
		||||
    connect \A { }
 | 
			
		||||
    connect \Y \Y
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
equiv_opt -assert opt_demorgan
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue