Merge remote-tracking branch 'origin/develop' into NR_BWP_config
This commit is contained in:
@@ -814,7 +814,7 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
llr_t *s1,*s2,*yp1,*yp2,*yp;
|
||||
unsigned int i,j,iind;//,pi;
|
||||
unsigned char iteration_cnt=0;
|
||||
unsigned int crc,oldcrc,crc_len;
|
||||
unsigned int crc, crc_len;
|
||||
uint8_t temp;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i *yp128;
|
||||
@@ -1233,8 +1233,8 @@ uint8_t phy_threegpplte_turbo_decoder8(int16_t *y,
|
||||
}
|
||||
|
||||
// check the CRC
|
||||
oldcrc= *((unsigned int *)(&decoded_bytes[(n>>3)-crc_len]));
|
||||
|
||||
uint32_t oldcrc;
|
||||
memcpy(&oldcrc, &decoded_bytes[(n >> 3) - crc_len], crc_len);
|
||||
switch (crc_type) {
|
||||
case CRC24_A:
|
||||
oldcrc&=0x00ffffff;
|
||||
|
||||
@@ -244,11 +244,11 @@ crc16 (unsigned char * inptr, int bitlen)
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
|
||||
crc = (crc << 8) ^ (crc16Table[(*inptr++) ^ (crc >> 24)] << 16);
|
||||
crc = (crc << 8) ^ (((uint32_t)crc16Table[(*inptr++) ^ (crc >> 24)]) << 16);
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
crc = (crc << resbit) ^ (crc16Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 16);
|
||||
crc = (crc << resbit) ^ (((uint32_t)crc16Table[(*inptr) >> (8 - resbit) ^ (crc >> (32 - resbit))]) << 16);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
@@ -961,7 +961,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1028,7 +1029,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1096,7 +1098,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1163,7 +1166,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1230,7 +1234,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1297,7 +1302,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1364,7 +1370,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1431,7 +1438,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1498,7 +1506,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1593,7 +1602,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1660,7 +1670,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1727,7 +1738,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1794,7 +1806,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1861,7 +1874,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
@@ -1928,7 +1942,8 @@ static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBu
|
||||
|
||||
// If no error pcRes should be 0
|
||||
// Only use valid CNs
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
if (Mrem)
|
||||
pcResSum |= (pcRes&(0xFFFFFFFF>>(32-Mrem)));
|
||||
|
||||
// If PC failed we can stop here
|
||||
if (pcResSum > 0)
|
||||
|
||||
@@ -532,9 +532,12 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL) {
|
||||
|
||||
}
|
||||
|
||||
// FIXME: this function is compting PRB outside the range, so I FORCED in the range
|
||||
// I can't understand the 3GPP spec, see below note
|
||||
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
|
||||
|
||||
int offset;
|
||||
int ret=-1;
|
||||
|
||||
switch (N_RB_DL) {
|
||||
|
||||
@@ -545,16 +548,16 @@ uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
|
||||
switch (vrb) {
|
||||
case 0: // even: 0->0, 1->2, odd: 0->3, 1->5
|
||||
case 1:
|
||||
return ((3*odd_slot) + 2*(vrb&3))%6;
|
||||
ret= ((3*odd_slot) + 2*(vrb&3))%6;
|
||||
break;
|
||||
case 2: // even: 2->3, 3->5, odd: 2->0, 3->2
|
||||
case 3:
|
||||
return ((3*odd_slot) + 2*(vrb&3) + 5)%6;
|
||||
ret= ((3*odd_slot) + 2*(vrb&3) + 5)%6;
|
||||
break;
|
||||
case 4: // even: 4->1, odd: 4->4
|
||||
return ((3*odd_slot) + 1)%6;
|
||||
ret= ((3*odd_slot) + 1)%6;
|
||||
case 5: // even: 5->4, odd: 5->1
|
||||
return ((3*odd_slot) + 4)%6;
|
||||
ret= ((3*odd_slot) + 4)%6;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -562,88 +565,90 @@ uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
|
||||
case 15:
|
||||
if (vrb<12) {
|
||||
if ((vrb&3) < 2) // even: 0->0, 1->4, 4->1, 5->5, 8->2, 9->6 odd: 0->7, 1->11
|
||||
return(((7*odd_slot) + 4*(vrb&3) + (vrb>>2))%14) + 14*(vrb/14);
|
||||
ret= (((7*odd_slot) + 4*(vrb&3) + (vrb>>2))%14) + 14*(vrb/14);
|
||||
else if (vrb < 12) // even: 2->7, 3->11, 6->8, 7->12, 10->9, 11->13
|
||||
return (((7*odd_slot) + 4*(vrb&3) + (vrb>>2) +13 )%14) + 14*(vrb/14);
|
||||
ret= (((7*odd_slot) + 4*(vrb&3) + (vrb>>2) +13 )%14) + 14*(vrb/14);
|
||||
}
|
||||
if (vrb==12)
|
||||
return (3+(7*odd_slot)) % 14;
|
||||
ret= (3+(7*odd_slot)) % 14;
|
||||
if (vrb==13)
|
||||
return (10+(7*odd_slot)) % 14;
|
||||
return 14;
|
||||
ret= (10+(7*odd_slot)) % 14;
|
||||
ret= 14;
|
||||
break;
|
||||
|
||||
// Formula in TS 36.211, chap 6.2.3.2
|
||||
// Fix me: returns a PRB number > 24 when vrb is 24
|
||||
case 25:
|
||||
return (((12*odd_slot) + 6*(vrb&3) + (vrb>>2))%24) + 24*(vrb/24);
|
||||
ret= (((12*odd_slot) + 6*(vrb&3) + (vrb>>2))%24) + 24*(vrb/24);
|
||||
break;
|
||||
|
||||
case 50: // P=3
|
||||
if (Ngap==0) {
|
||||
// Nrow=12,Nnull=2,NVRBDL=46,Ngap1= 27
|
||||
if (vrb>=23)
|
||||
offset=4;
|
||||
offset=4;
|
||||
else
|
||||
offset=0;
|
||||
offset=0;
|
||||
if (vrb<44) {
|
||||
if ((vrb&3)>=2)
|
||||
return offset+((23*odd_slot) + 12*(vrb&3) + (vrb>>2) + 45)%46;
|
||||
else
|
||||
return offset+((23*odd_slot) + 12*(vrb&3) + (vrb>>2))%46;
|
||||
if ((vrb&3)>=2)
|
||||
ret= offset+((23*odd_slot) + 12*(vrb&3) + (vrb>>2) + 45)%46;
|
||||
else
|
||||
ret= offset+((23*odd_slot) + 12*(vrb&3) + (vrb>>2))%46;
|
||||
}
|
||||
if (vrb==44) // even: 44->11, odd: 45->34
|
||||
return offset+((23*odd_slot) + 22-12+1);
|
||||
ret= offset+((23*odd_slot) + 22-12+1);
|
||||
if (vrb==45) // even: 45->10, odd: 45->33
|
||||
return offset+((23*odd_slot) + 22+12);
|
||||
ret= offset+((23*odd_slot) + 22+12);
|
||||
if (vrb==46)
|
||||
return offset+46+((23*odd_slot) + 23-12+1) % 46;
|
||||
ret= offset+46+((23*odd_slot) + 23-12+1) % 46;
|
||||
if (vrb==47)
|
||||
return offset+46+((23*odd_slot) + 23+12) % 46;
|
||||
ret= offset+46+((23*odd_slot) + 23+12) % 46;
|
||||
if (vrb==48)
|
||||
return offset+46+((23*odd_slot) + 23-12+1) % 46;
|
||||
ret= offset+46+((23*odd_slot) + 23-12+1) % 46;
|
||||
if (vrb==49)
|
||||
return offset+46+((23*odd_slot) + 23+12) % 46;
|
||||
ret= offset+46+((23*odd_slot) + 23+12) % 46;
|
||||
}
|
||||
else {
|
||||
// Nrow=6,Nnull=6,NVRBDL=18,Ngap1= 27
|
||||
if (vrb>=9)
|
||||
offset=18;
|
||||
offset=18;
|
||||
else
|
||||
offset=0;
|
||||
offset=0;
|
||||
|
||||
if (vrb<12) {
|
||||
if ((vrb&3)>=2)
|
||||
return offset+((9*odd_slot) + 6*(vrb&3) + (vrb>>2) + 17)%18;
|
||||
else
|
||||
return offset+((9*odd_slot) + 6*(vrb&3) + (vrb>>2))%18;
|
||||
if ((vrb&3)>=2)
|
||||
ret= offset+((9*odd_slot) + 6*(vrb&3) + (vrb>>2) + 17)%18;
|
||||
else
|
||||
ret= offset+((9*odd_slot) + 6*(vrb&3) + (vrb>>2))%18;
|
||||
}
|
||||
else {
|
||||
return offset+((9*odd_slot) + 12*(vrb&1)+(vrb>>1) )%18 + 18*(vrb/18);
|
||||
ret= offset+((9*odd_slot) + 12*(vrb&1)+(vrb>>1) )%18 + 18*(vrb/18);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 75:
|
||||
// Ngap1 = 32, NVRBRL=64, P=4, Nrow= 16, Nnull=0
|
||||
if (Ngap ==0) {
|
||||
return ((32*odd_slot) + 16*(vrb&3) + (vrb>>2))%64 + (vrb/64);
|
||||
ret= ((32*odd_slot) + 16*(vrb&3) + (vrb>>2))%64 + (vrb/64);
|
||||
} else {
|
||||
// Ngap2 = 16, NVRBDL=32, Nrow=8, Nnull=0
|
||||
return ((16*odd_slot) + 8*(vrb&3) + (vrb>>2))%32 + (vrb/32);
|
||||
ret= ((16*odd_slot) + 8*(vrb&3) + (vrb>>2))%32 + (vrb/32);
|
||||
}
|
||||
break;
|
||||
case 100:
|
||||
// Ngap1 = 48, NVRBDL=96, Nrow=24, Nnull=0
|
||||
if (Ngap ==0) {
|
||||
return ((48*odd_slot) + 24*(vrb&3) + (vrb>>2))%96 + (vrb/96);
|
||||
ret= ((48*odd_slot) + 24*(vrb&3) + (vrb>>2))%96 + (vrb/96);
|
||||
} else {
|
||||
// Ngap2 = 16, NVRBDL=32, Nrow=8, Nnull=0
|
||||
return ((16*odd_slot) + 8*(vrb&3) + (vrb>>2))%32 + (vrb/32);
|
||||
ret= ((16*odd_slot) + 8*(vrb&3) + (vrb>>2))%32 + (vrb/32);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unknown N_RB_DL %d\n",N_RB_DL);
|
||||
return 0;
|
||||
ret= 0;
|
||||
}
|
||||
return 0;
|
||||
return ret%N_RB_DL;
|
||||
|
||||
}
|
||||
|
||||
@@ -677,7 +682,7 @@ void generate_RIV_tables(void)
|
||||
|
||||
// printf("RIV %d (%d) : first_rb %d NBRB %d\n",RIV,localRIV2alloc_LUT25[RIV],RBstart,Lcrbs);
|
||||
localRIV2alloc_LUT6[RIV] = alloc0;
|
||||
distRIV2alloc_even_LUT6[RIV] = allocdist0_0_even;
|
||||
distRIV2alloc_even_LUT6[RIV] = allocdist0_0_even;
|
||||
distRIV2alloc_odd_LUT6[RIV] = allocdist0_0_odd;
|
||||
RIV2nb_rb_LUT6[RIV] = Lcrbs;
|
||||
RIV2first_rb_LUT6[RIV] = RBstart;
|
||||
@@ -693,15 +698,14 @@ void generate_RIV_tables(void)
|
||||
nVRB = Lcrbs-1+RBstart;
|
||||
//printf("RBstart %d, len %d --> ",RBstart,Lcrbs);
|
||||
alloc0 |= (1<<nVRB);
|
||||
allocdist0_0_even |= (1<<get_prb(25,0,nVRB,0));
|
||||
allocdist0_0_odd |= (1<<get_prb(25,1,nVRB,0));
|
||||
allocdist0_0_even |= 1U << get_prb(25, 0, nVRB, 0);
|
||||
allocdist0_0_odd |= 1U << get_prb(25, 1, nVRB, 0);
|
||||
|
||||
//printf("alloc 0 %x, allocdist0_even %x, allocdist0_odd %x\n",alloc0,allocdist0_0_even,allocdist0_0_odd);
|
||||
RIV=computeRIV(25,RBstart,Lcrbs);
|
||||
|
||||
if (RIV>RIV_max25)
|
||||
RIV_max25 = RIV;;
|
||||
|
||||
RIV_max25 = RIV;
|
||||
|
||||
localRIV2alloc_LUT25[RIV] = alloc0;
|
||||
distRIV2alloc_even_LUT25[RIV] = allocdist0_0_even;
|
||||
@@ -730,37 +734,37 @@ void generate_RIV_tables(void)
|
||||
|
||||
|
||||
if (nVRB<32)
|
||||
alloc0 |= (1<<nVRB);
|
||||
alloc0 |= 1U << nVRB;
|
||||
else
|
||||
alloc1 |= (1<<(nVRB-32));
|
||||
alloc1 |= 1U << (nVRB - 32);
|
||||
|
||||
// Distributed Gap1, even slot
|
||||
nVRB_even_dist = get_prb(50,0,nVRB,0);
|
||||
if (nVRB_even_dist<32)
|
||||
allocdist0_0_even |= (1<<nVRB_even_dist);
|
||||
allocdist0_0_even |= 1U << nVRB_even_dist;
|
||||
else
|
||||
allocdist1_0_even |= (1<<(nVRB_even_dist-32));
|
||||
allocdist1_0_even |= 1U << (nVRB_even_dist - 32);
|
||||
|
||||
// Distributed Gap1, odd slot
|
||||
nVRB_odd_dist = get_prb(50,1,nVRB,0);
|
||||
if (nVRB_odd_dist<32)
|
||||
allocdist0_0_odd |= (1<<nVRB_odd_dist);
|
||||
allocdist0_0_odd |= (1U <<nVRB_odd_dist);
|
||||
else
|
||||
allocdist1_0_odd |= (1<<(nVRB_odd_dist-32));
|
||||
allocdist1_0_odd |= (1U <<(nVRB_odd_dist-32));
|
||||
|
||||
// Distributed Gap2, even slot
|
||||
nVRB_even_dist = get_prb(50,0,nVRB,1);
|
||||
if (nVRB_even_dist<32)
|
||||
allocdist0_1_even |= (1<<nVRB_even_dist);
|
||||
allocdist0_1_even |= 1U << nVRB_even_dist;
|
||||
else
|
||||
allocdist1_1_even |= (1<<(nVRB_even_dist-32));
|
||||
allocdist1_1_even |= 1U << (nVRB_even_dist - 32);
|
||||
|
||||
// Distributed Gap2, odd slot
|
||||
nVRB_odd_dist = get_prb(50,1,nVRB,1);
|
||||
if (nVRB_odd_dist<32)
|
||||
allocdist0_1_odd |= (1<<nVRB_odd_dist);
|
||||
allocdist0_1_odd |= 1U << nVRB_odd_dist;
|
||||
else
|
||||
allocdist1_1_odd |= (1<<(nVRB_odd_dist-32));
|
||||
allocdist1_1_odd |= 1U << (nVRB_odd_dist - 32);
|
||||
|
||||
RIV=computeRIV(50,RBstart,Lcrbs);
|
||||
|
||||
@@ -811,13 +815,13 @@ void generate_RIV_tables(void)
|
||||
nVRB = Lcrbs-1+RBstart;
|
||||
|
||||
if (nVRB<32)
|
||||
alloc0 |= (1<<nVRB);
|
||||
alloc0 |= 1U << nVRB;
|
||||
else if (nVRB<64)
|
||||
alloc1 |= (1<<(nVRB-32));
|
||||
alloc1 |= 1U << (nVRB - 32);
|
||||
else if (nVRB<96)
|
||||
alloc2 |= (1<<(nVRB-64));
|
||||
alloc2 |= 1U << (nVRB - 64);
|
||||
else
|
||||
alloc3 |= (1<<(nVRB-96));
|
||||
alloc3 |= 1U << (nVRB - 96);
|
||||
|
||||
// Distributed Gap1, even slot
|
||||
nVRB_even_dist = get_prb(100,0,nVRB,0);
|
||||
@@ -825,15 +829,14 @@ void generate_RIV_tables(void)
|
||||
// if ((RBstart==0) && (Lcrbs<=8))
|
||||
// printf("nVRB %d => nVRB_even_dist %d\n",nVRB,nVRB_even_dist);
|
||||
|
||||
|
||||
if (nVRB_even_dist<32)
|
||||
allocdist0_0_even |= (1<<nVRB_even_dist);
|
||||
allocdist0_0_even |= 1U << nVRB_even_dist;
|
||||
else if (nVRB_even_dist<64)
|
||||
allocdist1_0_even |= (1<<(nVRB_even_dist-32));
|
||||
allocdist1_0_even |= 1U << (nVRB_even_dist - 32);
|
||||
else if (nVRB_even_dist<96)
|
||||
allocdist2_0_even |= (1<<(nVRB_even_dist-64));
|
||||
allocdist2_0_even |= 1U << (nVRB_even_dist - 64);
|
||||
else
|
||||
allocdist3_0_even |= (1<<(nVRB_even_dist-96));
|
||||
allocdist3_0_even |= 1U << (nVRB_even_dist - 96);
|
||||
/* if ((RBstart==0) && (Lcrbs<=8))
|
||||
printf("rballoc =>(%08x.%08x.%08x.%08x)\n",
|
||||
allocdist0_0_even,
|
||||
@@ -845,38 +848,37 @@ void generate_RIV_tables(void)
|
||||
// Distributed Gap1, odd slot
|
||||
nVRB_odd_dist = get_prb(100,1,nVRB,0);
|
||||
if (nVRB_odd_dist<32)
|
||||
allocdist0_0_odd |= (1<<nVRB_odd_dist);
|
||||
allocdist0_0_odd |= 1U << nVRB_odd_dist;
|
||||
else if (nVRB_odd_dist<64)
|
||||
allocdist1_0_odd |= (1<<(nVRB_odd_dist-32));
|
||||
allocdist1_0_odd |= 1U << (nVRB_odd_dist - 32);
|
||||
else if (nVRB_odd_dist<96)
|
||||
allocdist2_0_odd |= (1<<(nVRB_odd_dist-64));
|
||||
allocdist2_0_odd |= 1U << (nVRB_odd_dist - 64);
|
||||
else
|
||||
allocdist3_0_odd |= (1<<(nVRB_odd_dist-96));
|
||||
allocdist3_0_odd |= 1U << (nVRB_odd_dist - 96);
|
||||
|
||||
|
||||
// Distributed Gap2, even slot
|
||||
nVRB_even_dist = get_prb(100,0,nVRB,1);
|
||||
if (nVRB_even_dist<32)
|
||||
allocdist0_1_even |= (1<<nVRB_even_dist);
|
||||
allocdist0_1_even |= 1U << nVRB_even_dist;
|
||||
else if (nVRB_even_dist<64)
|
||||
allocdist1_1_even |= (1<<(nVRB_even_dist-32));
|
||||
allocdist1_1_even |= 1U << (nVRB_even_dist - 32);
|
||||
else if (nVRB_even_dist<96)
|
||||
allocdist2_1_even |= (1<<(nVRB_even_dist-64));
|
||||
allocdist2_1_even |= 1U << (nVRB_even_dist - 64);
|
||||
else
|
||||
allocdist3_1_even |= (1<<(nVRB_even_dist-96));
|
||||
allocdist3_1_even |= 1U << (nVRB_even_dist - 96);
|
||||
|
||||
|
||||
// Distributed Gap2, odd slot
|
||||
nVRB_odd_dist = get_prb(100,1,nVRB,1);
|
||||
if (nVRB_odd_dist<32)
|
||||
allocdist0_1_odd |= (1<<nVRB_odd_dist);
|
||||
allocdist0_1_odd |= 1U << nVRB_odd_dist;
|
||||
else if (nVRB_odd_dist<64)
|
||||
allocdist1_1_odd |= (1<<(nVRB_odd_dist-32));
|
||||
allocdist1_1_odd |= 1U << (nVRB_odd_dist - 32);
|
||||
else if (nVRB_odd_dist<96)
|
||||
allocdist2_1_odd |= (1<<(nVRB_odd_dist-64));
|
||||
allocdist2_1_odd |= 1U << (nVRB_odd_dist - 64);
|
||||
else
|
||||
allocdist3_1_odd |= (1<<(nVRB_odd_dist-96));
|
||||
|
||||
allocdist3_1_odd |= 1U << (nVRB_odd_dist - 96);
|
||||
|
||||
RIV=computeRIV(100,RBstart,Lcrbs);
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ static void TPencode(void * arg) {
|
||||
LTE_DL_eNB_HARQ_t *hadlsch=rdata->dlsch->harq_processes[harq_pid];
|
||||
|
||||
if ( rdata-> round == 0) {
|
||||
uint8_t tmp[96+12+3+3*6144];
|
||||
uint8_t tmp[96+12+3+3*6144] __attribute__((aligned(32)));
|
||||
memset(tmp,LTE_NULL, TURBO_SIMD_SOFTBITS);
|
||||
start_meas(rdata->te_stats);
|
||||
encoder(rdata->input,
|
||||
|
||||
@@ -64,6 +64,12 @@ extern uint16_t beta_cqi[16];
|
||||
extern uint16_t beta_ri[16];
|
||||
extern uint16_t beta_ack[16];
|
||||
|
||||
static int errorRB(int rb, char * table, int line) {
|
||||
LOG_E(PHY,"Received %d rb, impossble in table %s, at line %d\n", rb, table, line);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define rbAllocCheck(RBalL, TabLe) (RBalL) > sizeof(TabLe)/sizeof(*TabLe) ? errorRB(RBalL, #TabLe, __LINE__) : TabLe[RBalL]
|
||||
void extract_dci1A_info(uint8_t N_RB_DL, frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted)
|
||||
{
|
||||
uint8_t harq_pid=0;
|
||||
@@ -974,28 +980,28 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
{
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
NPRB = RIV2nb_rb_LUT6[rballoc];//NPRB;
|
||||
NPRB = rbAllocCheck(rballoc, RIV2nb_rb_LUT6);
|
||||
if(rah)
|
||||
RIV_max = RIV_max6;
|
||||
else
|
||||
RIV_max = 0x3F;
|
||||
break;
|
||||
case 25:
|
||||
NPRB = RIV2nb_rb_LUT25[rballoc];//NPRB;
|
||||
NPRB = rbAllocCheck(rballoc,RIV2nb_rb_LUT25);
|
||||
if(rah)
|
||||
RIV_max = RIV_max25;
|
||||
else
|
||||
RIV_max = 0x1FFF;
|
||||
break;
|
||||
case 50:
|
||||
NPRB = RIV2nb_rb_LUT50[rballoc];//NPRB;
|
||||
NPRB = rbAllocCheck(rballoc,RIV2nb_rb_LUT50);
|
||||
if(rah)
|
||||
RIV_max = RIV_max50;
|
||||
else
|
||||
RIV_max = 0x1FFFF;
|
||||
break;
|
||||
case 100:
|
||||
NPRB = RIV2nb_rb_LUT100[rballoc];//NPRB;
|
||||
NPRB = rbAllocCheck(rballoc,RIV2nb_rb_LUT100);
|
||||
if(rah)
|
||||
RIV_max = RIV_max100;
|
||||
else
|
||||
@@ -1034,9 +1040,14 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
// this is an eNB issue
|
||||
// retransmisison but old and new TBS are different !!!
|
||||
// work around, consider it as a new transmission
|
||||
LOG_E(PHY,"Format1A Retransmission but TBS are different: consider it as new transmission !!! \n");
|
||||
LOG_E(PHY,
|
||||
"Format1A Retransmission but TBS are different: consider it as new transmission !!!, round %d, mcs 1 %d, NPRB %d \n",
|
||||
pdlsch0_harq->round,
|
||||
mcs1,
|
||||
NPRB);
|
||||
pdlsch0_harq->round = 0;
|
||||
//return(0); // ?? to cross check
|
||||
return(0); // ?? to cross check
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1272,14 +1272,6 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb);
|
||||
@return Transport block size */
|
||||
uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
|
||||
|
||||
/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
|
||||
@param N_RB_DL number of PRB on DL
|
||||
@param indicator for even/odd slot
|
||||
@param vrb vrb index
|
||||
@param Ngap Gap indicator
|
||||
*/
|
||||
uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap);
|
||||
|
||||
/* \brief Return prb for a given vrb index
|
||||
@param vrb_type VRB type (0=localized,1=distributed)
|
||||
@param rb_alloc_dci rballoc field from DCI
|
||||
|
||||
@@ -90,7 +90,7 @@ typedef struct {
|
||||
/// Redundancy-version of the current sub-frame
|
||||
uint8_t rvidx;
|
||||
/// Turbo-code outputs (36-212 V8.6 2009-03, p.12
|
||||
uint8_t d[MAX_NUM_ULSCH_SEGMENTS][(96+3+(3*6144))];
|
||||
uint8_t *d[MAX_NUM_ULSCH_SEGMENTS];
|
||||
/// Sub-block interleaver outputs (36-212 V8.6 2009-03, p.16-17)
|
||||
uint8_t w[MAX_NUM_ULSCH_SEGMENTS][3*6144];
|
||||
/// Number of code segments (for definition see 36-212 V8.6 2009-03, p.9)
|
||||
|
||||
@@ -71,6 +71,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) {
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
if (ulsch->harq_processes[i]->c[r]) {
|
||||
free16(ulsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768);
|
||||
free16(ulsch->harq_processes[i]->d[r],0);
|
||||
ulsch->harq_processes[i]->c[r] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +87,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch) {
|
||||
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) {
|
||||
LTE_UE_ULSCH_t *ulsch;
|
||||
unsigned char exit_flag = 0,i,j,r;
|
||||
unsigned char exit_flag = 0;
|
||||
unsigned char bw_scaling =1;
|
||||
|
||||
switch (N_RB_UL) {
|
||||
@@ -113,7 +114,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) {
|
||||
memset(ulsch,0,sizeof(LTE_UE_ULSCH_t));
|
||||
ulsch->Mlimit = 4;
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
for (int i=0; i<8; i++) {
|
||||
ulsch->harq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t));
|
||||
|
||||
// printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]);
|
||||
@@ -129,15 +130,11 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) {
|
||||
}
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
ulsch->harq_processes[i]->c[r] = (unsigned char *)malloc16(((r==0)?8:0) + 3+768); // account for filler in first segment and CRCs for multiple segment case
|
||||
|
||||
if (ulsch->harq_processes[i]->c[r])
|
||||
memset(ulsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+768);
|
||||
else {
|
||||
LOG_E(PHY,"Can't get c\n");
|
||||
exit_flag=2;
|
||||
}
|
||||
for (int r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
ulsch->harq_processes[i]->c[r] = malloc16_clear(((r==0)?8:0) + 3+768); // account for filler in first segment and CRCs for multiple segment case
|
||||
AssertFatal(ulsch->harq_processes[i]->c[r], "");
|
||||
ulsch->harq_processes[i]->d[r] = malloc16_clear(96+3+(3*6144));
|
||||
AssertFatal(ulsch->harq_processes[i]->d[r], "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,15 +145,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag) {
|
||||
exit_flag=3;
|
||||
}
|
||||
}
|
||||
|
||||
if ((abstraction_flag == 0) && (exit_flag==0)) {
|
||||
for (i=0; i<8; i++)
|
||||
for (j=0; j<96; j++)
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++)
|
||||
ulsch->harq_processes[i]->d[r][j] = LTE_NULL;
|
||||
|
||||
return(ulsch);
|
||||
} else if (abstraction_flag==1)
|
||||
if (!exit_flag)
|
||||
return(ulsch);
|
||||
}
|
||||
|
||||
@@ -191,7 +180,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
uint32_t Qprime_ACK=0,Qprime_CQI=0,Qprime_RI=0,len_ACK=0,len_RI=0;
|
||||
// uint32_t E;
|
||||
uint8_t ack_parity;
|
||||
uint32_t i,q,j,iprime,j2;
|
||||
uint32_t q,j,iprime,j2;
|
||||
uint16_t o_RCC;
|
||||
uint8_t o_flip[8];
|
||||
uint32_t wACK_idx;
|
||||
@@ -327,6 +316,8 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
#endif
|
||||
// offset=0;
|
||||
start_meas(te_stats);
|
||||
for (int z=0; z<96; z++)
|
||||
ulsch->harq_processes[harq_pid]->d[r][z] = LTE_NULL;
|
||||
encoder(ulsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&ulsch->harq_processes[harq_pid]->d[r][96],
|
||||
@@ -539,8 +530,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
ulsch->q);
|
||||
}
|
||||
|
||||
i=0;
|
||||
|
||||
// Do RI coding
|
||||
if (ulsch->O_RI == 1) {
|
||||
switch (Q_m) {
|
||||
@@ -691,7 +680,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
j=0;
|
||||
|
||||
for (i=0; i<Qprime_RI; i++) {
|
||||
for (int i=0; i<Qprime_RI; i++) {
|
||||
r = Rmux_prime - 1 - (i>>2);
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
@@ -725,7 +714,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
}
|
||||
*/
|
||||
|
||||
for (i=0; i<Qprime_CQI; i++) {
|
||||
for (int i=0; i<Qprime_CQI; i++) {
|
||||
while (y[Q_m*j] != LTE_NULL) j++;
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
@@ -788,7 +777,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
j=0;
|
||||
|
||||
for (i=0; i<Qprime_ACK; i++) {
|
||||
for (int i=0; i<Qprime_ACK; i++) {
|
||||
r = Rmux_prime - 1 - (i>>2);
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
@@ -808,7 +797,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (int i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr=&y[((r*Cmux)+i)<<1];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
@@ -818,7 +807,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
break;
|
||||
|
||||
case 4:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (int i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr = &y[((r*Cmux)+i)<<2];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
@@ -830,7 +819,7 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (int i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr = &y[((r*Cmux)+i)*6];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
|
||||
@@ -226,10 +226,11 @@ void nr_modulation(uint32_t *in,
|
||||
i *= 24;
|
||||
bit_cnt = i * 8;
|
||||
while (bit_cnt < length) {
|
||||
x = *((uint32_t*)(in_bytes+i));
|
||||
x1 = x&4095;
|
||||
uint32_t xx;
|
||||
memcpy(&xx, in_bytes+i, sizeof(xx));
|
||||
x1 = xx & 4095;
|
||||
out64[j++] = nr_64qam_mod_table[x1];
|
||||
x1 = (x>>12)&4095;
|
||||
x1 = (xx >> 12) & 4095;
|
||||
out64[j++] = nr_64qam_mod_table[x1];
|
||||
i += 3;
|
||||
bit_cnt += 24;
|
||||
|
||||
@@ -162,7 +162,7 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
|
||||
measurements->n0_subband_power[aarx][rb]=0;
|
||||
}
|
||||
int offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) + (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
|
||||
if ((gNB->rb_mask_ul[s][rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
|
||||
if ((gNB->rb_mask_ul[s][rb >> 5] & (1U << (rb & 31))) == 0) { // check that rb was not used in this subframe
|
||||
nb_symb[rb]++;
|
||||
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
int offset = offset0 + (s*frame_parms->ofdm_symbol_size);
|
||||
|
||||
@@ -123,7 +123,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
rel15->dlDmrsSymbPos);
|
||||
n_ptrs = (rel15->rbSize + rel15->PTRSFreqDensity - 1)/rel15->PTRSFreqDensity;
|
||||
}
|
||||
int16_t mod_ptrs[n_ptrs<<1] __attribute__ ((aligned(16)));
|
||||
|
||||
/// CRC, coding, interleaving and rate matching
|
||||
AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n");
|
||||
@@ -302,12 +301,14 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
|
||||
/* calculate if current symbol is PTRS symbols */
|
||||
ptrs_idx = 0;
|
||||
|
||||
int16_t *mod_ptrs = NULL;
|
||||
if(rel15->pduBitmap & 0x1) {
|
||||
ptrs_symbol = is_ptrs_symbol(l,dlPtrsSymPos);
|
||||
if(ptrs_symbol) {
|
||||
/* PTRS QPSK Modulation for each OFDM symbol in a slot */
|
||||
LOG_D(PHY,"Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs);
|
||||
int16_t mod_ptrsBuf[n_ptrs<<1] __attribute__ ((aligned(16)));
|
||||
mod_ptrs =mod_ptrsBuf;
|
||||
nr_modulation(pdsch_dmrs[l][rel15->SCID], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,88 +466,87 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
if (cpumeas(CPUMEAS_GETSTATE))
|
||||
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine and zero forcing %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
|
||||
|
||||
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
|
||||
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
|
||||
/* Store the valid DL RE's */
|
||||
pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = nb_re_pdsch;
|
||||
pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = nb_re_pdsch;
|
||||
|
||||
if(dlsch0_harq->status == ACTIVE) {
|
||||
startSymbIdx = dlsch0_harq->start_symbol;
|
||||
nbSymb = dlsch0_harq->nb_symbols;
|
||||
pduBitmap = dlsch0_harq->pduBitmap;
|
||||
}
|
||||
if(dlsch1_harq) {
|
||||
startSymbIdx = dlsch1_harq->start_symbol;
|
||||
nbSymb = dlsch1_harq->nb_symbols;
|
||||
pduBitmap = dlsch1_harq->pduBitmap;
|
||||
}
|
||||
if(dlsch0_harq->status == ACTIVE) {
|
||||
startSymbIdx = dlsch0_harq->start_symbol;
|
||||
nbSymb = dlsch0_harq->nb_symbols;
|
||||
pduBitmap = dlsch0_harq->pduBitmap;
|
||||
}
|
||||
if(dlsch1_harq) {
|
||||
startSymbIdx = dlsch1_harq->start_symbol;
|
||||
nbSymb = dlsch1_harq->nb_symbols;
|
||||
pduBitmap = dlsch1_harq->pduBitmap;
|
||||
}
|
||||
|
||||
/* Check for PTRS bitmap and process it respectively */
|
||||
if((pduBitmap & 0x1) && (type == PDSCH)) {
|
||||
nr_pdsch_ptrs_processing(ue,
|
||||
pdsch_vars,
|
||||
frame_parms,
|
||||
dlsch0_harq,
|
||||
dlsch1_harq,
|
||||
gNB_id,
|
||||
nr_slot_rx,
|
||||
symbol,
|
||||
(nb_rb_pdsch*12),
|
||||
dlsch[0]->rnti,rx_type);
|
||||
pdsch_vars[gNB_id]->dl_valid_re[symbol-1] -= pdsch_vars[gNB_id]->ptrs_re_per_slot[0][symbol];
|
||||
}
|
||||
/* Check for PTRS bitmap and process it respectively */
|
||||
if((pduBitmap & 0x1) && (type == PDSCH)) {
|
||||
nr_pdsch_ptrs_processing(ue,
|
||||
pdsch_vars,
|
||||
frame_parms,
|
||||
dlsch0_harq,
|
||||
dlsch1_harq,
|
||||
gNB_id,
|
||||
nr_slot_rx,
|
||||
symbol,
|
||||
(nb_rb_pdsch*12),
|
||||
dlsch[0]->rnti,rx_type);
|
||||
pdsch_vars[gNB_id]->dl_valid_re[symbol-1] -= pdsch_vars[gNB_id]->ptrs_re_per_slot[0][symbol];
|
||||
}
|
||||
|
||||
/* at last symbol in a slot calculate LLR's for whole slot */
|
||||
if(symbol == (startSymbIdx + nbSymb -1)) {
|
||||
for(uint8_t i =startSymbIdx; i < (startSymbIdx+nbSymb);i++) {
|
||||
/* re evaluating the first symbol flag as LLR's are done in symbol loop */
|
||||
if(i == startSymbIdx && i < 3) {
|
||||
first_symbol_flag =1;
|
||||
}
|
||||
else {
|
||||
first_symbol_flag=0;
|
||||
}
|
||||
/* Calculate LLR's for each symbol */
|
||||
nr_dlsch_llr(pdsch_vars, frame_parms,
|
||||
rxdataF_comp_ptr, dl_ch_mag_ptr,
|
||||
dlsch0_harq, dlsch1_harq,
|
||||
rx_type, harq_pid,
|
||||
gNB_id, gNB_id_i,
|
||||
first_symbol_flag,
|
||||
i, nb_rb_pdsch,
|
||||
codeword_TB0, codeword_TB1,
|
||||
pdsch_vars[gNB_id]->dl_valid_re[i-1],
|
||||
nr_slot_rx, beamforming_mode);
|
||||
/* at last symbol in a slot calculate LLR's for whole slot */
|
||||
if(symbol == (startSymbIdx + nbSymb -1)) {
|
||||
for(uint8_t i =startSymbIdx; i < (startSymbIdx+nbSymb);i++) {
|
||||
/* re evaluating the first symbol flag as LLR's are done in symbol loop */
|
||||
if(i == startSymbIdx && i < 3) {
|
||||
first_symbol_flag =1;
|
||||
}
|
||||
|
||||
int dmrs_type = dlsch[0]->harq_processes[harq_pid]->dmrsConfigType;
|
||||
uint8_t nb_re_dmrs;
|
||||
uint16_t dmrs_len = get_num_dmrs(dlsch[0]->harq_processes[harq_pid]->dlDmrsSymbPos);
|
||||
if (dmrs_type==NFAPI_NR_DMRS_TYPE1) {
|
||||
nb_re_dmrs = 6*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
|
||||
} else {
|
||||
nb_re_dmrs = 4*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
|
||||
else {
|
||||
first_symbol_flag=0;
|
||||
}
|
||||
dlsch[0]->harq_processes[harq_pid]->G = nr_get_G(dlsch[0]->harq_processes[harq_pid]->nb_rb,
|
||||
dlsch[0]->harq_processes[harq_pid]->nb_symbols,
|
||||
nb_re_dmrs,
|
||||
dmrs_len,
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm,
|
||||
dlsch[0]->harq_processes[harq_pid]->Nl);
|
||||
nr_dlsch_layer_demapping(pdsch_vars[gNB_id]->llr,
|
||||
dlsch[0]->harq_processes[harq_pid]->Nl,
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm,
|
||||
dlsch[0]->harq_processes[harq_pid]->G,
|
||||
codeword_TB0,
|
||||
codeword_TB1,
|
||||
pdsch_vars[gNB_id]->layer_llr);
|
||||
|
||||
/* Calculate LLR's for each symbol */
|
||||
nr_dlsch_llr(pdsch_vars, frame_parms,
|
||||
rxdataF_comp_ptr, dl_ch_mag_ptr,
|
||||
dlsch0_harq, dlsch1_harq,
|
||||
rx_type, harq_pid,
|
||||
gNB_id, gNB_id_i,
|
||||
first_symbol_flag,
|
||||
i, nb_rb_pdsch,
|
||||
codeword_TB0, codeword_TB1,
|
||||
pdsch_vars[gNB_id]->dl_valid_re[i-1],
|
||||
nr_slot_rx, beamforming_mode);
|
||||
}
|
||||
|
||||
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
|
||||
if (cpumeas(CPUMEAS_GETSTATE))
|
||||
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
|
||||
int dmrs_type = dlsch[0]->harq_processes[harq_pid]->dmrsConfigType;
|
||||
uint8_t nb_re_dmrs;
|
||||
uint16_t dmrs_len = get_num_dmrs(dlsch[0]->harq_processes[harq_pid]->dlDmrsSymbPos);
|
||||
if (dmrs_type==NFAPI_NR_DMRS_TYPE1) {
|
||||
nb_re_dmrs = 6*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
|
||||
} else {
|
||||
nb_re_dmrs = 4*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
|
||||
}
|
||||
dlsch[0]->harq_processes[harq_pid]->G = nr_get_G(dlsch[0]->harq_processes[harq_pid]->nb_rb,
|
||||
dlsch[0]->harq_processes[harq_pid]->nb_symbols,
|
||||
nb_re_dmrs,
|
||||
dmrs_len,
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm,
|
||||
dlsch[0]->harq_processes[harq_pid]->Nl);
|
||||
nr_dlsch_layer_demapping(pdsch_vars[gNB_id]->llr,
|
||||
dlsch[0]->harq_processes[harq_pid]->Nl,
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm,
|
||||
dlsch[0]->harq_processes[harq_pid]->G,
|
||||
codeword_TB0,
|
||||
codeword_TB1,
|
||||
pdsch_vars[gNB_id]->layer_llr);
|
||||
}
|
||||
|
||||
// Please keep it: useful for debugging
|
||||
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
|
||||
if (cpumeas(CPUMEAS_GETSTATE))
|
||||
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
|
||||
|
||||
// Please keep it: useful for debugging
|
||||
#ifdef DEBUG_PDSCH_RX
|
||||
char filename[50];
|
||||
uint8_t aa = 0;
|
||||
|
||||
@@ -71,9 +71,9 @@
|
||||
#include "common/utils/system.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
extern int oai_exit;
|
||||
|
||||
#include "openair1/SCHED/sched_common_extern.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
void feptx0(RU_t *ru,
|
||||
int slot)
|
||||
@@ -616,9 +616,11 @@ void init_fep_thread(RU_t *ru,
|
||||
}
|
||||
|
||||
|
||||
extern void kill_fep_thread(RU_t *ru)
|
||||
void kill_fep_thread(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
if (proc->pthread_fep == 0)
|
||||
return;
|
||||
pthread_mutex_lock( &proc->mutex_fep );
|
||||
proc->instance_cnt_fep = 0;
|
||||
pthread_cond_signal(&proc->cond_fep);
|
||||
@@ -630,9 +632,11 @@ extern void kill_fep_thread(RU_t *ru)
|
||||
}
|
||||
|
||||
|
||||
extern void kill_feptx_thread(RU_t *ru)
|
||||
void kill_feptx_thread(RU_t *ru)
|
||||
{
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
if (proc->pthread_feptx == 0)
|
||||
return;
|
||||
pthread_mutex_lock( &proc->mutex_feptx );
|
||||
proc->instance_cnt_feptx = 0;
|
||||
pthread_cond_signal(&proc->cond_feptx);
|
||||
|
||||
@@ -29,4 +29,6 @@
|
||||
extern int16_t hundred_times_delta_TF[100];
|
||||
extern uint16_t hundred_times_log10_NPRB[100];
|
||||
|
||||
void kill_fep_thread(RU_t *ru);
|
||||
|
||||
#endif /*__SCHED_EXTERN_H__ */
|
||||
|
||||
@@ -573,7 +573,7 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
LOG_D(PHY,"symbol %d Filling rb_mask_ul rb_size %d\n",symbol,ulsch_harq->ulsch_pdu.rb_size);
|
||||
for (rb=0; rb<ulsch_harq->ulsch_pdu.rb_size; rb++) {
|
||||
rb2 = rb+ulsch_harq->ulsch_pdu.rb_start+ulsch_harq->ulsch_pdu.bwp_start;
|
||||
gNB->rb_mask_ul[symbol][rb2>>5] |= (1<<(rb2&31));
|
||||
gNB->rb_mask_ul[symbol][rb2 >> 5] |= 1U << (rb2 & 31);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1321,8 +1321,7 @@ int is_ssb_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_
|
||||
//uint8_t half_frame_index = fp->half_frame_bit;
|
||||
//uint8_t i_ssb = fp->ssb_index;
|
||||
uint8_t Lmax = fp->Lmax;
|
||||
|
||||
if (!(frame%(1<<(config->ssb_table.ssb_period-1)))){
|
||||
if ((config->ssb_table.ssb_period > 0) && !(frame % (1 << (config->ssb_table.ssb_period - 1)))) {
|
||||
|
||||
if(Lmax <= 8) {
|
||||
if(slot <=3 && (((config->ssb_table.ssb_mask_list[0].ssb_mask << 2*slot)&0x80000000) == 0x80000000 || ((config->ssb_table.ssb_mask_list[0].ssb_mask << (2*slot +1))&0x80000000) == 0x80000000))
|
||||
|
||||
@@ -512,12 +512,16 @@ int main(int argc, char **argv) {
|
||||
int re;
|
||||
int s,Kr,Kr_bytes;
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
double s_re0[30720*2],s_im0[30720*2],r_re0[30720*2],r_im0[30720*2];
|
||||
double s_re1[30720*2],s_im1[30720*2],r_re1[30720*2],r_im1[30720*2];
|
||||
double *s_re[2]= {s_re0,s_re1};
|
||||
double *s_im[2]= {s_im0,s_im1};
|
||||
double *r_re[2]= {r_re0,r_re1};
|
||||
double *r_im[2]= {r_im0,r_im1};
|
||||
double *tmpTX[4], *tmpRX[4] ;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
tmpTX[i] = malloc(30720 * NB_ANTENNAS_TX * sizeof(*tmpTX));
|
||||
tmpRX[i] = malloc(30720 * NB_ANTENNAS_RX * sizeof(*tmpRX));
|
||||
}
|
||||
double *s_re[NB_ANTENNAS_TX] = {tmpTX[0], tmpTX[1]};
|
||||
double *s_im[NB_ANTENNAS_TX] = {tmpTX[2], tmpTX[3]};
|
||||
double *r_re[NB_ANTENNAS_RX] = {tmpRX[0], tmpRX[1]};
|
||||
double *r_im[NB_ANTENNAS_RX] = {tmpRX[2], tmpRX[3]};
|
||||
|
||||
uint8_t transmission_mode=1,n_tx_port=1,n_tx_phy=1,n_rx=2;
|
||||
int eNB_id = 0;
|
||||
unsigned char round;
|
||||
|
||||
@@ -358,7 +358,7 @@ int main(int argc, char **argv) {
|
||||
unsigned short input_buffer_length;
|
||||
unsigned int ret;
|
||||
unsigned int coded_bits_per_codeword,nsymb;
|
||||
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[5]= {0,0,0,0,0},round_trials[4]= {0,0,0,0};
|
||||
unsigned int tx_lev = 0, tx_lev_dB = 0, trials, errs[6] = {0}, round_trials[4] = {0};
|
||||
FILE *bler_fd=NULL;
|
||||
char bler_fname[512];
|
||||
FILE *time_meas_fd=NULL;
|
||||
@@ -387,7 +387,6 @@ int main(int argc, char **argv) {
|
||||
double cpu_freq_GHz;
|
||||
int iter_trials;
|
||||
uint32_t UL_alloc_pdu;
|
||||
int s,Kr,Kr_bytes;
|
||||
int dump_perf=0;
|
||||
static int dump_table =0;
|
||||
double effective_rate=0.0;
|
||||
@@ -1233,20 +1232,21 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (n_frames==1) {
|
||||
printf("ULSCH errors found o_ACK[0]= %d\n",eNB->ulsch[0]->harq_processes[harq_pid]->o_ACK[0]);
|
||||
|
||||
#ifdef DUMP_EACH_VALUE
|
||||
int Kr_bytes;
|
||||
for (s=0; s<eNB->ulsch[0]->harq_processes[harq_pid]->C; s++) {
|
||||
if (s<eNB->ulsch[0]->harq_processes[harq_pid]->Cminus)
|
||||
Kr = eNB->ulsch[0]->harq_processes[harq_pid]->Kminus;
|
||||
Kr_bytes = eNB->ulsch[0]->harq_processes[harq_pid]->Kminus;
|
||||
else
|
||||
Kr = eNB->ulsch[0]->harq_processes[harq_pid]->Kplus;
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
Kr_bytes = eNB->ulsch[0]->harq_processes[harq_pid]->Kplus;
|
||||
Kr_bytes = Kr_bytes >> 3;
|
||||
printf("Decoded_output (Segment %d):\n",s);
|
||||
|
||||
for (i=0; i<Kr_bytes; i++)
|
||||
printf("%d : %x (%x)\n",i,eNB->ulsch[0]->harq_processes[harq_pid]->c[s][i],
|
||||
eNB->ulsch[0]->harq_processes[harq_pid]->c[s][i]^UE->ulsch[0]->harq_processes[harq_pid]->c[s][i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
dump_ulsch(eNB,eNB->proc.frame_rx,subframe,0,round);
|
||||
round=5;
|
||||
|
||||
@@ -1139,7 +1139,7 @@ int main(int argc, char **argv)
|
||||
Sched_INFO.frame = frame;
|
||||
Sched_INFO.slot = slot;
|
||||
Sched_INFO.DL_req = &gNB_mac->DL_req[0];
|
||||
Sched_INFO.UL_tti_req = gNB_mac->UL_tti_req_ahead[slot];
|
||||
Sched_INFO.UL_tti_req = gNB_mac->UL_tti_req_ahead[0];
|
||||
Sched_INFO.UL_dci_req = NULL;
|
||||
Sched_INFO.TX_req = &gNB_mac->TX_req[0];
|
||||
pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx);
|
||||
|
||||
Reference in New Issue
Block a user