1 //////////////////////////////////////////////////////////////////////
3 // Copyright (c) 2002-2011 Xilinx, Inc. All rights reserved.
6 // XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
7 // COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
8 // ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
9 // STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
10 // IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
11 // FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
12 // XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
13 // THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
14 // ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
15 // FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
16 // AND FITNESS FOR A PARTICULAR PURPOSE.
18 // $Id: _profile_init.c,v 1.1.2.1 2011/05/17 04:37:56 sadanan Exp $
21 // Initialize the Profiling Structures.
23 //////////////////////////////////////////////////////////////////////
27 // XMD Initializes the following Global Variables Value during Program
28 // Download with appropriate values.
30 #ifdef PROC_MICROBLAZE
32 extern int microblaze_init(void);
34 #elif defined PROC_PPC
36 extern int powerpc405_init(void);
40 extern int cortexa9_init(void);
46 int profile_version = 1; // Version of S/W Intrusive Profiling library
48 int binsize = BINSIZE; // Histogram Bin Size
49 unsigned int cpu_clk_freq = CPU_FREQ_HZ ; // CPU Clock Frequency
50 unsigned int sample_freq_hz = SAMPLE_FREQ_HZ ; // Histogram Sampling Frequency
51 unsigned int timer_clk_ticks = TIMER_CLK_TICKS ;// Timer Clock Ticks for the Timer
53 // Structure for Storing the Profiling Data
54 struct gmonparam *_gmonparam = (struct gmonparam *)0xffffffff;
55 int n_gmon_sections = 1;
57 // This is the initialization code, which is called from the crtinit.
59 void _profile_init( void )
61 /* print("Gmon Init called....\r\n") ; */
62 /* putnum(n_gmon_sections) ; print("\r\n") ; */
63 /* if( _gmonparam == 0xffffffff ) */
64 /* printf("Gmonparam is NULL !!\r\n"); */
65 /* for( i = 0; i < n_gmon_sections; i++ ){ */
66 /* putnum(_gmonparam[i].lowpc) ; print("\t") ; */
67 /* putnum(_gmonparam[i].highpc) ; print("\r\n") ; */
68 /* putnum( _gmonparam[i].textsize ); print("\r\n") ; */
69 /* putnum( _gmonparam[i].kcountsize * sizeof(unsigned short));print("\r\n"); */
72 #ifdef PROC_MICROBLAZE
74 #elif defined PROC_PPC