mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Reduced number of cycles needed for division
This commit is contained in:
		
							parent
							
								
									d6f1453275
								
							
						
					
					
						commit
						e840edc4e6
					
				@ -95,8 +95,7 @@ module fdivsqrtfsm(
 | 
			
		||||
  always_comb begin 
 | 
			
		||||
    if (SqrtE) fbits = Nf + 2 + 2; // Nf + two fractional bits for round/guard + 2 for right shift by up to 2
 | 
			
		||||
    else       fbits = Nf + 2 + `LOGR; // Nf + two fractional bits for round/guard + integer bits - try this when placing results in msbs
 | 
			
		||||
    if (SqrtE) cycles =  (fbits + (`LOGR*`DIVCOPIES)-1)/(`LOGR*`DIVCOPIES);  // ceiling(fbits / r*k)
 | 
			
		||||
    else       cycles = `FPDUR; // *** line above should work once otfc is used to put results in upper bits
 | 
			
		||||
    cycles =  (fbits + (`LOGR*`DIVCOPIES)-1)/(`LOGR*`DIVCOPIES);
 | 
			
		||||
  end 
 | 
			
		||||
 | 
			
		||||
  /* verilator lint_on WIDTH */
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user