V
valentin tihomirov
Guest
compiler accepts this:
constant LOG2: positive := UTILS.BITS_TO_FIT(X);
constant C: Integer := UTILS.MUX2(WIDTH, LOG2, COND);
but not this:
constant C: Integer := MUX2(WIDTH, BITS_TO_FIT(X), COND);
errors:
- Cannot find function MUX2 for these actuals
- Assignment target incompatible with right side. Expected type
"INTEGER"
the functions used:
function BITS_TO_FIT(N: natural) return positive; -- "log2_ceiling"
function MUX2(I0, I1: Integer; SEL: boolean) return Integer;
Just wanted to avoid intermediate constant LOG2 as it has no sense per se.
constant LOG2: positive := UTILS.BITS_TO_FIT(X);
constant C: Integer := UTILS.MUX2(WIDTH, LOG2, COND);
but not this:
constant C: Integer := MUX2(WIDTH, BITS_TO_FIT(X), COND);
errors:
- Cannot find function MUX2 for these actuals
- Assignment target incompatible with right side. Expected type
"INTEGER"
the functions used:
function BITS_TO_FIT(N: natural) return positive; -- "log2_ceiling"
function MUX2(I0, I1: Integer; SEL: boolean) return Integer;
Just wanted to avoid intermediate constant LOG2 as it has no sense per se.