PASDK-71:Ensure pfpBegin() not called twice before call to pfpEnd() for particular...
authorFrank Livingston <frank-livingston@ti.com>
Wed, 3 May 2017 18:12:27 +0000 (13:12 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Wed, 3 May 2017 18:12:27 +0000 (13:12 -0500)
pasdk/common/pfp_app.h
pasdk/test_arm/.cproject
pasdk/test_dsp/framework/audioStreamInpProc.c
pasdk/test_dsp/framework/audioStreamOutProc.c
pasdk/test_dsp/framework/itopo/system.c

index 77ec563fda6bc3e1dc8d4a2ed13ce4956fcbf8a4..b79a3460fd777607fde5e8b0561e290e25d8751e 100644 (file)
 #define PFP_DEF_PERIOD_MS   (100.0)
 #define PFP_DEF_ALPHA       (PFP_DEF_PERIOD_MS/PFP_DEF_TAU_MS)
 
+// disable all PFP's
+//#define PFP_ENABLE_MASK ( 0 )
+
+// enable all PFP's
+#define PFP_ENABLE_MASK ( (1<<PFP_ID_ASIT_0) | \
+                          (1<<PFP_ID_ASIT_1) | \
+                          (1<<PFP_ID_ASOT_0) | \
+                          (1<<PFP_ID_ASOT_ASP_0) | \
+                          (1<<PFP_ID_ASOT_ASP_1) | \
+                          (1<<PFP_ID_ASOT_ASP_2) | \
+                          (1<<PFP_ID_ASOT_ASP_3) )
+
 #else /* _TMS320C6X */
 
 /* Define all PFP ID's */
 #define PFP_DEF_PERIOD_MS   (100.0)
 #define PFP_DEF_ALPHA       (PFP_DEF_PERIOD_MS/PFP_DEF_TAU_MS)
 
+//
+// NOTE: currently ARM PFP's are enabled in main()
+// These masks can be considered a placeholder
+
+//
+// disable all PFP's
+//#define PFP_ENABLE_MASK ( 0 )
+
+// enable INFO and DECODE PFP's
+#define PFP_ENABLE_MASK ( (1<<PFP_ID_ASDT_0) | \
+                          (1<<PFP_ID_ASDT_1) )
+
+
 #endif /* _TMS320C6X */
 
 #endif /* _PFP_APP_H */
index 419d20df40fba767727c49fc5cf7216a8a89a0b5..7962f36d60d8c291facd98d3bd98ebe629204dc2 100644 (file)
                                                        <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1926416484" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1108422400"/>
                                                </toolChain>
                                        </folderInfo>
-                                       <fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1859149112.763196952" name="pfp.c" rcbsApplicability="disable" resourcePath="common/pfp/pfp.c" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.exe.compilerDebug.1212267112.918634850">
-                                               <tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.exe.compilerDebug.1212267112.918634850" name="GNU Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.exe.compilerDebug.1212267112">
-                                                       <option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OPT_LEVEL.1699808898" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OPT_LEVEL.3" valueType="enumerated"/>
-                                                       <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__C_SRCS.289636932" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__C_SRCS"/>
-                                                       <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__CPP_SRCS.454915412" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__CPP_SRCS"/>
-                                                       <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__ASM_SRCS.1285572722" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__ASM_SRCS"/>
+                                       <fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1859149112.525828123" name="pfp.c" rcbsApplicability="disable" resourcePath="common/pfp/pfp.c" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.exe.compilerDebug.1212267112.1138995781">
+                                               <tool id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.exe.compilerDebug.1212267112.1138995781" name="GNU Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.exe.compilerDebug.1212267112">
+                                                       <option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OPT_LEVEL.1387663569" name="Optimization Level" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OPT_LEVEL.3" valueType="enumerated"/>
+                                                       <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__C_SRCS.1655899773" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__C_SRCS"/>
+                                                       <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__CPP_SRCS.1368316669" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__CPP_SRCS"/>
+                                                       <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__ASM_SRCS.777145737" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compiler.inputType__ASM_SRCS"/>
                                                </tool>
                                        </fileInfo>
                                        <sourceEntries>
