cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
3,236 Views
Registered: ‎07-23-2010

Testing MPMC IP in XPS

Jump to solution

Hello everybody,

 

I have added and configured the MPMC IP in XPS using the Design Suite 12.2 version, just like it is explained in the video tutorials:

 

http://www.youtube.com/watch?v=D5ZbuNFuyyo

http://www.youtube.com/watch?v=pH4g9bIKi2g

http://www.youtube.com/watch?v=Jfw39n47oP4

 

and I have compiled the hardware correctly. But I do not know how to do to access to the DDR2 memory, using the MPMC, via software (using the PowerPc) processor. I have been looking for it in the functions explained in the API documentation, but the most similar way to access to it that I have found is by using the functions XMpmc_WriteReg and XMpmc_ReadReg. After configuring and  initializing correctly the IP, I try to call these functions but the application gets frozen... I have seen the source code for the XMpmc_SelfTest function, and it makes use of both functions to read and write values in the registers, but it seems that those registers are part of the device and they are not for accessing to the DDR2 memory really...

 

My source code is the following, I just want to insert a value in the DDR2 memory and then read it:

 

int main (void) {
XMpmc *mpmc_0;
XMpmc_Config *ConfigPtr;
int status;
int value;

    print("-- Entering main() --\r\n");
    ConfigPtr=XMpmc_LookupConfig (XPAR_MPMC_0_DEVICE_ID);
    if (ConfigPtr==NULL) {
        print("Lookup Config failed\r\n");
        return XST_FAILURE;
    }
    else{
        xil_printf ("\r\n cfgptr= %d \r\n", ConfigPtr);
    }
    status=XMpmc_CfgInitialize (mpmc_0, ConfigPtr, ConfigPtr->BaseAddress);
    if (status==XST_FAILURE) {
        print ("Init. MPMC failed\r\n");
        return XST_FAILURE;
    }
    xil_printf ("OK, let's test\r\n"); // This is the last line showed in TeraTerm

    /*status=XMpmc_SelfTest (mpmc_0);
    if (status==XST_FAILURE) {
        print("FAILED!\r\n");
    }
    else {
        print("OK! :smileyhappy:\r\n"); // If I run the test then it is OK
    }*/

    XMpmc_WriteReg (mpmc_0->ConfigPtr.BaseAddress, 0xC, 0x7); // Here it gets frozen
    value=XMpmc_ReadReg (mpmc_0->ConfigPtr.BaseAddress, 0xC);
    xil_printf ("Value: %d\r\n", value);
    
    print("-- Exiting main() --\r\n");
    return 0;
}

 

How could I write and read in the DDR memory correctly, please?? How could I continue testing? Can you help me? Is there any tutorial about this?? Because I have been looking for the way to do this in the Internet and it seems there is no documentation...

 

Thanks in advance!

 

PS: My board is a Xilinx Virtex-5 XC5VFX70T. I have also configured the MIG in Coregen according to the DDR memory MT4HTF3264HY-667F1.

Alejandro Cristo
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Participant
Participant
3,866 Views
Registered: ‎07-23-2010

Thanks for your answer rcingham,

 

finally the problem was that the mpmc was not correctly configured. I used the option in BSB instead and now it works, using variables as you propose.

 

Thank you very much anyway :)

Alejandro Cristo

View solution in original post

0 Kudos
2 Replies
Highlighted
Teacher
Teacher
3,203 Views
Registered: ‎09-09-2010

Have you thought of declaring a variable (possibly an array) in your C code, then making sure that the linker maps it into the DDR2 address range? Then you could write to and read from it with standard C variable assignment statements.

 


------------------------------------------
"If it don't work in simulation, it won't work on the board."
Highlighted
Participant
Participant
3,867 Views
Registered: ‎07-23-2010

Thanks for your answer rcingham,

 

finally the problem was that the mpmc was not correctly configured. I used the option in BSB instead and now it works, using variables as you propose.

 

Thank you very much anyway :)

Alejandro Cristo

View solution in original post

0 Kudos