Xilinx microblaze : SRAM external mem controller

R

Richard

Guest
Hello, <p>I am working with xilinx microblaze and I am trying to set up my microblaze to communicate with a 128 KB asynchronous SRAM chip (IS63LV1024). So far I have been able to set up the opb_emc (External Memory Controller) to communicate with the SRAM chip. However, I can only write to the SRAM in 4 bytes words. I cannot write byte by byte. Example: <BR>
If I try to write to byte 0x0F10_0001, the whole word at 0x0F10_0000 gets updated instead. <p>================================== <BR>
Before <BR>
0x0F10_0000: 00000000 <BR>
0x0F10_0004: 00000000 <p>Write 0x31 to 0x0F10_0001 <p>After <BR>
0x0F10_0000: 00000031 <BR>
0x0F10_0004: 00000000 <BR>
================================== <p>Now, I am trying to load my program to run in the external memory by setting the program start address in the compiler options. I cannot get the program to run in external memory and it keeps crashing. <p>Is that related to the fact that I cannot write byte by byte in the external memory, or are there some additional settings I need to do in the linker and compiler in order to get my program to run in external memory. <p>I am using Xilinx Platform Studio (XPS) to configure my system. Are there any special parameters that I need to set in the opb_emc to enable byte by byte access ? I could not find any such parameters. <p>Thanks <BR>
Richard
 
Hi Richard,
I am working with xilinx microblaze and I am trying to set up my
microblaze to communicate with a 128 KB asynchronous SRAM chip (IS63LV1024).
So far I'e been able to set up the opb_emc (External Memory Controller) to
communicate with the SRAM chip. However, I can only write to the
SRAM in 4 bytes rds. I cannot write byte by byte. Example:
If I try to write to byte 0x0F10_0001, the whole word at 0x0F10_0000 gets
updated instead.

There are two possiblilites

Software:
---------
So how do you write to memory?
In C you should be aware to declare your pointer according to the data width
you want to write.

int *my_memory_pointer = 0x0f100001;
*my_memory_pointer = 0x31;
will set the whole word.

char *my_memory_pointer = 0x0f100001;
*my_memory_pointer = 0x31;
will write only one byte

Hardware:
----------
How is your memory connected? Are you shure your byte - enable signals an
not
tied together?

---
In order to check whether your hardware or your software is the
reason for your problem try writing to memory using xmd.
Do not start any software on your microblaze.
Start xmd.
Connect to the microblaze.
Use the mwr command.
Example:

c:&gt; xmd -&gt; this starts xmd
xmd&gt; mbconnect (stub/mdm) -&gt; connects you to your microblaze, in case
you do not now
-&gt; how this works check
the mb docmentation
xmd&gt; mrd 0x0f100000 -&gt; read address 0x0f100000 (the whole word)
[...] -&gt; there should be the
content of your memory
xmd&gt; mwr 0x0f100001 0x31 b -&gt; writes _b_ytewise to memrory
xmd&gt; mrd 0x0f100000 -&gt; read address 0x0f100000
[...] -&gt; did it succeed? when
not, your hw might be wrong
-&gt; otherwise you have to
change your programm

Erik
 
"Erik Hansen" &lt;nospam-comp-arch-fpga@erik-hansen.de&gt; wrote in message news:&lt;bphv6h$1nj9oh$1@ID-207458.news.uni-berlin.de&gt;...
Hi Richard,
xmd&gt; mwr 0x0f100001 0x31 b -&gt; writes _b_ytewise to memrory
xmd&gt; mrd 0x0f100000 -&gt; read address 0x0f100000
WRONG, if you look at XMD stub you see the stub only support
32 bit read write to memory, so if you do byte read/write then
stub still reads/writes 32 and XMD emulates byte wide access!

antti
 
True,

You have to use the HW debug logic in MicroBlaze and the opb_mdm.

This will give you true byte-write and a lot of other things.

Göran

Antti Lukats wrote:

"Erik Hansen" &lt;nospam-comp-arch-fpga@erik-hansen.de&gt; wrote in message news:&lt;bphv6h$1nj9oh$1@ID-207458.news.uni-berlin.de&gt;...


Hi Richard,
xmd&gt; mwr 0x0f100001 0x31 b -&gt; writes _b_ytewise to memrory
xmd&gt; mrd 0x0f100000 -&gt; read address 0x0f100000



WRONG, if you look at XMD stub you see the stub only support
32 bit read write to memory, so if you do byte read/write then
stub still reads/writes 32 and XMD emulates byte wide access!

antti
 

Welcome to EDABoard.com

Sponsor

Back
Top