index f822db70d255d4f010d6d73ce9be6bfef0693e4a..f6b0f37d7d83788078cf92108931b1cb8b5eb96d 100644 (file)
@@ -68,6 +68,10 @@ All rights reserved.
 
 #include "pfp/pfp.h"
 #include "pfp_app.h"        /* contains all PFP ID's */
+Int32 gNumPfpAsit0=0; // debug
+Int32 gNumPfpAsit1=0;
+
+
 
 // FL: debug
 #include "dbgCapAf.h"
@@ -763,7 +767,9 @@ Void taskAsipFxn(
         // Measure cycles in autodet processing loop.
         // Only measures cycles spent in loop.
         pfpEnd(PFP_ID_ASIT_0, PFP_FINISH_MEAS);      // PFP end
+        gNumPfpAsit0--;
         pfpBegin(PFP_ID_ASIT_0, pC->taskHandle);     // PFP begin
+        gNumPfpAsit0++;
 
         statusOp_read(&tempVar8,
                       &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
@@ -792,7 +798,9 @@ Void taskAsipFxn(
         }
 #endif
         
-        pfpEnd(PFP_ID_ASIT_0, PFP_FINISH_MEAS);      // PFP end -- outside of PFP for autodetection complete
+        // PFP end -- outside of PFP for autodetection complete
+        pfpEnd(PFP_ID_ASIT_0, PFP_FINISH_MEAS);
+        gNumPfpAsit0--;
         
         // query for input type
         if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM, (Arg )&sourceProgram))
