Commit d82ea721 authored by Matthieu Kanj's avatar Matthieu Kanj

NPUSCH

parent 798c839b
......@@ -498,6 +498,8 @@ typedef struct {
uint8_t scheduling_delay;
/// The number of the repetition number for NPUSCH Transport block
uint8_t repetition_number;
////////// counter for repetitions ///////////////////////
uint8_t rep_tmp;
/// Determined the repetition number value 0-3
uint8_t dci_subframe_repetitions;
/// Flag indicating that this ULSCH has been allocated by a DCI (otherwise it is a retransmission based on PHICH NAK)
......
......@@ -21,7 +21,7 @@
/*! \file PHY/LTE_TRANSPORT/lte_mcs_NB_IoT.c
* \brief Some support routines for MCS computations
* \author V. Savaux , M. KANJ
* \author M. KANJ
* \date 2017
* \version 0.1
* \company b<>com
......
......@@ -1653,8 +1653,8 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
// uint8_t log2_maxh = 0,aarx;
//uint8_t harq_pid;
uint8_t Qm;
int subframe = proc->subframe_rx;
int frame = proc->frame_rx;
int subframe = proc->subframe_rx; // only used in the crc_indication !!
int frame = proc->frame_rx; // only used in the crc_indication !!
//uint8_t npusch_format = 1; // NB-IoT: format 1 (data), or 2: ack. Should be defined in higher layer
//uint8_t subcarrier_spacing = frame_parms->subcarrier_spacing; // 15 kHz or 3.75 kHz
uint8_t pilot_pos1_format1_15k = 3, pilot_pos2_format1_15k = 10; // holds for npusch format 1, and 15 kHz subcarrier bandwidth
......@@ -1891,7 +1891,7 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
Hpp = Hprime;
// Cmux = (ulsch_harq->Nsymb_UL-1)*ulsch_harq->Nslot_UL; // see definition in 36.212, Section 6.3.2, but not consistent with definition
// of RU in 36.211, Section 10.1.2.3. Maybe prefer the following:
Cmux = (7-pilots_slot) * nb_slot; // 6*16; //////////////(ulsch_harq->Nsymb_UL)*ulsch_harq->Nslot_UL;
Cmux = (7-pilots_slot) * nb_slot; // 6*16; //////////////(ulsch_harq->Nsymb_UL)*ulsch_harq->Nslot_UL; // * N_RU **********
Rmux_prime = Hpp/Cmux;
// Clear "tag" interleaving matrix to allow for CQI/DATA identification
memset(ytag,0,Cmux*Rmux_prime);
......@@ -1928,6 +1928,9 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
}
break;
}
///////////////////////////////// desin multi-tone
//if multi-RU
j = 0;
j2 = 0;
......
......@@ -475,6 +475,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
nulsch_harq->new_data_indication = nfapi_parameters_rel13->new_data_indication; // valid only for DCI N0
nulsch_harq->TBS = nfapi_parameters_rel13->size; /// check if needed *8 or /8 or nothing to do
//nulsch_harq->rep_tmp = ;
////////////////////////////////////////////////////////////////////////////////////////
LOG_I(PHY,"IF module proceed UL config NULSCH pdu\n");
break;
......
......@@ -667,69 +667,17 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0)
tab_rar[5]=nas_id[4]; // NAS part 5
tab_rar[6]=nas_id[5]; // NAS part 5
printf("ms4pdu[0] = %d \n",nas_id[0]);
printf("ms4pdu[1] = %d \n",nas_id[1]);
printf("ms4pdu[2] = %d \n",nas_id[2]);
printf("ms4pdu[3] = %d \n",nas_id[3]);
printf("ms4pdu[2] = %d \n",nas_id[4]);
if(proc->flag_scrambling ==0)
{
dlsch_encoding_NB_IoT(tab_rar,
rar,
1, ///// number_of_subframes_required
236); //////////// G*2 // option =2 for msg4
dlsch_scrambling_Gen_NB_IoT(fp,
rar,
236,
frame,
subframe*2,
65522); //RA_template[0].RA_rnti
}
proc->flag_scrambling =1;
printf("\n RAR sentttttt frame %d, subframe %d", frame, subframe);
dlsch_modulation_NB_IoT(txdataF,
AMP,
fp,
3, // control region size for LTE , values between 0..3, (0 for stand-alone / 1, 2 or 3 for in-band)
rar,
236, // number of bits per subframe
frame, // unrequired
subframe,
22);
proc->counter_msg4--;
proc->subframe_msg4 =subframe+1;
if(proc->counter_msg4 == 0)
{
proc->flag_msg5 =1;
proc->counter_msg5 =2;
proc->subframe_msg5= (subframe+12+1+4)%10;
if( ((subframe+12+1+4)%10) <20)
{
proc->frame_msg5=frame + 2;
}else{
proc->frame_msg5=frame + 3;
}
}
}
if(subframe==9)
{
proc->subframe_msg4=1;
proc->frame_msg4= frame+1;
}
}
......
......@@ -1605,6 +1605,8 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_c
// if eNB is ready to receive UL data
// define a flag to trigger on or off the decoding process
//if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && (ulsch_harq->frame == frame) && (ulsch_harq->subframe == subframe) && (ulsch_harq->handled == 0))
uint16_t N_slots = get_UL_slots_per_RU_NB_IoT(nulsch_harq->subcarrier_spacing, nulsch_harq->subcarrier_indication, nulsch->npusch_format)*get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag);
if ((nulsch->Msg3_active == 1) && (nulsch->Msg3_flag == 1)) // && (ulsch_harq->frame == framerx) && (ulsch_harq->subframe == subframerx))
{
......@@ -1616,22 +1618,7 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_c
nulsch->flag_scramble = 0;
}
/*
// UE has ULSCH scheduling
for (int rb=0; rb<=ulsch_harq->nb_rb; rb++)
{
int rb2 = rb+ulsch_harq->first_rb;
eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
}
*/
//rx_ulsch(eNB,proc, i);
/*ret = ulsch_decoding(eNB,proc,
i,
0, // control_only_flag
ulsch_harq->V_UL_DAI,
ulsch_harq->nb_rb>20 ? 1 : 0);*/
// fill_ulsch_cqi_indication(eNB,frame,subframe,ulsch_harq,ulsch->rnti);
uint16_t N_slots = get_UL_slots_per_RU_NB_IoT(nulsch_harq->subcarrier_spacing, nulsch_harq->subcarrier_indication, nulsch->npusch_format)*get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag);
rx_ulsch_Gen_NB_IoT(eNB,
proc,
......@@ -1654,6 +1641,28 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_c
0,
nulsch->Msg3_flag);
} else if((nulsch->Msg3_active == 1) && (nulsch->Msg3_flag == 0)){ //// case of NPUSCH other than Msg3
rx_ulsch_Gen_NB_IoT(eNB,
proc,
0, // this is the effective sector id
0,
nulsch,
nulsch->npusch_format, //npusch_format, // 1, 2
22, // 22 , to be included in // to be replaced by NB_IoT_start ??
1, // 0 (3.75 KHz) or 1 (15 KHz)
nulsch->rnti, //= 65522
nulsch->Msg3_subframe, // first received subframe
nulsch->Msg3_frame, // first received frame
N_slots, // total number of occupied slots = get_nb_slot_per_RU * NB_of_RU
get_UL_sc_index_start_NB_IoT(nulsch_harq->subcarrier_spacing,nulsch_harq->subcarrier_indication,nulsch->npusch_format),
get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag), // N_RU
nulsch_harq->mcs, // I_mcs
nulsch_harq->TBS, // A = TBS
N_slots/2, ///proc->counter_msg3, // this represents the number of Subframe after encoding the msg3 // proc->counter_msg3
subframerx,
0,
nulsch->Msg3_flag);
}
} // for UE loop
......
......@@ -293,7 +293,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
//(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[((DCIFormatN0_t *)DCI_pdu)->mcs][((DCIFormatN0_t *)DCI_pdu)->ResAssign];
//(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[get_UL_I_TBS_from_MCS_NB_IoT(((DCIFormatN0_t *)DCI_pdu)->mcs, get_N_RU(), 0)][((DCIFormatN0_t *)DCI_pdu)->ResAssign];
// get_UL_I_TBS_from_MCS_NB_IoT() to be used to get the I_TBS for any NPUSCH format
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table_msg3[get_UL_I_TBS_from_MCS_NB_IoT(((DCIFormatN0_t *)DCI_pdu)->mcs, 0, 1)]; // for the case of MSG3
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table_msg3[get_UL_I_TBS_from_MCS_NB_IoT(((DCIFormatN0_t *)DCI_pdu)->mcs, 1, 1)]; // for the case of MSG3
//LOG_D(MAC,"test\n");
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.rnti = schedule_result_list_UL->rnti; //TODO : check if it is the right rnti // get from msg2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment