MultiplyOnly constructor
Construct a MultiplyAccumulate that only multiplies to enable
using the same tester with zero accumulate addend c
.
Implementation
MultiplyOnly(
super.a,
super.b,
super.c,
Multiplier Function(Logic a, Logic b,
{Logic? selectSignedMultiplicand, Logic? selectSignedMultiplier})
mulGen, {
super.signedMultiplicand = false,
super.signedMultiplier = false,
super.signedAddend = false,
super.selectSignedMultiplicand,
super.selectSignedMultiplier,
super.selectSignedAddend,
}) // Will be overrwridden by multiplyGenerator
: super(
// ignore: prefer_interpolation_to_compose_strings
name: 'Multiply Only: ' +
_genName(mulGen, a, b, selectSignedMultiplicand,
selectSignedMultiplier)) {
final accumulate = addOutput('accumulate', width: a.width + b.width + 1);
final multiply = mulGen(a, b,
selectSignedMultiplicand: selectSignedMultiplicand,
selectSignedMultiplier: selectSignedMultiplier);
accumulate <=
mux(
multiply.isProductSigned,
multiply.product.signExtend(accumulate.width),
multiply.product.zeroExtend(accumulate.width));
}