Commit ac0dc9d3 authored by rmagueta's avatar rmagueta

Transmission of SIB1

parent 4f525854
...@@ -240,13 +240,7 @@ uint8_t nr_generate_dci_top(PHY_VARS_gNB *gNB, ...@@ -240,13 +240,7 @@ uint8_t nr_generate_dci_top(PHY_VARS_gNB *gNB,
} // m } // m
} // reg_idx } // reg_idx
printf(">> DCI: payloadSize = %d | payload = %llx\n\n",
printf("polar_encoder_fast: pdcch_pdu_rel15->dci_pdu.PayloadSizeBits[d] = %i, pdcch_pdu_rel15->dci_pdu.AggregationLevel[d] = %i, n_RNTI = %i\n",
pdcch_pdu_rel15->dci_pdu.PayloadSizeBits[d], pdcch_pdu_rel15->dci_pdu.AggregationLevel[d], n_RNTI);
printf("nr_pdcch_scrambling: encoded_length = %i, Nid = %i, scrambling_RNTI = %i\n\n",encoded_length, Nid, scrambling_RNTI);
printf("\n>> DCI: payloadSize = %d | payload = %llx\n\n",
*pdcch_pdu_rel15->dci_pdu.PayloadSizeBits,*(unsigned long long*)pdcch_pdu_rel15->dci_pdu.Payload); *pdcch_pdu_rel15->dci_pdu.PayloadSizeBits,*(unsigned long long*)pdcch_pdu_rel15->dci_pdu.Payload);
} // for (int d=0;d<pdcch_pdu_rel15->numDlDci;d++) } // for (int d=0;d<pdcch_pdu_rel15->numDlDci;d++)
......
...@@ -590,8 +590,17 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -590,8 +590,17 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int // Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) { if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r); LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r);
if (r==0)
for (int i=0;i<10;i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t*)llrProcBuf)[i]); if (r==0) {
for (int i=0;i<10;i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t*)llrProcBuf)[i]);
printf("\n");
printf("==== CRC OK ====\n");
for (int i=0;i<10;i++) printf("byte %d : %x\n",i,((uint8_t*)llrProcBuf)[i]);
printf("\n");
getchar();
}
//Temporary hack //Temporary hack
no_iteration_ldpc = dlsch->max_ldpc_iterations; no_iteration_ldpc = dlsch->max_ldpc_iterations;
...@@ -600,6 +609,13 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -600,6 +609,13 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
else { else {
LOG_D(PHY,"CRC NOK\n\033[0m"); LOG_D(PHY,"CRC NOK\n\033[0m");
ret = 1 + dlsch->max_ldpc_iterations; ret = 1 + dlsch->max_ldpc_iterations;
printf("\n");
printf("==== CRC NOT OK ====\n");
for (int i=0;i<10;i++) printf("byte %d : %x\n",i,((uint8_t*)llrProcBuf)[i]);
printf("\n");
getchar();
} }
......
...@@ -2234,8 +2234,13 @@ uint16_t nr_dci_size(NR_ServingCellConfigCommon_t *scc, ...@@ -2234,8 +2234,13 @@ uint16_t nr_dci_size(NR_ServingCellConfigCommon_t *scc,
case NR_DL_DCI_FORMAT_1_0: case NR_DL_DCI_FORMAT_1_0:
/// fixed: Format identifier 1, VRB2PRB 1, MCS 5, NDI 1, RV 2, HARQ PID 4, DAI 2, PUCCH TPC 2, PUCCH RInd 3, PDSCH to HARQ TInd 3 Time Domain assgnmt 4 -- 28 /// fixed: Format identifier 1, VRB2PRB 1, MCS 5, NDI 1, RV 2, HARQ PID 4, DAI 2, PUCCH TPC 2, PUCCH RInd 3, PDSCH to HARQ TInd 3 Time Domain assgnmt 4 -- 28
size += 28; size = 28;
size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment
dci_pdu->frequency_domain_assignment.nbits = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
dci_pdu->time_domain_assignment.nbits = 4;
dci_pdu->vrb_to_prb_mapping.nbits = 1;
break; break;
case NR_DL_DCI_FORMAT_1_1: case NR_DL_DCI_FORMAT_1_1:
......
...@@ -163,10 +163,8 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t ...@@ -163,10 +163,8 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
rel15->dci_length_options[i] = nr_dci_size(scc, mac->scg, def_dci_pdu_rel15, rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, bwp_id); rel15->dci_length_options[i] = nr_dci_size(scc, mac->scg, def_dci_pdu_rel15, rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, bwp_id);
} }
printf("bwp_Common->genericParameters.locationAndBandwidth = %li\n", bwp_Common->genericParameters.locationAndBandwidth);
printf("rel15->BWPSize = %i\n", rel15->BWPSize);
break; break;
case NR_RNTI_SFI: case NR_RNTI_SFI:
break; break;
case NR_RNTI_INT: case NR_RNTI_INT:
...@@ -253,23 +251,12 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -253,23 +251,12 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
} }
} }
} }
/*if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){ if (pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
printf("*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = %li\n", *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1);
printf("ss->searchSpaceId = %li\n", ss->searchSpaceId);
// FIXME:
//if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){ if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1){
if( (frame%2 == mac->type0_PDCCH_CSS_config.sfn_c) && (slot == mac->type0_PDCCH_CSS_config.n_0) ){ // Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
rel15->num_dci_options = 1; LOG_W(MAC, "[DCI_CONFIG] This seach space should not be configured yet...");
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_0;
config_dci_pdu(mac, rel15, dl_config, NR_RNTI_SI, ss_id);
fill_dci_search_candidates(ss, rel15);
}
} }
}*/ }
if (pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){ if (pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){
if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){ if (ss->searchSpaceId == *pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation){
// Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG // Configure monitoring of PDCCH candidates in Type0-PDCCH common search space on the MCG
......
...@@ -204,12 +204,6 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP, ...@@ -204,12 +204,6 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
/* TODO BCCH SIB1 SIBs */ /* TODO BCCH SIB1 SIBs */
if ((Srb_id & RAB_OFFSET ) == BCCH) { if ((Srb_id & RAB_OFFSET ) == BCCH) {
// memcpy(&buffer_pP[0],
// RC.rrc[Mod_idP]->carrier[CC_id].SIB1_MBMS,
// RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_MBMS);
//
// return RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_MBMS;
memcpy(&buffer_pP[0], memcpy(&buffer_pP[0],
RC.nrrrc[Mod_idP]->carrier.SIB1, RC.nrrrc[Mod_idP]->carrier.SIB1,
RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1); RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1);
......
...@@ -182,43 +182,21 @@ static void init_NR_SI(gNB_RRC_INST *rrc) { ...@@ -182,43 +182,21 @@ static void init_NR_SI(gNB_RRC_INST *rrc) {
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__); LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
// MIB
rrc->carrier.MIB = (uint8_t *) malloc16(4); rrc->carrier.MIB = (uint8_t *) malloc16(4);
rrc->carrier.sizeof_MIB = do_MIB_NR(rrc,0); rrc->carrier.sizeof_MIB = do_MIB_NR(rrc,0);
printf("rrc->carrier.sizeof_MIB = %i\n", rrc->carrier.sizeof_MIB);
// SIB 1
gNB_RrcConfigurationReq *configuration; gNB_RrcConfigurationReq *configuration;
configuration = CALLOC(1,sizeof(gNB_RrcConfigurationReq)); configuration = CALLOC(1,sizeof(gNB_RrcConfigurationReq));
configuration->cell_identity = 3; configuration->cell_identity = 3;
configuration->ssb_SubcarrierOffset = rrc->carrier.ssb_SubcarrierOffset; configuration->ssb_SubcarrierOffset = rrc->carrier.ssb_SubcarrierOffset;
configuration->pdsch_AntennaPorts = rrc->carrier.pdsch_AntennaPorts; configuration->pdsch_AntennaPorts = rrc->carrier.pdsch_AntennaPorts;
configuration->pusch_TargetSNRx10 = rrc->carrier.pusch_TargetSNRx10; configuration->pusch_TargetSNRx10 = rrc->carrier.pusch_TargetSNRx10;
configuration->pucch_TargetSNRx10 = rrc->carrier.pucch_TargetSNRx10; configuration->pucch_TargetSNRx10 = rrc->carrier.pucch_TargetSNRx10;
configuration->scc = rrc->carrier.servingcellconfigcommon; configuration->scc = rrc->carrier.servingcellconfigcommon;
if(rrc->carrier.SIB1 == NULL) rrc->carrier.SIB1 = (uint8_t *) malloc16(100);
rrc->carrier.SIB1 = (uint8_t *) malloc16(100); rrc->carrier.sizeof_SIB1 = do_SIB1_NR(&rrc->carrier, configuration);
rrc->carrier.sizeof_SIB1 = do_SIB1_NR(&rrc->carrier, configuration);
printf("\n");
printf("rrc->carrier.sizeof_SIB1 = %i\n", rrc->carrier.sizeof_SIB1);
for(int i = 0; i<20; i++) {
printf("%i ", rrc->carrier.SIB1[i]);
}
printf("\n\n");
LOG_I(NR_RRC,"Done init_NR_SI\n"); LOG_I(NR_RRC,"Done init_NR_SI\n");
rrc_mac_config_req_gNB(rrc->module_id, rrc_mac_config_req_gNB(rrc->module_id,
......
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