AnsweredAssumed Answered

how to enable and use  VFPU and SPE2-SIMD for MPC57xx in S32DS project

Question asked by E.w. Hu Employee on Aug 18, 2016
Latest reply on Aug 30, 2016 by E.w. Hu

Hi,

 

As we know, in most of our MPC57xx parts, such as MPC5775K as below, there are VFPU and SPE2-SIMD, which are very useful when doing DSP and complex math calculation.but how can we enable and use it in a S32DS project?

MPC5xxx 32-bit MCU for ADAS Applications

There is no options for this when create the project, and there are some related options in project properties-->C/C++ Bulid-->Stettings-->Target Processor, I checked Use hardware floating point, and configured Signal Processing: generate SPE v2 SIMD instructions and use ewl_c9x library:

S32DS_SPE_settings.jpg

 

However, after configurations as above, I find the disassemle code has nothing differerent,  no performance improve, no SPE instructions generated for my codes, it seems still call the ewl_c9x library to complete my math operations:

 

void calc_magnitude_doppler( fft_value_t* inAddr, magnitude_t* outAddr, bool_t bRCSComp, eDistRange distRange){

  fft_value_t real, img;

  uint64_t quad;

  double sqroot;

  uint16_t x, y;

 

  for(y=0; y<FFT_NUM_SAMPLES; y++){

   // Do it for one chirp

   for(x=0;x<FFT_NUM_CHIRPS;x++){

 

  // Pointer to values

  real = *(inAddr + (x * FFT_NUM_SAMPLES * 2));

  img = *(inAddr + (x * FFT_NUM_SAMPLES * 2) + 1);

 

  // Calculate magnitude

  quad = (uint64_t)((int64_t)real*real + (int64_t)img*img);

 

 

  sqroot = sqrt((double)quad);

// sqroot = __ev_fssqrt(quad);

 

  // Calculate RCS compensation

  /*if( par->bRCSComp == bTrue ){

   if( y < (FFT_NUM_SAMPLES/2) ){

  sqroot = sqroot * rcs_comp(y, par->distRange);

   }

   else{

  sqroot = sqroot * rcs_comp((y-(y-128)*2-1), par->distRange);

   }

  }*/

  // Save Value

  *(outAddr) = (magnitude_t)sqroot;

 

  // Adjust pointer

  outAddr++;

   }

   // Adjust Pointer

   inAddr+=2;

  }

}

 

So, how can we enable and use the powerful VFPU and SPE2-SIMD in S32DS project?  Is there any addtional header files should be included or any SPE/FPU initialization needed besides the above project settings/configurations?

 

Thanks~!

 

Best regard,

Enwei Hu.

Outcomes