simuhw.fp.riscv package

Module contents

class simuhw.fp.riscv.FRec7(dtype: type[Float16 | Float32 | Float64 | Float128])

Bases: FPUnaryOperator

A 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 softfloatpy module 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. None when starting to make the device work.

Returns:

A tuple of the list of the input ports that are to be watched receive a signal, and the next resuming time in seconds. The next resuming time can be None if resumable anytime.

class simuhw.fp.riscv.SIMD_FRec7(width: int, dtype: type[Float16 | Float32 | Float64 | Float128] | Iterable[type[Float16 | Float32 | Float64 | Float128]])

Bases: SIMD_FPUnaryOperator

A 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 softfloatpy module 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 total width of words in bits.

  • dtype – The selectable floating-point type or types.

Raises:

ValueError – If width is not divisible by any of dtype sizes.

work(time: float | None) tuple[list[InputPort], float | None]

Makes the device work.

Parameters:

time – The current time in seconds. None when starting to make the device work.

Returns:

A tuple of the list of the input ports that are to be watched receive a signal, and the next resuming time in seconds. The next resuming time can be None if resumable anytime.

simuhw.fp.riscv.frec7(x: Float16 | Float32 | Float64 | Float128) Float16 | Float32 | Float64 | Float128
class simuhw.fp.riscv.FRSqrt7(dtype: type[Float16 | Float32 | Float64 | Float128])

Bases: FPUnaryOperator

A 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 softfloatpy module 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. None when starting to make the device work.

Returns:

A tuple of the list of the input ports that are to be watched receive a signal, and the next resuming time in seconds. The next resuming time can be None if resumable anytime.

class simuhw.fp.riscv.SIMD_FRSqrt7(width: int, dtype: type[Float16 | Float32 | Float64 | Float128] | Iterable[type[Float16 | Float32 | Float64 | Float128]])

Bases: SIMD_FPUnaryOperator

A 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 softfloatpy module 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 total width of words in bits.

  • dtype – The selectable floating-point type or types.

Raises:

ValueError – If width is not divisible by any of dtype sizes.

work(time: float | None) tuple[list[InputPort], float | None]

Makes the device work.

Parameters:

time – The current time in seconds. None when starting to make the device work.

Returns:

A tuple of the list of the input ports that are to be watched receive a signal, and the next resuming time in seconds. The next resuming time can be None if resumable anytime.

simuhw.fp.riscv.frsqrt7(x: Float16 | Float32 | Float64 | Float128) Float16 | Float32 | Float64 | Float128