mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	cmp2lut: new techmap pass.
This commit is contained in:
		
							parent
							
								
									4b9f619349
								
							
						
					
					
						commit
						a91892bba4
					
				
					 5 changed files with 139 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1,4 +1,6 @@
 | 
			
		|||
simplemap
 | 
			
		||||
equiv_opt -assert techmap -map +/gate2lut.v -D LUT_WIDTH=4
 | 
			
		||||
equiv_opt -assert techmap -D LUT_WIDTH=4 -map +/cmp2lut.v
 | 
			
		||||
design -load postopt
 | 
			
		||||
select -assert-count 1 t:$lut
 | 
			
		||||
equiv_opt -assert techmap -D LUT_WIDTH=4 -map +/gate2lut.v
 | 
			
		||||
design -load postopt
 | 
			
		||||
select -assert-count 0 t:* t:$lut %d
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										29
									
								
								tests/lut/map_cmp.v
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								tests/lut/map_cmp.v
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
module top(...);
 | 
			
		||||
	input [3:0] a;
 | 
			
		||||
 | 
			
		||||
	output o1_1 = 4'b1010 <= a;
 | 
			
		||||
	output o1_2 = 4'b1010 <  a;
 | 
			
		||||
	output o1_3 = 4'b1010 >= a;
 | 
			
		||||
	output o1_4 = 4'b1010 >  a;
 | 
			
		||||
	output o1_5 = 4'b1010 == a;
 | 
			
		||||
	output o1_6 = 4'b1010 != a;
 | 
			
		||||
 | 
			
		||||
	output o2_1 = a <= 4'b1010;
 | 
			
		||||
	output o2_2 = a <  4'b1010;
 | 
			
		||||
	output o2_3 = a >= 4'b1010;
 | 
			
		||||
	output o2_4 = a >  4'b1010;
 | 
			
		||||
	output o2_5 = a == 4'b1010;
 | 
			
		||||
	output o2_6 = a != 4'b1010;
 | 
			
		||||
 | 
			
		||||
	output o3_1 = 4'sb0101 <= $signed(a);
 | 
			
		||||
	output o3_2 = 4'sb0101 <  $signed(a);
 | 
			
		||||
	output o3_3 = 4'sb0101 >= $signed(a);
 | 
			
		||||
	output o3_4 = 4'sb0101 >  $signed(a);
 | 
			
		||||
	output o3_5 = 4'sb0101 == $signed(a);
 | 
			
		||||
	output o3_6 = 4'sb0101 != $signed(a);
 | 
			
		||||
 | 
			
		||||
	output o4_1 = $signed(a) <= 4'sb0000;
 | 
			
		||||
	output o4_2 = $signed(a) <  4'sb0000;
 | 
			
		||||
	output o4_3 = $signed(a) >= 4'sb0000;
 | 
			
		||||
	output o4_4 = $signed(a) >  4'sb0000;
 | 
			
		||||
endmodule
 | 
			
		||||
							
								
								
									
										0
									
								
								tests/lut/run-test.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								tests/lut/run-test.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue