📄 qpsk.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 : qpsk.asm
Label name : __qpsk
Version : 2.0
Change History :
Version Date Author Comments
2.0 01/09/2007 Tested with VDSP++4.5
compiler 7.2.3.2
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 03/05/2002 Sunder Modified to match
silicon cycle count
1.0 10/08/2001 Sunder Original
Description : This function maps the input bits to the corresponding symbols
in the look up table.
Assumptions : 1. The bitstream is stored in a character array where the
start of the bitstream is at the LSB of the first character
2. All the characters are full (i.e. the bitstream size is at
least a multiple of 8)
3. Since two characters from the input bitstream are read at a
time, the bitstream size should be a multiple of 16 (i.e.
the no. of chars in the i/p array should be even)
4. The size of the I and Q arrays is 4 times that of the input
array
5. The I and Q channel outputs corresponding to the input two
bit symbols should be stored in the table in the following
manner:
I/P data I Q
00 table[0](LB) table[0](HB)
01 table[2](LB) table[2](HB)
10 table[1](LB) table[1](HB)
11 table[3](LB) table[3](HB)
where LB - lower byte HB - Higher byte
Note that the IQ components of symbol 01 are stored in
table[2] and for 10 are in table[1].
This is so because, the bitstream is assumed to start from the
LSB and continue till the MSB of the first character and then
start again from the LSB of the next char and so on.
Hence a '01' in the register is equivalent to a '10' in the
actual bitstream.
Prototype : void __qpsk(int n, char I[], short table[], char Q[],
char in[])
n - No. of characters in the input array
table[] - The table containing the I and Q values
corresponding to each symbol.
Registers used : R0-R3, R7, P0-P5, LC0, LC1.
Performance :
Code size : 100 bytes
Cycle count : 20 + 26*N (For N no. of characters)
176 Cycles (For 6 no. of characters)
*******************************************************************************/
.section L1_code;
.global __qpsk;
.align 8;
__qpsk:
[--SP] = (R7:7,P5:3); //P5-P3 ON STACK
P5 = [SP+28]; //Q array
R0 = R0 >> 1 || P2 = [SP+32];
//counter/2 || load Input data address
P0 = R0; //Outer Loop counter
P4 = R1; //I array
P3 = 7 (Z); //Inner loop counter
R3 = 3 (Z); //Mask for getting the last two bits
MNOP || R0 = W[P2++] (Z);
// MNOP for instr. alignment || Load a word from
// the bitstream
LSETUP(out_loop_start,out_loop_end) LC0 = P0;
out_loop_start:
R1 = R0&R3; //Apply the mask to obtain the last two bits
R1 <<= 1; //Generate the offset
R1 = R1+R2;
P1 = R1; //Load the final address from where the IQ
//components have to be fetched
R0 >>= 2; //Shift the input word so that the next bit pair is
//in the last two bits
LSETUP(in_loop_start,in_loop_end) LC1 = P3;
in_loop_start:
R1 = R0&R3; //Mask R0 to obtain the last two bits that form a
// symbol
R1 = R1 << 1 || R7.L = W[P1];
//Load the Constellation point from the table
R1 = R1+R2;
P1 = R1;
R7 = R7 >> 8 || B[P4++] = R7;
//Store the I component
in_loop_end:R0 = R0 >> 2 || B[P5++] = R7;
//Store the Q component
R0 = W[P2++] (Z); //Load the next word in the bitstream from mem.
R7.L = W[P1]; //Load the IQ components from the table
R7 = R7 >> 8 || B[P4++] = R7;
//Shift R7 so that the Q part is in last 8 bits ||
//Store the I component
out_loop_end:
B[P5++] = R7; //Store the Q component
(R7:7,P5:3) = [SP++]; //P5-P3 FROM STACK
RTS;
NOP;
__qpsk.end:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -