1 // $Id: _profile_init.c,v 1.1.2.1 2011/05/17 04:37:56 sadanan Exp $
2 /******************************************************************************
4 * Copyright (C) 2002 - 2014 Xilinx, Inc. All rights reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * Use of the Software is limited solely to applications:
17 * (a) running on a Xilinx device, or
18 * (b) that interact with a Xilinx device through a bus or interconnect.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
25 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 * Except as contained in this notice, the name of the Xilinx shall not be used
29 * in advertising or otherwise to promote the sale, use or other dealings in
30 * this Software without prior written authorization from Xilinx.
32 ******************************************************************************
35 * Initialize the Profiling Structures.
37 ******************************************************************************/
41 // XMD Initializes the following Global Variables Value during Program
42 // Download with appropriate values.
44 #ifdef PROC_MICROBLAZE
46 extern int microblaze_init(void);
48 #elif defined PROC_PPC
50 extern int powerpc405_init(void);
54 extern int cortexa9_init(void);
60 int profile_version = 1; // Version of S/W Intrusive Profiling library
62 int binsize = BINSIZE; // Histogram Bin Size
63 unsigned int cpu_clk_freq = CPU_FREQ_HZ ; // CPU Clock Frequency
64 unsigned int sample_freq_hz = SAMPLE_FREQ_HZ ; // Histogram Sampling Frequency
65 unsigned int timer_clk_ticks = TIMER_CLK_TICKS ;// Timer Clock Ticks for the Timer
67 // Structure for Storing the Profiling Data
68 struct gmonparam *_gmonparam = (struct gmonparam *)0xffffffff;
69 int n_gmon_sections = 1;
71 // This is the initialization code, which is called from the crtinit.
73 void _profile_init( void )
75 /* print("Gmon Init called....\r\n") ; */
76 /* putnum(n_gmon_sections) ; print("\r\n") ; */
77 /* if( _gmonparam == 0xffffffff ) */
78 /* printf("Gmonparam is NULL !!\r\n"); */
79 /* for( i = 0; i < n_gmon_sections; i++ ){ */
80 /* putnum(_gmonparam[i].lowpc) ; print("\t") ; */
81 /* putnum(_gmonparam[i].highpc) ; print("\r\n") ; */
82 /* putnum( _gmonparam[i].textsize ); print("\r\n") ; */
83 /* putnum( _gmonparam[i].kcountsize * sizeof(unsigned short));print("\r\n"); */
86 #ifdef PROC_MICROBLAZE
88 #elif defined PROC_PPC