Merge branch 'bandwidth-testing' of https://gitlab.eurecom.fr/oai/openairinterface5g into bandwidth-testing
Conflicts: executables/nr-ru.c
This commit is contained in:
@@ -213,7 +213,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
|
||||
(amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15;
|
||||
|
||||
#ifdef DEBUG_PDCCH_DMRS
|
||||
printf("PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
|
||||
if (dci_pdu->RNTI!=0xFFFF) LOG_I(PHY,"PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
|
||||
((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1176,8 +1176,8 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
gNB->pusch_vars[ulsch_id]->cl_done = 0;
|
||||
|
||||
bwp_start_subcarrier = ((rel15_ul->rb_start + rel15_ul->bwp_start)*NR_NB_SC_PER_RB + frame_parms->first_carrier_offset) % frame_parms->ofdm_symbol_size;
|
||||
LOG_I(PHY,"pusch %d.%d : bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", frame,slot,bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
|
||||
LOG_I(PHY,"pusch %d.%d : ul_dmrs_symb_pos %x\n",frame,slot,rel15_ul->ul_dmrs_symb_pos);
|
||||
LOG_D(PHY,"pusch %d.%d : bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", frame,slot,bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
|
||||
LOG_D(PHY,"pusch %d.%d : ul_dmrs_symb_pos %x\n",frame,slot,rel15_ul->ul_dmrs_symb_pos);
|
||||
|
||||
//----------------------------------------------------------
|
||||
//--------------------- Channel estimation ---------------------
|
||||
@@ -1185,7 +1185,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
start_meas(&gNB->ulsch_channel_estimation_stats);
|
||||
for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) {
|
||||
uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
|
||||
LOG_I(PHY, "symbol %d, dmrs_symbol_flag :%d\n", symbol, dmrs_symbol_flag);
|
||||
LOG_D(PHY, "symbol %d, dmrs_symbol_flag :%d\n", symbol, dmrs_symbol_flag);
|
||||
if (dmrs_symbol_flag == 1) {
|
||||
if (gNB->pusch_vars[ulsch_id]->dmrs_symbol == INVALID_VALUE)
|
||||
gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
|
||||
@@ -1246,7 +1246,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
|
||||
gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] = nb_re_pusch;
|
||||
LOG_I(PHY,"symbol %d: nb_re_pusch %d, DMRS symbl used for Chest :%d \n", symbol, nb_re_pusch, gNB->pusch_vars[ulsch_id]->dmrs_symbol);
|
||||
LOG_D(PHY,"symbol %d: nb_re_pusch %d, DMRS symbl used for Chest :%d \n", symbol, nb_re_pusch, gNB->pusch_vars[ulsch_id]->dmrs_symbol);
|
||||
|
||||
//----------------------------------------------------------
|
||||
//--------------------- RBs extraction ---------------------
|
||||
@@ -1296,7 +1296,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
//--------------------- Channel Compensation ---------------
|
||||
//----------------------------------------------------------
|
||||
start_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
LOG_I(PHY,"Doing channel compensations log2_maxh %d, avgs %d (%d,%d)\n",gNB->pusch_vars[ulsch_id]->log2_maxh,avgs,avg[0],avg[1]);
|
||||
LOG_D(PHY,"Doing channel compensations log2_maxh %d, avgs %d (%d,%d)\n",gNB->pusch_vars[ulsch_id]->log2_maxh,avgs,avg[0],avg[1]);
|
||||
nr_ulsch_channel_compensation(gNB->pusch_vars[ulsch_id]->rxdataF_ext,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
|
||||
gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
|
||||
|
||||
@@ -397,8 +397,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0;
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1);
|
||||
uci_pdu->harq->harq_list[0].harq_value = index&0x01;
|
||||
LOG_I(PHY, "Slot %d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d n0 %d pucch0_thres %d, cqi %d, SNRtimes10 %d\n",
|
||||
slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,max_n0,uci_stats->pucch0_thres,cqi,SNRtimes10);
|
||||
LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d n0 %d pucch0_thres %d, cqi %d, SNRtimes10 %d\n",
|
||||
frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,max_n0,uci_stats->pucch0_thres,cqi,SNRtimes10);
|
||||
|
||||
if (pucch_pdu->sr_flag == 1) {
|
||||
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
|
||||
@@ -415,8 +415,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2);
|
||||
uci_pdu->harq->harq_list[1].harq_value = index&0x01;
|
||||
uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01;
|
||||
LOG_D(PHY, "Slot %d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d\n",
|
||||
slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10);
|
||||
LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d\n",
|
||||
frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10);
|
||||
if (pucch_pdu->sr_flag == 1) {
|
||||
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
|
||||
uci_pdu->sr->sr_indication = (index>3) ? 1 : 0;
|
||||
|
||||
@@ -183,7 +183,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
uint8_t number_ul_tti_pdu = (UL_tti_req==NULL) ? 0 : UL_tti_req->n_pdus;
|
||||
|
||||
if (DL_req != NULL && TX_req!=NULL && (number_dl_pdu > 0 || number_ul_dci_pdu > 0 || number_ul_tti_pdu > 0))
|
||||
LOG_I(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n",
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n",
|
||||
frame,slot,
|
||||
DL_req->SFN,DL_req->Slot,number_dl_pdu,
|
||||
TX_req->SFN,TX_req->Slot,TX_req->Number_of_PDUs,
|
||||
@@ -253,7 +253,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
nr_fill_ulsch(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pusch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
LOG_I(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUCCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUCCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_pucch(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pucch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE:
|
||||
|
||||
@@ -234,6 +234,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
|
||||
NR_gNB_ULSCH_t *ulsch = rdata->ulsch;
|
||||
int r = rdata->segment_r;
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[rdata->ulsch_id][0]->harq_processes[rdata->harq_pid]->ulsch_pdu;
|
||||
|
||||
bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter);
|
||||
ulsch_harq->processedSegments++;
|
||||
@@ -263,18 +264,18 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
// if all segments are done
|
||||
if (rdata->nbSegments == ulsch_harq->processedSegments) {
|
||||
if (decodeSuccess) {
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for slot %d TBS %d\n",
|
||||
gNB->Mod_id,ulsch_harq->slot,ulsch_harq->TBS);
|
||||
LOG_I(PHY,"[gNB %d] ULSCH: Setting ACK for SFN/SF %d.%d (pid %d, ndi %d, status %d, round %d, TBS %d)\n",
|
||||
gNB->Mod_id,ulsch_harq->frame,ulsch_harq->slot,rdata->harq_pid,pusch_pdu->pusch_data.new_data_indicator,ulsch_harq->status,ulsch_harq->round,ulsch_harq->TBS);
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->round = 0;
|
||||
ulsch->harq_mask &= ~(1 << rdata->harq_pid);
|
||||
|
||||
LOG_I(PHY, "ULSCH received ok \n");
|
||||
LOG_D(PHY, "ULSCH received ok \n");
|
||||
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0);
|
||||
} else {
|
||||
LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) r %d\n",
|
||||
LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, TBS %d) r %d\n",
|
||||
gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot,
|
||||
rdata->harq_pid,ulsch_harq->status, ulsch_harq->round,ulsch_harq->TBS,r);
|
||||
rdata->harq_pid,pusch_pdu->pusch_data.new_data_indicator,ulsch_harq->status, ulsch_harq->round,ulsch_harq->TBS,r);
|
||||
if (ulsch_harq->round >= ulsch->Mlimit) {
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->round = 0;
|
||||
@@ -425,7 +426,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
|
||||
if (timing_advance_update < 0) timing_advance_update = 0;
|
||||
if (timing_advance_update > 63) timing_advance_update = 63;
|
||||
|
||||
LOG_I(PHY, "%d.%d : Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", frame,slot_rx,sync_pos,timing_advance_update);
|
||||
if (crc_flag == 0) LOG_I(PHY, "%d.%d : Received PUSCH : Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", frame,slot_rx,sync_pos,timing_advance_update);
|
||||
|
||||
// estimate UL_CQI for MAC
|
||||
|
||||
@@ -439,7 +440,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
|
||||
else cqi=(640+SNRtimes10)/5;
|
||||
|
||||
|
||||
if (pusch_pdu->mcs_index == 9) {
|
||||
if (0/*pusch_pdu->mcs_index == 9*/) {
|
||||
#ifdef __AVX2__
|
||||
int off = ((pusch_pdu->rb_size&1) == 1)? 4:0;
|
||||
#else
|
||||
|
||||
@@ -51,7 +51,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
uint32_t Ninfo, Np_info, C;
|
||||
uint8_t n, scale;
|
||||
|
||||
LOG_D(MAC,"nb_symb_sch %d, nb_dmrs_prb %d, nb_rb_oh %d\n",nb_symb_sch,nb_dmrs_prb,nb_rb_oh);
|
||||
LOG_D(NR_MAC,"nb_symb_sch %d, nb_dmrs_prb %d, nb_rb_oh %d\n",nb_symb_sch,nb_dmrs_prb,nb_rb_oh);
|
||||
|
||||
nbp_re = NR_NB_SC_PER_RB * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
|
||||
nb_re = min(156, nbp_re) * nb_rb;
|
||||
@@ -59,6 +59,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
// Intermediate number of information bits
|
||||
Ninfo = ((nb_re * R * Qm * Nl)>>scale)>>tb_scaling;
|
||||
|
||||
|
||||
if (Ninfo <=3824) {
|
||||
n = max(3, floor(log2(Ninfo)) - 6);
|
||||
Np_info = max(24, (Ninfo>>n)<<n);
|
||||
@@ -85,7 +86,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(PHY, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
|
||||
LOG_D(NR_MAC, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
|
||||
|
||||
return nr_tbs;
|
||||
|
||||
|
||||
@@ -1359,7 +1359,7 @@ int get_nr_prach_occasion_info_from_index(uint8_t index,
|
||||
if (table_6_3_3_2_3_prachConfig_Index[index][1] != -1)
|
||||
format2 = (uint8_t) table_6_3_3_2_3_prachConfig_Index[index][1];
|
||||
*format = ((uint8_t) table_6_3_3_2_3_prachConfig_Index[index][0]) | (format2<<8);
|
||||
LOG_I(MAC,"Getting Total PRACH info from index %d (col %lu ) absoluteFrequencyPointA %u mu %u frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_sfn = %u\n",
|
||||
LOG_D(NR_MAC,"Getting Total PRACH info from index %d (col %lu ) absoluteFrequencyPointA %u mu %u frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_sfn = %u\n",
|
||||
index, table_6_3_3_2_3_prachConfig_Index[index][6],
|
||||
pointa,
|
||||
mu,
|
||||
@@ -1842,7 +1842,7 @@ int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index)
|
||||
|
||||
int32_t delta_duplex = (nr_bandtable[nr_table_idx].ul_min - nr_bandtable[nr_table_idx].dl_min);
|
||||
|
||||
LOG_I(PHY, "NR band duplex spacing is %d KHz (nr_bandtable[%d].band = %d)\n", delta_duplex, nr_table_idx, nr_bandtable[nr_table_idx].band);
|
||||
LOG_I(NR_MAC, "NR band duplex spacing is %d KHz (nr_bandtable[%d].band = %d)\n", delta_duplex, nr_table_idx, nr_bandtable[nr_table_idx].band);
|
||||
|
||||
return delta_duplex;
|
||||
}
|
||||
@@ -1857,7 +1857,7 @@ lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index)
|
||||
else
|
||||
current_type = FDD;
|
||||
|
||||
LOG_I(MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex);
|
||||
LOG_I(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex);
|
||||
|
||||
return current_type;
|
||||
}
|
||||
@@ -1994,7 +1994,7 @@ uint32_t to_nrarfcn(int nr_bandP,
|
||||
uint32_t nrarfcn;
|
||||
int i = get_nr_table_idx(nr_bandP, scs_index);
|
||||
|
||||
LOG_I(MAC,"Searching for nr band %d DL Carrier frequency %llu bw %u\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
|
||||
LOG_I(NR_MAC,"Searching for nr band %d DL Carrier frequency %llu bw %u\n",nr_bandP,(long long unsigned int)dl_CarrierFreq,bw);
|
||||
|
||||
AssertFatal(dl_CarrierFreq_by_1k >= nr_bandtable[i].dl_min,
|
||||
"Band %d, bw %u : DL carrier frequency %llu kHz < %llu\n",
|
||||
@@ -2071,14 +2071,14 @@ uint64_t from_nrarfcn(int nr_bandP,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC, "Frequency from NR-ARFCN for N_OFFs %lu, duplex spacing %d KHz, deltaFglobal %d KHz\n", N_OFFs, delta_duplex, deltaFglobal);
|
||||
LOG_D(NR_MAC, "Frequency from NR-ARFCN for N_OFFs %lu, duplex spacing %d KHz, deltaFglobal %d KHz\n", N_OFFs, delta_duplex, deltaFglobal);
|
||||
|
||||
AssertFatal(nrarfcn >= N_OFFs,"nrarfcn %u < N_OFFs[%d] %llu\n", nrarfcn, nr_bandtable[i].band, (long long unsigned int)N_OFFs);
|
||||
get_delta_arfcn(i, nrarfcn, N_OFFs);
|
||||
|
||||
frequency = 1000*(F_REF_Offs_khz + (nrarfcn - N_REF_Offs) * deltaFglobal);
|
||||
|
||||
LOG_I(MAC, "Computing frequency (pointA %llu => %llu KHz (freq_min %llu KHz, NR band %d N_OFFs %llu))\n",
|
||||
LOG_I(NR_MAC, "Computing frequency (pointA %llu => %llu KHz (freq_min %llu KHz, NR band %d N_OFFs %llu))\n",
|
||||
(unsigned long long)nrarfcn,
|
||||
(unsigned long long)frequency/1000,
|
||||
(unsigned long long)freq_min,
|
||||
@@ -2423,7 +2423,7 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
|
||||
uint8_t row, colomn;
|
||||
int32_t l_prime;
|
||||
|
||||
LOG_I(MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position);
|
||||
LOG_D(NR_MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position);
|
||||
|
||||
// Section 6.4.1.1.3 in Spec 38.211
|
||||
// For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PUSCH resources
|
||||
@@ -2450,11 +2450,11 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
|
||||
l0 = 1<<l0 | 1<<(l0+1);
|
||||
}
|
||||
|
||||
LOG_I(MAC, "PUSCH - l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, colomn, additional_pos, pusch_maxLength);
|
||||
LOG_D(NR_MAC, "PUSCH - l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, colomn, additional_pos, pusch_maxLength);
|
||||
AssertFatal(l_prime>=0,"invalid l_prime < 0\n");
|
||||
|
||||
l_prime = (mapping_type == typeA) ? (l_prime | l0) : (l_prime << start_symbol);
|
||||
LOG_I(MAC, " PUSCH DMRS MASK in HEX:%x\n", l_prime);
|
||||
LOG_D(MAC, " PUSCH DMRS MASK in HEX:%x\n", l_prime);
|
||||
|
||||
return l_prime;
|
||||
|
||||
@@ -2493,7 +2493,7 @@ uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint
|
||||
else if (I_mcs >= mcs3 && I_mcs < mcs4)
|
||||
return 0;
|
||||
else {
|
||||
LOG_I(PHY, "PT-RS time-density determination is obtained from the DCI for the same transport block in the initial transmission\n");
|
||||
LOG_D(NR_MAC, "PT-RS time-density determination is obtained from the DCI for the same transport block in the initial transmission\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -2657,7 +2657,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
dci_pdu->frequency_domain_assignment.nbits = ((int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )>numRBG) ? (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )+1 : numRBG+1;
|
||||
}
|
||||
else dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
LOG_I(NR_MAC,"PUSCH Frequency Domain Assignment nbits %d, N_RB %d\n",dci_pdu->frequency_domain_assignment.nbits,N_RB);
|
||||
LOG_D(NR_MAC,"PUSCH Frequency Domain Assignment nbits %d, N_RB %d\n",dci_pdu->frequency_domain_assignment.nbits,N_RB);
|
||||
size += dci_pdu->frequency_domain_assignment.nbits;
|
||||
// Time domain assignment
|
||||
if (pusch_Config==NULL || pusch_Config->pusch_TimeDomainAllocationList==NULL) {
|
||||
@@ -2669,7 +2669,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
else
|
||||
num_entries = pusch_Config->pusch_TimeDomainAllocationList->choice.setup->list.count;
|
||||
dci_pdu->time_domain_assignment.nbits = (int)ceil(log2(num_entries));
|
||||
LOG_I(NR_MAC,"PUSCH Time Domain Allocation nbits %d, pusch_Config %p\n",dci_pdu->time_domain_assignment.nbits,pusch_Config);
|
||||
LOG_D(NR_MAC,"PUSCH Time Domain Allocation nbits %d, pusch_Config %p\n",dci_pdu->time_domain_assignment.nbits,pusch_Config);
|
||||
size += dci_pdu->time_domain_assignment.nbits;
|
||||
// Frequency Hopping flag
|
||||
if (pusch_Config &&
|
||||
@@ -2685,7 +2685,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
else
|
||||
dci_pdu->dai[0].nbits = 1;
|
||||
size += dci_pdu->dai[0].nbits;
|
||||
LOG_I(NR_MAC,"DAI1 nbits %d\n",dci_pdu->dai[0].nbits);
|
||||
LOG_D(NR_MAC,"DAI1 nbits %d\n",dci_pdu->dai[0].nbits);
|
||||
// 2nd DAI
|
||||
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { //TODO not sure about that
|
||||
@@ -2732,7 +2732,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
size += dci_pdu->srs_resource_indicator.nbits;
|
||||
}
|
||||
} else dci_pdu->srs_resource_indicator.nbits = 0;
|
||||
LOG_I(PHY,"dci_pdu->srs_resource_indicator.nbits %d\n",dci_pdu->srs_resource_indicator.nbits);
|
||||
LOG_D(NR_MAC,"dci_pdu->srs_resource_indicator.nbits %d\n",dci_pdu->srs_resource_indicator.nbits);
|
||||
// Precoding info and number of layers
|
||||
long transformPrecoder = get_transformPrecoding(initialUplinkBWP, pusch_Config, ubwpd, (uint8_t*)&format, rnti_type, 0);
|
||||
dci_pdu->precoding_information.nbits=0;
|
||||
@@ -2761,7 +2761,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
}
|
||||
}
|
||||
size += dci_pdu->precoding_information.nbits;
|
||||
LOG_I(PHY,"dci_pdu->precoding_informaiton.nbits=%d\n",dci_pdu->precoding_information.nbits);
|
||||
LOG_D(NR_MAC,"dci_pdu->precoding_informaiton.nbits=%d\n",dci_pdu->precoding_information.nbits);
|
||||
// Antenna ports
|
||||
NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig = NULL;
|
||||
int xa=0;
|
||||
@@ -2781,7 +2781,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
else
|
||||
dci_pdu->antenna_ports.nbits = xb;
|
||||
size += dci_pdu->antenna_ports.nbits;
|
||||
LOG_I(PHY,"dci_pdu->antenna_ports.nbits = %d\n",dci_pdu->antenna_ports.nbits);
|
||||
LOG_D(NR_MAC,"dci_pdu->antenna_ports.nbits = %d\n",dci_pdu->antenna_ports.nbits);
|
||||
// SRS request
|
||||
if (cg->spCellConfig->spCellConfigDedicated->supplementaryUplink==NULL)
|
||||
dci_pdu->srs_request.nbits = 2;
|
||||
@@ -2839,6 +2839,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
break;
|
||||
|
||||
case NR_DL_DCI_FORMAT_1_1:
|
||||
LOG_D(NR_MAC,"DCI_FORMAT 1_1 : pdsch_Config %p, pucch_Config %p\n",pdsch_Config,pucch_Config);
|
||||
// General note: 0 bits condition is ignored as default nbits is 0.
|
||||
// Format identifier
|
||||
size = 1;
|
||||
@@ -2871,6 +2872,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
else
|
||||
dci_pdu->frequency_domain_assignment.nbits = ((int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )>numRBG) ? (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) )+1 : numRBG+1;
|
||||
size += dci_pdu->frequency_domain_assignment.nbits;
|
||||
LOG_D(NR_MAC,"dci_pdu->frequency_domain_assignment.nbits %d (N_RB %d)\n",dci_pdu->frequency_domain_assignment.nbits,N_RB);
|
||||
// Time domain assignment (see table 5.1.2.1.1-1 in 38.214
|
||||
if (pdsch_Config == NULL || pdsch_Config->pdsch_TimeDomainAllocationList==NULL) {
|
||||
if (bwpc->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList==NULL)
|
||||
@@ -2881,6 +2883,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
else
|
||||
num_entries = pdsch_Config->pdsch_TimeDomainAllocationList->choice.setup->list.count;
|
||||
dci_pdu->time_domain_assignment.nbits = (int)ceil(log2(num_entries));
|
||||
LOG_D(NR_MAC,"pdsch tda.nbits= %d\n",dci_pdu->time_domain_assignment.nbits);
|
||||
size += dci_pdu->time_domain_assignment.nbits;
|
||||
// VRB to PRB mapping
|
||||
if (pdsch_Config &&
|
||||
@@ -2925,6 +2928,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
dci_pdu->dai[0].nbits = 2;
|
||||
size += dci_pdu->dai[0].nbits;
|
||||
}
|
||||
LOG_D(NR_MAC,"dci_pdu->dai[0].nbits %d\n",dci_pdu->dai[0].nbits);
|
||||
// TPC PUCCH
|
||||
size += 2;
|
||||
// PUCCH resource indicator
|
||||
@@ -2933,12 +2937,14 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
uint8_t I = pucch_Config->dl_DataToUL_ACK ? pucch_Config->dl_DataToUL_ACK->list.count : 8;
|
||||
dci_pdu->pdsch_to_harq_feedback_timing_indicator.nbits = (int)ceil(log2(I));
|
||||
size += dci_pdu->pdsch_to_harq_feedback_timing_indicator.nbits;
|
||||
LOG_D(NR_MAC,"dci_pdu->pdsch_to_harq_feedback_timing_indicator.nbits %d\n",dci_pdu->pdsch_to_harq_feedback_timing_indicator.nbits);
|
||||
// Antenna ports
|
||||
NR_SetupRelease_DMRS_DownlinkConfig_t *typeA = pdsch_Config ? pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA : NULL;
|
||||
NR_SetupRelease_DMRS_DownlinkConfig_t *typeB = pdsch_Config ? pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB : NULL;
|
||||
AssertFatal(typeA!=NULL || typeB!=NULL, "either dmrs_typeA or typeB must be configured\n");
|
||||
dci_pdu->antenna_ports.nbits = getAntPortBitWidth(typeA,typeB);
|
||||
size += dci_pdu->antenna_ports.nbits;
|
||||
LOG_D(NR_MAC,"dci_pdu->antenna_ports.nbits %d\n",dci_pdu->antenna_ports.nbits);
|
||||
// Tx Config Indication
|
||||
long *isTciEnable = pdcch_Config->controlResourceSetToAddModList->list.array[0]->tci_PresentInDCI;
|
||||
if (isTciEnable != NULL) {
|
||||
|
||||
@@ -385,6 +385,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
}
|
||||
|
||||
memset(RC.nrmac[module_idP]->cce_list[0][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0
|
||||
memset(RC.nrmac[module_idP]->cce_list[0][1],0,MAX_NUM_CCE*sizeof(int)); // coreset1 on initialBWP
|
||||
memset(RC.nrmac[module_idP]->cce_list[bwp_id][1],0,MAX_NUM_CCE*sizeof(int)); // coresetid 1
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info;
|
||||
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id])
|
||||
|
||||
@@ -1007,8 +1007,8 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dl_req->nPDUs+=1;
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15;
|
||||
|
||||
LOG_I(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%x, state %d\n",
|
||||
module_idP, CC_id, frameP, slotP, ra->RA_rnti, ra->state);
|
||||
LOG_I(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%x, state %d, CoreSetType %d\n",
|
||||
module_idP, CC_id, frameP, slotP, ra->RA_rnti, ra->state,pdcch_pdu_rel15->CoreSetType);
|
||||
|
||||
// SCF222: PDU index incremented for each PDSCH PDU sent in TX control message. This is used to associate control
|
||||
// information to data and is reset every slot.
|
||||
|
||||
@@ -63,7 +63,6 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
|
||||
const int bwp_id = bwp ? bwp->bwp_Id : 0;
|
||||
if (nrmac->preferred_dl_tda[bwp_id])
|
||||
return;
|
||||
|
||||
/* there is a mixed slot only when in TDD */
|
||||
NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon;
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd =
|
||||
@@ -136,7 +135,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
|
||||
nrmac->preferred_dl_tda[bwp_id][i] = 0;
|
||||
else if (tdd && nr_mix_slots && i % nr_slots_period == tdd->nrofDownlinkSlots)
|
||||
nrmac->preferred_dl_tda[bwp_id][i] = tdaMi;
|
||||
LOG_I(MAC, "slot %d preferred_dl_tda %d\n", i, nrmac->preferred_dl_tda[bwp_id][i]);
|
||||
LOG_D(MAC, "slot %d preferred_dl_tda %d\n", i, nrmac->preferred_dl_tda[bwp_id][i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,6 +451,10 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch;
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
|
||||
|
||||
|
||||
NR_BWP_t *genericParameters = sched_ctrl->active_bwp ?
|
||||
&sched_ctrl->active_bwp->bwp_Common->genericParameters :
|
||||
&RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
@@ -461,7 +464,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2);
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_bwp ||bwpd) ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2);
|
||||
|
||||
int rbSize = 0;
|
||||
bool is_mixed_slot = is_xlsch_in_slot(RC.nrmac[module_id]->dlsch_slot_bitmap[slot / 64], slot) &&
|
||||
@@ -486,7 +489,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
* (re-)transmission */
|
||||
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pdsch_semi_static(
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
scc, cg, sched_ctrl->active_bwp,bwpd, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
} else {
|
||||
/* the retransmission will use a different time domain allocation, check
|
||||
* that we have enough resources */
|
||||
@@ -496,7 +499,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
rbSize++;
|
||||
NR_pdsch_semi_static_t temp_ps;
|
||||
nr_set_pdsch_semi_static(
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, &temp_ps);
|
||||
scc, cg, sched_ctrl->active_bwp, bwpd, tda, num_dmrs_cdm_grps_no_data, &temp_ps);
|
||||
uint32_t new_tbs;
|
||||
uint16_t new_rbSize;
|
||||
bool success = nr_find_nb_rb(retInfo->Qm,
|
||||
@@ -588,6 +591,10 @@ void pf_dl(module_id_t module_id,
|
||||
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
|
||||
sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head;
|
||||
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
|
||||
|
||||
|
||||
/* Calculate Throughput */
|
||||
const float a = 0.0005f; // corresponds to 200ms window
|
||||
const uint32_t b = UE_info->mac_stats[UE_id].dlsch_current_bytes;
|
||||
@@ -641,6 +648,8 @@ void pf_dl(module_id_t module_id,
|
||||
p = &UE_sched.next[*max];
|
||||
*max = UE_sched.next[*max];
|
||||
*p = -1;
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
|
||||
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0;
|
||||
@@ -696,10 +705,10 @@ void pf_dl(module_id_t module_id,
|
||||
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2);
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_bwp || bwpd) ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2);
|
||||
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pdsch_semi_static(
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
|
||||
sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
|
||||
sched_pdsch->pucch_allocation = alloc;
|
||||
@@ -818,6 +827,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
if (sched_ctrl->ul_failure==1 && get_softmodem_params()->phy_test==0) continue;
|
||||
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
|
||||
UE_info->mac_stats[UE_id].dlsch_current_bytes = 0;
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL;
|
||||
|
||||
/* update TA and set ta_apply every 10 frames.
|
||||
* Possible improvement: take the periodicity from input file.
|
||||
@@ -872,7 +883,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++;
|
||||
|
||||
LOG_I(NR_MAC,
|
||||
"%4d.%2d RNTI %04x start %3d RBs %3d startSymbol %2d nb_symbol %2d MCS %2d TBS %4d HARQ PID %2d round %d NDI %d\n",
|
||||
"%4d.%2d [DLSCH/PDSCH/PUCCH] RNTI %04x start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d NDI %d dl_data_to_ULACK %d (%d.%d)\n",
|
||||
frame,
|
||||
slot,
|
||||
rnti,
|
||||
@@ -880,18 +891,22 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
sched_pdsch->rbSize,
|
||||
ps->startSymbolIndex,
|
||||
ps->nrOfSymbols,
|
||||
ps->dl_dmrs_symb_pos,
|
||||
sched_pdsch->mcs,
|
||||
TBS,
|
||||
current_harq_pid,
|
||||
harq->round,
|
||||
harq->ndi);
|
||||
harq->ndi,
|
||||
pucch->timing_indicator,
|
||||
pucch->frame,
|
||||
pucch->ul_slot);
|
||||
|
||||
NR_BWP_Downlink_t *bwp = sched_ctrl->active_bwp;
|
||||
|
||||
/* look up the PDCCH PDU for this CC, BWP, and CORESET. If it does not
|
||||
* exist, create it */
|
||||
const int bwpid = bwp ? bwp->bwp_Id : 0;
|
||||
const int coresetid = bwp ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId;
|
||||
const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId;
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid];
|
||||
if (!pdcch_pdu) {
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
||||
@@ -901,8 +916,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
dl_req->nPDUs += 1;
|
||||
pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15;
|
||||
LOG_D(NR_MAC,"Trying to configure DL pdcch for bwp %d, cs %d\n",bwpid,coresetid);
|
||||
NR_SearchSpace_t *ss = bwp ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space;
|
||||
NR_ControlResourceSet_t *coreset = bwp? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset;
|
||||
NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space;
|
||||
NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset;
|
||||
nr_configure_pdcch(pdcch_pdu, ss, coreset, scc, bwp);
|
||||
gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
//#define UL_HARQ_PRINT
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
const uint8_t nr_rv_round_map[4] = {0, 2, 1, 3};
|
||||
const uint8_t nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
|
||||
|
||||
//uint8_t mac_pdu[MAX_NR_DLSCH_PAYLOAD_BYTES];
|
||||
@@ -371,7 +371,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = 1;
|
||||
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data)
|
||||
nr_set_pdsch_semi_static(
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, num_dmrs_cdm_grps_no_data, ps);
|
||||
|
||||
sched_pdsch->nrOfLayers = target_dl_Nl;
|
||||
sched_pdsch->mcs = target_dl_mcs;
|
||||
|
||||
@@ -185,8 +185,8 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
int coreset_id = coreset->controlResourceSetId;
|
||||
|
||||
int *cce_list;
|
||||
if(bwp == NULL || bwp->bwp_Id == 0) {
|
||||
cce_list = nr_mac->cce_list[0][0];
|
||||
if(bwp == NULL) {
|
||||
cce_list = nr_mac->cce_list[0][coreset_id];
|
||||
} else {
|
||||
cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id];
|
||||
}
|
||||
@@ -204,6 +204,8 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
|
||||
const uint16_t N_cce = N_reg / NR_NB_REG_PER_CCE;
|
||||
const uint16_t M_s_max = nr_of_candidates;
|
||||
|
||||
LOG_D(PHY,"allocate_NR_CCes : bwp_id %d, coreset_id %d : N_cce %d, m %d, nr_of_candidates %d, Y %d\n",
|
||||
(int)(bwp ? bwp->bwp_Id : 0),coreset_id,N_cce,m,nr_of_candidates, Y);
|
||||
//PDCCH candidate index m in CORESET exceeds the maximum number of PDCCH candidates
|
||||
if(m >= nr_of_candidates)
|
||||
return -1;
|
||||
@@ -268,6 +270,7 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
const NR_BWP_Downlink_t *bwp,
|
||||
const NR_BWP_DownlinkDedicated_t *bwpd0,
|
||||
int tda,
|
||||
uint8_t num_dmrs_cdm_grps_no_data,
|
||||
NR_pdsch_semi_static_t *ps)
|
||||
@@ -281,28 +284,34 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const int mapping_type = tdaList->list.array[tda]->mappingType;
|
||||
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
|
||||
NR_BWP_DownlinkDedicated_t *bwpd;
|
||||
|
||||
ps->mcsTableIdx = 0;
|
||||
if (bwp &&
|
||||
bwp->bwp_Dedicated &&
|
||||
bwp->bwp_Dedicated->pdsch_Config &&
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup &&
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table) {
|
||||
if (*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == 0)
|
||||
bwp->bwp_Dedicated) bwpd = bwp->bwp_Dedicated;
|
||||
else bwpd = bwpd0;
|
||||
|
||||
if (bwpd->pdsch_Config &&
|
||||
bwpd->pdsch_Config->choice.setup &&
|
||||
bwpd->pdsch_Config->choice.setup->mcs_Table) {
|
||||
if (*bwpd->pdsch_Config->choice.setup->mcs_Table == 0)
|
||||
ps->mcsTableIdx = 1;
|
||||
else
|
||||
ps->mcsTableIdx = 2;
|
||||
}
|
||||
else ps->mcsTableIdx = 0;
|
||||
|
||||
|
||||
ps->numDmrsCdmGrpsNoData = num_dmrs_cdm_grps_no_data;
|
||||
ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
|
||||
ps->dmrsConfigType = bwpd!=NULL ? (bwpd->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
|
||||
|
||||
// if no data in dmrs cdm group is 1 only even REs have no data
|
||||
// if no data in dmrs cdm group is 2 both odd and even REs have no data
|
||||
ps->N_PRB_DMRS = num_dmrs_cdm_grps_no_data * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
|
||||
ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwp ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
|
||||
ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
|
||||
ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos);
|
||||
LOG_I(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT);
|
||||
}
|
||||
|
||||
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
@@ -631,7 +640,7 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp,
|
||||
dci_pdu_rel15->format_indicator = 0;
|
||||
break;
|
||||
case NR_UL_DCI_FORMAT_0_1:
|
||||
LOG_I(NR_MAC,"Configuring DCI Format 0_1\n");
|
||||
LOG_D(NR_MAC,"Configuring DCI Format 0_1\n");
|
||||
dci_pdu_rel15->dai[0].val = 0; //TODO
|
||||
// bwp indicator as per table 7.3.1.1.2-1 in 38.212
|
||||
dci_pdu_rel15->bwp_indicator.val = n_ubwp < 4 ? bwp_id : bwp_id - 1;
|
||||
@@ -1356,7 +1365,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
case NR_UL_DCI_FORMAT_0_0:
|
||||
switch (rnti_type) {
|
||||
case NR_RNTI_C:
|
||||
LOG_I(NR_MAC,"Filling format 0_0 DCI for CRNTI (size %d bits, format ind %d)\n",dci_size,dci_pdu_rel15->format_indicator);
|
||||
LOG_D(NR_MAC,"Filling format 0_0 DCI for CRNTI (size %d bits, format ind %d)\n",dci_size,dci_pdu_rel15->format_indicator);
|
||||
// indicating a UL DCI format 1bit
|
||||
pos=1;
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 1) << (dci_size - pos);
|
||||
@@ -1452,7 +1461,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
case NR_UL_DCI_FORMAT_0_1:
|
||||
switch (rnti_type) {
|
||||
case NR_RNTI_C:
|
||||
LOG_I(NR_MAC,"Filling NR_UL_DCI_FORMAT_0_1 size %d format indicator %d\n",dci_size,dci_pdu_rel15->format_indicator);
|
||||
LOG_D(NR_MAC,"Filling NR_UL_DCI_FORMAT_0_1 size %d format indicator %d\n",dci_size,dci_pdu_rel15->format_indicator);
|
||||
// Indicating a DL DCI format 1bit
|
||||
pos = 1;
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 0x1) << (dci_size - pos);
|
||||
@@ -1531,6 +1540,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
|
||||
|
||||
case NR_DL_DCI_FORMAT_1_1:
|
||||
// Indicating a DL DCI format 1bit
|
||||
LOG_D(NR_MAC,"Filling Format 1_1 DCI of size %d\n",dci_size);
|
||||
pos = 1;
|
||||
*dci_pdu |= ((uint64_t)dci_pdu_rel15->format_indicator & 0x1) << (dci_size - pos);
|
||||
// Carrier indicator
|
||||
@@ -2018,20 +2028,41 @@ uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
|
||||
|
||||
void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
int UE_id,
|
||||
int bwp_id,
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type,
|
||||
uint8_t *pdsch_to_harq_feedback) {
|
||||
|
||||
int bwp_id=1;
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
||||
NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_Downlink_t *bwp=NULL;
|
||||
NR_BWP_Uplink_t *ubwp=NULL;
|
||||
|
||||
if (CellGroup && CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList)
|
||||
bwp = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1];
|
||||
if (CellGroup && CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList)
|
||||
ubwp = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1];
|
||||
NR_BWP_DownlinkDedicated_t *bwpd=NULL;
|
||||
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
|
||||
|
||||
if (ss_type == NR_SearchSpace__searchSpaceType_PR_ue_Specific) {
|
||||
AssertFatal(CellGroup!=NULL,"Cellgroup is not defined for UE_id %d\n",UE_id);
|
||||
AssertFatal(CellGroup->spCellConfig!=NULL,"Cellgroup->spCellConfig is null\n");
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated!=NULL,"CellGroup->spCellConfig->spCellConfigDedicated is null\n");
|
||||
}
|
||||
if (bwp_id>0) {
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList!=NULL,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList!=NULL,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList is null\n");
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count >= bwp_id,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count %d < bwp_id %d\n",
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count,bwp_id);
|
||||
AssertFatal(CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count >= bwp_id,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count %d < bwp_id %d\n",
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count,bwp_id);
|
||||
|
||||
bwpd = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated;
|
||||
ubwpd = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated;
|
||||
}
|
||||
else if (CellGroup) { // this is an initialBWP
|
||||
AssertFatal((bwpd=CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP)!=NULL,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP is null\n");
|
||||
AssertFatal((ubwpd=CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)!=NULL,
|
||||
"CellGroup->spCellConfig->spCellConfigDedicated->uplnikConfig->initialUplinkBWP is null\n");
|
||||
}
|
||||
NR_SearchSpace_t *ss=NULL;
|
||||
|
||||
// common search type uses DCI format 1_0
|
||||
@@ -2043,9 +2074,11 @@ void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
|
||||
// searching for a ue specific search space
|
||||
int found=0;
|
||||
|
||||
for (int i=0;i<bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count;i++) {
|
||||
ss=bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i];
|
||||
AssertFatal(bwpd->pdcch_Config!=NULL,"bwpd->pdcch_Config is null\n");
|
||||
AssertFatal(bwpd->pdcch_Config->choice.setup->searchSpacesToAddModList!=NULL,
|
||||
"bwpd->pdcch_Config->choice.setup->searchSpacesToAddModList is null\n");
|
||||
for (int i=0;i<bwpd->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count;i++) {
|
||||
ss=bwpd->pdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i];
|
||||
AssertFatal(ss->controlResourceSetId != NULL,"ss->controlResourceSetId is null\n");
|
||||
AssertFatal(ss->searchSpaceType != NULL,"ss->searchSpaceType is null\n");
|
||||
if (ss->searchSpaceType->present == ss_type) {
|
||||
@@ -2061,9 +2094,10 @@ void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
pdsch_to_harq_feedback[i] = i+1;
|
||||
}
|
||||
else {
|
||||
if(ubwp->bwp_Dedicated->pucch_Config->choice.setup->dl_DataToUL_ACK != NULL) {
|
||||
AssertFatal(ubwpd!=NULL,"ubwpd shouldn't be null here\n");
|
||||
if(ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK != NULL) {
|
||||
for (int i=0; i<8; i++)
|
||||
pdsch_to_harq_feedback[i] = *ubwp->bwp_Dedicated->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i];
|
||||
pdsch_to_harq_feedback[i] = *ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i];
|
||||
}
|
||||
else
|
||||
AssertFatal(0==1,"There is no allocated dl_DataToUL_ACK for pdsch to harq feedback\n");
|
||||
|
||||
@@ -60,7 +60,7 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
|
||||
memset(pucch_pdu, 0, sizeof(nfapi_nr_pucch_pdu_t));
|
||||
future_ul_tti_req->n_pdus += 1;
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
LOG_I(NR_MAC,
|
||||
"%4d.%2d Scheduling pucch reception in %4d.%2d: bits SR %d, ACK %d, CSI %d on res %d\n",
|
||||
frame,
|
||||
slot,
|
||||
@@ -147,7 +147,7 @@ void nr_schedule_pucch(int Mod_idP,
|
||||
|| frameP != curr_pucch->frame
|
||||
|| slotP != curr_pucch->ul_slot)
|
||||
continue;
|
||||
LOG_D(NR_MAC,"Scheduling PUCCH[%d] RX for UE %d in %d.%d O_ack %d\n",i,UE_id,curr_pucch->frame,curr_pucch->ul_slot,O_ack);
|
||||
LOG_I(NR_MAC,"Scheduling PUCCH[%d] RX for UE %d in %d.%d O_ack %d\n",i,UE_id,curr_pucch->frame,curr_pucch->ul_slot,O_ack);
|
||||
nr_fill_nfapi_pucch(Mod_idP, frameP, slotP, curr_pucch, UE_id);
|
||||
memset(curr_pucch, 0, sizeof(*curr_pucch));
|
||||
}
|
||||
@@ -1217,7 +1217,7 @@ int nr_acknack_scheduling(int mod_id,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC,"1. DL slot %d, UL_ACK %d\n",slot,pucch->ul_slot);
|
||||
LOG_D(NR_MAC,"1. DL slot %d, UL_ACK %d, DAI_C %d\n",slot,pucch->ul_slot,pucch->dai_c);
|
||||
/* if the UE's next PUCCH occasion is after the possible UL slots (within the
|
||||
* same frame) or wrapped around to the next frame, then we assume there is
|
||||
* no possible PUCCH allocation anymore */
|
||||
@@ -1227,10 +1227,25 @@ int nr_acknack_scheduling(int mod_id,
|
||||
return -1;
|
||||
|
||||
// this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific: NR_SearchSpace__searchSpaceType_PR_common;
|
||||
uint8_t pdsch_to_harq_feedback[8];
|
||||
get_pdsch_to_harq_feedback(mod_id, UE_id, ss_type, pdsch_to_harq_feedback);
|
||||
NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id];
|
||||
NR_BWP_UplinkDedicated_t *ubwpd=NULL;
|
||||
|
||||
if (cg &&
|
||||
cg->spCellConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated &&
|
||||
cg->spCellConfig->spCellConfigDedicated->uplinkConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)
|
||||
ubwpd = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
|
||||
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type = (sched_ctrl->active_bwp || ubwpd) ? NR_SearchSpace__searchSpaceType_PR_ue_Specific: NR_SearchSpace__searchSpaceType_PR_common;
|
||||
uint8_t pdsch_to_harq_feedback[8];
|
||||
int bwp_Id = 0;
|
||||
if (sched_ctrl->active_ubwp) bwp_Id = sched_ctrl->active_ubwp->bwp_Id;
|
||||
|
||||
get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, pdsch_to_harq_feedback);
|
||||
|
||||
|
||||
LOG_D(NR_MAC,"1b. DL slot %d, UL_ACK %d, DAI_C %d\n",slot,pucch->ul_slot,pucch->dai_c);
|
||||
/* there is a HARQ. Check whether we can use it for this ACKNACK */
|
||||
if (pucch->dai_c > 0) {
|
||||
/* this UE already has a PUCCH occasion */
|
||||
@@ -1303,9 +1318,10 @@ int nr_acknack_scheduling(int mod_id,
|
||||
|
||||
// is there already CSI in this slot?
|
||||
csi_pucch = &sched_ctrl->sched_pucch[1];
|
||||
if (csi_pucch->csi_bits > 0
|
||||
&& csi_pucch->frame == pucch->frame
|
||||
&& csi_pucch->ul_slot == pucch->ul_slot) {
|
||||
if (csi_pucch &&
|
||||
csi_pucch->csi_bits > 0 &&
|
||||
csi_pucch->frame == pucch->frame &&
|
||||
csi_pucch->ul_slot == pucch->ul_slot) {
|
||||
// skip the CSI PUCCH if it is present and if in the next frame/slot
|
||||
// and if we don't multiplex
|
||||
// FIXME currently we support at most 11 bits in pucch2 so skip also in that case
|
||||
@@ -1352,14 +1368,16 @@ int nr_acknack_scheduling(int mod_id,
|
||||
/* verify that at that slot and symbol, resources are free. We only do this
|
||||
* for initialCyclicShift 0 (we assume it always has that one), so other
|
||||
* initialCyclicShifts can overlap with ICS 0!*/
|
||||
const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator];
|
||||
DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0);
|
||||
if (resource->format.choice.format0->initialCyclicShift == 0) {
|
||||
uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE];
|
||||
const uint16_t symb = 1 << resource->format.choice.format0->startingSymbolIndex;
|
||||
if ((vrb_map_UL[resource->startingPRB] & symb) != 0)
|
||||
LOG_W(NR_MAC, "symbol 0x%x is not free for PUCCH alloc in vrb_map_UL at RB %ld and slot %d.%d\n", symb, resource->startingPRB, pucch->frame, pucch->ul_slot);
|
||||
vrb_map_UL[resource->startingPRB] |= symb;
|
||||
if (pucch_Config) {
|
||||
const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator];
|
||||
DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0);
|
||||
if (resource->format.choice.format0->initialCyclicShift == 0) {
|
||||
uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE];
|
||||
const uint16_t symb = 1 << resource->format.choice.format0->startingSymbolIndex;
|
||||
if ((vrb_map_UL[resource->startingPRB] & symb) != 0)
|
||||
LOG_W(NR_MAC, "symbol 0x%x is not free for PUCCH alloc in vrb_map_UL at RB %ld and slot %d.%d\n", symb, resource->startingPRB, pucch->frame, pucch->ul_slot);
|
||||
vrb_map_UL[resource->startingPRB] |= symb;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -188,13 +188,13 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub
|
||||
tdd->nrofUplinkSlots);
|
||||
}
|
||||
|
||||
void nr_process_mac_pdu(module_id_t module_idP,
|
||||
int UE_id,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t slot,
|
||||
uint8_t *pduP,
|
||||
uint16_t mac_pdu_len)
|
||||
int nr_process_mac_pdu(module_id_t module_idP,
|
||||
int UE_id,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t slot,
|
||||
uint8_t *pduP,
|
||||
uint16_t mac_pdu_len)
|
||||
{
|
||||
|
||||
// This function is adapting code from the old
|
||||
@@ -234,7 +234,6 @@ void nr_process_mac_pdu(module_id_t module_idP,
|
||||
// L: The Length field indicates the length of the corresponding MAC SDU or variable-sized MAC CE in bytes. There is one L field per MAC subheader except for subheaders corresponding to fixed-sized MAC CEs and padding. The size of the L field is indicated by the F field;
|
||||
// F: lenght of L is 0:8 or 1:16 bits wide
|
||||
// R: Reserved bit, set to zero.
|
||||
|
||||
while (!done && pdu_len > 0){
|
||||
mac_ce_len = 0;
|
||||
mac_subheader_len = 1; // default to fixed-length subheader = 1-oct
|
||||
@@ -389,18 +388,24 @@ void nr_process_mac_pdu(module_id_t module_idP,
|
||||
mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pdu_ptr)->L;
|
||||
mac_subheader_len = 2;
|
||||
}
|
||||
LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: %d \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, UE_info->rnti[UE_id]);
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE_info->rnti[UE_id],
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcid,
|
||||
(char *) (pdu_ptr + mac_subheader_len),
|
||||
mac_sdu_len,
|
||||
1,
|
||||
NULL);
|
||||
if (UE_info->CellGroup[UE_id]) {
|
||||
LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: %d \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, UE_info->rnti[UE_id]);
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE_info->rnti[UE_id],
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcid,
|
||||
(char *) (pdu_ptr + mac_subheader_len),
|
||||
mac_sdu_len,
|
||||
1,
|
||||
NULL);
|
||||
} else {
|
||||
LOG_W(NR_MAC,"[UE %d] Frame/Slot %d.%d : Received LCID %d which is not configured, dropping packet\n",UE_id,frameP,slot,rx_lcid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
case UL_SCH_LCID_SRB3:
|
||||
// todo
|
||||
@@ -490,7 +495,7 @@ void nr_process_mac_pdu(module_id_t module_idP,
|
||||
|
||||
default:
|
||||
LOG_E(NR_MAC, "Received unknown MAC header (LCID = 0x%02x)\n", rx_lcid);
|
||||
return;
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
pdu_ptr += ( mac_subheader_len + mac_ce_len + mac_sdu_len );
|
||||
@@ -502,9 +507,10 @@ void nr_process_mac_pdu(module_id_t module_idP,
|
||||
for (int i = 0; i < 20; i++) // Only printf 1st - 20nd bytes
|
||||
printf("%02x ", pdu_ptr[i]);
|
||||
printf("\n");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void abort_nr_ul_harq(module_id_t mod_id, int UE_id, int8_t harq_pid)
|
||||
@@ -781,13 +787,16 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
// First byte corresponds to R/LCID MAC sub-header
|
||||
memcpy(ra->cont_res_id, &sduP[1], sizeof(uint8_t) * 6);
|
||||
|
||||
nr_process_mac_pdu(gnb_mod_idP, UE_id, CC_idP, frameP, slotP, sduP, sdu_lenP);
|
||||
|
||||
ra->state = Msg4;
|
||||
ra->Msg4_frame = ( frameP +2 ) % 1024;
|
||||
ra->Msg4_slot = 1;
|
||||
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot);
|
||||
|
||||
if (nr_process_mac_pdu(gnb_mod_idP, UE_id, CC_idP, frameP, slotP, sduP, sdu_lenP) == 0) {
|
||||
ra->state = Msg4;
|
||||
ra->Msg4_frame = ( frameP +2 ) % 1024;
|
||||
ra->Msg4_slot = 1;
|
||||
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot);
|
||||
}
|
||||
else {
|
||||
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1003,6 +1012,7 @@ void pf_ul(module_id_t module_id,
|
||||
|
||||
if (UE_info->Msg4_ACKed[UE_id] != true) continue;
|
||||
|
||||
LOG_D(NR_MAC,"pf_ul: preparing UL scheduling for UE %d\n",UE_id);
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
@@ -1020,6 +1030,7 @@ void pf_ul(module_id_t module_id,
|
||||
|
||||
/* Check if retransmission is necessary */
|
||||
sched_pusch->ul_harq_pid = sched_ctrl->retrans_ul_harq.head;
|
||||
LOG_D(NR_MAC,"pf_ul: UE %d harq_pid %d\n",UE_id,sched_pusch->ul_harq_pid);
|
||||
if (sched_pusch->ul_harq_pid >= 0) {
|
||||
/* Allocate retransmission*/
|
||||
bool r = allocate_ul_retransmission(
|
||||
@@ -1028,6 +1039,8 @@ void pf_ul(module_id_t module_id,
|
||||
LOG_D(NR_MAC, "%4d.%2d UL retransmission UE RNTI %04x can NOT be allocated\n", frame, slot, UE_info->rnti[UE_id]);
|
||||
continue;
|
||||
}
|
||||
else LOG_D(NR_MAC,"%4d.%2d UL Retransmission UE RNTI %04x to be allocated, max_num_ue %d\n",frame,slot,UE_info->rnti[UE_id],max_num_ue);
|
||||
|
||||
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
|
||||
max_num_ue--;
|
||||
if (max_num_ue < 0)
|
||||
@@ -1039,6 +1052,7 @@ void pf_ul(module_id_t module_id,
|
||||
/* preprocessor computed sched_frame/sched_slot */
|
||||
const bool do_sched = nr_UE_is_to_be_scheduled(module_id, 0, UE_id, sched_pusch->frame, sched_pusch->slot);
|
||||
|
||||
LOG_D(NR_MAC,"pf_ul: do_sched UE %d => %s\n",UE_id,do_sched ? "yes" : "no");
|
||||
if (B == 0 && !do_sched)
|
||||
continue;
|
||||
|
||||
@@ -1161,13 +1175,13 @@ void pf_ul(module_id_t module_id,
|
||||
UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
|
||||
return;
|
||||
}
|
||||
else LOG_D(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
|
||||
else LOG_I(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize);
|
||||
|
||||
/* Save PUSCH field */
|
||||
/* we want to avoid a lengthy deduction of DMRS and other parameters in
|
||||
* every TTI if we can save it, so check whether dci_format, TDA, or
|
||||
* num_dmrs_cdm_grps_no_data has changed and only then recompute */
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_ubwp ? 1 : 2;
|
||||
const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2;
|
||||
int dci_format = get_dci_format(sched_ctrl);
|
||||
const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
|
||||
if (ps->time_domain_allocation != tda
|
||||
@@ -1190,8 +1204,8 @@ void pf_ul(module_id_t module_id,
|
||||
&rbSize);
|
||||
sched_pusch->rbSize = rbSize;
|
||||
sched_pusch->tb_size = TBS;
|
||||
LOG_D(NR_MAC,"rbSize %d, TBS %d, est buf %d, sched_ul %d, B %d, CCE %d\n",
|
||||
rbSize, sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B,sched_ctrl->cce_index);
|
||||
LOG_I(NR_MAC,"rbSize %d, TBS %d, est buf %d, sched_ul %d, B %d, CCE %d, num_dmrs_symb %d, N_PRB_DMRS %d\n",
|
||||
rbSize, sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B,sched_ctrl->cce_index,ps->num_dmrs_symb,ps->N_PRB_DMRS);
|
||||
|
||||
/* Mark the corresponding RBs as used */
|
||||
n_rb_sched -= sched_pusch->rbSize;
|
||||
@@ -1352,6 +1366,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
if (sched_ctrl->ul_failure == 1 && get_softmodem_params()->phy_test==0) continue;
|
||||
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL;
|
||||
UE_info->mac_stats[UE_id].ulsch_current_bytes = 0;
|
||||
|
||||
/* dynamic PUSCH values (RB alloc, MCS, hence R, Qm, TBS) that change in
|
||||
@@ -1423,7 +1440,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
sched_ctrl->last_ul_slot = sched_pusch->slot;
|
||||
|
||||
LOG_I(NR_MAC,
|
||||
"%4d.%2d RNTI %04x UL sched %4d.%2d start %2d RBS %3d startSymbol %2d nb_symbol %2d dmrs_pos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d est %6d sched %6d est BSR %6d\n",
|
||||
"ULSCH/PUSCH: %4d.%2d RNTI %04x UL sched %4d.%2d start %2d RBS %3d startSymbol %2d nb_symbol %2d dmrs_pos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d est %6d sched %6d est BSR %6d\n",
|
||||
frame,
|
||||
slot,
|
||||
rnti,
|
||||
@@ -1534,7 +1551,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
pusch_pdu->pusch_data.tb_size = sched_pusch->tb_size;
|
||||
pusch_pdu->pusch_data.num_cb = 0; //CBG not supported
|
||||
|
||||
LOG_I(NR_MAC,"PUSCH PDU : data_scrambling_identity %x, dmrs_scrambling_id %x\n",pusch_pdu->data_scrambling_id,pusch_pdu->ul_dmrs_scrambling_id);
|
||||
LOG_D(NR_MAC,"PUSCH PDU : data_scrambling_identity %x, dmrs_scrambling_id %x\n",pusch_pdu->data_scrambling_id,pusch_pdu->ul_dmrs_scrambling_id);
|
||||
/* TRANSFORM PRECODING --------------------------------------------------------*/
|
||||
|
||||
if (pusch_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled){
|
||||
@@ -1574,8 +1591,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
/* look up the PDCCH PDU for this BWP and CORESET. If it does not exist,
|
||||
* create it */
|
||||
const int bwpid = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0;
|
||||
NR_SearchSpace_t *ss = sched_ctrl->active_bwp ? sched_ctrl->search_space: RC.nrmac[module_id]->sched_ctrlCommon->search_space;
|
||||
NR_ControlResourceSet_t *coreset = sched_ctrl->active_bwp? sched_ctrl->coreset: RC.nrmac[module_id]->sched_ctrlCommon->coreset;
|
||||
NR_SearchSpace_t *ss = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->search_space: RC.nrmac[module_id]->sched_ctrlCommon->search_space;
|
||||
NR_ControlResourceSet_t *coreset = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->coreset: RC.nrmac[module_id]->sched_ctrlCommon->coreset;
|
||||
const int coresetid = coreset->controlResourceSetId;
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = pdcch_pdu_bwp_coreset[bwpid][coresetid];
|
||||
if (!pdcch_pdu) {
|
||||
@@ -1589,7 +1606,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
pdcch_pdu_bwp_coreset[bwpid][coresetid] = pdcch_pdu;
|
||||
}
|
||||
|
||||
LOG_I(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti);
|
||||
LOG_D(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti);
|
||||
|
||||
/* Fill PDCCH DL DCI PDU */
|
||||
nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu->dci_pdu[pdcch_pdu->numDlDci];
|
||||
@@ -1610,15 +1627,10 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
|
||||
dci_pdu_rel15_t uldci_payload;
|
||||
memset(&uldci_payload, 0, sizeof(uldci_payload));
|
||||
NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id];
|
||||
int n_ubwp=1;
|
||||
NR_BWP_UplinkDedicated_t *ubwpd;
|
||||
if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig) {
|
||||
ubwpd = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP;
|
||||
if (CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList)
|
||||
n_ubwp = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if (cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList)
|
||||
n_ubwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
|
||||
config_uldci(sched_ctrl->active_ubwp,
|
||||
ubwpd,
|
||||
scc,
|
||||
@@ -1630,7 +1642,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
n_ubwp,
|
||||
bwpid);
|
||||
fill_dci_pdu_rel15(scc,
|
||||
CellGroup,
|
||||
cg,
|
||||
dci_pdu,
|
||||
&uldci_payload,
|
||||
ps->dci_format,
|
||||
|
||||
@@ -201,6 +201,7 @@ int nr_acknack_scheduling(int Mod_idP,
|
||||
|
||||
void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
int UE_id,
|
||||
int bwp_id,
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type,
|
||||
uint8_t *pdsch_to_harq_feedback);
|
||||
|
||||
@@ -275,6 +276,7 @@ long get_K2(NR_ServingCellConfigCommon_t *scc, NR_BWP_Uplink_t *ubwp, int time_d
|
||||
void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
const NR_BWP_Downlink_t *bwp,
|
||||
const NR_BWP_DownlinkDedicated_t *bwpd,
|
||||
int tda,
|
||||
uint8_t num_dmrs_cdm_grps_no_data,
|
||||
NR_pdsch_semi_static_t *ps);
|
||||
|
||||
@@ -285,7 +285,7 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
|
||||
LOG_D(NR_RRC,"[gNB %d] Frame %d CCCH request (Srb_id %ld)\n", Mod_idP, frameP, Srb_id);
|
||||
|
||||
AssertFatal(ue_context_p!=NULL,"failed to get ue_context\n");
|
||||
AssertFatal(ue_context_p!=NULL,"failed to get ue_context, rnti %x\n",rnti);
|
||||
char payload_size = ue_context_p->ue_context.Srb0.Tx_buffer.payload_size;
|
||||
|
||||
// check if data is there for MAC
|
||||
|
||||
@@ -1186,6 +1186,14 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
*schedulingRequestResourceConfig->resource = 0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
|
||||
}
|
||||
pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
|
||||
long *delay[8];
|
||||
for (int i=0;i<8;i++) {
|
||||
delay[i] = calloc(1,sizeof(*delay[i]));
|
||||
*delay[i] = (i+2);
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
|
||||
}
|
||||
|
||||
SpCellConfig->spCellConfigDedicated->initialDownlinkBWP = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->initialDownlinkBWP));
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
bwp_Dedicated->pdcch_Config=calloc(1,sizeof(*bwp_Dedicated->pdcch_Config));
|
||||
@@ -1201,15 +1209,20 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
// frequency domain resources depends on BWP size
|
||||
// options are 24, 48 or 96
|
||||
coreset->frequencyDomainResources.buf = calloc(1,6);
|
||||
int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
if (curr_bwp < 48)
|
||||
coreset->frequencyDomainResources.buf[0] = 0xf0;
|
||||
else
|
||||
coreset->frequencyDomainResources.buf[0] = 0xff;
|
||||
if (curr_bwp < 96)
|
||||
coreset->frequencyDomainResources.buf[1] = 0;
|
||||
else
|
||||
coreset->frequencyDomainResources.buf[1] = 0xff;
|
||||
if (0) {
|
||||
int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
if (curr_bwp < 48)
|
||||
coreset->frequencyDomainResources.buf[0] = 0xf0;
|
||||
else
|
||||
coreset->frequencyDomainResources.buf[0] = 0xff;
|
||||
if (curr_bwp < 96)
|
||||
coreset->frequencyDomainResources.buf[1] = 0;
|
||||
else
|
||||
coreset->frequencyDomainResources.buf[1] = 0xff;
|
||||
} else {
|
||||
coreset->frequencyDomainResources.buf[0] = 0xf0;
|
||||
coreset->frequencyDomainResources.buf[1] = 0;
|
||||
}
|
||||
coreset->frequencyDomainResources.buf[2] = 0;
|
||||
coreset->frequencyDomainResources.buf[3] = 0;
|
||||
coreset->frequencyDomainResources.buf[4] = 0;
|
||||
@@ -1271,7 +1284,7 @@ void fill_initial_SpCellConfig(rnti_t rnti,
|
||||
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition));
|
||||
*bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1;
|
||||
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->resourceAllocation = NR_PDSCH_Config__resourceAllocation_resourceAllocationType1;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling = calloc(1,sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling));
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize =
|
||||
@@ -1365,7 +1378,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms80;
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_p64;
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.pollByte = NR_PollByte_kB125;
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t4;
|
||||
rlc_Config_drb->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t8;
|
||||
rlc_BearerConfig_drb->rlc_Config = rlc_Config_drb;
|
||||
logicalChannelConfig_drb = calloc(1, sizeof(NR_LogicalChannelConfig_t));
|
||||
logicalChannelConfig_drb->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig_drb->ul_SpecificParameters));
|
||||
|
||||
@@ -641,7 +641,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
break;
|
||||
case USRP_X300_DEV:
|
||||
case USRP_N300_DEV:
|
||||
rxshift=4;
|
||||
rxshift=2;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Shouldn't be here\n");
|
||||
@@ -940,6 +940,7 @@ extern "C" {
|
||||
LOG_I(HW, "openair0_cfg[0].sdr_addrs == '%s'\n", openair0_cfg[0].sdr_addrs);
|
||||
LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external);
|
||||
usrp_state_t *s ;
|
||||
int choffset = 0;
|
||||
|
||||
if ( device->priv == NULL) {
|
||||
s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1);
|
||||
@@ -1248,10 +1249,10 @@ extern "C" {
|
||||
|
||||
for(int i=0; i<((int) s->usrp->get_rx_num_channels()); i++) {
|
||||
if (i<openair0_cfg[0].rx_num_channels) {
|
||||
s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i);
|
||||
s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i);
|
||||
s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i+choffset);
|
||||
s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i+choffset);
|
||||
set_rx_gain_offset(&openair0_cfg[0],i,bw_gain_adjust);
|
||||
::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i);
|
||||
::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i+choffset);
|
||||
// limit to maximum gain
|
||||
double gain=openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i];
|
||||
if ( gain > gain_range.stop()) {
|
||||
@@ -1260,7 +1261,7 @@ extern "C" {
|
||||
gain=gain_range.stop();
|
||||
}
|
||||
|
||||
s->usrp->set_rx_gain(gain,i);
|
||||
s->usrp->set_rx_gain(gain,i+choffset);
|
||||
LOG_I(HW,"RX Gain %d %f (%f) => %f (max %f)\n",i,
|
||||
openair0_cfg[0].rx_gain[i],openair0_cfg[0].rx_gain_offset[i],
|
||||
openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop());
|
||||
@@ -1274,9 +1275,9 @@ extern "C" {
|
||||
::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(i);
|
||||
|
||||
if (i<openair0_cfg[0].tx_num_channels) {
|
||||
s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i);
|
||||
s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i);
|
||||
s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[i],i);
|
||||
s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i+choffset);
|
||||
s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i+choffset);
|
||||
s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[i],i+choffset);
|
||||
LOG_I(HW,"USRP TX_GAIN:%3.2lf gain_range:%3.2lf tx_gain:%3.2lf\n", gain_range_tx.stop()-openair0_cfg[0].tx_gain[i], gain_range_tx.stop(), openair0_cfg[0].tx_gain[i]);
|
||||
}
|
||||
}
|
||||
@@ -1303,41 +1304,41 @@ extern "C" {
|
||||
s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps());
|
||||
|
||||
for (int i = 0; i<openair0_cfg[0].rx_num_channels; i++) {
|
||||
LOG_I(HW,"setting rx channel %d\n",i);
|
||||
stream_args_rx.channels.push_back(i);
|
||||
LOG_I(HW,"setting rx channel %d\n",i+choffset);
|
||||
stream_args_rx.channels.push_back(i+choffset);
|
||||
}
|
||||
|
||||
s->rx_stream = s->usrp->get_rx_stream(stream_args_rx);
|
||||
uhd::stream_args_t stream_args_tx("sc16", "sc16");
|
||||
|
||||
for (int i = 0; i<openair0_cfg[0].tx_num_channels; i++)
|
||||
stream_args_tx.channels.push_back(i);
|
||||
stream_args_tx.channels.push_back(i+choffset);
|
||||
|
||||
s->tx_stream = s->usrp->get_tx_stream(stream_args_tx);
|
||||
|
||||
/* Setting TX/RX BW after streamers are created due to USRP calibration issue */
|
||||
for(int i=0; i<((int) s->usrp->get_tx_num_channels()) && i<openair0_cfg[0].tx_num_channels; i++)
|
||||
s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
|
||||
s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i+choffset);
|
||||
|
||||
for(int i=0; i<((int) s->usrp->get_rx_num_channels()) && i<openair0_cfg[0].rx_num_channels; i++)
|
||||
s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
|
||||
s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i+choffset);
|
||||
|
||||
for (int i=0; i<openair0_cfg[0].rx_num_channels; i++) {
|
||||
LOG_I(HW,"RX Channel %d\n",i);
|
||||
LOG_I(HW," Actual RX sample rate: %fMSps...\n",s->usrp->get_rx_rate(i)/1e6);
|
||||
LOG_I(HW," Actual RX frequency: %fGHz...\n", s->usrp->get_rx_freq(i)/1e9);
|
||||
LOG_I(HW," Actual RX gain: %f...\n", s->usrp->get_rx_gain(i));
|
||||
LOG_I(HW," Actual RX bandwidth: %fM...\n", s->usrp->get_rx_bandwidth(i)/1e6);
|
||||
LOG_I(HW," Actual RX antenna: %s...\n", s->usrp->get_rx_antenna(i).c_str());
|
||||
LOG_I(HW," Actual RX sample rate: %fMSps...\n",s->usrp->get_rx_rate(i+choffset)/1e6);
|
||||
LOG_I(HW," Actual RX frequency: %fGHz...\n", s->usrp->get_rx_freq(i+choffset)/1e9);
|
||||
LOG_I(HW," Actual RX gain: %f...\n", s->usrp->get_rx_gain(i+choffset));
|
||||
LOG_I(HW," Actual RX bandwidth: %fM...\n", s->usrp->get_rx_bandwidth(i+choffset)/1e6);
|
||||
LOG_I(HW," Actual RX antenna: %s...\n", s->usrp->get_rx_antenna(i+choffset).c_str());
|
||||
}
|
||||
|
||||
for (int i=0; i<openair0_cfg[0].tx_num_channels; i++) {
|
||||
LOG_I(HW,"TX Channel %d\n",i);
|
||||
LOG_I(HW," Actual TX sample rate: %fMSps...\n", s->usrp->get_tx_rate(i)/1e6);
|
||||
LOG_I(HW," Actual TX frequency: %fGHz...\n", s->usrp->get_tx_freq(i)/1e9);
|
||||
LOG_I(HW," Actual TX gain: %f...\n", s->usrp->get_tx_gain(i));
|
||||
LOG_I(HW," Actual TX bandwidth: %fM...\n", s->usrp->get_tx_bandwidth(i)/1e6);
|
||||
LOG_I(HW," Actual TX antenna: %s...\n", s->usrp->get_tx_antenna(i).c_str());
|
||||
LOG_I(HW," Actual TX sample rate: %fMSps...\n", s->usrp->get_tx_rate(i+choffset)/1e6);
|
||||
LOG_I(HW," Actual TX frequency: %fGHz...\n", s->usrp->get_tx_freq(i+choffset)/1e9);
|
||||
LOG_I(HW," Actual TX gain: %f...\n", s->usrp->get_tx_gain(i+choffset));
|
||||
LOG_I(HW," Actual TX bandwidth: %fM...\n", s->usrp->get_tx_bandwidth(i+choffset)/1e6);
|
||||
LOG_I(HW," Actual TX antenna: %s...\n", s->usrp->get_tx_antenna(i+choffset).c_str());
|
||||
LOG_I(HW," Actual TX packet size: %lu\n",s->tx_stream->get_max_num_samps());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user