c0da Posted July 27, 2017 Share Posted July 27, 2017 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. Link to comment Share on other sites More sharing options...
D@n Posted July 27, 2017 Share Posted July 27, 2017 @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 More sharing options...
c0da Posted July 28, 2017 Author Share Posted July 28, 2017 Thanks, it is solved! Variable was optimized, and CPU hated. Link to comment Share on other sites More sharing options...
Question
c0da
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.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.