Where is the MODE1 register in 21571?

Hi,

    I want to set the PEYEN bit in MODE1 register, but I don't know the address of the MODE1 register, I can't find anything about it in adsp-sc57x-2157x_hwr.pdf. Otherwise, is there any function to help me to enable the PEy?

    Please give some issues, thanks!

  • 0
    •  Analog Employees 
    on Mar 22, 2021 5:24 PM

    Hi,

    You can follow one of method mentioned below to set PEYEN bit in MODE1 register

    R1 = MODE1;
    R1 = BSET R1 by 21; /* sets PEYEN bit */
    MODE1 = R1;

     or

    BIT SET MODE1 BITM_REGF_MODE1_PEYEN ; /*these macros are defined in the platform header, see #include <sys/platform.h> to get the definitions */
    NOP;                             /* effect latency */

    Please refer SHARC+ Core Programming Reference manual for more information:
    www.analog.com/.../SC58x-2158x-prm.pdf

    Regards,
    Anand Selvaraj.

  • Hi,

        I only find BITM_REGF_MODE1_PEYEN defined in <sys/platform.h> , where is others like MODE1,R1,SET,etc.

        I think I need to write it as asm code in my c source file, but I don't know how to add it in my code since the compiler makes errors. If I need to include any other .h file ?

  • +1
    •  Analog Employees 
    on Mar 25, 2021 5:15 AM in reply to Foster

    Hi,

    As per our understanding, you are asking to enable SIMD in C code. If so, Please follow the below steps and compiler can automatically generate SIMD code:
    1. Enable the optimizer;
    2. Remove any switches that disable SIMD generation.
    3. Specify the -loop-simd switch or the -linear-simd switch, as required, to tell the compiler to attempt SIMD generation.

    You don’t have to enable bit PEYEN using an asm() statement and that the compiler can automatically generate SIMD code from standard C/C++ as long as there is sufficient information to indicate that the transformation does not alter the semantics of the source code.

    Also, please refer in CCES help for more information:
    CrossCore® Embedded Studio 2.9.1 > SHARC® Development Tools Documentation > C/C++ Compiler Manual for SHARC® Processors > Compiler > C/C++ Compiler Language Extensions > SIMD Support > How to Help the Compiler Exploit SIMDMode

    Regards,
    Anand Selvaraj.