cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pi_muon10
Visitor
Visitor
7,868 Views
Registered: ‎09-01-2010

Problem with xps_mch_emc configuration for SRAM for microblaze.

I am using a custom board which contains a spartan 3an fpga. I would like to have a tutorial that contains how to configure  xps_mch_emc version 3.01.a for working with an external SRAM module, knowing that I am using Microblaze 7.30.a and that I am using ISE12.1. If possible, this tutorial shall tell how to appropriately enable/disable the cache memory.

Thank you.

0 Kudos
8 Replies
htsvn
Xilinx Employee
Xilinx Employee
7,860 Views
Registered: ‎08-02-2007

Hi,

 

You can build a BSB design on a development board with Cache being enabled.

 

This would give an MCH_EMC instance with corresponding parameters.

 

Or

 

Check the Example provided in the Datasheet to understand how to integrate the core with a SRAM.

 

$EDK_Install\hw\XilinxProcessorIPLib\pcores\xps_mch_emc_v3_01_a\doc

 

Thnx

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
pi_muon10
Visitor
Visitor
7,839 Views
Registered: ‎09-01-2010

Thanks for your response.

1-Unforunately, I can not find a Xilinx board with the same type of SRAM fitted on it.

2- I have initially checked the example in the datasheet and applied all what it says, but I am having a problem with running the code from SRAM. The problem is as follows:

-For the same project that runs on the internal BRAM with a stack of size 1KB, it doesn't run on the fitted SRAM except with a stack of minimum size 100KB

-When I try to debug the project, the program counter does not point at the main() function address, it contains a random address. I don't know whether it starts from the _start label an then gets lost, or if it is lost from the beginning.

(N.B. this only works when the PLB interface is disabled and the cache memory is also disabled. When any of them is enabled, the project does't run)

0 Kudos
pi_muon10
Visitor
Visitor
7,817 Views
Registered: ‎09-01-2010

Please, anyone knows a solution to this problem??

0 Kudos
xiaofeip_dup
Xilinx Employee
Xilinx Employee
7,800 Views
Registered: ‎08-07-2007

Hi

 

In the EMC datasheet, there is a section talks about how to connect a SRAM to EMC. Check that out and make sure you have made the right connections. Especially pay attention to the address lines.

 

The EMC core itself is simple enough to use, as long as you have the right connections, it should work. if it's asynchronous SRAM, you need set the timing parameters too.

 

-Felix

0 Kudos
pi_muon10
Visitor
Visitor
7,759 Views
Registered: ‎09-01-2010

Hi,

When I debug my project on hardware, and looked at the memory contents, I discovered that the branch instructions at the reset vector, interrupt vector are not the same as the ones written in the .elf file. This only happens when I download the code to run on the SRAM. In contrast when I run it on the BRAm, everything goes fine. Please if anyone has experiened this problem post a reply.

Thanks.

0 Kudos
dcherry
Explorer
Explorer
7,719 Views
Registered: ‎08-02-2007

Since your application runs fine out of BRAM, have you written a test application that will run out of the BRAM memory to do a full memory test of the SRAM?  It sounds like the data is not reading/writing into the external memory correctly, and you should ideally verify that you can read/write to all regions of the external memory from your microblaze processor.

 

If you have already done this type of test and can verify that the sw application reads/writes to all locations correctly, then you could next try XMD.  You can use the mwr and mrd commands to check that you can successfully read/write to the external memory offset correctly.

 

Lastly, you can do an objdump of the contents of your elf and compare this to a readback from the external memory to see if you can spot the exact locations of memory that are corrupted.  This will help to verify if it is the entire application that is incorrect, or just a few regions of the memory that are wrong.

0 Kudos
pi_muon10
Visitor
Visitor
7,688 Views
Registered: ‎09-01-2010

Hi,

I looked at the memory contents using the GUI of the SDK Debug view. I found that the branch instruction at the reset vector, which is in the BRAM(in my priject it is the boot memory), to be corrupted. That also applies to the branch instruction at the interrupt vector, which is also at the BRAM. When I copy their correct values from the .elf dump, everything goes fine (The copying is done also using the GUI of the SDK Debug view). Please if anyone has had such a problem, reply.

Thanks.

0 Kudos
aggneha25
Visitor
Visitor
7,218 Views
Registered: ‎07-06-2011

Hi,

 

I m new to EDK. I hv 2 program SRAM i.e. write n read to it. I dnt knw hw to do d same. which API's and functions 2 use. hw to set the clk. n othergnals or variables lyk OEN, CEN, WEN.

0 Kudos