📄 conv_80211a_1by2_7.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_80211a_1by2_7.asm
Label name : __conv_80211a_1by2_7
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 = 171 and G1 = 133 in octal form, used in
802.11a.
The function produces the coded output for a
given input message data. The result is stored in
the output buffer in the unpacked manner.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 should be a multiple of 16.
Implementation : Let the message bits be x0,x1,x2,......x15.The first generator
polynomial is G0 = 171 = 1111001 = 1+D+D**2+D**3+D**6.
The output 16 bit word(for G0) for a message of 16 bits is
given by
| c0[1] | | x0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 |
| c0[2] | | x1 | | x0| | 0 | | 0 | | 0 | | 0 | | 0 |
| c0[3] | | x2 | | x1| | x0| | 0 | | 0 | | 0 | | 0 |
| c0[4] | = | x3 | ^ | x2| ^ | x1| ^ | x0| ^ | 0 | ^ | 0 | ^ | 0 |
| c0[5] | | x4 | | x3| | x2| | x1| | 0 | | 0 | | 0 |
| .... | | .. | | ..| | ..| | ..| | ..| | ..| | ..|
| c0[16]| | x15| |x14| |x13| |x12| | 0 | | 0 | | x9|
.........[1]
The second polynomial is
G1 = 133 = 1011011 = 1+D**2+D**3+D**5+D**6.
The output 16 bit word(for G1) for a message of 16 bits is
given by
| c1[1] | | x0 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 |
| c1[1] | | x1 | | 0 | | 0 | | 0 | | 0 | | 0 | | 0 |
| c1[1] | | x2 | | 0 | | x0| | 0 | | 0 | | 0 | | 0 |
| c1[1] | = | x3 | ^ | 0 | ^ | x1| ^ | x0| ^ | 0 | ^ | 0 | ^ | 0 |
| c1[1] | | x4 | | 0 | | x2| | x1| | 0 | | 0 | | 0 |
| c1[1] | | .. | | ..| | ..| | ..| | ..| | ..| | ..|
| c1[1] | | x15| | 0 | |x13| | x12| | 0 | |x10| | x9|
.............[2]
Prototype :
void _conv_80211a_1by2_7
(
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 : 184 Bytes
If number of message bits = a
Kernel cycle count : [(a/16)*(31+16*3)]
Total cycle count : 190 Cycles (for a = 32)
*******************************************************************************/
.section L1_code;
.global __conv_80211a_1by2_7;
.align 8;
__conv_80211a_1by2_7:
[--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; //Address of output;
R1 = 0;
R2 = R2 >> 4; //R2 contains the number bits in the input message
//data
[--SP] = R1;
P1 = R2; //P1 contains the number of 16 bit messages in the
//given frame
A0 = 0 || I0+= M0;
P0 = I0;
P2 = 16;
B0 = 0;
B1 = 0;
R6 = A0 || R7 = [SP++]; //R6 and R7 are initialized to Zero
R0 = A0 || R1.L = W[I1++];
//Message data which has to be encoded;
LSETUP(CONV_START,CONV_END)LC1 = P1;
CONV_START:
R2 = R1 << 1; //1st column of Equation [1]
R2 = R2 | R6;
R3 = R1 << 2; //2nd column of Equation [1]
R3 = R3 | R7;
R4 = R1 << 3; //3rd column of Equation [1]
R6 = B0;
R4 = R4 | R6; //R4.h = R4.L
R6 = B1;
R5 = R1 << 6; //6th column of Equation [1]
R5 = R5 | R6;
R6 = R1 ^ R2;
R6 = R6 ^ R3;
R6 = R6 ^ R4;
R6 = R6 ^ R5;
R6 = R6 << 16; //R6.h = R6.L
R7 = R1 << 5; //5th column of Equation [2]
R7 = R7 | R0;
R7 = R7 ^ R1;
R7 = R7 ^ R5;
R7 = R7 ^ R4;
R7 = R7 ^ R3;
R7 = R7 << 16; //R7.H = R7.L
LSETUP(CODE_START,CODE_END)LC0 = p2;
CODE_START: BITMUX(R6,R7,A0)(ASL);
//Packing the first and second coded bits
R2 = A0.W; //R2 contains the code word
CODE_END: A0 = 0 || B[P0--] = R2;
//Storing the codeword in the output array
R6 = R1 >> 13; //Restoring 3 bits of previous 16 bit data
B0 = R6;
R6 = R1 >> 10; //Restoring 6 bits of previous 16 bit data
B1 = R6;
P0+= 32;
R6 = R1 >> 15; //Restoring 1 bit of previous 16 bit data
R0 = R1 >> 11; //Restoring 5 bits of previous 16 bit data
CONV_END: R7 = R1 >> 14 || R1.L = W[I1++];
//Fetching the next data
(R7:4) = [SP++]; //Pop the call save registers R7,R6,R5,R4
RTS;
NOP; //to avoid one stall if LINK or UNLINK happens to be
//the next instruction after RTS in the memory.
__conv_80211a_1by2_7.end:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -