[21369] Erroneous results for memcpy to/from external memory

Hello,

I'm having issues when using 'memcpy' to and from external memory on my ADSP-21369.

When SIMD optimization are enabled (e.g. in Release mode), only every other element seems to be copied (as seen in the ?

I get the same behavior when using #pragma SIMD_for on a for loop between internal and external memory.

When profiling the copy, I get half the cycles compared to no optimization or #pragma vector_for.

Is this the expected behavior?

Note: I'm copying vectors of 32-bit integer or float.



Added data type (float & int)
[edited by: ClementLebar at 1:37 AM (GMT 0) on 2 May 2019]
Parents
  • For info, the PLL init is the following

    void Init_PLL_SDRAM(void)
    {
    	
    	int temp,i;
    	
    	int* temp1=(int*)0x8000000;
    	
    	*pPMCTL=PLLM27|INDIV|SDCKR2_5|DIVEN;
    	
    	temp=*pPMCTL;
    	temp|=PLLBP;
    	temp^=DIVEN;
    	*pPMCTL=temp;
    	
    	for(i=0;i<=5000;i++);
    	
    	*pPMCTL^=PLLBP;
    	
    	*pSYSCTL|=MSEN;
    	
    	*pEPCTL|=B2SD;
    	
    	#ifdef OPTIMIZE
    		
    		*pSDRRC=0x814|SDROPT|(1<<17);
    		
    	#else
    		
    		*pSDRRC=0x814;
    	
    	#endif
    	
    	*pSDCTL=SDCL3|DSDCLK1|SDPSS|SDCAW8|SDRAW12|SDTRAS7|SDTRP3|SDTWR2|SDTRCD3;
    	
    	temp=*temp1;
    	
    }

    Read optimization is enabled and the behavior is the same regardless.

Reply
  • For info, the PLL init is the following

    void Init_PLL_SDRAM(void)
    {
    	
    	int temp,i;
    	
    	int* temp1=(int*)0x8000000;
    	
    	*pPMCTL=PLLM27|INDIV|SDCKR2_5|DIVEN;
    	
    	temp=*pPMCTL;
    	temp|=PLLBP;
    	temp^=DIVEN;
    	*pPMCTL=temp;
    	
    	for(i=0;i<=5000;i++);
    	
    	*pPMCTL^=PLLBP;
    	
    	*pSYSCTL|=MSEN;
    	
    	*pEPCTL|=B2SD;
    	
    	#ifdef OPTIMIZE
    		
    		*pSDRRC=0x814|SDROPT|(1<<17);
    		
    	#else
    		
    		*pSDRRC=0x814;
    	
    	#endif
    	
    	*pSDCTL=SDCL3|DSDCLK1|SDPSS|SDCAW8|SDRAW12|SDTRAS7|SDTRP3|SDTWR2|SDTRCD3;
    	
    	temp=*temp1;
    	
    }

    Read optimization is enabled and the behavior is the same regardless.

Children