UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor begleysm
Visitor
6,971 Views
Registered: ‎08-12-2008

Problem with apparent skipping of instructions

Jump to solution

Apologies for double posting (this msg is also posted in the Embedded Processing forum) but I didnt realize how much more active this forum was... and I, frankly, don't know where this message should go!.

 

 

First off, I'll say that I don't know exactly what is causing this problem so I am throwing it out there to see if anyone has had a similar experience.

 

I am using a Memec Design V4FX12LC dev board (has a Virtex-4 XCv4FX12 with a built in PowerPC processor) .  I am using the BRAM for my instruction and data storage.  The system is designed to send and receive UDP packets through the built in Ethernet port and communicates with a PC.  I have, successfully, demonstrated that the board can send and receive UDP packets.  I am using the uartlite & emaclite cores with some custom code on top of it.  User I/O (w/ the FPGA board) is done through RS232 and a terminal emulator.  I have used both the built-in RS-232 to USB solution and the straight RS232 Serial Port with similar results.  I have also tried using the PPC at 100 Mhz & 300 MHz (100 MHz is my base system).

 

The problem that I am having is that the system appears to "skip" entire lines of code.  I will often not receive the output of print statements at all.  For instance, I have "while loop started" and "while loop ended" print statments at the beginning and end of the main loop (which checks for user input, sends a packet if the correct input found and then goes on to check for new received UDP packets and handles them).  Often times the "while loop started" will print over and over without the "while loop ended" or visa-versa.  In addition, sometimes the payload of the UDP packet will be printed fine (say, 000004) but sometimes garbage will be appended onto the end (say, 000004%$@^), where "%$@^" represent non-ascii characters.

 

I tried switching my print statements to xil_printf which, actually, seemed to help, but not come anywhere close to fixing the problem.  I also tried putting in a sleep(1) at the top of the while loop, this did not help either.

 

As you can see, I am pulling at straws as I try to find the problem so any help would be greatly appreciated.

 

Thanks,

Sean

 

0 Kudos
1 Solution

Accepted Solutions
Visitor begleysm
Visitor
8,232 Views
Registered: ‎08-12-2008

Re: Problem with apparent skipping of instructions

Jump to solution

Ok I finally figured it out.  The problem was a large array designed to receive the incoming UDP packet that was declared in main().  It was, therefore, put on the stack and this was causing, something, (either something else on the stack or something on the heap) to bleed over into enemy territory.  I fixed it initially by placing the array outside of main and declaring in static to put it in instruction memory instead of data memory and now plan and going about increasing the stack size.

 

Sean

0 Kudos
5 Replies
Visitor begleysm
Visitor
6,959 Views
Registered: ‎08-12-2008

Re: Problem with apparent skipping of instructions

Jump to solution

I'm not sure yet, but I believe the problem is related to the Ethernet MAC.

 

Sean

0 Kudos
Xilinx Employee
Xilinx Employee
6,956 Views
Registered: ‎01-18-2008

Re: Problem with apparent skipping of instructions

Jump to solution

I'd do the following:

 

- see if the issue persists even if you single step in XMD. Check the program memory to see it is not corrupt.

- make sure interrupts are being handled properly

- maybe your program is incorrect - invalid pointers, stack/heap size issues, etc.

- as a final resort, you can connect chipscope to the processors trace interface and see what instructions are being executed and pinpoint when an incorrect branch happens.

0 Kudos
Visitor begleysm
Visitor
6,941 Views
Registered: ‎08-12-2008

Re: Problem with apparent skipping of instructions

Jump to solution

Im working on getting the XMD to work right now.  I'll post back when I get some results.

 

Thanks,

Sean

0 Kudos
Visitor begleysm
Visitor
8,233 Views
Registered: ‎08-12-2008

Re: Problem with apparent skipping of instructions

Jump to solution

Ok I finally figured it out.  The problem was a large array designed to receive the incoming UDP packet that was declared in main().  It was, therefore, put on the stack and this was causing, something, (either something else on the stack or something on the heap) to bleed over into enemy territory.  I fixed it initially by placing the array outside of main and declaring in static to put it in instruction memory instead of data memory and now plan and going about increasing the stack size.

 

Sean

0 Kudos
Xilinx Employee
Xilinx Employee
5,096 Views
Registered: ‎08-13-2007

Re: Problem with apparent skipping of instructions

Jump to solution

Sean,

Here's an app note you may find useful:

http://www.xilinx.com/support/documentation/application_notes/xapp1036.pdf (Introduction to Software Debugging on Xilinx PowerPC 405 Embedded Platforms)

For other platforms:

http://www.xilinx.com/support/documentation/application_notes/xapp1037.pdf (Introduction to Software Debugging on Xilinx MicroBlaze Embedded Platforms)
http://www.xilinx.com/support/documentation/application_notes/xapp1060.pdf (Reference System: Debugging PowerPC 440 Processor Systems)

Cheers,

bt

0 Kudos