Commit d092a130 authored by knopp's avatar knopp
Browse files

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5927 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent d704453e
......@@ -4673,85 +4673,85 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
if (cqi_req == 1) {
ulsch->O_RI = 1; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table
ulsch->harq_processes[harq_pid]->O_RI = 1; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table
switch(transmission_mode){
// The aperiodic CQI reporting mode is fixed for every transmission mode instead of being configured by higher layer signaling
case 1:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
}
break;
case 2:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
}
break;
case 3:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
}
break;
case 4:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = wideband_cqi_rank1_2A;
}
break;
case 5:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = wideband_cqi_rank1_2A;
}
break;
case 6:
if ((rnti >= cba_rnti) && (rnti < p_rnti)){
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_mcs_CBA;
}
else {
ulsch->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = wideband_cqi_rank1_2A;
}
break;
case 7:
ulsch->Or2 = 0;
ulsch->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
break;
default:
LOG_E(PHY,"Incorrect Transmission Mode \n");
......@@ -4759,10 +4759,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
}
}
else {
ulsch->O_RI = 0;//1;
ulsch->Or2 = 0;
ulsch->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->harq_processes[harq_pid]->O_RI = 0;//1;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
}
if (frame_parms->frame_type == FDD) {
......@@ -4786,8 +4786,8 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
ulsch->beta_offset_ri_times8 = beta_ri[phy_vars_eNB->pusch_config_dedicated[UE_id].betaOffset_RI_Index];//10;
ulsch->beta_offset_harqack_times8 = beta_ack[phy_vars_eNB->pusch_config_dedicated[UE_id].betaOffset_ACK_Index];//16;
ulsch->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1);
ulsch->srs_active = use_srs;
ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1);
ulsch->harq_processes[harq_pid]->srs_active = use_srs;
ulsch->bundling = 1-AckNackFBMode;
//Mapping of cyclic shift field in DCI format0 to n_DMRS2 (3GPP 36.211, Table 5.5.2.1.1-1)
if(cshift == 0)
......@@ -4832,7 +4832,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
ulsch->harq_processes[harq_pid]->TBS = TBStable[get_I_TBS_UL(ulsch->harq_processes[harq_pid]->mcs)][ulsch->harq_processes[harq_pid]->nb_rb-1];
ulsch->harq_processes[harq_pid]->Msc_initial = 12*ulsch->harq_processes[harq_pid]->nb_rb;
ulsch->harq_processes[harq_pid]->Nsymb_initial = ulsch->Nsymb_pusch;
ulsch->harq_processes[harq_pid]->Nsymb_initial = ulsch->harq_processes[harq_pid]->Nsymb_pusch;
ulsch->harq_processes[harq_pid]->round = 0;
}
else {
......@@ -4858,8 +4858,8 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
msg("ulsch (eNB): round %d\n",ulsch->harq_processes[harq_pid]->round);
msg("ulsch (eNB): TBS %d\n",ulsch->harq_processes[harq_pid]->TBS);
msg("ulsch (eNB): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs);
msg("ulsch (eNB): Or1 %d\n",ulsch->Or1);
msg("ulsch (eNB): Nsymb_pusch %d\n",ulsch->Nsymb_pusch);
msg("ulsch (eNB): Or1 %d\n",ulsch->harq_processes[harq_pid]->Or1);
msg("ulsch (eNB): Nsymb_pusch %d\n",ulsch->harq_processes[harq_pid]->Nsymb_pusch);
msg("ulsch (eNB): cshift %d\n",ulsch->harq_processes[harq_pid]->n_DMRS2);
#else
UNUSED_VARIABLE(dai);
......
......@@ -355,16 +355,52 @@ typedef struct {
uint32_t TBS;
/// The payload + CRC size in bits
uint32_t B;
/// CQI CRC status
uint8_t cqi_crc_status;
/// Pointer to CQI data
uint8_t o[MAX_CQI_BYTES];
/// Format of CQI data
UCI_format_t uci_format;
/// Length of CQI data under RI=1 assumption(bits)
uint8_t Or1;
/// Length of CQI data under RI=2 assumption(bits)
uint8_t Or2;
/// Rank information
uint8_t o_RI[2];
/// Length of rank information (bits)
uint8_t O_RI;
/// Pointer to ACK
uint8_t o_ACK[4];
/// Length of ACK information (bits)
uint8_t O_ACK;
/// The value of DAI in DCI format 0
uint8_t V_UL_DAI;
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
int8_t q[MAX_CQI_PAYLOAD];
/// number of coded CQI bits after interleaving
uint8_t o_RCC;
/// coded and interleaved CQI bits
int8_t o_w[(MAX_CQI_BITS+8)*3];
/// coded CQI bits
int8_t o_d[96+((MAX_CQI_BITS+8)*3)];
/// coded ACK bits
int16_t q_ACK[MAX_ACK_PAYLOAD];
/// coded RI bits
int16_t q_RI[MAX_RI_PAYLOAD];
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
int16_t e[MAX_NUM_CHANNEL_BITS];
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Pointer to the payload
uint8_t *b;
/// Pointers to transport block segments
uint8_t *c[MAX_NUM_ULSCH_SEGMENTS];
/// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15)
uint32_t RTC[MAX_NUM_ULSCH_SEGMENTS];
/// Current Number of Symbols
uint8_t Nsymb_pusch;
/// SRS active flag
uint8_t srs_active;
/// Index of current HARQ round for this ULSCH
uint8_t round;
/// MCS format for this ULSCH
......@@ -404,50 +440,14 @@ typedef struct {
} LTE_UL_eNB_HARQ_t;
typedef struct {
/// Current Number of Symbols
uint8_t Nsymb_pusch;
/// SRS active flag
uint8_t srs_active;
/// Pointers to 8 HARQ processes for the ULSCH
LTE_UL_eNB_HARQ_t *harq_processes[8];
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
int16_t e[MAX_NUM_CHANNEL_BITS];
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Mdlharq;
/// Maximum number of iterations used in eNB turbo decoder
uint8_t max_turbo_iterations;
/// CQI CRC status
uint8_t cqi_crc_status;
/// Pointer to CQI data
uint8_t o[MAX_CQI_BYTES];
/// Format of CQI data
UCI_format_t uci_format;
/// Length of CQI data under RI=1 assumption(bits)
uint8_t Or1;
/// Length of CQI data under RI=2 assumption(bits)
uint8_t Or2;
/// Rank information
uint8_t o_RI[2];
/// Length of rank information (bits)
uint8_t O_RI;
/// Pointer to ACK
uint8_t o_ACK[4];
/// ACK/NAK Bundling flag
uint8_t bundling;
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
int8_t q[MAX_CQI_PAYLOAD];
/// number of coded CQI bits after interleaving
uint8_t o_RCC;
/// coded and interleaved CQI bits
int8_t o_w[(MAX_CQI_BITS+8)*3];
/// coded CQI bits
int8_t o_d[96+((MAX_CQI_BITS+8)*3)];
/// coded ACK bits
int16_t q_ACK[MAX_ACK_PAYLOAD];
/// coded RI bits
int16_t q_RI[MAX_RI_PAYLOAD];
/// beta_offset_cqi times 8
uint16_t beta_offset_cqi_times8;
/// beta_offset_ri times 8
......
......@@ -880,8 +880,9 @@ int dlsch_modulation(mod_sym_t **txdataF,
int16_t amp_rho_a, amp_rho_b;
int16_t qam16_table_a[4],qam64_table_a[8],qam16_table_b[4],qam64_table_b[8];
int16_t *qam_table_s;
#ifdef DEBUG_DLSCH_MODULATION
uint8_t Nl = dlsch->harq_processes[harq_pid]->Nl;
#endif
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_FUNCTION_IN);
nsymb = (frame_parms->Ncp==0) ? 14:12;
......
......@@ -1283,6 +1283,9 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue,
// ulsch->harq_processes[harq_pid]->Ndi = 0;
ulsch->harq_processes[harq_pid]->round++;
ulsch->harq_processes[harq_pid]->rvidx = rv_table[ulsch->harq_processes[harq_pid]->round&3];
ulsch->O_RI = 0;
ulsch->O = 0;
ulsch->uci_format = HLC_subband_cqi_nopmi;
}
......@@ -1406,6 +1409,11 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
// ulsch_eNB[UE_id]->harq_processes[harq_pid]->Ndi = 0;
// ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; //this is already done in phy_procedures
ulsch_eNB[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch_eNB[UE_id]->harq_processes[harq_pid]->round&3];
ulsch_eNB[UE_id]->harq_processes[harq_pid]->O_RI = 0;
ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or2 = 0;
ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1 = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz;
ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
}
else {
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n",
......
......@@ -120,14 +120,14 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu,
cqireq = rar[3]&1;
if (cqireq==1){
ulsch->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->O_RI = 1;
ulsch->harq_processes[harq_pid]->Or2 = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->harq_processes[harq_pid]->Or1 = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->harq_processes[harq_pid]->O_RI = 1;
}
else{
ulsch->O_RI = 0;//1;
ulsch->Or2 = 0;
ulsch->Or1 = 0;
ulsch->harq_processes[harq_pid]->O_RI = 0;//1;
ulsch->harq_processes[harq_pid]->Or2 = 0;
ulsch->harq_processes[harq_pid]->Or1 = 0;
}
ulsch->harq_processes[harq_pid]->O_ACK = 0;//2;
......@@ -136,7 +136,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu,
ulsch->beta_offset_harqack_times8 = 16;
ulsch->Nsymb_pusch = 12-(frame_parms->Ncp<<1);
ulsch->harq_processes[harq_pid]->Nsymb_pusch = 12-(frame_parms->Ncp<<1);
ulsch->rnti = (((uint16_t)rar[4])<<8)+rar[5];
if (ulsch->harq_processes[harq_pid]->round == 0) {
ulsch->harq_processes[harq_pid]->status = ACTIVE;
......@@ -160,8 +160,8 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu,
msg("ulsch ra (eNB): round %d\n",ulsch->harq_processes[harq_pid]->round);
msg("ulsch ra (eNB): TBS %d\n",ulsch->harq_processes[harq_pid]->TBS);
msg("ulsch ra (eNB): mcs %d\n",ulsch->harq_processes[harq_pid]->mcs);
msg("ulsch ra (eNB): Or1 %d\n",ulsch->Or1);
msg("ulsch ra (eNB): ORI %d\n",ulsch->O_RI);
msg("ulsch ra (eNB): Or1 %d\n",ulsch->harq_processes[harq_pid]->Or1);
msg("ulsch ra (eNB): ORI %d\n",ulsch->harq_processes[harq_pid]->O_RI);
#endif
return(0);
}
......
......@@ -291,7 +291,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
Q_m = get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs);
G = nb_rb * (12 * Q_m) * ulsch->Nsymb_pusch;
G = nb_rb * (12 * Q_m) * ulsch->harq_processes[harq_pid]->Nsymb_pusch;
#ifdef DEBUG_ULSCH_DECODING
......@@ -300,7 +300,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
ulsch->harq_processes[harq_pid]->round,
ulsch->harq_processes[harq_pid]->rvidx,
ulsch->harq_processes[harq_pid]->mcs,
ulsch->O_RI,
ulsch->harq_processes[harq_pid]->O_RI,
ulsch->harq_processes[harq_pid]->O_ACK,
G,
subframe);
......@@ -338,7 +338,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
ulsch->harq_processes[harq_pid]->round,
ulsch->harq_processes[harq_pid]->rvidx,
ulsch->harq_processes[harq_pid]->mcs,
ulsch->O_RI,
ulsch->harq_processes[harq_pid]->O_RI,
ulsch->harq_processes[harq_pid]->O_ACK,
G,
subframe);
......@@ -347,7 +347,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
}
// Compute Q_ri
Qprime = ulsch->O_RI*ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_ri_times8;
Qprime = ulsch->harq_processes[harq_pid]->O_RI*ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_ri_times8;
if (Qprime > 0 ) {
if ((Qprime % (8*sumKr)) > 0)
......@@ -383,12 +383,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
Qprime_ACK,ulsch->harq_processes[harq_pid]->Msc_initial,ulsch->harq_processes[harq_pid]->Nsymb_initial,sumKr);
#endif
// Compute Q_cqi
if (ulsch->Or1 < 12)
if (ulsch->harq_processes[harq_pid]->Or1 < 12)
L=0;
else
L=8;
if (ulsch->Or1 > 0)
Qprime = (ulsch->Or1 + L) * ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_cqi_times8;
if (ulsch->harq_processes[harq_pid]->Or1 > 0)
Qprime = (ulsch->harq_processes[harq_pid]->Or1 + L) * ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_cqi_times8;
else
Qprime=0;
......@@ -399,16 +399,16 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
Qprime = Qprime/(8*sumKr);
}
G = nb_rb * (12 * Q_m) * (ulsch->Nsymb_pusch);
G = nb_rb * (12 * Q_m) * (ulsch->harq_processes[harq_pid]->Nsymb_pusch);
if (Qprime > (G - ulsch->O_RI))
Qprime = G - ulsch->O_RI;
if (Qprime > (G - ulsch->harq_processes[harq_pid]->O_RI))
Qprime = G - ulsch->harq_processes[harq_pid]->O_RI;
Q_CQI = Q_m * Qprime;
//#ifdef DEBUG_ULSCH_DECODING
LOG_D(PHY,"ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch->Or1,ulsch->harq_processes[harq_pid]->O_ACK);
LOG_D(PHY,"ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch->harq_processes[harq_pid]->Or1,ulsch->harq_processes[harq_pid]->O_ACK);
//#endif
Qprime_CQI = Qprime;
......@@ -425,7 +425,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
// Demultiplexing/Deinterleaving of PUSCH/ACK/RI/CQI
Hpp = Hprime + Qprime_RI;
Cmux = ulsch->Nsymb_pusch;
Cmux = ulsch->harq_processes[harq_pid]->Nsymb_pusch;
// Rmux = Hpp*Q_m/Cmux;
Rmux_prime = Hpp/Cmux;
......@@ -764,17 +764,17 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
}
for (i=0;i<len_ACK;i++)
ulsch->q_ACK[i] = 0;
ulsch->harq_processes[harq_pid]->q_ACK[i] = 0;
for (i=0;i<Qprime_ACK;i++) {
r = Rmux_prime -1 - (i>>2);
for (q=0;q<Q_m;q++) {
if (y[q+(Q_m*((r*Cmux) + columnset[j]))]!=0)
ulsch->q_ACK[(q+(Q_m*i))%len_ACK] += y[q+(Q_m*((r*Cmux) + columnset[j]))];
ulsch->harq_processes[harq_pid]->q_ACK[(q+(Q_m*i))%len_ACK] += y[q+(Q_m*((r*Cmux) + columnset[j]))];
#ifdef DEBUG_ULSCH_DECODING
// LOG_D(PHY,"ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]);
printf("ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]);
// LOG_D(PHY,"ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch->harq_processes[harq_pid]->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]);
printf("ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch->harq_processes[harq_pid]->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]);
#endif
y[q+(Q_m*((r*Cmux) + columnset[j]))]=0; // NULL LLRs in ACK positions
}
......@@ -784,7 +784,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
// RI BITS
if (ulsch->O_RI == 1) {
if (ulsch->harq_processes[harq_pid]->O_RI == 1) {
switch (Q_m) {
case 2:
len_RI=2;
......@@ -798,13 +798,13 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
}
}
if (ulsch->O_RI > 1) {
if (ulsch->harq_processes[harq_pid]->O_RI > 1) {
LOG_E(PHY,"ulsch_decoding: FATAL, RI cannot be more than 1 bit yet\n");
return(-1);
}
for (i=0;i<len_RI;i++)
ulsch->q_RI[i] = 0;
ulsch->harq_processes[harq_pid]->q_RI[i] = 0;
if (frame_parms->Ncp == 0)
columnset = cs_ri_normal;
......@@ -814,7 +814,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
for (i=0;i<Qprime_RI;i++) {
r = Rmux_prime -1 - (i>>2);
for (q=0;q<Q_m;q++)
ulsch->q_RI[(q+(Q_m*i))%len_RI] += y[q+(Q_m*((r*Cmux) + columnset[j]))];
ulsch->harq_processes[harq_pid]->q_RI[(q+(Q_m*i))%len_RI] += y[q+(Q_m*((r*Cmux) + columnset[j]))];
ytag[(r*Cmux) + columnset[j]] = LTE_NULL;
j=(j+3)&3;
}
......@@ -838,11 +838,11 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
for (q=0;q<Q_m;q++) {
ys = y[q+(Q_m*((r*Cmux)+j))];
if (ys>127)
ulsch->q[q+(Q_m*i)] = 127;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = 127;
else if (ys<-128)
ulsch->q[q+(Q_m*i)] = -128;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = -128;
else
ulsch->q[q+(Q_m*i)] = ys;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = ys;
#ifdef DEBUG_ULSCH_DECODING
msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys);
#endif
......@@ -854,11 +854,11 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
// ys = y[q+(Q_m*((r*Cmux)+j))];
ys = y[q+j2];
if (ys>127)
ulsch->q[q+(Q_m*i)] = 127;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = 127;
else if (ys<-128)
ulsch->q[q+(Q_m*i)] = -128;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = -128;
else
ulsch->q[q+(Q_m*i)] = ys;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = ys;
#ifdef DEBUG_ULSCH_DECODING
LOG_D(PHY,"ulsch_decoding.c: CQI %d, q %d, y[%d] %d\n",q+(Q_m*i),q,j2, q+j2,ys);
#endif
......@@ -873,8 +873,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
for (iprime=0;iprime<(Hprime-Qprime_CQI)<<1;) {
while (ytag[j]==LTE_NULL) { j++;j2+=2; }
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
#ifdef DEBUG_ULSCH_DECODING
// msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
#endif
......@@ -886,10 +886,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
for (iprime=0;iprime<(Hprime-Qprime_CQI)<<2;) {
while (ytag[j]==LTE_NULL) { j++;j2+=4; }
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
#ifdef DEBUG_ULSCH_DECODING
// msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
#endif
......@@ -900,12 +900,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
for (iprime=0;iprime<(Hprime-Qprime_CQI)*6;) {
while (ytag[j]==LTE_NULL) { j++;j2+=6; }
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
ulsch->harq_processes[harq_pid]->e[iprime++] = y[j2++];
#ifdef DEBUG_ULSCH_DECODING
// msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
#endif
......@@ -933,11 +933,11 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
for (q=0;q<Q_m;q++) {
ys = y[q+(Q_m*((r*Cmux)+j))];
if (ys>127)
ulsch->q[q+(Q_m*i)] = 127;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = 127;
else if (ys<-128)
ulsch->q[q+(Q_m*i)] = -128;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = -128;
else
ulsch->q[q+(Q_m*i)] = ys;
ulsch->harq_processes[harq_pid]->q[q+(Q_m*i)] = ys;
#ifdef DEBUG_ULSCH_DECODING
msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys);
#endif
......@@ -969,85 +969,85 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
ulsch->bundling,Nbundled,wACK_idx);
#endif
if (ulsch->harq_processes[harq_pid]->O_ACK == 1) {
ulsch->q_ACK[0] *= wACK_RX[wACK_idx][0];
ulsch->q_ACK[0] += (ulsch->bundling==0) ? ulsch->q_ACK[1]*wACK_RX[wACK_idx][0] : ulsch->q_ACK[1]*wACK_RX[wACK_idx][1];
ulsch->harq_processes[harq_pid]->q_ACK[0] *= wACK_RX[wACK_idx][0];
ulsch->harq_processes[harq_pid]->q_ACK[0] += (ulsch->bundling==0) ? ulsch->harq_processes[harq_pid]->q_ACK[1]*wACK_RX[wACK_idx][0] : ulsch->harq_processes[harq_pid]->q_ACK[1]*wACK_RX[wACK_idx][1];