@@ -2129,6 +2137,11 @@ PAF_ASIT_decodeProcessing(
                 else if (getVal == ASPERR_ABORT)
                 {
                     TRACE_VERBOSE0("PAF_ASIT_decodeProcessing. %d: return getVal");
+                    
+                    // PFP end -- outside of PFP for errors, EOS, or Input SIO change
+                    pfpEnd(PFP_ID_ASIT_1, PFP_FINISH_MEAS);
+                    gNumPfpAsit1--;
+                    
                     return getVal;
                 }
                 else
@@ -2217,6 +2230,11 @@ PAF_ASIT_decodeProcessing(
                             {
                                 gProbe2Err++;
                                 TRACE_TERSE0("PAF_ASIT_decodeProcessing. %d: INFO1, return (ASPERR_ISSUE)");
+                                
+                                // PFP end -- outside of PFP for errors, EOS, or Input SIO change
+                                pfpEnd(PFP_ID_ASIT_1, PFP_FINISH_MEAS);
+                                gNumPfpAsit1--;
+                                
                                 return (ASPERR_ISSUE);
                             }
                         }
@@ -2256,7 +2274,9 @@ PAF_ASIT_decodeProcessing(
                 // Measure cycles in decode processing loop.
                 // Only measures cycles spent in loop.
                 pfpEnd(PFP_ID_ASIT_1, PFP_FINISH_MEAS);     // PFP end
+                gNumPfpAsit1--;
                 pfpBegin(PFP_ID_ASIT_1, pC->taskHandle);    // PFP begin
+                gNumPfpAsit1++;
 
                 if (errno = pP->fxns->decodeInfo2(pP, pQ, pC, frame, block))
                 {
@@ -2323,8 +2343,6 @@ PAF_ASIT_decodeProcessing(
 
         }  // End of switch (state).
 
-        pfpEnd(PFP_ID_ASIT_1, PFP_FINISH_MEAS); // PFP end -- outside of PFP for errors, EOS, or Input SIO change
-        
         TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: Calling decode complete");
         if (pP->fxns->decodeComplete(pP, pQ, pC, alg, frame, block))
         {
@@ -2333,8 +2351,19 @@ PAF_ASIT_decodeProcessing(
         
         TRACE_TIME((&TIME_MOD, "as1-f2: ... + %d = ?? (final? %d)", dtime(), state == FINAL));
 
-        return errno;
+        // PFP end -- outside of PFP for errors, EOS, or Input SIO change
+        //pfpEnd(PFP_ID_ASIT_1, PFP_FINISH_MEAS);
+        //gNumPfpAsit1--;
+        
+        //return errno;
+        break;
     }  // End of for (;;) to Receive, process, and transmit the data.
+    
+    // PFP end -- outside of PFP for errors, EOS, or Input SIO change
+    pfpEnd(PFP_ID_ASIT_1, PFP_FINISH_MEAS);
+    gNumPfpAsit1--;
+    
+    return errno;
 } //PAF_ASIT_decodeProcessing
 
 // -----------------------------------------------------------------------------
index c63e826d115cda05ccdc3c83a01242ad7b152695..a8fb3cfe0d6b1167a378b6d548fbc5c5e2fc7259 100644 (file)
@@ -62,6 +62,7 @@ All rights reserved.
 
 #include "pfp/pfp.h"
 #include "pfp_app.h"        /* contains all PFP ID's */
+Int32 gNumPfpAsot0=0; // debug
 
 // FL: debug
 #include "evmc66x_gpio_dbg.h"
@@ -1458,8 +1459,10 @@ PAF_ASOT_decodeProcessing(
                 // Measure cycles in output processing loop.
                 // Only measures cycles spent in loop.
                 pfpEnd(PFP_ID_ASOT_0, PFP_FINISH_MEAS);
+                gNumPfpAsot0--;
                 pfpBegin(PFP_ID_ASOT_0, pC->taskHandle);
-
+                gNumPfpAsot0++;
+                
                 // (***) FL: do we need this? 
                 //       AF pointers come from CB read, any resets occur in Decoder AF.
                 // Reset audio frame pointers to original values
@@ -1544,17 +1547,22 @@ PAF_ASOT_decodeProcessing(
 
         }  // End of switch (state).
         
-        pfpEnd(PFP_ID_ASOT_0, PFP_FINISH_MEAS); // PFP end -- outside of PFP for errors, EOS, or Output SIO change
-
         TRACE_VERBOSE0("PAF_ASOT_decodeProcessing: Calling decode complete");
         if (pP->fxns->decodeComplete(pP, pQ, pC, NULL, frame, block))
         {
             /* ignored? */;
         }
         
-        return errno;
+        //pfpEnd(PFP_ID_ASOT_0, PFP_FINISH_MEAS); // PFP end -- outside of PFP for errors, EOS, or Output SIO change
+        //gNumPfpAsot0--;
+        
+        //return errno;
+        break;        
     } // End of for (;;)
         
+    pfpEnd(PFP_ID_ASOT_0, PFP_FINISH_MEAS); // PFP end -- outside of PFP for errors, EOS, or Output SIO change
+    gNumPfpAsot0--;
+        
     return errno;
 }
 
index d1101e730c1240df59b8ca6cc149545983976c3a..00c3fecbcb7b0861c3804781d776b45208058851 100644 (file)
@@ -47,14 +47,6 @@ All rights reserved.
 #include "pfp/pfp.h"
 #include "pfp_app.h"        /* contains all PFP ID's */
 
-#define PFP_ENABLE_MASK ( (1<<PFP_ID_ASIT_0) | \
-                          (1<<PFP_ID_ASIT_1) | \
-                          (1<<PFP_ID_ASOT_0) | \
-                          (1<<PFP_ID_ASOT_ASP_0) | \
-                          (1<<PFP_ID_ASOT_ASP_1) | \
-                          (1<<PFP_ID_ASOT_ASP_2) | \
-                          (1<<PFP_ID_ASOT_ASP_3) )
-                          
 // System Stream parameters, primary functions
 const struct {
     PAF_SST_FxnsMain *main;