mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	opt_lut: eliminate LUTs evaluating to constants or inputs.
This commit is contained in:
		
							parent
							
								
									0a840dd883
								
							
						
					
					
						commit
						42c356c49c
					
				
					 4 changed files with 104 additions and 0 deletions
				
			
		
							
								
								
									
										19
									
								
								tests/opt/opt_lut_elim.il
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								tests/opt/opt_lut_elim.il
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
module \test
 | 
			
		||||
  wire input 1 \i
 | 
			
		||||
 | 
			
		||||
  wire output 2 \o1
 | 
			
		||||
  cell $lut $1
 | 
			
		||||
    parameter \LUT 16'0110100110010110
 | 
			
		||||
    parameter \WIDTH 4
 | 
			
		||||
    connect \A { \i 3'000 }
 | 
			
		||||
    connect \Y \o1
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  wire output 2 \o2
 | 
			
		||||
  cell $lut $2
 | 
			
		||||
    parameter \LUT 16'0110100010010110
 | 
			
		||||
    parameter \WIDTH 4
 | 
			
		||||
    connect \A { \i 3'000 }
 | 
			
		||||
    connect \Y \o2
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										3
									
								
								tests/opt/opt_lut_elim.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								tests/opt/opt_lut_elim.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
read_ilang opt_lut_elim.il
 | 
			
		||||
opt_lut
 | 
			
		||||
select -assert-count 0 t:$lut
 | 
			
		||||
| 
						 | 
				
			
			@ -1,2 +1,3 @@
 | 
			
		|||
read_ilang opt_lut_port.il
 | 
			
		||||
opt_lut
 | 
			
		||||
select -assert-count 2 t:$lut
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue