/* Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/ All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * ======== main.c ======== */ #include #include #include #include #include #include #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) { System_abort("Ipc_start failed\n"); } BIOS_start(); /* does not return */ return(0); }