Commit dc5993be authored by Fang-WANG's avatar Fang-WANG

100M ok for rfsim, ssb not at the center

parent 24edd58f
......@@ -137,6 +137,9 @@ extern int sync_var;
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern int point_a_15khz;
extern int kssb_15khz;
extern int rx_input_level_dBm;
extern uint64_t num_missed_slots; // counter for the number of missed slots
......
......@@ -112,6 +112,9 @@ int8_t threequarter_fs=0;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
int point_a_15khz;
int kssb_15khz;
//Temp fix for inexistent NR upper layer
unsigned char NB_gNB_INST = 1;
......
......@@ -127,6 +127,8 @@ int dumpframe = 0;
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
int rx_input_level_dBm;
int point_a_15khz;
int kssb_15khz;
#if MAX_NUM_CCs == 1
rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}};
......@@ -489,13 +491,16 @@ int main( int argc, char **argv ) {
nrUE_config->carrier_config.ul_grid_size[nrUE_config->ssb_config.scs_common] = UE[CC_id]->frame_parms.N_RB_DL;
nrUE_config->carrier_config.dl_frequency = (downlink_frequency[0][0] -(6*UE[CC_id]->frame_parms.N_RB_DL*(15000<<nrUE_config->ssb_config.scs_common)))/1000;
nrUE_config->carrier_config.uplink_frequency = (downlink_frequency[0][0] -(6*UE[CC_id]->frame_parms.N_RB_DL*(15000<<nrUE_config->ssb_config.scs_common)))/1000;
nrUE_config->ssb_table.ssb_offset_point_a = (UE[CC_id]->frame_parms.N_RB_DL - 20)>>1;
if ((UE[CC_id]->frame_parms.N_RB_DL & 0x01) == 1)
{
nrUE_config->ssb_table.ssb_subcarrier_offset = 12; // 15khz
}
else
nrUE_config->ssb_table.ssb_subcarrier_offset = 0;
nrUE_config->ssb_table.ssb_offset_point_a = point_a_15khz>>1; // used as 30kHZ //(UE[CC_id]->frame_parms.N_RB_DL - 20)>>1;
nrUE_config->ssb_table.ssb_subcarrier_offset = kssb_15khz; // used as 15kHZ
LOG_I(PHY, "freq %d %d\n", downlink_frequency[0][0]/1000, nrUE_config->carrier_config.dl_frequency);
// if ((UE[CC_id]->frame_parms.N_RB_DL & 0x01) == 1)
// {
// nrUE_config->ssb_table.ssb_subcarrier_offset = 12; // 15khz
// }
// else
// nrUE_config->ssb_table.ssb_subcarrier_offset = 0;
// Initialize values, will be updated upon SIB1 reception
nrUE_config->cell_config.frame_duplex_type = TDD;
......
......@@ -138,6 +138,8 @@ extern int usrp_tx_thread;
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:3619200000, TYPE_UINT64, 0}, \
{"pointA" , CONFIG_HLP_DLF, 0, iptr:&point_a_15khz, defintval:86, TYPE_INT, 0}, \
{"kssb" , CONFIG_HLP_DLF, 0, iptr:&kssb_15khz, defintval:0, TYPE_INT, 0}, \
{"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
......@@ -259,6 +261,8 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
extern void set_softmodem_sighandler(void);
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern int point_a_15khz;
extern int kssb_15khz;
extern int usrp_tx_thread;
extern uint16_t sl_ahead;
extern uint16_t sf_ahead;
......
......@@ -318,7 +318,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
fp->ssb_start_subcarrier = (12 * config->ssb_table.ssb_offset_point_a + sco/2);
LOG_I(PHY, "sco %d, ssb_subcarrier_offset %d, ssb_offset_point_a %d, ssb_start_subcarrier %d, ofdmsize %d\n",
LOG_I(PHY, "ue init sco %d, ssb_subcarrier_offset %d, ssb_offset_point_a %d, ssb_start_subcarrier %d, ofdmsize %d\n",
sco, // sco is 15khz
config->ssb_table.ssb_subcarrier_offset,
config->ssb_table.ssb_offset_point_a,
......
......@@ -645,7 +645,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
return((1 + dlsch->max_ldpc_iterations));
} else {
LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for nr_slot_rx %d TBS %d mcs %d nb_rb %d harq_process->round %d\n",
LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for frame nr_slot_rx %d TBS %d mcs %d nb_rb %d harq_process->round %d\n",
phy_vars_ue->Mod_id,nr_slot_rx,harq_process->TBS,harq_process->mcs,harq_process->nb_rb, harq_process->round);
harq_process->status = SCH_IDLE;
......
......@@ -40,6 +40,9 @@ extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern int point_a_15khz;
extern int kssb_15khz;
extern const short conjugate[8],conjugate2[8];
extern int number_of_cards;
......
......@@ -363,6 +363,8 @@ void nr_ue_pbch_procedures(uint8_t gNB_id,
if (ret==0) {
LOG_I(PHY,"[UE %d] frame %d, nr_slot_rx %d, OK decoding PBCH!\n",
ue->Mod_id,frame_rx, nr_slot_rx);
ue->pbch_vars[gNB_id]->pdu_errors_conseq = 0;
// Switch to PRACH state if it is first PBCH after initial synch and no timing correction is performed
......
......@@ -3396,7 +3396,7 @@ void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PD
break;
}
LOG_D(MAC,"Coreset0: index_4msb=%d, num_rbs=%d, num_symb=%d, rb_offset=%d\n",
LOG_I(MAC,"Coreset0: index_4msb=%d, num_rbs=%d, num_symb=%d, rb_offset=%d\n",
index_4msb,type0_PDCCH_CSS_config->num_rbs,type0_PDCCH_CSS_config->num_symbols,type0_PDCCH_CSS_config->rb_offset );
AssertFatal(type0_PDCCH_CSS_config->num_rbs != -1, "Type0 PDCCH coreset num_rbs undefined");
......
......@@ -392,8 +392,9 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
cfg->ssb_table.ssb_offset_point_a = scc_SIB->downlinkConfigCommon.frequencyInfoDL.offsetToPointA;
cfg->ssb_table.ssb_period = scc_SIB->ssb_PeriodicityServingCell;
cfg->ssb_table.ssb_subcarrier_offset = 0; // TODO currently not in RRC?
//cfg->ssb_table.ssb_subcarrier_offset = 0; // TODO currently not in RRC?
LOG_I(PHY, "in SIB, ssb_offset_point_a %d, ssb_subcarrier_offset %d\n", cfg->ssb_table.ssb_offset_point_a, cfg->ssb_table.ssb_subcarrier_offset);
AssertFatal(scc_SIB->ssb_PositionsInBurst.groupPresence==NULL, "Cannot handle more than 8 SSBs for now (%x.%x.%x.%x.%x.%x.%x.%x)\n",
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[0],
scc_SIB->ssb_PositionsInBurst.groupPresence->buf[1],
......
......@@ -173,7 +173,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
ssb_index,
ssb_offset_point_a);
LOG_I(MAC,"ssb_start_subcarrier %d, ssb_subcarrier_offset %d, ssb_offset_point_a %d\n",
LOG_I(MAC,"in mib : ssb_start_subcarrier %d, ssb_subcarrier_offset %d, ssb_offset_point_a %d\n",
ssb_start_subcarrier, ssb_subcarrier_offset, ssb_offset_point_a );
mac->type0_pdcch_ss_mux_pattern = mac->type0_PDCCH_CSS_config.type0_pdcch_ss_mux_pattern;
mac->type0_pdcch_ss_sfn_c = mac->type0_PDCCH_CSS_config.sfn_c;
......
......@@ -387,15 +387,15 @@ void schedule_control_sib1(module_id_t module_id,
TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx),
nr_get_code_rate_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx),
rbSize, nrOfSymbols, N_PRB_DMRS * dmrs_length,0, 0,1) >> 3;
} while (rbStart + rbSize < bwpSize && !vrb_map[rbStart + rbSize + type0_PDCCH_CSS_config->cset_start_rb] && TBS < gNB_mac->sched_ctrlCommon->num_total_bytes);
} while (rbSize < bwpSize && !vrb_map[rbStart + rbSize + type0_PDCCH_CSS_config->cset_start_rb] && TBS < gNB_mac->sched_ctrlCommon->num_total_bytes);
gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize = rbSize;
gNB_mac->sched_ctrlCommon->sched_pdsch.rbStart = rbStart;
LOG_D(MAC,"startSymbolIndex = %i\n", startSymbolIndex);
LOG_D(MAC,"nrOfSymbols = %i\n", nrOfSymbols);
LOG_D(MAC, "rbSize = %i\n", gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize);
LOG_D(MAC,"TBS = %i\n", TBS);
LOG_I(MAC, "rbSize = %i, %d, bwp %d %d\n", rbStart, gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize, type0_PDCCH_CSS_config->cset_start_rb, bwpSize);
LOG_I(MAC,"TBS = %i, totalbyte %d\n", TBS, gNB_mac->sched_ctrlCommon->num_total_bytes);
LOG_D(MAC,"dmrs_length %d\n",dmrs_length);
LOG_D(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS);
LOG_D(MAC,"mappingtype = %d\n", mappingtype);
......@@ -537,7 +537,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP,
LOG_D(MAC,"CyclicPrefix: %i\n", pdcch_pdu_rel15->CyclicPrefix);
LOG_D(MAC,"StartSymbolIndex: %i\n", pdcch_pdu_rel15->StartSymbolIndex);
LOG_D(MAC,"DurationSymbols: %i\n", pdcch_pdu_rel15->DurationSymbols);
for(int n=0;n<6;n++) LOG_D(MAC,"FreqDomainResource[%i]: %x\n",n, pdcch_pdu_rel15->FreqDomainResource[n]);
for(int n=0;n<6;n++) LOG_I(MAC,"FreqDomainResource[%i]: %x\n",n, pdcch_pdu_rel15->FreqDomainResource[n]);
LOG_D(MAC,"CceRegMappingType: %i\n", pdcch_pdu_rel15->CceRegMappingType);
LOG_D(MAC,"RegBundleSize: %i\n", pdcch_pdu_rel15->RegBundleSize);
LOG_D(MAC,"InterleaverSize: %i\n", pdcch_pdu_rel15->InterleaverSize);
......
......@@ -2577,9 +2577,9 @@ int decode_BCCH_DLSCH_Message(
Sdu_len );
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E( RRC, "[UE %"PRIu8"] Failed to decode BCCH_DLSCH_MESSAGE (%zu bits)\n",
LOG_E( RRC, "[UE %"PRIu8"] Failed to decode BCCH_DLSCH_MESSAGE (%zu bits) %d\n",
ctxt_pP->module_id,
dec_rval.consumed );
dec_rval.consumed, Sdu_len );
log_dump(RRC, Sdu, Sdu_len, LOG_DUMP_CHAR," Received bytes:\n" );
// free the memory
SEQUENCE_free( &asn_DEF_LTE_BCCH_DL_SCH_Message, (void *)bcch_message, 1 );
......
......@@ -419,8 +419,9 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
nrMultiBandInfo->freqBandIndicatorNR = configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[i];
ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list,nrMultiBandInfo);
}
//sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = 86;
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = ((*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB -
configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA) * 15 / 30 / 12 - 10 ) * 2;
//sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = 86;
for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.count; i++) {
ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list,configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[i]);
}
......
......@@ -1159,9 +1159,9 @@ int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(
}
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E( NR_RRC, "[UE %"PRIu8"] Failed to decode BCCH_DLSCH_MESSAGE (%zu bits)\n",
LOG_E( NR_RRC, "[UE %"PRIu8"] Failed to decode BCCH_DLSCH_MESSAGE (%zu bits) %d\n",
module_id,
dec_rval.consumed );
dec_rval.consumed, Sdu_len );
log_dump(NR_RRC, Sdu, Sdu_len, LOG_DUMP_CHAR," Received bytes:\n" );
// free the memory
SEQUENCE_free( &asn_DEF_LTE_BCCH_DL_SCH_Message, (void *)bcch_message, 1 );
......
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