coreblocks.func_blocks.fu.fpu package
Submodules
coreblocks.func_blocks.fu.fpu.fpu_common module
- class coreblocks.func_blocks.fu.fpu.fpu_common.Errors
Bases:
IntFlag
- DIVISION_BY_ZERO = 2
- INEXACT = 16
- INVALID_OPERATION = 1
- OVERFLOW = 4
- UNDERFLOW = 8
- __new__(value)
coreblocks.func_blocks.fu.fpu.fpu_error_module module
- class coreblocks.func_blocks.fu.fpu.fpu_error_module.FPUErrorMethodLayout
Bases:
object
FPU error checking module layouts for methods
- Parameters
- fpu_params: FPUParams
FPU parameters
- class coreblocks.func_blocks.fu.fpu.fpu_error_module.FPUErrorModule
Bases:
Elaboratable
FPU error checking module
- Parameters
- fpu_params: FPUParams
FPU rounding module parameters
- Attributes
- error_checking_request: Method
Transactional method for initiating error checking of a floating point number. Takes ‘error_in_layout’ as argument Returns final number and errors as ‘error_out_layout’
coreblocks.func_blocks.fu.fpu.fpu_rounding_module module
- class coreblocks.func_blocks.fu.fpu.fpu_rounding_module.FPURoudningMethodLayout
Bases:
object
FPU Rounding module layouts for methods
- Parameters
- fpu_params: FPUParams
FPU parameters
- class coreblocks.func_blocks.fu.fpu.fpu_rounding_module.FPURounding
Bases:
Elaboratable
FPU Rounding module
- Parameters
- fpu_params: FPUParams
FPU parameters
- Attributes
- rounding_request: Method
Transactional method for initiating rounding of a floating point number. Takes ‘rounding_in_layout’ as argument Returns rounded number and errors as ‘rounding_out_layout’
coreblocks.func_blocks.fu.fpu.lza module
- class coreblocks.func_blocks.fu.fpu.lza.LZAMethodLayout
Bases:
object
LZA module layouts for methods
- Parameters
- fpu_params: FPUParams
FPU parameters
- class coreblocks.func_blocks.fu.fpu.lza.LZAModule
Bases:
Elaboratable
LZA module Based on: https://userpages.cs.umbc.edu/phatak/645/supl/lza/lza-survey-arith01.pdf After performing subtracion, we may have to normalize floating point numbers and For that, we have to know the number of leading zeros. The most basic approach includes using LZC (leading zero counter) after subtracion, a more advanced approach includes using LZA (Leading Zero Anticipator) to predict the number of leading zeroes. It is worth noting that this LZA module works under assumptions that significands are in two’s complement and that before complementation sig_a was greater or equal to sig_b. Another thing worth noting is that LZA works with error = 1. That means that if ‘n’ is the result of the LZA module, in reality, to normalize number we may have to shift left by ‘n’ or ‘n+1’. There are few techniques of dealing with that error like specially designed shifters or predicting the error but the most basic approach is to just use multiplexer after shifter to perform one more shift left if necessary.
- Parameters
- fpu_params: FPUParams
FPU rounding module parameters
- Attributes
- predict_request: Method
Transactional method for initiating leading zeros prediction. Takes ‘predict_in_layout’ as argument Returns shift amount as ‘predict_out_layout’