FloatingPointSort<FpType extends FloatingPoint> constructor
Constructs a FloatingPointSort module that sorts two floating point values so that the larger one is first.
Implementation
FloatingPointSort(super.a, super.b,
{super.metaA,
super.metaB,
super.name = 'floating_point_sort',
super.reserveName,
super.reserveDefinitionName,
String? definitionName})
: super(
definitionName: definitionName ?? 'FloatingPointSort_W${a.width}') {
final (sorted: (larger, smaller), didSwap: doSwap) =
FloatingPointUtilities.sort((super.a, super.b));
output('outA') <= larger;
output('outB') <= smaller;
if ((metaA != null) & (metaB != null)) {
final (swapMetaA, swapMetaB) = swap(doSwap, (super.metaA!, super.metaB!));
output('outMetaA') <= swapMetaA;
output('outMetaB') <= swapMetaB;
}
}