Commit 06e2a585 authored by Raymond Knopp's avatar Raymond Knopp

minor changes for testing

parent 2a964910
......@@ -583,7 +583,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
if (LOG_DEBUGFLAG(PRACH)) {
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
if (en>60) LOG_D(PHY,"frame %d, slot %d : preamble index %d, NCS %d, N_ZC/NCS %d: offset %d, preamble shift %d , en %d)\n",
if (en>30) LOG_I(PHY,"frame %d, slot %d : preamble index %d, NCS %d, N_ZC/NCS %d: offset %d, preamble shift %d , en %d)\n",
frame,slot,preamble_index,NCS,N_ZC/NCS,preamble_offset,preamble_shift,en);
}
......@@ -630,8 +630,8 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
}
if (LOG_DUMPFLAG(PRACH)) {
if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
if (aa==1) LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
if (aa==0) LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,N_ZC == 839 ? 1024 : 256,1,1);
if (aa==1) {LOG_M("prach_rxF_comp1.m","prach_rxF_comp1",prachF,N_ZC == 839 ? 1024 : 256,1,1);exit(-1);}
}
}// antennas_rx
......@@ -690,7 +690,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
else *TA = *TA/2;
if (LOG_DUMPFLAG(PRACH)) {
if (/*levdB>200*/LOG_DUMPFLAG(PRACH)) {
//int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
// if (en>60) {
int k = (12*n_ra_prb) - 6*fp->N_RB_UL;
......@@ -702,10 +702,11 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
k*=2;
LOG_M("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
LOG_M("rxsigF.m","prach_rxF",&rxsigF[0][0],N_ZC,1,1);
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,N_ZC==839?1024:256,1,1);
LOG_M("Xu.m","xu",Xu,N_ZC,1,1);
LOG_M("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);
LOG_M("prach_ifft0.m","prach_t0",prach_ifft,N_ZC=839?1024:256,1,1);
exit(-1);
// }
} /* LOG_DUMPFLAG(PRACH) */
stop_meas(&gNB->rx_prach);
......
......@@ -174,7 +174,7 @@
#define SCCPARAMS_DESC(scc) { \
{GNB_CONFIG_STRING_PHYSCELLID,NULL,0,.i64ptr=scc->physCellId,.defint64val=0,TYPE_INT64,0/*0*/}, \
{GNB_CONFIG_STRING_NTIMINGADVANCEOFFSET,NULL,0,.i64ptr=scc->n_TimingAdvanceOffset,.defint64val=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0,TYPE_INT64,0/*1*/},\
{GNB_CONFIG_STRING_NTIMINGADVANCEOFFSET,NULL,0,.i64ptr=scc->n_TimingAdvanceOffset,.defint64val=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n25600,TYPE_INT64,0/*1*/},\
{GNB_CONFIG_STRING_SSBPERIODICITYSERVINGCELL,NULL,0,.i64ptr=scc->ssb_periodicityServingCell,.defint64val=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20,TYPE_INT64,0/*2*/},\
{GNB_CONFIG_STRING_DMRSTYPEAPOSITION,NULL,0,.i64ptr=&scc->dmrs_TypeA_Position,.defint64val=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2,TYPE_INT64,0/*3*/},\
{GNB_CONFIG_STRING_SUBCARRIERSPACING,NULL,0,.i64ptr=scc->ssbSubcarrierSpacing,.defint64val=NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*4*/},\
......
......@@ -1091,7 +1091,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
prepare_scc(scc);
paramdef_t SCCsParams[] = SCCPARAMS_DESC(scc);
paramlist_def_t SCCsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, NULL, 0};
// Serving Cell Config Dedicated
NR_ServingCellConfig_t *scd = calloc(1,sizeof(NR_ServingCellConfig_t));
memset((void*)scd,0,sizeof(NR_ServingCellConfig_t));
......
......@@ -237,7 +237,7 @@ void nr_csi_meas_reporting(int Mod_idP,
if ((sched_frame*n_slots_frame + sched_slot - offset)%period != 0)
continue;
AssertFatal(is_xlsch_in_slot(nrmac->ulsch_slot_bitmap[sched_slot / 64], sched_slot), "CSI reporting slot %d is not set for an uplink slot\n", sched_slot);
AssertFatal(is_xlsch_in_slot(nrmac->ulsch_slot_bitmap[sched_slot / 64], sched_slot), "CSI reporting slot %d is not set for an uplink slot, period %d, offset %d\n", sched_slot,period,offset);
LOG_D(NR_MAC, "CSI reporting in frame %d slot %d CSI report ID %ld\n", sched_frame, sched_slot, csirep->reportConfigId);
const NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[1]; // set with formats >1
......
......@@ -1358,9 +1358,9 @@ static void set_csi_meas_periodicity(const NR_ServingCellConfigCommon_t *scc, NR
const int ideal_period = MAX_MOBILES_PER_GNB * 2 * n_slots_period / n_ul_slots_period; // 2 reports per UE
const int first_ul_slot_period = tdd ? get_first_ul_slot(tdd->nrofDownlinkSlots, tdd->nrofDownlinkSymbols, tdd->nrofUplinkSymbols) : 0;
const int idx = (uid << 1) + is_rsrp;
const int offset = first_ul_slot_period + idx % n_ul_slots_period + (idx / n_ul_slots_period) * n_slots_period;
const int offset = first_ul_slot_period + (idx % n_ul_slots_period) + (idx / n_ul_slots_period) * n_slots_period;
AssertFatal(offset < 320, "Not enough UL slots to accomodate all possible UEs. Need to rework the implementation\n");
LOG_I(NR_RRC,"setting csi_meas_periodicity : offset %d, first_ul_slot_period %d, idx %d, n_ul_slots_period %d\n",offset,first_ul_slot_period,idx,n_ul_slots_period);
if (ideal_period < 5) {
csirep->reportConfigType.choice.periodic->reportSlotConfig.present = NR_CSI_ReportPeriodicityAndOffset_PR_slots4;
csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots4 = offset;
......
......@@ -316,6 +316,8 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot){
src = pData;
}
else if(p_sec_desc->pData==NULL){
LOG_E(PHY,"p_sec_desc->pData is NULL for sym_id %d\n",sym_id);
exit(-1);
return -1;
}else{
src = p_sec_desc->pData;
......
......@@ -429,6 +429,33 @@ int32_t init_xran(void)
struct xran_buffer_list *pFthRxRachBuffer[XRAN_MAX_SECTOR_NR][XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
struct xran_buffer_list *pFthRxSrsBuffer[XRAN_MAX_SECTOR_NR][XRAN_MAX_ANT_ARRAY_ELM_NR][XRAN_N_FE_BUF_LEN];
// get mixed slot information
int tdd_period=startupConfiguration.nTddPeriod;
int mixed_slot_index=-1;
int mixed_slot_num_DLsymb=-1;
int mixed_slot_num_ULsymb=-1;
int mixed_slot_ULstart_symb=-1;
for (int slot_idx=0;slot_idx < tdd_period;slot_idx++){
mixed_slot_num_DLsymb=0;
mixed_slot_num_ULsymb=0;
for (int symb_idx=0;symb_idx < XRAN_NUM_OF_SYMBOL_PER_SLOT; symb_idx++) {
if (startupConfiguration.sSlotConfig[slot_idx].nSymbolType[symb_idx]==0)
mixed_slot_num_DLsymb++;
else if (startupConfiguration.sSlotConfig[slot_idx].nSymbolType[symb_idx]==2)
mixed_slot_index=slot_idx;
else if (startupConfiguration.sSlotConfig[slot_idx].nSymbolType[symb_idx]==1) {
if (mixed_slot_num_ULsymb==0) mixed_slot_ULstart_symb=symb_idx;
mixed_slot_num_ULsymb++;
}
}
if (mixed_slot_index>0) break;
}
if (mixed_slot_index<0) {
printf("Couldn't find the mixed slot, this is a problem\b");
exit(-1);
}
printf("tdd_duration %d, mixed_slot_index %d, numDL symbols %d, first UL symbol %d, numUL symbols %d\n",
tdd_period,mixed_slot_index,mixed_slot_num_DLsymb,mixed_slot_ULstart_symb,mixed_slot_num_ULsymb);
for (nSectorNum = 0; nSectorNum < XRAN_MAX_SECTOR_NR; nSectorNum++)
{
nSectorIndex[nSectorNum] = nSectorNum;
......@@ -570,9 +597,14 @@ int32_t init_xran(void)
void *sd_mb;
int elm_id;
struct xran_prb_map * p_rb_map = (struct xran_prb_map *)ptr;
if (startupConfiguration.appMode == APP_O_DU)
if (startupConfiguration.appMode == APP_O_DU) {
memcpy(ptr, &startupConfiguration.PrbMapDl, sizeof(struct xran_prb_map));
else
if ((j%tdd_period) == mixed_slot_index) {
p_rb_map->prbMap[0].nStartSymb=0;
p_rb_map->prbMap[0].numSymb = mixed_slot_num_DLsymb;
}
}
else
memcpy(ptr, &startupConfiguration.PrbMapUl, sizeof(struct xran_prb_map));
for (elm_id = 0; elm_id < p_rb_map->nPrbElm; elm_id++){
......@@ -673,8 +705,13 @@ int32_t init_xran(void)
int elm_id;
struct xran_prb_map * p_rb_map = (struct xran_prb_map *)ptr;
if (startupConfiguration.appMode == APP_O_DU)
if (startupConfiguration.appMode == APP_O_DU) {
memcpy(ptr, &startupConfiguration.PrbMapUl, sizeof(struct xran_prb_map));
if ((j%tdd_period) == mixed_slot_index) {
p_rb_map->prbMap[0].nStartSymb=mixed_slot_ULstart_symb;
p_rb_map->prbMap[0].numSymb = mixed_slot_num_ULsymb;
}
}
else
memcpy(ptr, &startupConfiguration.PrbMapDl, sizeof(struct xran_prb_map));
......
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