⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 conv_is54136_1by2_6.asm

📁 ADSP-BLACKFIN533 平台上实现卷积编码
💻 ASM
字号:
/*******************************************************************************
Copyright(c) 2000 - 2002 Analog Devices. All Rights Reserved.
Developed by Joint Development Software Application Team, IPDC, Bangalore, India
for Blackfin DSPs  ( Micro Signal Architecture 1.0 specification).

    By using this module you agree to the terms of the Analog Devices License
Agreement for DSP Software. 
********************************************************************************
Module name     : conv_is54136_1by2_6.asm
Label name      : __conv_is54136_1by2_6
Version         : 1.3
Change History  :

                Version     Date        Author          Comments
                1.3         11/18/2002  Swarnalatha     Tested with VDSP++ 3.0
                                                        compiler 6.2.2 on 
                                                        ADSP-21535 Rev.0.2
                1.2         11/13/2002  Swarnalatha     Tested with VDSP++ 3.0
                                                        on ADSP-21535 Rev. 0.2
                1.1         01/22/2002  Swarnalatha     Modified to match
                                                        silicon cycle count
                1.0         03/15/2001  Swarnalatha     Original 

Description     : This function performs convolution coding for the
                  polynomials G0=65 and G1=57 in Octal Form, used in IS-54/136.
                  The function produces the coded output for a given input
                  message data. The result is stored in the output buffer. The
                  parameters passed should be in the order d,o,a.

                  d  = Start address of the message data which has to be encoded
                  o  = Pointer to the output of the encoder
                  a  = Number of  bits in the input message data

Assumptions     : The number of bits must be a multiple of 16.

Implementation  : Let the message bits be x0,x1,x2,......x15.The first generator
                  polynomial is G0 = 65 = 110101 = 1+D+D**3+D**5.
                  The output 16 bit word(for G0) for a message of 16 bits is
                  given by

                | c0[1] |         | x0 |   | 0 |   | 0 |   | 0 |   | 0 |   | 0 |
                | c0[2] |         | x1 |   | x0|   | 0 |   | 0 |   | 0 |   | 0 |
                | c0[3] |         | x2 |   | x1|   | 0 |   | 0 |   | 0 |   | 0 |
                | c0[4] |   =     | x3 | ^ | x2| ^ | 0 | ^ | x0| ^ | 0 | ^ | 0 |
                | c0[5] |         | x4 |   | x3|   | 0 |   | x1|   | 0 |   | 0 |
                | ..... |         | .. |   | ..|   |.. |   | ..|   | ..|   | ..|   
                | c0[16]|         | x15|   |x14|   | 0 |   | x12|  | 0 |   |x10|

                                                                .............[1]

                The second polynomial is 
                G1 = 57 = 101111 = 1+D**2+D**3+D**4+D**5.
                The output 16 bit word(for G1) for a message of 16 bits is given
                by

                | c1[1] |         | x0 |   | 0 |   | 0 |   | 0 |   | 0 |   | 0 |
                | c1[2] |         | x1 |   | 0 |   | 0 |   | 0 |   | 0 |   | 0 |
                | c1[3] |         | x2 |   | 0 |   | x0|   | 0 |   | 0 |   | 0 |
                | c1[4] |    =    | x3 | ^ | 0 | ^ | x1| ^ | x0| ^ | 0 | ^ | 0 |
                | c1[5] |         | x4 |   | 0 |   | x2|   | x1|   | x0|   | 0 |
                | ......|         | .. |   | ..|   | ..|   | ..|   | ..|   | ..|
                | c1[16] |        | x15|   | 0 |   |x13|   | x12|  |x11|   |x10|

                                                             ................[2]

Prototype       :
                    void _conv_is54136_1by2_6
                    ( 
                        fract16 * ,         // Start address of message data 'd'
                        char *,             //Pointer To The output 'o'
                        int                 //Number of message bits
                        );

Registers used  : A0, R0-R7, I0-I2, B0, B1, M0, L0-L2, P0-P2, LC0, LC1.

Performance     : 
                Code size           : 182 Bytes

                If number of message bits = a
                Kernel cycle count  : [(a/16)*(29+16*3)]
                Total Cycle Count   : 188 (for a  =  32)
*******************************************************************************/
.section  L1_code;
.global __conv_is54136_1by2_6;
.align 8;

__conv_is54136_1by2_6:

    [--SP] = (R7:4);        //Push the call save registers  R7,R6,R5 and R4
    L0 = 0;
    L1 = 0;
    L2 = 0;
    I1 = R0;                //Start address of the message data
    M0 = 15;
    I0 = R1;                //Start Address of output;
    R1 = 0;
    R2 = R2 >> 4;
    [--SP] = R1;            //R2 contains the number of bits in the input 
                            //message data.
    P1 = R2;                //P1 contains the number of 16 bit messages in the
                            //frame
    A0 = 0 || I0 += M0;
    P0 = I0;
    P2 = 16;
    B0 = 0;
    B1 = 0;
    R6 = A0 || R7 = [SP++]; //Clearing the registers R6 and R7
    R0 = A0 || R1.L = W[I1++];
                            //Input Message data which has to be encoded
    LSETUP(CONV_START,CONV_END)LC1 = P1;
                            //Initializes the loop for the number of 16 bit
                            //messages in the frame.
CONV_START:
        R2 = R1 << 1;       //1st column of the Equation[1]
        R2 = R2 | R6;
        R3 = R1 << 3;       //3rd column of the Equation[1]
        R3 = R3 | R7;
        R4 = R1 << 5;       //5th column of the Equation[1]
        R6 = B0;
        R4 = R4 | R6;
        R5 = R1 ^ R2;
        R5 = R5 ^ R3;
        R5 = R5 ^ R4;
        R5 = R5 << 16;      //R5 contains the 16 coded bits for 16 message bits
                            //corresponding to the first polynomial
        R6 = R1 << 2;       //2nd column of the Equation[2]
        R6 = R6 | R0;
        R0 = B1;
        R7 = R1 << 4;       //4th column of the Equation[2]
        R7 = R7 | R0;
        R7 = R1 ^ R7;
        R7 = R7 ^ R6;
        R7 = R7 ^ R4;
        R7 = R7 ^ R3;
        R7 = R7 << 16;      //R7 contains the 16 coded bits for 16 message bits
                            //corresponding to the second polynomial
        LSETUP(CODE_START,CODE_END)LC0 = P2;
                            //Initializes the loop for 16 number of input
                            //message bits
CODE_START:
            BITMUX(R5,R7,A0)(ASL);
                            //Interleaving the first and 2nd coded bits
            R2 = A0.W;
CODE_END:
            A0 = 0 || B[P0--] = R2;
                            //Store the output and clear the accumulator
        P0 +=  32;
        R6 = R1 >> 12;      //Restoring the 4 bits of previous 16 bit data
        B1 = R6;
        R6 = R1 >> 11;      //Restoring the 5 bits of previous 16 bit data
        B0 = R6;
        R6 = R1 >> 15;      //Restoring the 1 bit of previous 16 bit data
        R0 = R1 >> 14;      //Restoring the 2 bits of previous 16 bit data
CONV_END:
        R7 = R1 >> 13 || R1.L = W[I1++];
                            //Fetch the next data
    (R7:4) = [SP++];        //Pop the call save register R7,R6,R5 and R4
    RTS;
    NOP;                    //to avoid one stall if LINK or UNLINK happens to be
                            //the next instruction after RTS in the memory.
__conv_is54136_1by2_6.end:                            

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -