stack heap 溢出的问题
/***************************** Include Files *********************************/
#include "xparameters.h"
#include "stdio.h"
#include "xio.h"
#include "math.h"
#include "dpd.h"
#include "xbasic_types.h"
#include "xgpio.h"
#include "mb_interface.h"
/***************************Macros Definitions*******************************/
#define LED_GPIO XPAR_LEDS_4BITS_DEVICE_ID
#define LED_LADD XPAR_XPS_GPIO_0_BASEADDR
#define LED_CHANNEL 1
#define LED_DLY 1000000
#define N 1000
XGpio Mygpio;
void getdata(fcomplex Tx[N],fcomplex Rx[N]);
void waitfor();
int main(void)
{
int Status;
int i=0;
int j=0;
float temp=0;
float txpower=0;
float rxpower=0;
int FLAG=0;
float READ[2*N]={0};
fcomplex Tx[N]={0};
fcomplex Rx[N]={0};
fcomplex TXe[N]={0};
fcomplex RXe[N]={0};
microblaze_init_icache_range(0,XPAR_MICROBLAZE_0_CACHE_BYTE_SIZE);
microblaze_enable_icache();
microblaze_init_dcache_range(0,XPAR_MICROBLAZE_0_DCACHE_BYTE_SIZE);
microblaze_enable_dcache();
microblaze_enable_interrupts();
xil_printf("---Entering main---\n\n\n\r");
/*INITIAL GPIO*/
Status = XGpio_Initialize(&Mygpio, LED_GPIO);
if (Status == XST_SUCCESS)
{
// xil_printf("-- XGpio_Initialize Was Passed --\n\r");
}
// else
// {
// xil_printf("-- XGpio_Initialize Was Failed --\n\r");
// }
/*
* Set the direction for all signals to be outputs
*/
XGpio_SetDataDirection(&Mygpio, 1, 0x0);
/*
* Set the GPIO outputs to High
*/
XGpio_DiscreteWrite(&Mygpio, 1, 0xF);
waitfor();
// xil_printf("---In this case we use for loop generate data for simulation---\n\n\n\r");
getdata(Tx , Rx );
xil_printf("---For Loop Passed--\n\r");
XGpio_DiscreteWrite(&Mygpio, 1, 0xF);
microblaze_disable_dcache();
microblaze_init_dcache_range(0,XPAR_MICROBLAZE_0_DCACHE_BYTE_SIZE);
microblaze_disable_icache();
microblaze_init_icache_range(0,XPAR_MICROBLAZE_0_CACHE_BYTE_SIZE);
xil_printf("---Exiting main---\n\r");
return 0;
}
void getdata(fcomplex Tx[N],fcomplex Rx[N])
{
int i=0;
int j=0;
for(i=0; i<N; i++)
{
Tx.re=(float)(i*0.19);
Tx.im=(float)(i*0.27);
Rx.re=(float)(i*0.36);
Rx.im=(float)(i*0.79);
}
}
void waitfor()
{
long int i;
for(i=100; i>=0; i--);
}
使用XMD对其进行调试
FPGADeveloper 2011-10-14 23:44
Hoki 2011-10-14 17:54