Commit 26a989ed authored by Rohit Gupta's avatar Rohit Gupta
Browse files

Merge branch 'develop' into feature-34-test_framework

parents 6066ebb7 82b0b3ba
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#include "PHY/defs.h" #include "PHY/defs.h"
#include "assertions.h"
//#define cmin(a,b) ((a)<(b) ? (a) : (b)) //#define cmin(a,b) ((a)<(b) ? (a) : (b))
...@@ -515,16 +516,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, ...@@ -515,16 +516,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
// if (rvidx==3) // if (rvidx==3)
// for (cnt=0;cnt<Ncb;cnt++) // for (cnt=0;cnt<Ncb;cnt++)
// counter_buffer[rvidx][cnt]=0; // counter_buffer[rvidx][cnt]=0;
if (Ncb<(3*(RTC<<5))) { AssertFatal(Ncb>=(3*RTC<<5),"Exiting, RM condition (Ncb %d, Nir/C %d, Nsoft %d, Kw %d\n",Ncb,Nir/C,Nsoft,3*(RTC<<5));
msg("Exiting, RM condition (Nir %d, Nsoft %d, Kw %d\n",Nir,Nsoft,3*(RTC<<5));
return(0);
}
Gp = G/Nl/Qm; Gp = G/Nl/Qm;
GpmodC = Gp%C; GpmodC = Gp%C;
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("lte_rate_matching_turbo: Kw %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",3*(RTC<<5),rvidx, G, Qm,Nl,r); printf("lte_rate_matching_turbo: Ncb %d, Kw %d, Nir/C %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,3*(RTC<<5),Nir/C,rvidx, G, Qm,Nl,r);
#endif #endif
if (r < (C-(GpmodC))) if (r < (C-(GpmodC)))
......
...@@ -243,15 +243,16 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -243,15 +243,16 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe); int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe);
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb, void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe,
module_id_t eNB_id, module_id_t eNB_id,
unsigned char clear); unsigned char clear);
void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNb, void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t sect_id); uint8_t sect_id);
void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb, void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNBy,
module_id_t eNB_id, module_id_t eNB_id,
module_id_t UE_id, module_id_t UE_id,
unsigned char init_averaging); unsigned char init_averaging);
......
...@@ -39,57 +39,36 @@ ...@@ -39,57 +39,36 @@
int32_t rx_power_avg_eNB[3][3]; int32_t rx_power_avg_eNB[3][3];
void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb, void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
int subframe,
unsigned char eNB_id, unsigned char eNB_id,
unsigned char clear) unsigned char clear)
{ {
LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNb->lte_eNB_common_vars; LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNb->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNb->PHY_measurements_eNB[eNB_id]; PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id];
int32_t *rb_mask = phy_vars_eNB->rb_mask_ul;
uint32_t aarx,rx_power_correction; uint32_t aarx,rx_power_correction;
uint32_t rb; uint32_t rb;
int32_t *ul_ch; int32_t *ul_ch;
int32_t n0_power_tot; int32_t n0_power_tot;
int len;
int offset;
int Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
// noise measurements // noise measurements
// for the moment we measure the noise on the 7th OFDM symbol (in S subframe) // for the moment we measure the noise on the 7th OFDM symbol (in S subframe)
phy_measurements->n0_power_tot = 0; phy_measurements->n0_power_tot = 0;
/* printf("rxdataF0 %p, rxdataF1 %p\n",
(&eNB_common_vars->rxdataF[0][0][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]),
(&eNB_common_vars->rxdataF[0][1][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]));
*/
/*
for (i=0;i<512;i++)
printf("sector 0 antenna 0 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1],
((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]);
for (i=0;i<12;i++)
// printf("sector 0 antenna 1 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1],
((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]);
*/
if ( (frame_parms->ofdm_symbol_size == 128) ||
(frame_parms->ofdm_symbol_size == 512) )
rx_power_correction = 2;
else
rx_power_correction = 1;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
if (clear == 1) if (clear == 1)
phy_measurements->n0_power[aarx]=0; phy_measurements->n0_power[aarx]=0;
#ifdef USER_MODE
phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size], phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10; frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10;
#else
phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
frame_parms->ofdm_symbol_size))+k2*phy_measurements->n0_power[aarx])>>10;
#endif
phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size); phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
phy_measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(phy_measurements->n0_power[aarx]); phy_measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(phy_measurements->n0_power[aarx]);
phy_measurements->n0_power_tot += phy_measurements->n0_power[aarx]; phy_measurements->n0_power_tot += phy_measurements->n0_power[aarx];
...@@ -97,52 +76,49 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb, ...@@ -97,52 +76,49 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
phy_measurements->n0_power_tot_dB = (unsigned short) dB_fixed(phy_measurements->n0_power_tot); phy_measurements->n0_power_tot_dB = (unsigned short) dB_fixed(phy_measurements->n0_power_tot);
phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNb->rx_total_gain_eNB_dB; phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNB->rx_total_gain_eNB_dB;
// printf("n0_power %d\n",phy_measurements->n0_power_tot_dB); // printf("n0_power %d\n",phy_measurements->n0_power_tot_dB);
for (rb=0; rb<frame_parms->N_RB_UL; rb++) { for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
n0_power_tot=0; n0_power_tot=0;
if ((rb_mask[rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
// select the 7th symbol in an uplink subframe
if (rb < 12) offset = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
// ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((19*(frame_parms->ofdm_symbol_size)) + frame_parms->first_carrier_offset + (rb*12))<<1]; offset += (7*frame_parms->ofdm_symbol_size);//(((Nsymb*subframe)+7)*frame_parms->ofdm_symbol_size);
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + frame_parms->first_carrier_offset + (rb*12))<<1]; ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][offset];
else if (rb>12) len = 12;
ul_ch = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + 6 + (rb-13)*12)<<1]; // just do first half of middle PRB for odd number of PRBs
else { if (((frame_parms->N_RB_UL&1) == 1) &&
ul_ch = NULL; (rb==(frame_parms->N_RB_UL>>1))) {
} len=6;
}
if (clear == 1) if (clear == 1)
phy_measurements->n0_subband_power[aarx][rb]=0; phy_measurements->n0_subband_power[aarx][rb]=0;
if (ul_ch) { AssertFatal(ul_ch, "RX signal buffer (freq) problem");
// for (i=0;i<24;i+=2)
// printf("re %d => %d\n",i/2,ul_ch[i]);
phy_measurements->n0_subband_power[aarx][rb] = ((k1*(signal_energy_nodc(ul_ch, phy_measurements->n0_subband_power[aarx][rb] = signal_energy_nodc(ul_ch,len);
24))*rx_power_correction) + (k2*phy_measurements->n0_subband_power[aarx][rb]))>>11; // 11 and 24 to compensate for repeated signal format //((k1*(signal_energy_nodc(ul_ch,len)))
// + (k2*phy_measurements->n0_subband_power[aarx][rb]));
phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]);
// printf("eNb %d, aarx %d, rb %d : energy %d (%d dB)\n",eNB_id,aarx,rb,signal_energy_nodc(ul_ch,24), phy_measurements->n0_subband_power_dB[aarx][rb]); phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]);
n0_power_tot += phy_measurements->n0_subband_power[aarx][rb]; // printf("subframe %d (%d): eNb %d, aarx %d, rb %d len %d: energy %d (%d dB)\n",subframe,offset,eNB_id,aarx,rb,len,signal_energy_nodc(ul_ch,len),
} else { // phy_measurements->n0_subband_power_dB[aarx][rb]);
phy_measurements->n0_subband_power[aarx][rb] = 1; n0_power_tot += phy_measurements->n0_subband_power[aarx][rb];
phy_measurements->n0_subband_power_dB[aarx][rb] = -99;
n0_power_tot = 1;
} }
phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNB->rx_total_gain_eNB_dB - dB_fixed(frame_parms->N_RB_UL);
} }
phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNb->rx_total_gain_eNB_dB - 14;
} }
} }
void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb, void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb,
unsigned char eNB_id, unsigned char eNB_id,
unsigned char UE_id, unsigned char UE_id,
......
...@@ -2108,14 +2108,14 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2108,14 +2108,14 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
if (dci_alloc[i].L == (uint8_t)L) { if (dci_alloc[i].L == (uint8_t)L) {
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].nCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L, LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
*(unsigned int*)dci_alloc[i].dci_pdu); *(unsigned int*)dci_alloc[i].dci_pdu);
dump_dci(frame_parms,&dci_alloc[i]); dump_dci(frame_parms,&dci_alloc[i]);
#endif #endif
if (dci_alloc[i].nCCE>=0) { if (dci_alloc[i].firstCCE>=0) {
e_ptr = generate_dci0(dci_alloc[i].dci_pdu, e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].nCCE), e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length, dci_alloc[i].dci_length,
dci_alloc[i].L, dci_alloc[i].L,
dci_alloc[i].rnti); dci_alloc[i].rnti);
...@@ -2133,9 +2133,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2133,9 +2133,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
dump_dci(frame_parms,&dci_alloc[i]); dump_dci(frame_parms,&dci_alloc[i]);
#endif #endif
if (dci_alloc[i].nCCE >= 0) { if (dci_alloc[i].firstCCE >= 0) {
e_ptr = generate_dci0(dci_alloc[i].dci_pdu, e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].nCCE), e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length, dci_alloc[i].dci_length,
dci_alloc[i].L, dci_alloc[i].L,
dci_alloc[i].rnti); dci_alloc[i].rnti);
...@@ -2537,13 +2537,116 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin ...@@ -2537,13 +2537,116 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin
return(Nreg - 4 - (3*Ngroup_PHICH)); return(Nreg - 4 - (3*Ngroup_PHICH));
} }
uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id) uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe)
{ {
// check for eNB only ! // check for eNB only !
return(get_nCCE(3,&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,1)); // 5, 15,21 return(get_nCCE(num_pdcch_symbols,
&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,
get_mi(&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,subframe)));
} }
int get_nCCE_offset_l1(int *CCE_table,
const unsigned char L,
const int nCCE,
const int common_dci,
const unsigned short rnti,
const unsigned char subframe)
{
int search_space_free,m,nb_candidates = 0,l,i;
unsigned int Yk;
/*
printf("CCE Allocation: ");
for (i=0;i<nCCE;i++)
printf("%d.",CCE_table[i]);
printf("\n");
*/
if (common_dci == 1) {
// check CCE(0 ... L-1)
nb_candidates = (L==4) ? 4 : 2;
nb_candidates = min(nb_candidates,nCCE/L);
// printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L);
for (m = nb_candidates-1 ; m >=0 ; m--) {
search_space_free = 1;
for (l=0; l<L; l++) {
// printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]);
if (CCE_table[(m*L) + l] == 1) {
search_space_free = 0;
break;
}
}
if (search_space_free == 1) {
// printf("returning %d\n",m*L);
for (l=0; l<L; l++)
CCE_table[(m*L)+l]=1;
return(m*L);
}
}
return(-1);
} else { // Find first available in ue specific search space
// according to procedure in Section 9.1.1 of 36.213 (v. 8.6)
// compute Yk
Yk = (unsigned int)rnti;
for (i=0; i<=subframe; i++)
Yk = (Yk*39827)%65537;
Yk = Yk % (nCCE/L);
switch (L) {
case 1:
case 2:
nb_candidates = 6;
break;
case 4:
case 8:
nb_candidates = 2;
break;
default:
DevParam(L, nCCE, rnti);
break;
}
LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates);
for (m = 0 ; m < nb_candidates ; m++) {
search_space_free = 1;
for (l=0; l<L; l++) {
if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) {
search_space_free = 0;
break;
}
}
if (search_space_free == 1) {
for (l=0; l<L; l++)
CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1;
return(((Yk+m)%(nCCE/L))*L);
}
}
return(-1);
}
}
void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars, void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,
int do_common, int do_common,
uint8_t subframe, uint8_t subframe,
...@@ -2691,7 +2794,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars, ...@@ -2691,7 +2794,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,
dci_alloc[*dci_cnt].dci_length = sizeof_bits; dci_alloc[*dci_cnt].dci_length = sizeof_bits;
dci_alloc[*dci_cnt].rnti = crc; dci_alloc[*dci_cnt].rnti = crc;
dci_alloc[*dci_cnt].L = L; dci_alloc[*dci_cnt].L = L;
dci_alloc[*dci_cnt].nCCE = CCEind; dci_alloc[*dci_cnt].firstCCE = CCEind;
if (sizeof_bytes<=4) { if (sizeof_bytes<=4) {
dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[0]; dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[0];
......
...@@ -453,7 +453,7 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL) { ...@@ -453,7 +453,7 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL) {
} }
int get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) { uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
int offset; int offset;
...@@ -926,10 +926,15 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -926,10 +926,15 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB); // printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
} }
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc]; if (vrb_type==LOCALIZED) {
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT6[rballoc];
}
else {
LOG_E(PHY,"Distributed RB allocation not done yet\n");
mac_xface->macphy_exit("exiting");
}
dlsch0_harq->vrb_type = vrb_type; dlsch0_harq->vrb_type = vrb_type;
dlsch0_harq->nb_rb = RIV2nb_rb_LUT6[rballoc];//NPRB; dlsch0_harq->nb_rb = RIV2nb_rb_LUT6[rballoc];//NPRB;
RIV_max = RIV_max6; RIV_max = RIV_max6;
...@@ -960,7 +965,14 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -960,7 +965,14 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc];
if (vrb_type==LOCALIZED) {
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT25[rballoc];
}
else {
LOG_E(PHY,"Distributed RB allocation not done yet\n");
mac_xface->macphy_exit("exiting");
}
dlsch0_harq->vrb_type = vrb_type; dlsch0_harq->vrb_type = vrb_type;
dlsch0_harq->nb_rb = RIV2nb_rb_LUT25[rballoc];//NPRB; dlsch0_harq->nb_rb = RIV2nb_rb_LUT25[rballoc];//NPRB;
RIV_max = RIV_max25; RIV_max = RIV_max25;
...@@ -987,9 +999,16 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -987,9 +999,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
} }
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
if (vrb_type==LOCALIZED) {
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc];
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc];
}
else {
LOG_E(PHY,"Distributed RB allocation not done yet\n");
mac_xface->macphy_exit("exiting");
}
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT50_0[rballoc];
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT50_1[rballoc];
dlsch0_harq->vrb_type = vrb_type; dlsch0_harq->vrb_type = vrb_type;
dlsch0_harq->nb_rb = RIV2nb_rb_LUT50[rballoc];//NPRB; dlsch0_harq->nb_rb = RIV2nb_rb_LUT50[rballoc];//NPRB;
RIV_max = RIV_max50; RIV_max = RIV_max50;
...@@ -1017,10 +1036,17 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -1017,10 +1036,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
dlsch0_harq->vrb_type = vrb_type; dlsch0_harq->vrb_type = vrb_type;
dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc]; if (vrb_type==LOCALIZED) {
dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc]; dlsch0_harq->rb_alloc[0] = localRIV2alloc_LUT100_0[rballoc];
dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc]; dlsch0_harq->rb_alloc[1] = localRIV2alloc_LUT100_1[rballoc];
dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc]; dlsch0_harq->rb_alloc[2] = localRIV2alloc_LUT100_2[rballoc];
dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rballoc];
}
else {
LOG_E(PHY,"Distributed RB allocation not done yet\n");
mac_xface->macphy_exit("exiting");
}
dlsch0_harq->nb_rb = RIV2nb_rb_LUT100[rballoc];//NPRB; dlsch0_harq->nb_rb = RIV2nb_rb_LUT100[rballoc];//NPRB;
...@@ -2682,17 +2708,17 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -2682,17 +2708,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
#ifdef DEBUG_DCI #ifdef DEBUG_DCI
if (dlsch0) { if (dlsch0) {
msg("dlsch0 eNB: dlsch0 %p\n",dlsch0); printf("dlsch0 eNB: dlsch0 %p\n",dlsch0);
msg("dlsch0 eNB: rnti %x\n",dlsch0->rnti); printf("dlsch0 eNB: rnti %x\n",dlsch0->rnti);
msg("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb); printf("dlsch0 eNB: NBRB %d\n",dlsch0_harq->nb_rb);
msg("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]); printf("dlsch0 eNB: rballoc %x\n",dlsch0_harq->rb_alloc[0]);
msg("dlsch0 eNB: harq_pid %d\n",harq_pid); printf("dlsch0 eNB: harq_pid %d\n",harq_pid);
msg("dlsch0 eNB: round %d\n",dlsch0_harq->round); printf("dlsch0 eNB: round %d\n",dlsch0_harq->round);
msg("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx); printf("dlsch0 eNB: rvidx %d\n",dlsch0_harq->rvidx);
msg("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB); printf("dlsch0 eNB: TBS %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB);
msg("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs); printf("dlsch0 eNB: mcs %d\n",dlsch0_harq->mcs);
msg("dlsch0 eNB: tpmi %d\n",tpmi); printf("dlsch0 eNB: tpmi %d\n",tpmi);
msg("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode); printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode);
} }
#endif #endif
...@@ -5549,15 +5575,15 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -5549,15 +5575,15 @@ int generate_ue_dlsch_params_from_dci(int frame,
#ifdef DEBUG_DCI #ifdef DEBUG_DCI
if (dlsch[0]) { if (dlsch[0]) {
msg("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti);
msg("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb);
msg("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc[0]); printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]);
msg("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid);
msg("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); printf("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi);
msg("PDSCH dlsch0 UE: rvidx %d\n",dlsch0_harq->rvidx);