]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - pasdk/test_arm/application/main.c
PASDK-376:Update ARM&DSP CCS projects
[processor-sdk/performance-audio-sr.git] / pasdk / test_arm / application / main.c
index c16b6b7b0e26a5f4f3e468a863e4b2db5a3cc3eb..08cd68faedeea65799058f606d2cf3b54b28211c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
-Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
+Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/
 All rights reserved.
 
 * Redistribution and use in source and binary forms, with or without 
@@ -44,15 +44,52 @@ All rights reserved.
 #include <ti/sysbios/BIOS.h>
 #include <ti/ipc/Ipc.h>
 
+#include "components/clk.h" /* PFP testing */
+#include "pfp/pfp.h"
+#include "pfp_app.h"        /* contains all PFP ID's */
+
+extern void BOARD_initPerfCounters();
+extern uint32_t readTime32(void);
+
 /*
  *  ======== main ========
  */
 Int main()
 { 
     Int status;
+    Int k;
+    //UInt32 tsStart, tsEnd, delta; // debug: check ARM SYS/BIOS timestamp provider
     
     Log_info0("Enter main()");
 
+#if 0 // debug: check ARM SYS/BIOS timestamp provider
+    BOARD_initPerfCounters();
+#endif
+    
+    /* Setup Profile Points (PFP) */
+    Log_info0("enter PFP Setup");
+    pfpCreate();
+    pfpCalibrate(1000, 1);
+    for (k = 0; k <= PFP_ID_LAST; k++) 
+    {
+        pfpEnable(k);   /* Enable profile point #k */
+    }
+    for (k = 1; k <= PFP_ID_LAST; k++)
+    {
+        pfpSetAlpha(k, PFP_DEF_ALPHA);  /* Set default exp. avg. time const. */
+    }
+#if 0 // debug: dummy load
+    for (k = 0; k < 1000; k++) 
+    {
+        tsStart=readTime32();
+        pfpBegin(PFP_ID_MAIN,0);
+        clkWorkDelay(CLK_WORKCNT_PER_MS);     /* This should take about 750,000 cycles to execute, or 750e3/600e6=1.25 msec. */
+        pfpEnd(PFP_ID_MAIN,0);
+        tsEnd=readTime32();
+    }
+    delta = tsEnd-tsStart;
+#endif
+
     // Initialize IPC
     status = Ipc_start();
     if (status < 0)