simuhw.float.riscv package
Module contents
- simuhw.float.riscv.is_available() bool
Checks whether
floatsubpackage is available or not.- Returns:
Trueiffloatsubpackage is available.
Note
floatsubpackage is available only when an appropriate version ofsoftfloatpymodule is found. The least version can be retrieved usingget_required_softfloatpy_least_version()
- class simuhw.float.riscv.FRec7(dtype: type[Float16 | Float32 | Float64 | Float128])
Bases:
FPUnaryOperatorA device to estimate a floating-point reciprocal to 7 bits.
This device is intended to be used for emulation of the RISC-V instruction
vfrec7.Available only if an appropriate version of
softfloatpymodule is found.- __init__(dtype: type[Float16 | Float32 | Float64 | Float128]) None
Creates a device to estimate a floating-point reciprocal.
- Parameters:
dtype – The floating-point type.
- work(time: float | None) tuple[list[InputPort], float | None]
Makes the device work.
- Parameters:
time – The current time in seconds.
Nonewhen starting to make the device work.- Returns:
A tuple of the list of the input ports that are to be watched receive a data word, and the next resuming time in seconds. The next resuming time can be
Noneif resumable anytime.
- class simuhw.float.riscv.SIMD_FRec7(width: int, dtype: type[Float16 | Float32 | Float64 | Float128] | Iterable[type[Float16 | Float32 | Float64 | Float128]])
Bases:
SIMD_FPUnaryOperatorA SIMD device to estimate floating-point reciprocals to 7 bits simultaneously.
This device is intended to be used for emulation of the RISC-V instruction
vfrec7.Available only if an appropriate version of
softfloatpymodule is found.- __init__(width: int, dtype: type[Float16 | Float32 | Float64 | Float128] | Iterable[type[Float16 | Float32 | Float64 | Float128]]) None
Creates a SIMD device to estimate floating-point reciprocals.
- Parameters:
width – The data word width in bits.
dtype – The selectable floating-point type or types.
- Raises:
ValueError – If
widthis not divisible by any ofdtypesizes.
- work(time: float | None) tuple[list[InputPort], float | None]
Makes the device work.
- Parameters:
time – The current time in seconds.
Nonewhen starting to make the device work.- Returns:
A tuple of the list of the input ports that are to be watched receive a data word, and the next resuming time in seconds. The next resuming time can be
Noneif resumable anytime.
- class simuhw.float.riscv.FRSqrt7(dtype: type[Float16 | Float32 | Float64 | Float128])
Bases:
FPUnaryOperatorA device to estimate a floating-point reciprocal square-root to 7 bits.
This device is intended to be used for emulation of the RISC-V instruction
vfrsqrt7.Available only if an appropriate version of
softfloatpymodule is found.- __init__(dtype: type[Float16 | Float32 | Float64 | Float128]) None
Creates a device to estimate a floating-point reciprocal square-root.
- Parameters:
dtype – The floating-point type.
- work(time: float | None) tuple[list[InputPort], float | None]
Makes the device work.
- Parameters:
time – The current time in seconds.
Nonewhen starting to make the device work.- Returns:
A tuple of the list of the input ports that are to be watched receive a data word, and the next resuming time in seconds. The next resuming time can be
Noneif resumable anytime.
- class simuhw.float.riscv.SIMD_FRSqrt7(width: int, dtype: type[Float16 | Float32 | Float64 | Float128] | Iterable[type[Float16 | Float32 | Float64 | Float128]])
Bases:
SIMD_FPUnaryOperatorA SIMD device to estimate floating-point reciprocal square-roots to 7 bits simultaneously.
This device is intended to be used for emulation of the RISC-V instruction
vfrsqrt7.Available only if an appropriate version of
softfloatpymodule is found.- __init__(width: int, dtype: type[Float16 | Float32 | Float64 | Float128] | Iterable[type[Float16 | Float32 | Float64 | Float128]]) None
Creates a SIMD device to estimate floating-point reciprocal square-roots.
- Parameters:
width – The data word width in bits.
dtype – The selectable floating-point type or types.
- Raises:
ValueError – If
widthis not divisible by any ofdtypesizes.
- work(time: float | None) tuple[list[InputPort], float | None]
Makes the device work.
- Parameters:
time – The current time in seconds.
Nonewhen starting to make the device work.- Returns:
A tuple of the list of the input ports that are to be watched receive a data word, and the next resuming time in seconds. The next resuming time can be
Noneif resumable anytime.