mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	better handling of lut and begin/end add
This commit is contained in:
		
							parent
							
								
									3487b95224
								
							
						
					
					
						commit
						8badd4d812
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -6,7 +6,11 @@ module EFX_LUT4(
 | 
			
		|||
   input I3
 | 
			
		||||
);
 | 
			
		||||
	parameter LUTMASK = 16'h0000;
 | 
			
		||||
	assign O = LUTMASK >> {I3, I2, I1, I0};   
 | 
			
		||||
 | 
			
		||||
	wire [7:0] s3 = I3 ? LUTMASK[15:8] : LUTMASK[7:0];
 | 
			
		||||
	wire [3:0] s2 = I2 ?      s3[ 7:4] :      s3[3:0];
 | 
			
		||||
	wire [1:0] s1 = I1 ?      s2[ 3:2] :      s2[1:0];
 | 
			
		||||
	assign O = I0 ? s1[1] : s1[0];	   
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
module EFX_ADD(
 | 
			
		||||
| 
						 | 
				
			
			@ -71,12 +75,14 @@ module EFX_FF(
 | 
			
		|||
         begin
 | 
			
		||||
            always @(posedge clk)
 | 
			
		||||
               if (ce)
 | 
			
		||||
               begin
 | 
			
		||||
                  if (sr)
 | 
			
		||||
                     Q <= SR_VALUE;
 | 
			
		||||
                  else
 | 
			
		||||
                     Q <= d;
 | 
			
		||||
               end
 | 
			
		||||
         end
 | 
			
		||||
      end
 | 
			
		||||
      else
 | 
			
		||||
      begin
 | 
			
		||||
         always @(posedge clk or posedge sr)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue