diff --git a/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c b/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c index 386a10cc..d56fd4b3 100644 --- a/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c +++ b/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c @@ -175,6 +175,112 @@ #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) #include "arm_helium_utils.h" + +static void arm_biquad_cas_df1_32x64_q31_scalar(const arm_biquad_cas_df1_32x64_ins_q31 * S, + const q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize) +{ + const q31_t *pIn = pSrc; /* input pointer initialization */ + q31_t *pOut = pDst; /* output pointer initialization */ + q63_t *pState = S->pState; /* state pointer initialization */ + const q31_t *pCoeffs = S->pCoeffs; /* coeff pointer initialization */ + q63_t acc; /* accumulator */ + q31_t Xn1, Xn2; /* Input Filter state variables */ + q63_t Yn1, Yn2; /* Output Filter state variables */ + q31_t b0, b1, b2, a1, a2; /* Filter coefficients */ + q31_t Xn; /* temporary input */ + int32_t shift = (int32_t) S->postShift + 1; /* Shift to be applied to the output */ + uint32_t sample, stage = S->numStages; /* loop counters */ + q31_t acc_l, acc_h; /* temporary output */ + uint32_t uShift = ((uint32_t) S->postShift + 1U); + uint32_t lShift = 32U - uShift; /* Shift to be applied to the output */ + + do + { + /* Reading the coefficients */ + b0 = *pCoeffs++; + b1 = *pCoeffs++; + b2 = *pCoeffs++; + a1 = *pCoeffs++; + a2 = *pCoeffs++; + + /* Reading the state values */ + Xn1 = (q31_t) (pState[0]); + Xn2 = (q31_t) (pState[1]); + Yn1 = pState[2]; + Yn2 = pState[3]; + + /* Initialize blkCnt with number of samples */ + sample = blockSize; + + while (sample > 0U) + { + /* Read the input */ + Xn = *pIn++; + + /* acc = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2] + a1 * y[n-1] + a2 * y[n-2] */ + + /* acc = b0 * x[n] */ + acc = (q63_t) Xn * b0; + /* acc += b1 * x[n-1] */ + acc += (q63_t) Xn1 * b1; + /* acc += b[2] * x[n-2] */ + acc += (q63_t) Xn2 * b2; + /* acc += a1 * y[n-1] */ + acc += mult32x64(Yn1, a1); + /* acc += a2 * y[n-2] */ + acc += mult32x64(Yn2, a2); + + /* Every time after the output is computed state should be updated. */ + /* The states should be updated as: */ + /* Xn2 = Xn1 */ + /* Xn1 = Xn */ + /* Yn2 = Yn1 */ + /* Yn1 = acc */ + Xn2 = Xn1; + Xn1 = Xn; + Yn2 = Yn1; + + /* The result is converted to 1.63, Yn1 variable is reused */ + Yn1 = acc << shift; + + /* Calc lower part of acc */ + acc_l = acc & 0xffffffff; + + /* Calc upper part of acc */ + acc_h = (acc >> 32) & 0xffffffff; + + /* Apply shift for lower part of acc and upper part of acc */ + acc_h = (uint32_t) acc_l >> lShift | acc_h << uShift; + + /* Store the output in the destination buffer in 1.31 format. */ + *pOut++ = acc_h; + /* Yn1 = acc << shift; */ + + /* Store the output in the destination buffer in 1.31 format. */ +/* *pOut++ = (q31_t) (acc >> (32 - shift)); */ + + /* decrement loop counter */ + sample--; + } + + /* The first stage output is given as input to the second stage. */ + pIn = pDst; + + /* Reset to destination buffer working pointer */ + pOut = pDst; + + /* Store the updated state variables back into the pState array */ + *pState++ = (q63_t) Xn1; + *pState++ = (q63_t) Xn2; + *pState++ = Yn1; + *pState++ = Yn2; + + } while (--stage); + +} + void arm_biquad_cas_df1_32x64_q31( const arm_biquad_cas_df1_32x64_ins_q31 * S, const q31_t * pSrc, @@ -193,218 +299,225 @@ void arm_biquad_cas_df1_32x64_q31( q31x4_t vecCoef, vecIn; q63_t acc; - do + if (blockSize <= 3) + { + arm_biquad_cas_df1_32x64_q31_scalar(S,pSrc,pDst,blockSize); + } + else { - uint32_t i; - /* - * Reading the coefficients - */ - b0 = *pCoeffs++; - b1 = *pCoeffs++; - b2 = *pCoeffs++; - a1 = *pCoeffs++; - a2 = *pCoeffs++; - - vecCoef[0] = 0; - vecCoef[1] = b2; - vecCoef[2] = b1; - vecCoef[3] = b0; - /* - * Reading the state values - */ - Xn1 = pState[0]; - Xn2 = pState[1]; - Yn1 = pState[2]; - Yn2 = pState[3]; - - /* - * append history with initial samples - */ - q31_t hist[6]; - hist[0] = 0; - hist[1] = Xn2; - hist[2] = Xn1; - hist[3] = pIn[0]; - hist[4] = pIn[1]; - hist[5] = pIn[2]; - - const q31_t *pIn1 = hist; - q31x4_t vecIn0 = *(q31x4_t *) & pIn[0]; - q31x4_t vecIn1 = *(q31x4_t *) & pIn[1]; - q31x4_t vecIn2 = *(q31x4_t *) & pIn[2]; - - i = 3; - do - { - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - vecIn = vld1q(pIn1); - pIn1 += 1; - Yn1 = vmlaldavaq(Yn1, vecIn, vecCoef); - Yn1 = asrl(Yn1, -shift); - /* - * Store the output in the destination buffer in 1.31 format. - */ - *pOut++ = (q31_t) (Yn1 >> 32); - } - while (--i); - - sample = blockSize - 3; - pIn1 = pIn + 3; - - i = sample / 4; - while (i > 0U) - { - - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn0, vecCoef); - vecIn = vld1q(pIn1); - pIn1 += 1; - Yn1 = asrl(Yn1, -shift); - /* - * Store the output in the destination buffer in 1.31 format. - */ - *pOut++ = (q31_t) (Yn1 >> 32); - - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn1, vecCoef); - vecIn0 = vld1q(pIn1); - pIn1 += 1; - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn2, vecCoef); - vecIn1 = vld1q(pIn1); - pIn1 += 1; - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn, vecCoef); - vecIn2 = vld1q(pIn1); - pIn1 += 1; - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - /* - * Decrement the loop counter - */ - i--; - } - /* - * save input state - */ - Xn2 = vecIn[2]; - Xn1 = vecIn[3]; - - int loopRemainder = blockSize - 3 - 4 * ((blockSize - 3) / 4); - if (loopRemainder == 1) - { - /* - * remainder - */ - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn0, vecCoef); - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - /* - * save input state - */ - Xn2 = vecIn0[2]; - Xn1 = vecIn0[3]; - - } - else if (loopRemainder == 2) - { - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn0, vecCoef); - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn1, vecCoef); - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - /* - * save input state - */ - Xn2 = vecIn1[2]; - Xn1 = vecIn1[3]; - - } - else if (loopRemainder == 3) - { - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn0, vecCoef); - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn1, vecCoef); - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - - acc = mult32x64(Yn1, a1); - acc += mult32x64(Yn2, a2); - Yn2 = Yn1; - Yn1 = acc; - Yn1 = vmlaldavaq(Yn1, vecIn2, vecCoef); - Yn1 = asrl(Yn1, -shift); - *pOut++ = (q31_t) (Yn1 >> 32); - /* - * save input state - */ - Xn2 = vecIn2[2]; - Xn1 = vecIn2[3]; - - } - - /* - * The first stage output is given as input to the second stage. - */ - pIn = pDst; - /* - * Reset to destination buffer working pointer - */ - pOut = pDst; - /* - * Store the updated state variables back into the pState array - */ - *pState++ = (q63_t) Xn1; - *pState++ = (q63_t) Xn2; - *pState++ = Yn1; - *pState++ = Yn2; + do + { + uint32_t i; + /* + * Reading the coefficients + */ + b0 = *pCoeffs++; + b1 = *pCoeffs++; + b2 = *pCoeffs++; + a1 = *pCoeffs++; + a2 = *pCoeffs++; + + vecCoef[0] = 0; + vecCoef[1] = b2; + vecCoef[2] = b1; + vecCoef[3] = b0; + /* + * Reading the state values + */ + Xn1 = pState[0]; + Xn2 = pState[1]; + Yn1 = pState[2]; + Yn2 = pState[3]; + + /* + * append history with initial samples + */ + q31_t hist[6]; + hist[0] = 0; + hist[1] = Xn2; + hist[2] = Xn1; + hist[3] = pIn[0]; + hist[4] = pIn[1]; + hist[5] = pIn[2]; + + const q31_t *pIn1 = hist; + q31x4_t vecIn0 = *(q31x4_t *) & pIn[0]; + q31x4_t vecIn1 = *(q31x4_t *) & pIn[1]; + q31x4_t vecIn2 = *(q31x4_t *) & pIn[2]; + + i = 3; + do + { + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + vecIn = vld1q(pIn1); + pIn1 += 1; + Yn1 = vmlaldavaq(Yn1, vecIn, vecCoef); + Yn1 = asrl(Yn1, -shift); + /* + * Store the output in the destination buffer in 1.31 format. + */ + *pOut++ = (q31_t) (Yn1 >> 32); + } + while (--i); + + sample = blockSize - 3; + pIn1 = pIn + 3; + + i = sample / 4; + while (i > 0U) + { + + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn0, vecCoef); + vecIn = vld1q(pIn1); + pIn1 += 1; + Yn1 = asrl(Yn1, -shift); + /* + * Store the output in the destination buffer in 1.31 format. + */ + *pOut++ = (q31_t) (Yn1 >> 32); + + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn1, vecCoef); + vecIn0 = vld1q(pIn1); + pIn1 += 1; + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn2, vecCoef); + vecIn1 = vld1q(pIn1); + pIn1 += 1; + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn, vecCoef); + vecIn2 = vld1q(pIn1); + pIn1 += 1; + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + /* + * Decrement the loop counter + */ + i--; + } + /* + * save input state + */ + Xn2 = vecIn[2]; + Xn1 = vecIn[3]; + + int loopRemainder = blockSize - 3 - 4 * ((blockSize - 3) / 4); + if (loopRemainder == 1) + { + /* + * remainder + */ + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn0, vecCoef); + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + /* + * save input state + */ + Xn2 = vecIn0[2]; + Xn1 = vecIn0[3]; + + } + else if (loopRemainder == 2) + { + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn0, vecCoef); + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn1, vecCoef); + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + /* + * save input state + */ + Xn2 = vecIn1[2]; + Xn1 = vecIn1[3]; + + } + else if (loopRemainder == 3) + { + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn0, vecCoef); + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn1, vecCoef); + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + + acc = mult32x64(Yn1, a1); + acc += mult32x64(Yn2, a2); + Yn2 = Yn1; + Yn1 = acc; + Yn1 = vmlaldavaq(Yn1, vecIn2, vecCoef); + Yn1 = asrl(Yn1, -shift); + *pOut++ = (q31_t) (Yn1 >> 32); + /* + * save input state + */ + Xn2 = vecIn2[2]; + Xn1 = vecIn2[3]; + + } + + /* + * The first stage output is given as input to the second stage. + */ + pIn = pDst; + /* + * Reset to destination buffer working pointer + */ + pOut = pDst; + /* + * Store the updated state variables back into the pState array + */ + *pState++ = (q63_t) Xn1; + *pState++ = (q63_t) Xn2; + *pState++ = Yn1; + *pState++ = Yn2; + } + while (--stage); } - while (--stage); } #else void arm_biquad_cas_df1_32x64_q31( diff --git a/Testing/Source/Tests/BIQUADQ31.cpp b/Testing/Source/Tests/BIQUADQ31.cpp index 5806b06c..6249c931 100755 --- a/Testing/Source/Tests/BIQUADQ31.cpp +++ b/Testing/Source/Tests/BIQUADQ31.cpp @@ -11,6 +11,13 @@ #define ABS_32x64_ERROR_Q31 ((q31_t)25) +void checkInnerTail(q31_t *b) +{ + ASSERT_TRUE(b[0] == 0); + ASSERT_TRUE(b[1] == 0); + ASSERT_TRUE(b[2] == 0); + ASSERT_TRUE(b[3] == 0); +} void BIQUADQ31::test_biquad_cascade_df1() { @@ -112,7 +119,7 @@ the state management of the fir is working.) */ - +#if 0 arm_biquad_cas_df1_32x64_q31(&this->S32x64,inputp,outp,blockSize); outp += blockSize; @@ -120,7 +127,27 @@ arm_biquad_cas_df1_32x64_q31(&this->S32x64,inputp,outp,blockSize); outp += blockSize; - +#else + int delta=1; + int k; + for(k=0;k + delta <2*blockSize ; k+=delta) + { + arm_biquad_cas_df1_32x64_q31(&this->S32x64,inputp,outp,delta); + outp += delta; + checkInnerTail(outp); + + inputp += delta; + } + if (k < 2*blockSize) + { + delta = 2*blockSize - k; + arm_biquad_cas_df1_32x64_q31(&this->S32x64,inputp,outp,delta); + outp += delta; + checkInnerTail(outp); + + inputp += delta; + } +#endif ASSERT_EMPTY_TAIL(output); diff --git a/Testing/extractDb.py b/Testing/extractDb.py index ee351b0d..ba859bc0 100755 --- a/Testing/extractDb.py +++ b/Testing/extractDb.py @@ -9,7 +9,6 @@ import os.path refCoreName="" -runidCMD = "runid = ?" # Command to get last runid lastID="""SELECT runid FROM RUN ORDER BY runid DESC LIMIT 1 @@ -62,8 +61,7 @@ parser.add_argument('-ratio', action='store_true', help="Compute ratios for regr parser.add_argument('-ref', nargs='?',type = str, default="M55", help="Reference COREDEF for ratio in db") parser.add_argument('-clampval', nargs='?',type = float, default=8.0, help="Clamp for ratio") parser.add_argument('-clamp', action='store_true', help="Clamp enabled for ratio") -parser.add_argument('-keep', nargs='?',type = str, help="Core to keep for ratio") -parser.add_argument('-disprunid', action='store_true', help="Include runid in html") +parser.add_argument('-cores', nargs='?',type = str, help="Cores to keep") # For runid or runid range parser.add_argument('others', nargs=argparse.REMAINDER,help="Run ID") @@ -72,36 +70,66 @@ args = parser.parse_args() c = sqlite3.connect(args.b) -if args.others: - vals=[] - runidCMD=[] - runidHeader=[] - runidVIEWcmd=[] - for t in args.others: +coreidSQL="select distinct coreid from CORE where coredef==?" + +def getCoreID(corename): + r=c.execute(coreidSQL,(corename,)) + t=r.fetchone() + if t is None: + print("Unrecognized reference core \"%s\"" % corename) + quit() + return(t[0]) + +def parseSelector(o,field="runid"): + vals=[] + runidCMD=[] + # parameters are not allowed in VIEWs + runidVIEWcmd=[] + for t in o: if re.search(r'-',t): bounds=[int(x) for x in t.split("-")] vals += bounds - runidHeader += ["%d <= runid <= %d" % tuple(bounds)] - runidCMD += ["(runid >= ? AND runid <= ?)"] - runidVIEWcmd += ["(runid >= %d AND runid <= %d) " % tuple(bounds)] + runidCMD += ["(%s >= ? AND %s <= ?)" % (field,field)] + x=(field,bounds[0],field,bounds[1]) + runidVIEWcmd += ["(%s >= %d AND %s <= %d)" % x] else: theid=int(t) - runidHeader += ["runid == %d" % theid] - runidCMD += ["runid == ?"] - runidVIEWcmd += ["runid == %d" % theid] + runidCMD += ["%s == ?" % field] + runidVIEWcmd += ["%s == %d" % (field,theid)] vals.append(theid) - runidval = tuple(vals) - runidHeader = "(" + "".join(joinit(runidHeader," OR ")) + ")" - runidCMD = "(" + "".join(joinit(runidCMD," OR ")) + ")" - runidVIEWcmd = "(" + "".join(joinit(runidVIEWcmd," OR ")) + ")" + runidval = tuple(vals) + runidCMD = "(" + "".join(joinit(runidCMD," OR ")) + ")" + runidVIEWcmd = "(" + "".join(joinit(runidVIEWcmd," OR ")) + ")" + return(runidval,runidCMD,runidVIEWcmd) + +if args.others: + + runidval,runidCMD,runidVIEWcmd = parseSelector(args.others) + else: theid=getLastRunID() print("Last run ID = %d\n" % theid) runidval=(theid,) - runidHeader="%d" % theid + runidCMD = "runid = ?" runidVIEWcmd="(runid = %d)" % theid +# None means all +coreidval = [] +coreidCMD = [] +keepCoreIds=None +if args.cores: + cores=args.cores.split(",") + coreids = [str(getCoreID(x.strip())) for x in cores] + keepCoreIds = coreids.copy() + if args.ref: + coreids.append(str(getCoreID(args.ref.strip()))) + #print(coreids) + coreidval,coreidCMD, coreidVIEWcmd = parseSelector(coreids,field="coreid") + runidval += coreidval + runidCMD += " AND %s" % coreidCMD + runidVIEWcmd += " AND %s" % coreidVIEWcmd + # We extract data only from data tables # Those tables below are used for descriptions @@ -703,28 +731,16 @@ referenceCoreID = None -coreidSQL="select distinct coreid from CORE where coredef==?" -def getCoreID(corename): - r=c.execute(coreidSQL,(corename,)) - t=r.fetchone() - if t is None: - print("Unrecognized reference core") - quit() - return(t[0]) refCore="""CREATE TEMP VIEW if not exists refCore AS select * from %s where (coreid = %s) and (typeid = %s) and %s and compilerid = %s""" -allOtherCores="""CREATE TEMP VIEW if not exists otherCore AS -select * from %s where (coreid != %s) and (typeid = %s) - and %s - and compilerid = %s""" otherCore="""CREATE TEMP VIEW if not exists otherCore AS -select * from %s where (coreid = %s) and (typeid = %s) +select * from %s where (typeid = %s) and %s and compilerid = %s""" @@ -734,7 +750,7 @@ select * from %s where (coreid = %s) and compilerid = %s""" otherCoreAllTypes="""CREATE TEMP VIEW if not exists otherCore AS -select * from %s where (coreid = %s) +select * from %s where (coreid = %s) and %s and compilerid = %s""" @@ -838,11 +854,10 @@ def computeRatio(benchName,viewParams,refMkViewCmd,otherMkViewCmd,byd): def computeRatioTable(benchName,referenceCore,typeID,compiler): viewParams = (benchName,referenceCore,typeID,runidVIEWcmd,compiler) refMkViewCmd = refCore % viewParams - otherMkViewCmd = allOtherCores % viewParams - if args.keep: - keepCoreID = getCoreID(args.keep) - otherParams = (benchName,keepCoreID,typeID,runidVIEWcmd,compiler) - otherMkViewCmd = otherCore % otherParams + otherParams = (benchName,typeID,runidVIEWcmd,compiler) + otherMkViewCmd = otherCore % otherParams + #print(refMkViewCmd) + #print(otherMkViewCmd) return(computeRatio(benchName,viewParams,refMkViewCmd,otherMkViewCmd,False)) @@ -851,6 +866,8 @@ def computeRatioTableForCore(benchName,referenceCore,otherCoreID,compiler): refMkViewCmd = refCoreAllTypes % viewParams otherParams = (benchName,otherCoreID,runidVIEWcmd,compiler) otherMkViewCmd = otherCoreAllTypes % otherParams + #print(refMkViewCmd) + #print(otherMkViewCmd) return(computeRatio(benchName,viewParams,refMkViewCmd,otherMkViewCmd,True)) def formatPerfRatio(s): @@ -945,9 +962,10 @@ def addReportFor(document,benchName): if args.byd: allCores=getAllExistingCores(benchName) if args.ratio: - allCores.remove(referenceCoreID) - if args.keep: - allCores=[getCoreID(args.keep)] + if keepCoreIds: + allCores=keepCoreIds + if ("%d" % referenceCoreID) in allCores: + allCores.remove("%d" % referenceCoreID) for aCoreID in allCores: nbElems = getNbElemsInBenchAndCoreCmd(benchName,aCoreID) if nbElems > 0: @@ -1106,10 +1124,7 @@ def createDoc(document,sections,benchtables): try: benchtables=getBenchTables() - if args.disprunid: - document = Document(runidHeader) - else: - document = Document(None) + document = Document(None) if args.ratio: referenceCoreID= getCoreID(args.ref)