Jump to content
  • 0

Nexys video DDR3 Microblaze newbie problem


c0da

Question

Hello!

I'm newbie in xilinx, and I have one more problem with microblaze with ddr3.

I want to have access to DDR3 memory in my MB processor, without processor caches.

I implement some design, write very simple code:

#include "xparameters.h"

int main()
{
	int a = 0;
	for(;;)
	{
		a++;
	}
	return 0;
}

and I can't start debug ...

When I start debug, it don't stay at main (but, thread is still running).

When I pause it, I see in disassembler what processor stays at _hw_exception_handler

 

In attach you can see system, linker mapping, and problem..

Please help me.

2017-07-27_10-47-28.png

2017-07-27_10-49-09.png

2017-07-27_10-49-32.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

@c0da,

It might be fun to look at the assembly the compiler is producing for that program.

From the compiler's standpoint, you are updating a variable that nothing depends upon.  Hence, "a++" can be optimized away.  That leaves your code as "for(;;);".  How MicroBlaze implements that, I'm not sure.  It might just halt the processor, at which point what the debugger is showing you makes sense.

If you have an objdump program lying around (might be called mb-objdump or some such), you might consider applying "objdump -D main.o" (adjust cmd for your objdump, and your main object file's name) and just see what you get from it.  Once you do that, then redeclare "a" as a "volatile int a" instead of "int a" and recompile.  I'm betting you'll see quite the difference.

As for whether or not the processor cache is running, I can't tell from what you've posted.

Dan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...