Post Go back to editing

Complex multiply operation in Blackfin and Sharc DSP?

Hi, ADI guys,
We want to choose a proper DSP for IoT communication。The most frequently used operation is Complex multiply operation。That means:

Z1 = a + bi, Z2 = c + di
Z1Z1 = (ac-bd) + (ad + bc)i

We do this Complex multiply operation about 100 Million times every second. So we eagerly want to find a DSP which is good at complex multiply operation.

Now, we have to chips under consideration:
1. ADSP-BF707
2. ADSP-21569

And we want to compare their abilities at Complex multiply operation.

ADSP-BF707 has an instruction callded Mac32Cmplx. It’s perfectly fits our requirments. And we want to know more about the instruction Mac32Cmplx:
1. How many cycles it consumes to do a Complex multiply operation?
2. How to Call it in C language?

ADSP-21569 has higher operation frequence up to 1GHz. It seems that it has no Complex multiply instruction, but it has lib funtions for us to choose. So we want to know:
1. How many cycles it consumes to do a Complex multiply operation on ADSP-21569?


Maybe there are some informations we do not know about ADI DSP, so we need your suggestions badly, Thanks very much.

  • Hi,

    In order to measure cycle counts using code within an assembly, you can simply access the cycle count registers directly. We would recommend using the Cycle Count Registers, The cycle count could be read at the start of the function and stored/compared against the last reading.

    For BLACKFIN processor, You could use CYCLES and CYCLES2 register to count number of CCLK cycles a code takes to execute.

    For Sharc processor, You could use EMUCLK and EMUCLK2 register to count number of CCLK cycles a code takes to execute in the following way:

    r0=EMUCLK;
    //Code for which number of CCLK cyles need to be calculated
    r1= EMUCLK;
    r2= r1-r0;
    //r2 contains the number of CCLK cycles taken by the code to execute.

    Please refer the below programming reference manual for more details.

    For BLACKFIN: www.analog.com/.../ADSP-BF70x_Blackfin_Programming_Reference.pdf
    For SHARC: www.analog.com/.../sc58x-2158x-prm.pdf

    In order to measure cycle counts using C code, we provide Cycle Count Macros for profiling code execution, as documented at at below CCES help page:

    CrossCore® Embedded Studio > Blackfin® Development Tools Documentation > C/C++ Compiler and Library Manual for Blackfin® Processors > DSP Run-Time Library > DSP Run-Time Library Guide > Measuring Cycle Counts > Basic Cycle Counting Facility

    CrossCore® Embedded Studio > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > C/C++ Run-Time Library > C and C++ Run-Time Libraries Guide > Measuring Cycle Counts > Basic Cycle Counting Facility

    When doing so, ensure that "DO_CYCLE_COUNTS" macro is specified in the Properties. This can either be added as "DO_CYCLE_COUNTS" to the 'Preprocessor Definitions' under "Properties > CrossCore processor C/C++ Compiler > Preprocessor", or as "-DDO_CYCLE_COUNTS" to the 'Additional Options' under "Properties > CrossCore SHARC C/C++ Compiler".

    When the compiler generates the assembly version of a C-namespace symbol, it either prepends an underscore or appends a dot to the symbol name. When compiling with the -char-size-8 switch on processors that support byte-addressing, the symbol name will have a dot suffix, otherwise it will have an underscore prefix.

    Please follow the below link's for compiler manual in which details the correct approach for "Calling Assembly Subroutines From C/C++ Programs"

    CCES with sharc processor:
    www.analog.com/.../cces-SharcCompiler-manual.pdf

    CCES with Blackfin processor:
    www.analog.com/.../cces-blackfincompiler-library-manual.pdf

    Also, please refer the below Ezone thread for blackfin programming which might be helpful to you:
    ez.analog.com/.../144747

    Regards,
    Santhakumari.K