Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Abnormal behavior of MicroBlaze

Status
Not open for further replies.

Zarrin

Junior Member level 3
Junior Member level 3
Joined
Jan 24, 2013
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,521
Dear all
I've written a simple code to run on microblaze processor (using EDK software). This code simply write some data into different FSL ports. When i define two different variables, namely pathlen[6][6] and data, everything goes well, but when i define some extra variables, the last FSL operation doesn't work. I can't understand what is the relation between a defined variable and a write_into_fsl() operation!!! The codes are as follow:

The code that runs well:
//////////////////////////////////////////////////////////////

#include "xparameters.h"

#include "xutil.h"

#include "core_0.h"

//====================================================

int main (void) {



/*
* MemoryTest routine will not be run for the memory at
* 0x00000000 (dlmb_cntlr)
* because it is being used to hold a part of this application program
*/


//int pathlen[6][6],path[100][6],fx[100],pos[2],posmax[2],child[2][6];
//int i,j,min_index,min_val,data=2;
//int city[6];

int data=2;
int pathlen[6][6];

pathlen[0][0]=0;
pathlen[0][1]=16;
pathlen[0][2]=9;
pathlen[0][3]=13;
pathlen[0][4]=11;
pathlen[0][5]=10;

pathlen[1][0]=16;
pathlen[1][1]=0;
pathlen[1][2]=15;
pathlen[1][3]=7;
pathlen[1][4]=6;
pathlen[1][5]=2;

pathlen[2][0]=9;
pathlen[2][1]=15;
pathlen[2][2]=0;
pathlen[2][3]=19;
pathlen[2][4]=15;
pathlen[2][5]=17;

pathlen[3][0]=13;
pathlen[3][1]=7;
pathlen[3][2]=19;
pathlen[3][3]=0;
pathlen[3][4]=5;
pathlen[3][5]=10;

pathlen[4][0]=11;
pathlen[4][1]=6;
pathlen[4][2]=15;
pathlen[4][3]=5;
pathlen[4][4]=0;
pathlen[4][5]=19;

pathlen[5][0]=10;
pathlen[5][1]=2;
pathlen[5][2]=17;
pathlen[5][3]=10;
pathlen[5][4]=19;
pathlen[5][5]=0;

write_into_fsl(data,0);
read_from_fsl(data,0);

write_into_fsl(data,1);
read_from_fsl(data,1);

write_into_fsl(data,2);
read_from_fsl(data,2);

srand(pathlen[0][1]);

data=20;
write_into_fsl(data,0);

return 0;
}
///------------------------------------------------------------------


The code that work abnormally by not executing the last write_into_fsl() instruction (The only difference between this code and the previous one is in the number of variables defined. The extra variables are not used in this code)

//-----------------------------------------------------------------------------------
#include "xparameters.h"

#include "xutil.h"

#include "core_0.h"

//====================================================

int main (void) {



/*
* MemoryTest routine will not be run for the memory at
* 0x00000000 (dlmb_cntlr)
* because it is being used to hold a part of this application program
*/


int pathlen[6][6],path[100][6],fx[100],pos[2],posmax[2],child[2][6];
int i,j,min_index,min_val,data=2;
int city[6];

//int data=2;
//int pathlen[6][6];

pathlen[0][0]=0;
pathlen[0][1]=16;
pathlen[0][2]=9;
pathlen[0][3]=13;
pathlen[0][4]=11;
pathlen[0][5]=10;

pathlen[1][0]=16;
pathlen[1][1]=0;
pathlen[1][2]=15;
pathlen[1][3]=7;
pathlen[1][4]=6;
pathlen[1][5]=2;

pathlen[2][0]=9;
pathlen[2][1]=15;
pathlen[2][2]=0;
pathlen[2][3]=19;
pathlen[2][4]=15;
pathlen[2][5]=17;

pathlen[3][0]=13;
pathlen[3][1]=7;
pathlen[3][2]=19;
pathlen[3][3]=0;
pathlen[3][4]=5;
pathlen[3][5]=10;

pathlen[4][0]=11;
pathlen[4][1]=6;
pathlen[4][2]=15;
pathlen[4][3]=5;
pathlen[4][4]=0;
pathlen[4][5]=19;

pathlen[5][0]=10;
pathlen[5][1]=2;
pathlen[5][2]=17;
pathlen[5][3]=10;
pathlen[5][4]=19;
pathlen[5][5]=0;

write_into_fsl(data,0);
read_from_fsl(data,0);

write_into_fsl(data,1);
read_from_fsl(data,1);

write_into_fsl(data,2);
read_from_fsl(data,2);

srand(pathlen[0][1]);

data=20;
write_into_fsl(data,0);

return 0;
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top