Only trim sigM if USE_MULT; only look for ffM then too

This commit is contained in:
Eddie Hung 2019-09-09 20:57:03 -07:00
parent a7e6032287
commit 2c04430445
1 changed files with 13 additions and 9 deletions

View File

@ -39,16 +39,18 @@ code unextend sigA sigB sigC sigD sigM
sigD = dsp->connections_.at(\D, SigSpec()); sigD = dsp->connections_.at(\D, SigSpec());
SigSpec P = port(dsp, \P); SigSpec P = port(dsp, \P);
// Only care about those bits that are used if (dsp->parameters.at(\USE_MULT, Const("MULTIPLY")).decode_string() == "MULTIPLY") {
int i; // Only care about those bits that are used
for (i = 0; i < GetSize(P); i++) { int i;
if (nusers(P[i]) <= 1) for (i = 0; i < GetSize(P); i++) {
break; if (nusers(P[i]) <= 1)
sigM.append(P[i]); break;
sigM.append(P[i]);
}
log_assert(nusers(P.extract_end(i)) <= 1);
} }
log_assert(nusers(P.extract_end(i)) <= 1); else
//if (GetSize(sigM) <= 10) sigM = P;
// reject;
endcode endcode
code argQ ffAD ffADmux ffADenpol sigA clock code argQ ffAD ffADmux ffADenpol sigA clock
@ -159,6 +161,7 @@ endcode
match ffMmux match ffMmux
if param(dsp, \MREG).as_int() == 0 if param(dsp, \MREG).as_int() == 0
if dsp->parameters.at(\USE_MULT, Const("MULTIPLY")).decode_string() == "MULTIPLY"
if nusers(sigM) == 2 if nusers(sigM) == 2
select ffMmux->type.in($mux) select ffMmux->type.in($mux)
choice <IdString> BA {\B, \A} choice <IdString> BA {\B, \A}
@ -194,6 +197,7 @@ match ffM_enable
endmatch endmatch
match ffM match ffM
if dsp->parameters.at(\USE_MULT, Const("MULTIPLY")).decode_string() == "MULTIPLY"
if !ffM_enable if !ffM_enable
if param(dsp, \MREG).as_int() == 0 if param(dsp, \MREG).as_int() == 0
if nusers(sigM) == 2 if nusers(sigM) == 2