Merge remote-tracking branch 'origin/develop-CSI' into develop-CSI-Measurements
# Conflicts: # openair1/PHY/INIT/nr_init.c # openair1/PHY/INIT/nr_init_ue.c # openair1/PHY/NR_REFSIG/nr_gold.c # openair1/PHY/NR_TRANSPORT/nr_csi_rs.c # openair1/PHY/defs_nr_common.h # openair2/LAYER2/NR_MAC_gNB/config.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c # openair2/RRC/NR/MESSAGES/asn1_msg.c # openair2/RRC/NR/nr_rrc_proto.h # openair2/RRC/NR/rrc_gNB_reconfig.c # targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
This commit is contained in:
@@ -1561,9 +1561,10 @@ set(PHY_SRC_UE
|
||||
|
||||
set(PHY_NR_SRC_COMMON
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_prach_common.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_csi_rs.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_scrambling.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/scrambling_luts.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c
|
||||
)
|
||||
|
||||
set(PHY_NR_SRC
|
||||
@@ -1587,7 +1588,6 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_csi_rs.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gen_mod_table.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/dmrs_nr.c
|
||||
@@ -1635,6 +1635,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/pucch_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/csi_rx.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_uci_tools_common.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c
|
||||
@@ -1886,6 +1887,7 @@ set(NR_L2_SRC_UE
|
||||
${NR_RRC_DIR}/nr_rrc_config.c
|
||||
${NR_UE_RRC_DIR}/rrc_UE.c
|
||||
${NR_UE_RRC_DIR}/rrc_nsa.c
|
||||
${NR_RRC_DIR}/nr_rrc_config.c
|
||||
)
|
||||
|
||||
set (MAC_SRC
|
||||
|
||||
@@ -503,7 +503,6 @@ int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
int get_subband_size(int NPRB,int size) {
|
||||
// implements table 5.2.1.4-2 from 36.214
|
||||
//
|
||||
|
||||
@@ -173,7 +173,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
}
|
||||
|
||||
for (int i=0; i<NUMBER_OF_ULSCH_MAX; i++) {
|
||||
LOG_D(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i);
|
||||
LOG_D(PHY,"Allocating Transport Channel Buffers for ULSCH, UE %d\n",i);
|
||||
AssertFatal((eNB->ulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0)) != NULL,
|
||||
"Can't get eNB ulsch structures\n");
|
||||
// this is the transmission mode for the signalling channels
|
||||
|
||||
@@ -475,20 +475,20 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint16_t bwp_size;//
|
||||
uint16_t bwp_start;//
|
||||
uint8_t subcarrier_spacing;//
|
||||
uint8_t cyclic_prefix;//
|
||||
uint16_t start_rb;
|
||||
uint16_t nr_of_rbs;
|
||||
uint8_t csi_type;//Value: 0:TRS 1:CSI-RS NZP 2:CSI-RS ZP
|
||||
uint8_t row;//Row entry into the CSI Resource location table. [TS38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1] Value: 1-18
|
||||
uint16_t freq_domain;//Value: Up to the 12 LSBs, actual size is determined by the Row parameter
|
||||
uint8_t symb_l0;//The time domain location l0 and firstOFDMSymbolInTimeDomain Value: 0->13
|
||||
uint8_t symb_l1;//
|
||||
uint8_t cdm_type;
|
||||
uint8_t freq_density;//The density field, p and comb offset (for dot5).0: dot5 (even RB), 1: dot5 (odd RB), 2: one, 3: three
|
||||
uint16_t scramb_id;//ScramblingID of the CSI-RS [TS38.214, sec 5.2.2.3.1] Value: 0->1023
|
||||
uint8_t subcarrier_spacing; // subcarrierSpacing [3GPP TS 38.211, sec 4.2], Value:0->4
|
||||
uint8_t cyclic_prefix; // Cyclic prefix type [3GPP TS 38.211, sec 4.2], 0: Normal; 1: Extended
|
||||
uint16_t start_rb; // PRB where this CSI resource starts related to common resource block #0 (CRB#0). Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSIFrequencyOccupation], Value: 0 ->274
|
||||
uint16_t nr_of_rbs; // Number of PRBs across which this CSI resource spans. Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSI-FrequencyOccupation], Value: 24 -> 276
|
||||
uint8_t csi_type; // CSI Type [3GPP TS 38.211, sec 7.4.1.5], Value: 0:TRS; 1:CSI-RS NZP; 2:CSI-RS ZP
|
||||
uint8_t row; // Row entry into the CSI Resource location table. [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 1-18
|
||||
uint16_t freq_domain; // Bitmap defining the frequencyDomainAllocation [3GPP TS 38.211, sec 7.4.1.5.3] [3GPP TS 38.331 CSIResourceMapping], Value: Up to the 12 LSBs, actual size is determined by the Row parameter
|
||||
uint8_t symb_l0; // The time domain location l0 and firstOFDMSymbolInTimeDomain [3GPP TS 38.211, sec 7.4.1.5.3], Value: 0->13
|
||||
uint8_t symb_l1; // The time domain location l1 and firstOFDMSymbolInTimeDomain2 [3GPP TS 38.211, sec 7.4.1.5.3], Value: 2->12
|
||||
uint8_t cdm_type; // The cdm-Type field [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 0: noCDM; 1: fd-CDM2; 2: cdm4-FD2-TD2; 3: cdm8-FD2-TD4
|
||||
uint8_t freq_density; // The density field, p and comb offset (for dot5). [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 0: dot5 (even RB); 1: dot5 (odd RB); 2: one; 3: three
|
||||
uint16_t scramb_id; // ScramblingID of the CSI-RS [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->1023
|
||||
uint8_t power_control_offset; // Ratio of PDSCH EPRE to NZP CSI-RSEPRE [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->23 representing -8 to 15 dB in 1dB steps; 255: L1 is configured with ProfileSSS
|
||||
uint8_t power_control_offset_ss; // Ratio of NZP CSI-RS EPRE to SSB/PBCH block EPRE [3GPP TS 38.214, sec 5.2.2.3.1], Values: 0: -3dB; 1: 0dB; 2: 3dB; 3: 6dB; 255: L1 is configured with ProfileSSS
|
||||
} fapi_nr_dl_config_csirs_pdu_rel15_t;
|
||||
|
||||
|
||||
|
||||
@@ -920,32 +920,24 @@ typedef struct
|
||||
} nfapi_nr_dlsch_pdu_t;
|
||||
*/
|
||||
|
||||
//for csi-rs_pdu:
|
||||
|
||||
//table 3-39
|
||||
typedef struct
|
||||
{
|
||||
uint16_t bwp_size;//
|
||||
uint16_t bwp_start;//
|
||||
uint8_t subcarrier_spacing;//
|
||||
uint8_t cyclic_prefix;//
|
||||
uint16_t start_rb;
|
||||
uint16_t nr_of_rbs;
|
||||
uint8_t csi_type;//Value: 0:TRS 1:CSI-RS NZP 2:CSI-RS ZP
|
||||
uint8_t row;//Row entry into the CSI Resource location table. [TS38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1] Value: 1-18
|
||||
uint16_t freq_domain;//Value: Up to the 12 LSBs, actual size is determined by the Row parameter
|
||||
uint8_t symb_l0;//The time domain location l0 and firstOFDMSymbolInTimeDomain Value: 0->13
|
||||
uint8_t symb_l1;//
|
||||
uint8_t cdm_type;
|
||||
uint8_t freq_density;//The density field, p and comb offset (for dot5).0: dot5 (even RB), 1: dot5 (odd RB), 2: one, 3: three
|
||||
uint16_t scramb_id;//ScramblingID of the CSI-RS [TS38.214, sec 5.2.2.3.1] Value: 0->1023
|
||||
//tx power info
|
||||
uint8_t power_control_offset;//Ratio of PDSCH EPRE to NZP CSI-RSEPRE Value :0->23 representing -8 to 15 dB in 1dB steps
|
||||
uint8_t power_control_offset_ss;//Ratio of SSB/PBCH block EPRE to NZP CSI-RS EPRES 0: -3dB, 1: 0dB, 2: 3dB, 3: 6dB
|
||||
|
||||
uint8_t subcarrier_spacing; // subcarrierSpacing [3GPP TS 38.211, sec 4.2], Value:0->4
|
||||
uint8_t cyclic_prefix; // Cyclic prefix type [3GPP TS 38.211, sec 4.2], 0: Normal; 1: Extended
|
||||
uint16_t start_rb; // PRB where this CSI resource starts related to common resource block #0 (CRB#0). Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSIFrequencyOccupation], Value: 0 ->274
|
||||
uint16_t nr_of_rbs; // Number of PRBs across which this CSI resource spans. Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSI-FrequencyOccupation], Value: 24 -> 276
|
||||
uint8_t csi_type; // CSI Type [3GPP TS 38.211, sec 7.4.1.5], Value: 0:TRS; 1:CSI-RS NZP; 2:CSI-RS ZP
|
||||
uint8_t row; // Row entry into the CSI Resource location table. [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 1-18
|
||||
uint16_t freq_domain; // Bitmap defining the frequencyDomainAllocation [3GPP TS 38.211, sec 7.4.1.5.3] [3GPP TS 38.331 CSIResourceMapping], Value: Up to the 12 LSBs, actual size is determined by the Row parameter
|
||||
uint8_t symb_l0; // The time domain location l0 and firstOFDMSymbolInTimeDomain [3GPP TS 38.211, sec 7.4.1.5.3], Value: 0->13
|
||||
uint8_t symb_l1; // The time domain location l1 and firstOFDMSymbolInTimeDomain2 [3GPP TS 38.211, sec 7.4.1.5.3], Value: 2->12
|
||||
uint8_t cdm_type; // The cdm-Type field [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 0: noCDM; 1: fd-CDM2; 2: cdm4-FD2-TD2; 3: cdm8-FD2-TD4
|
||||
uint8_t freq_density; // The density field, p and comb offset (for dot5). [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 0: dot5 (even RB); 1: dot5 (odd RB); 2: one; 3: three
|
||||
uint16_t scramb_id; // ScramblingID of the CSI-RS [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->1023
|
||||
uint8_t power_control_offset; // Ratio of PDSCH EPRE to NZP CSI-RSEPRE [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->23 representing -8 to 15 dB in 1dB steps; 255: L1 is configured with ProfileSSS
|
||||
uint8_t power_control_offset_ss; // Ratio of NZP CSI-RS EPRE to SSB/PBCH block EPRE [3GPP TS 38.214, sec 5.2.2.3.1], Values: 0: -3dB; 1: 0dB; 2: 3dB; 3: 6dB; 255: L1 is configured with ProfileSSS
|
||||
} nfapi_nr_dl_tti_csi_rs_pdu_rel15_t;
|
||||
|
||||
//for ssb_pdu:
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
@@ -200,8 +200,6 @@ static uint8_t pack_tpm_value(nfapi_dl_config_dci_dl_tpm_t *value, uint8_t **ppW
|
||||
static uint8_t pack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) {
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv;
|
||||
return(
|
||||
push16(value->bwp_size, ppWritePackedMsg, end) &&
|
||||
push16(value->bwp_start, ppWritePackedMsg, end) &&
|
||||
push8(value->subcarrier_spacing, ppWritePackedMsg, end) &&
|
||||
push8(value->cyclic_prefix, ppWritePackedMsg, end) &&
|
||||
push16(value->start_rb, ppWritePackedMsg, end) &&
|
||||
@@ -3627,8 +3625,6 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
|
||||
static uint8_t unpack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) {
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv;
|
||||
return(
|
||||
pull16(ppReadPackedMsg, &value->bwp_size, end) &&
|
||||
pull16(ppReadPackedMsg, &value->bwp_start, end) &&
|
||||
pull8(ppReadPackedMsg, &value->subcarrier_spacing, end) &&
|
||||
pull8(ppReadPackedMsg, &value->cyclic_prefix, end) &&
|
||||
pull16(ppReadPackedMsg, &value->start_rb, end) &&
|
||||
|
||||
+23
-22
@@ -185,26 +185,24 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
LOG_D(PHY,"Initializing PUSCH DMRS Gold sequence with (%x,%x)\n",Nid_pusch[0],Nid_pusch[1]);
|
||||
nr_gold_pusch(gNB, &Nid_pusch[0]);
|
||||
|
||||
//CSI RS init
|
||||
gNB->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
|
||||
uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
|
||||
AssertFatal(csi_rs!=NULL, "NR init: csi reference signal malloc failed\n");
|
||||
|
||||
// CSI RS init
|
||||
// ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32)
|
||||
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
|
||||
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
|
||||
AssertFatal(csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot);
|
||||
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length*sizeof(uint32_t));
|
||||
AssertFatal(csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
for (int id=0; id<NUMBER_OF_NR_CSIRS_MAX; id++) {
|
||||
gNB->nr_csi_rs_info[id] = (nr_csi_rs_info_t *)malloc16_clear(sizeof(nr_csi_rs_info_t));
|
||||
gNB->nr_csi_rs_info[id]->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
|
||||
AssertFatal(gNB->nr_csi_rs_info[id]->nr_gold_csi_rs!=NULL, "NR init: csi reference signal malloc failed\n");
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
gNB->nr_csi_rs_info[id]->nr_gold_csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
|
||||
AssertFatal(gNB->nr_csi_rs_info[id]->nr_gold_csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot);
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
gNB->nr_csi_rs_info[id]->nr_gold_csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length*sizeof(uint32_t));
|
||||
AssertFatal(gNB->nr_csi_rs_info[id]->nr_gold_csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
}
|
||||
}
|
||||
nr_init_csi_rs(&gNB->frame_parms, gNB->nr_csi_rs_info[id]->nr_gold_csi_rs, cfg->cell_config.phy_cell_id.value);
|
||||
}
|
||||
|
||||
nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value);
|
||||
|
||||
for (int id=0; id<NUMBER_OF_NR_SRS_MAX; id++) {
|
||||
gNB->nr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
|
||||
gNB->nr_srs_info[id]->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
|
||||
@@ -348,13 +346,16 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
}
|
||||
free_and_zero(pusch_dmrs);
|
||||
|
||||
uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
|
||||
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
|
||||
for (int symb = 0; symb < fp->symbols_per_slot; symb++)
|
||||
free_and_zero(csi_rs[slot][symb]);
|
||||
free_and_zero(csi_rs[slot]);
|
||||
for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) {
|
||||
uint32_t ***csi_rs = gNB->nr_csi_rs_info[id]->nr_gold_csi_rs;
|
||||
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
|
||||
for (int symb = 0; symb < fp->symbols_per_slot; symb++)
|
||||
free_and_zero(csi_rs[slot][symb]);
|
||||
free_and_zero(csi_rs[slot]);
|
||||
}
|
||||
free_and_zero(csi_rs);
|
||||
free_and_zero(gNB->nr_csi_rs_info[id]);
|
||||
}
|
||||
free_and_zero(csi_rs);
|
||||
|
||||
for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) {
|
||||
for (int i = 0; i < Prx; i++){
|
||||
@@ -614,7 +615,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
|
||||
|
||||
for (int i=0; i<gNB->number_of_nr_ulsch_max; i++) {
|
||||
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max);
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffers for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max);
|
||||
|
||||
gNB->ulsch[i] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL);
|
||||
|
||||
|
||||
@@ -124,9 +124,10 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
ru->num_gNB,NUMBER_OF_gNB_MAX);
|
||||
|
||||
LOG_I(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB);
|
||||
if (ru->do_precoding == 1) {
|
||||
|
||||
if (ru->do_precoding == 1) {
|
||||
int beam_count = 0;
|
||||
if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1
|
||||
if (ru->nb_tx>1) { //Enable beamforming when nb_tx > 1
|
||||
|
||||
for (p=0;p<ru->nb_log_antennas;p++) {
|
||||
//if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0
|
||||
@@ -149,7 +150,7 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
} // for j
|
||||
//}
|
||||
} // for p
|
||||
} //for i
|
||||
} // for i
|
||||
}
|
||||
|
||||
ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*));
|
||||
|
||||
@@ -162,10 +162,11 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
NR_UE_COMMON *const common_vars = &ue->common_vars;
|
||||
NR_UE_PBCH **const pbch_vars = ue->pbch_vars;
|
||||
NR_UE_PRACH **const prach_vars = ue->prach_vars;
|
||||
int i,j,k,l,slot,symb;
|
||||
|
||||
NR_UE_CSI_IM **const csiim_vars = ue->csiim_vars;
|
||||
NR_UE_CSI_RS **const csirs_vars = ue->csirs_vars;
|
||||
NR_UE_SRS **const srs_vars = ue->srs_vars;
|
||||
|
||||
int i,j,k,l,slot,symb;
|
||||
int gNB_id;
|
||||
int th_id;
|
||||
|
||||
@@ -328,9 +329,43 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
prach_vars[gNB_id] = (NR_UE_PRACH *)malloc16_clear(sizeof(NR_UE_PRACH));
|
||||
pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH));
|
||||
csiim_vars[gNB_id] = (NR_UE_CSI_IM *)malloc16_clear(sizeof(NR_UE_CSI_IM));
|
||||
csirs_vars[gNB_id] = (NR_UE_CSI_RS *)malloc16_clear(sizeof(NR_UE_CSI_RS));
|
||||
srs_vars[gNB_id] = (NR_UE_SRS *)malloc16_clear(sizeof(NR_UE_SRS));
|
||||
|
||||
csiim_vars[gNB_id]->active = false;
|
||||
csirs_vars[gNB_id]->active = false;
|
||||
srs_vars[gNB_id]->active = false;
|
||||
|
||||
ue->nr_csi_rs_info = (nr_csi_rs_info_t *)malloc16_clear(sizeof(nr_csi_rs_info_t));
|
||||
ue->nr_csi_rs_info->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
|
||||
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs!=NULL, "NR init: csi reference signal malloc failed\n");
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
ue->nr_csi_rs_info->nr_gold_csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
|
||||
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot);
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb] = (uint32_t *)malloc16(NR_MAX_CSI_RS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
}
|
||||
}
|
||||
ue->nr_csi_rs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
||||
ue->nr_csi_rs_info->csi_rs_generated_signal = (int32_t **)malloc16(NR_MAX_NB_PORTS * sizeof(int32_t *) );
|
||||
for (i=0; i<NR_MAX_NB_PORTS; i++) {
|
||||
ue->nr_csi_rs_info->csi_rs_generated_signal[i] = (int32_t *) malloc16_clear(fp->samples_per_frame_wCP * sizeof(int32_t));
|
||||
}
|
||||
ue->nr_csi_rs_info->csi_rs_received_signal = (int32_t **)malloc16(fp->nb_antennas_rx * sizeof(int32_t *) );
|
||||
ue->nr_csi_rs_info->csi_rs_ls_estimated_channel = (int32_t ***)malloc16(fp->nb_antennas_rx * sizeof(int32_t **) );
|
||||
ue->nr_csi_rs_info->csi_rs_estimated_channel_freq = (int32_t ***)malloc16(fp->nb_antennas_rx * sizeof(int32_t **) );
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
ue->nr_csi_rs_info->csi_rs_received_signal[i] = (int32_t *) malloc16_clear(fp->samples_per_frame_wCP * sizeof(int32_t));
|
||||
ue->nr_csi_rs_info->csi_rs_ls_estimated_channel[i] = (int32_t **) malloc16_clear(NR_MAX_NB_PORTS * sizeof(int32_t *));
|
||||
ue->nr_csi_rs_info->csi_rs_estimated_channel_freq[i] = (int32_t **) malloc16_clear(NR_MAX_NB_PORTS * sizeof(int32_t *));
|
||||
for (j=0; j<NR_MAX_NB_PORTS; j++) {
|
||||
ue->nr_csi_rs_info->csi_rs_ls_estimated_channel[i][j] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size * sizeof(int32_t));
|
||||
ue->nr_csi_rs_info->csi_rs_estimated_channel_freq[i][j] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size * sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
|
||||
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
|
||||
ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
|
||||
ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
|
||||
@@ -511,7 +546,7 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
for (int q=0; q<nb_codewords; q++)
|
||||
for (int q=0; q<nb_codewords; q++)
|
||||
free_and_zero(ue->nr_gold_pdsch[0][slot][symb][q]);
|
||||
free_and_zero(ue->nr_gold_pdsch[0][slot][symb]);
|
||||
}
|
||||
@@ -586,6 +621,32 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]);
|
||||
}
|
||||
|
||||
for (int i=0; i<NR_MAX_NB_PORTS; i++) {
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_generated_signal[i]);
|
||||
}
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_received_signal[i]);
|
||||
for (int j=0; j<NR_MAX_NB_PORTS; j++) {
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_ls_estimated_channel[i][j]);
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq[i][j]);
|
||||
}
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_ls_estimated_channel[i]);
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq[i]);
|
||||
}
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb]);
|
||||
}
|
||||
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs[slot]);
|
||||
}
|
||||
free_and_zero(ue->nr_csi_rs_info->noise_power);
|
||||
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs);
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_generated_signal);
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_received_signal);
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_ls_estimated_channel);
|
||||
free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq);
|
||||
free_and_zero(ue->nr_csi_rs_info);
|
||||
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
free_and_zero(ue->nr_srs_info->srs_received_signal[i]);
|
||||
free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]);
|
||||
@@ -603,6 +664,8 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted);
|
||||
free_and_zero(ue->nr_srs_info);
|
||||
|
||||
free_and_zero(ue->csiim_vars[gNB_id]);
|
||||
free_and_zero(ue->csirs_vars[gNB_id]);
|
||||
free_and_zero(ue->srs_vars[gNB_id]);
|
||||
|
||||
free_and_zero(ue->pbch_vars[gNB_id]);
|
||||
|
||||
@@ -133,27 +133,3 @@ void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
|
||||
uint32_t x1, x2;
|
||||
uint8_t reset;
|
||||
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
|
||||
|
||||
for (uint8_t slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
for (uint8_t symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
|
||||
reset = 1;
|
||||
x2 = ((1<<10) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid));
|
||||
|
||||
for (uint32_t n=0; n<csi_dmrs_init_length; n++) {
|
||||
csi_rs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB);
|
||||
*/
|
||||
void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid);
|
||||
void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid);
|
||||
void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid);
|
||||
void nr_init_csi_rs(NR_DL_FRAME_PARMS *fp, uint32_t ***csi_rs, uint32_t Nid);
|
||||
|
||||
void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid);
|
||||
|
||||
|
||||
@@ -67,4 +67,6 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
|
||||
uint16_t *N_n_scid,
|
||||
uint8_t n_scid);
|
||||
|
||||
void nr_init_csi_rs(NR_DL_FRAME_PARMS *fp, uint32_t ***csi_rs, uint32_t Nid);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,21 +27,54 @@
|
||||
//#define NR_CSIRS_DEBUG
|
||||
|
||||
|
||||
void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
void nr_init_csi_rs(NR_DL_FRAME_PARMS *fp, uint32_t ***csi_rs, uint32_t Nid) {
|
||||
uint32_t x1, x2;
|
||||
uint8_t reset;
|
||||
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
|
||||
for (uint8_t slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
for (uint8_t symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
reset = 1;
|
||||
x2 = ((1<<10) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid));
|
||||
for (uint32_t n=0; n<csi_dmrs_init_length; n++) {
|
||||
csi_rs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nr_generate_csi_rs(NR_DL_FRAME_PARMS frame_parms,
|
||||
int32_t **dataF,
|
||||
int16_t amp,
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params,
|
||||
nr_csi_rs_info_t *nr_csi_rs_info,
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params,
|
||||
uint16_t cell_id,
|
||||
int slot){
|
||||
|
||||
NR_DL_FRAME_PARMS frame_parms=gNB->frame_parms;
|
||||
int32_t **txdataF = gNB->common_vars.txdataF;
|
||||
int txdataF_offset = slot*frame_parms.samples_per_slot_wCP;
|
||||
uint32_t **gold_csi_rs = gNB->nr_gold_csi_rs[slot];
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
LOG_I(NR_PHY, "csi_params->subcarrier_spacing = %i\n", csi_params->subcarrier_spacing);
|
||||
LOG_I(NR_PHY, "csi_params->cyclic_prefix = %i\n", csi_params->cyclic_prefix);
|
||||
LOG_I(NR_PHY, "csi_params->start_rb = %i\n", csi_params->start_rb);
|
||||
LOG_I(NR_PHY, "csi_params->nr_of_rbs = %i\n", csi_params->nr_of_rbs);
|
||||
LOG_I(NR_PHY, "csi_params->csi_type = %i (0:TRS, 1:CSI-RS NZP, 2:CSI-RS ZP)\n", csi_params->csi_type);
|
||||
LOG_I(NR_PHY, "csi_params->row = %i\n", csi_params->row);
|
||||
LOG_I(NR_PHY, "csi_params->freq_domain = %i\n", csi_params->freq_domain);
|
||||
LOG_I(NR_PHY, "csi_params->symb_l0 = %i\n", csi_params->symb_l0);
|
||||
LOG_I(NR_PHY, "csi_params->symb_l1 = %i\n", csi_params->symb_l1);
|
||||
LOG_I(NR_PHY, "csi_params->cdm_type = %i\n", csi_params->cdm_type);
|
||||
LOG_I(NR_PHY, "csi_params->freq_density = %i (0: dot5 (even RB), 1: dot5 (odd RB), 2: one, 3: three)\n", csi_params->freq_density);
|
||||
LOG_I(NR_PHY, "csi_params->scramb_id = %i\n", csi_params->scramb_id);
|
||||
LOG_I(NR_PHY, "csi_params->power_control_offset = %i\n", csi_params->power_control_offset);
|
||||
LOG_I(NR_PHY, "csi_params->power_control_offset_ss = %i\n", csi_params->power_control_offset_ss);
|
||||
#endif
|
||||
|
||||
int dataF_offset = slot*frame_parms.samples_per_slot_wCP;
|
||||
uint32_t **nr_gold_csi_rs = nr_csi_rs_info->nr_gold_csi_rs[slot];
|
||||
//*8(max allocation per RB)*2(QPSK))
|
||||
int csi_rs_length = frame_parms.N_RB_DL<<4;
|
||||
int16_t mod_csi[frame_parms.symbols_per_slot][csi_rs_length>>1] __attribute__((aligned(16)));;
|
||||
uint16_t b = csi_params.freq_domain;
|
||||
uint16_t n, csi_bw, csi_start, p, k, l, mprime, na, kpn, csi_length;
|
||||
uint16_t b = csi_params->freq_domain;
|
||||
uint16_t n, p, k, l, mprime, na, kpn;
|
||||
uint8_t size, ports, kprime, lprime, i, gs;
|
||||
uint8_t j[16], k_n[6], koverline[16], loverline[16];
|
||||
int found = 0;
|
||||
@@ -49,26 +82,27 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
uint8_t fi = 0;
|
||||
double rho, alpha;
|
||||
uint32_t beta = amp;
|
||||
nr_csi_rs_info->csi_rs_generated_signal_bits = log2_approx(amp);
|
||||
|
||||
AssertFatal(b!=0, "Invalid CSI frequency domain mapping: no bit selected in bitmap\n");
|
||||
|
||||
// pre-computed for scrambling id equel to cell id
|
||||
// if the scrambling id is not the cell id we need to re-initialize the rs
|
||||
if (csi_params.scramb_id != cell_id) {
|
||||
if (csi_params->scramb_id != cell_id) {
|
||||
uint8_t reset;
|
||||
uint32_t x1, x2;
|
||||
uint32_t Nid = csi_params.scramb_id;
|
||||
uint32_t Nid = csi_params->scramb_id;
|
||||
for (uint8_t symb=0; symb<frame_parms.symbols_per_slot; symb++) {
|
||||
reset = 1;
|
||||
x2 = ((1<<10) * (frame_parms.symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid));
|
||||
for (uint32_t n=0; n<(csi_rs_length>>5)+1; n++) {
|
||||
gold_csi_rs[symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
nr_gold_csi_rs[symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (csi_params.row) {
|
||||
switch (csi_params->row) {
|
||||
// implementation of table 7.4.1.5.3-1 of 38.211
|
||||
// lprime and kprime are the max value of l' and k'
|
||||
case 1:
|
||||
@@ -86,7 +120,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = 0;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[0] + (i<<2);
|
||||
}
|
||||
break;
|
||||
@@ -106,7 +140,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = 0;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[0];
|
||||
}
|
||||
break;
|
||||
@@ -126,7 +160,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = 0;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[0];
|
||||
}
|
||||
break;
|
||||
@@ -146,7 +180,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[0] + (i<<1);
|
||||
}
|
||||
break;
|
||||
@@ -166,7 +200,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0 + i;
|
||||
loverline[i] = csi_params->symb_l0 + i;
|
||||
koverline[i] = k_n[0];
|
||||
}
|
||||
break;
|
||||
@@ -185,7 +219,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[i];
|
||||
}
|
||||
break;
|
||||
@@ -204,7 +238,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0 + (i>>1);
|
||||
loverline[i] = csi_params->symb_l0 + (i>>1);
|
||||
koverline[i] = k_n[i%2];
|
||||
}
|
||||
break;
|
||||
@@ -223,7 +257,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[i];
|
||||
}
|
||||
break;
|
||||
@@ -242,7 +276,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[i];
|
||||
}
|
||||
break;
|
||||
@@ -261,7 +295,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[i];
|
||||
}
|
||||
break;
|
||||
@@ -280,7 +314,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0 + (i>>2);
|
||||
loverline[i] = csi_params->symb_l0 + (i>>2);
|
||||
koverline[i] = k_n[i%4];
|
||||
}
|
||||
break;
|
||||
@@ -299,7 +333,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[i];
|
||||
}
|
||||
break;
|
||||
@@ -319,9 +353,9 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
if (i<6)
|
||||
loverline[i] = csi_params.symb_l0 + i/3;
|
||||
loverline[i] = csi_params->symb_l0 + i/3;
|
||||
else
|
||||
loverline[i] = csi_params.symb_l1 + i/9;
|
||||
loverline[i] = csi_params->symb_l1 + i/9;
|
||||
koverline[i] = k_n[i%3];
|
||||
}
|
||||
break;
|
||||
@@ -341,9 +375,9 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
if (i<3)
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
else
|
||||
loverline[i] = csi_params.symb_l1;
|
||||
loverline[i] = csi_params->symb_l1;
|
||||
koverline[i] = k_n[i%3];
|
||||
}
|
||||
break;
|
||||
@@ -362,7 +396,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[i];
|
||||
}
|
||||
break;
|
||||
@@ -382,9 +416,9 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
if (i<8)
|
||||
loverline[i] = csi_params.symb_l0 + (i>>2);
|
||||
loverline[i] = csi_params->symb_l0 + (i>>2);
|
||||
else
|
||||
loverline[i] = csi_params.symb_l1 + (i/12);
|
||||
loverline[i] = csi_params->symb_l1 + (i/12);
|
||||
koverline[i] = k_n[i%4];
|
||||
}
|
||||
break;
|
||||
@@ -404,9 +438,9 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
if (i<4)
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
else
|
||||
loverline[i] = csi_params.symb_l1;
|
||||
loverline[i] = csi_params->symb_l1;
|
||||
koverline[i] = k_n[i%4];
|
||||
}
|
||||
break;
|
||||
@@ -425,17 +459,17 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
for (i=0; i<size; i++) {
|
||||
j[i] = i;
|
||||
loverline[i] = csi_params.symb_l0;
|
||||
loverline[i] = csi_params->symb_l0;
|
||||
koverline[i] = k_n[i];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0==1, "Row %d is not valid for CSI Table 7.4.1.5.3-1\n", csi_params.row);
|
||||
AssertFatal(0==1, "Row %d is not valid for CSI Table 7.4.1.5.3-1\n", csi_params->row);
|
||||
}
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
printf(" row %d, n. of ports %d\n k' ",csi_params.row,ports);
|
||||
printf(" row %d, n. of ports %d\n k' ",csi_params->row,ports);
|
||||
for (kp=0; kp<=kprime; kp++)
|
||||
printf("%d, ",kp);
|
||||
printf("l' ");
|
||||
@@ -452,7 +486,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
|
||||
|
||||
// setting the frequency density from its index
|
||||
switch (csi_params.freq_density) {
|
||||
switch (csi_params->freq_density) {
|
||||
|
||||
case 0:
|
||||
rho = 0.5;
|
||||
@@ -484,7 +518,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
#endif
|
||||
|
||||
// CDM group size from CDM type index
|
||||
switch (csi_params.cdm_type) {
|
||||
switch (csi_params->cdm_type) {
|
||||
|
||||
case 0:
|
||||
gs = 1;
|
||||
@@ -506,39 +540,31 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
AssertFatal(0==1, "Invalid cdm type index for CSI\n");
|
||||
}
|
||||
|
||||
// according to 38.214 5.2.2.3.1 last paragraph
|
||||
if (csi_params.start_rb<csi_params.bwp_start)
|
||||
csi_start = csi_params.bwp_start;
|
||||
else
|
||||
csi_start = csi_params.start_rb;
|
||||
if (csi_params.nr_of_rbs > (csi_params.bwp_start+csi_params.bwp_size-csi_start))
|
||||
csi_bw = csi_params.bwp_start+csi_params.bwp_size-csi_start;
|
||||
else
|
||||
csi_bw = csi_params.nr_of_rbs;
|
||||
|
||||
uint16_t csi_length;
|
||||
if (rho < 1) {
|
||||
if (csi_params.freq_density == 0)
|
||||
csi_length = (((csi_bw + csi_start)>>1)<<kprime)<<1;
|
||||
else
|
||||
csi_length = ((((csi_bw + csi_start)>>1)<<kprime)+1)<<1;
|
||||
if (csi_params->freq_density == 0) {
|
||||
csi_length = (((csi_params->start_rb + csi_params->nr_of_rbs)>>1)<<kprime)<<1;
|
||||
} else {
|
||||
csi_length = ((((csi_params->start_rb + csi_params->nr_of_rbs)>>1)<<kprime)+1)<<1;
|
||||
}
|
||||
} else {
|
||||
csi_length = (((uint16_t) rho*(csi_params->start_rb + csi_params->nr_of_rbs))<<kprime)<<1;
|
||||
}
|
||||
else
|
||||
csi_length = (((uint16_t) rho*(csi_bw + csi_start))<<kprime)<<1;
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
printf(" start rb %d, n. rbs %d, csi length %d\n",csi_start,csi_bw,csi_length);
|
||||
printf(" start rb %d, nr of rbs %d, csi length %d\n", csi_params->start_rb, csi_params->nr_of_rbs, csi_length);
|
||||
#endif
|
||||
|
||||
|
||||
// TRS
|
||||
if (csi_params.csi_type == 0) {
|
||||
if (csi_params->csi_type == 0) {
|
||||
// ???
|
||||
}
|
||||
|
||||
// NZP CSI RS
|
||||
if (csi_params.csi_type == 1) {
|
||||
if (csi_params->csi_type == 1) {
|
||||
// assuming amp is the amplitude of SSB channels
|
||||
switch (csi_params.power_control_offset_ss) {
|
||||
switch (csi_params->power_control_offset_ss) {
|
||||
case 0:
|
||||
beta = (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
break;
|
||||
@@ -556,15 +582,15 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
|
||||
for (lp=0; lp<=lprime; lp++){
|
||||
symb = csi_params.symb_l0;
|
||||
nr_modulation(gold_csi_rs[symb+lp], csi_length, DMRS_MOD_ORDER, mod_csi[symb+lp]);
|
||||
if ((csi_params.row == 5) || (csi_params.row == 7) || (csi_params.row == 11) || (csi_params.row == 13) || (csi_params.row == 16))
|
||||
nr_modulation(gold_csi_rs[symb+1], csi_length, DMRS_MOD_ORDER, mod_csi[symb+1]);
|
||||
if ((csi_params.row == 14) || (csi_params.row == 13) || (csi_params.row == 16) || (csi_params.row == 17)) {
|
||||
symb = csi_params.symb_l1;
|
||||
nr_modulation(gold_csi_rs[symb+lp], csi_length, DMRS_MOD_ORDER, mod_csi[symb+lp]);
|
||||
if ((csi_params.row == 13) || (csi_params.row == 16))
|
||||
nr_modulation(gold_csi_rs[symb+1], csi_length, DMRS_MOD_ORDER, mod_csi[symb+1]);
|
||||
symb = csi_params->symb_l0;
|
||||
nr_modulation(nr_gold_csi_rs[symb+lp], csi_length, DMRS_MOD_ORDER, mod_csi[symb+lp]);
|
||||
if ((csi_params->row == 5) || (csi_params->row == 7) || (csi_params->row == 11) || (csi_params->row == 13) || (csi_params->row == 16))
|
||||
nr_modulation(nr_gold_csi_rs[symb+1], csi_length, DMRS_MOD_ORDER, mod_csi[symb+1]);
|
||||
if ((csi_params->row == 14) || (csi_params->row == 13) || (csi_params->row == 16) || (csi_params->row == 17)) {
|
||||
symb = csi_params->symb_l1;
|
||||
nr_modulation(nr_gold_csi_rs[symb+lp], csi_length, DMRS_MOD_ORDER, mod_csi[symb+lp]);
|
||||
if ((csi_params->row == 13) || (csi_params->row == 16))
|
||||
nr_modulation(nr_gold_csi_rs[symb+1], csi_length, DMRS_MOD_ORDER, mod_csi[symb+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -572,14 +598,14 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
uint16_t start_sc = frame_parms.first_carrier_offset;
|
||||
|
||||
// resource mapping according to 38.211 7.4.1.5.3
|
||||
for (n=csi_start; n<(csi_start+csi_bw); n++) {
|
||||
if ( (csi_params.freq_density > 1) || (csi_params.freq_density == (n%2))) { // for freq density 0.5 checks if even or odd RB
|
||||
for (n=csi_params->start_rb; n<(csi_params->start_rb+csi_params->nr_of_rbs); n++) {
|
||||
if ( (csi_params->freq_density > 1) || (csi_params->freq_density == (n%2))) { // for freq density 0.5 checks if even or odd RB
|
||||
for (int ji=0; ji<size; ji++) { // loop over CDM groups
|
||||
for (int s=0 ; s<gs; s++) { // loop over each CDM group size
|
||||
p = s+j[ji]*gs; // port index
|
||||
for (kp=0; kp<=kprime; kp++) { // loop over frequency resource elements within a group
|
||||
k = (start_sc+(n*NR_NB_SC_PER_RB)+koverline[ji]+kp)%(frame_parms.ofdm_symbol_size); // frequency index of current resource element
|
||||
// wf according to tables 7.4.5.3-2 to 7.4.5.3-5
|
||||
// wf according to tables 7.4.5.3-2 to 7.4.5.3-5
|
||||
if (kp == 0)
|
||||
wf = 1;
|
||||
else
|
||||
@@ -602,24 +628,44 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
else
|
||||
wt = -1;
|
||||
}
|
||||
|
||||
// ZP CSI RS
|
||||
if (csi_params.csi_type == 2) {
|
||||
((int16_t*)txdataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+(2*txdataF_offset)] = 0;
|
||||
((int16_t*)txdataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+1+(2*txdataF_offset)] = 0;
|
||||
if (csi_params->csi_type == 2) {
|
||||
((int16_t*)dataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+(2*dataF_offset)] = 0;
|
||||
((int16_t*)dataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+1+(2*dataF_offset)] = 0;
|
||||
}
|
||||
else {
|
||||
((int16_t*)txdataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+(2*txdataF_offset)] = (beta*wt*wf*mod_csi[l][mprime<<1]) >> 15;
|
||||
((int16_t*)txdataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+1+(2*txdataF_offset)] = (beta*wt*wf*mod_csi[l][(mprime<<1) + 1]) >> 15;
|
||||
((int16_t*)dataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+(2*dataF_offset)] = (beta*wt*wf*mod_csi[l][mprime<<1]) >> 15;
|
||||
((int16_t*)dataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+1+(2*dataF_offset)] = (beta*wt*wf*mod_csi[l][(mprime<<1) + 1]) >> 15;
|
||||
}
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
printf("l,k (%d %d) seq. index %d \t port %d \t (%d,%d)\n",l,k,mprime,p+3000,
|
||||
((int16_t*)txdataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+(2*txdataF_offset)],
|
||||
((int16_t*)txdataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+1+(2*txdataF_offset)]);
|
||||
printf("l,k (%d,%d) seq. index %d \t port %d \t (%d,%d)\n",l,k,mprime,p+3000,
|
||||
((int16_t*)dataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+(2*dataF_offset)],
|
||||
((int16_t*)dataF[p])[((l*frame_parms.ofdm_symbol_size + k)<<1)+1+(2*dataF_offset)]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
nr_csi_rs_info->N_cdm_groups = size;
|
||||
nr_csi_rs_info->CDM_group_size = gs;
|
||||
nr_csi_rs_info->kprime = kprime;
|
||||
nr_csi_rs_info->lprime = lprime;
|
||||
nr_csi_rs_info->N_ports = ports;
|
||||
memcpy(nr_csi_rs_info->j,j,16*sizeof(uint8_t));
|
||||
memcpy(nr_csi_rs_info->koverline,koverline,16*sizeof(uint8_t));
|
||||
memcpy(nr_csi_rs_info->loverline,loverline,16*sizeof(uint8_t));
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
LOG_I(NR_PHY, "nr_csi_rs_info->N_ports = %d\n", nr_csi_rs_info->N_ports);
|
||||
LOG_I(NR_PHY, "nr_csi_rs_info->N_cdm_groups = %d\n", nr_csi_rs_info->N_cdm_groups);
|
||||
LOG_I(NR_PHY, "nr_csi_rs_info->CDM_group_size = %d\n", nr_csi_rs_info->CDM_group_size);
|
||||
LOG_I(NR_PHY, "nr_csi_rs_info->kprime = %d\n", nr_csi_rs_info->kprime);
|
||||
LOG_I(NR_PHY, "nr_csi_rs_info->lprime = %d\n", nr_csi_rs_info->lprime);
|
||||
for(int ji=0; ji<nr_csi_rs_info->N_cdm_groups; ji++) {
|
||||
LOG_I(NR_PHY, "(CDM group %d) j = %d, koverline = %d, loverline = %d\n", ji, nr_csi_rs_info->j[ji], nr_csi_rs_info->koverline[ji], nr_csi_rs_info->loverline[ji]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -210,6 +210,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
#endif
|
||||
|
||||
stop_meas(&gNB->dlsch_layer_mapping_stats);
|
||||
|
||||
/// Resource mapping
|
||||
|
||||
// Non interleaved VRB to PRB mapping
|
||||
@@ -231,6 +232,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
for (int nl=0; nl<rel15->nrOfLayers; nl++) {
|
||||
|
||||
int dmrs_port = get_dmrs_port(nl,rel15->dmrsPorts);
|
||||
|
||||
// DMRS params for this dmrs port
|
||||
get_Wt(Wt, dmrs_port, dmrs_Type);
|
||||
get_Wf(Wf, dmrs_port, dmrs_Type);
|
||||
@@ -308,7 +310,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
for (int i=0; i<rel15->rbSize*NR_NB_SC_PER_RB; i++) {
|
||||
/* check if cuurent RE is PTRS RE*/
|
||||
is_ptrs_re = 0;
|
||||
if (ptrs_symbol)
|
||||
/* check for PTRS symbol and set flag for PTRS RE */
|
||||
if(ptrs_symbol){
|
||||
is_ptrs_re = is_ptrs_subcarrier(k,
|
||||
rel15->rnti,
|
||||
nl,
|
||||
@@ -318,6 +321,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
rel15->PTRSReOffset,
|
||||
start_sc,
|
||||
frame_parms->ofdm_symbol_size);
|
||||
}
|
||||
/* Map DMRS Symbol */
|
||||
if ( (dmrs_symbol_map & (1 << l)) &&
|
||||
(k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) {
|
||||
@@ -333,6 +337,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
k_prime&=1;
|
||||
n+=(k_prime)?0:1;
|
||||
}
|
||||
/* Map PTRS Symbol */
|
||||
else if(is_ptrs_re){
|
||||
txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15;
|
||||
txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15;
|
||||
|
||||
@@ -335,9 +335,11 @@ void init_prach_ru_list(RU_t *ru);
|
||||
void free_nr_ru_prach_entry(RU_t *ru, int prach_id);
|
||||
uint8_t get_nr_prach_duration(uint8_t prach_format);
|
||||
|
||||
void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
void nr_generate_csi_rs(NR_DL_FRAME_PARMS frame_parms,
|
||||
int32_t **dataF,
|
||||
int16_t amp,
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params,
|
||||
nr_csi_rs_info_t *nr_csi_rs_info,
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params,
|
||||
uint16_t cell_id,
|
||||
int slot);
|
||||
|
||||
|
||||
@@ -1534,7 +1534,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
||||
#ifdef DEBUG_NR_PUCCH_RX
|
||||
printf("cw_ML %d, metric %d dB\n",cw_ML,corr_dB);
|
||||
#endif
|
||||
LOG_D(PHY,"slot %d PUCCH2 cw_ML %d, metric %d dB\n",slot,cw_ML,corr_dB);
|
||||
LOG_D(PHY,"slot %d PUCCH2 cw_ML %d, metric %d dB\n", slot, cw_ML, corr_dB);
|
||||
|
||||
decodedPayload[0]=(uint64_t)cw_ML;
|
||||
}
|
||||
|
||||
@@ -282,4 +282,17 @@ short filt16_middle4[16] = {
|
||||
4096,8192,8192,8192,8192,8192,8192,8192,4096,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16_end[16] = {
|
||||
4096,8192,8192,8192,12288,16384,16384,16384,0,0,0,0,0,0,0,0};
|
||||
4096,8192,8192,8192,12288,16384,16384,16384,0,0,0,0,0,0,0,0};
|
||||
|
||||
// CSI-RS
|
||||
short filt24_start[24] = {
|
||||
12288,11605,10923,10240,9557,8875,8192,7509,6827,6144,5461,4779,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt24_end[24] = {
|
||||
4096,4779,5461,6144,6827,7509,8192,8875,9557,10240,10923,11605,
|
||||
16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384};
|
||||
|
||||
short filt24_middle[24] = {
|
||||
4096,4779,5461,6144,6827,7509,8192,8875,9557,10240,10923,11605,
|
||||
12288,11605,10923,10240,9557,8875,8192,7509,6827,6144,5461,4779};
|
||||
@@ -193,4 +193,10 @@ extern short filt8_end[8];
|
||||
extern short filt16_start[16];
|
||||
extern short filt16_middle4[16];
|
||||
extern short filt16_end[16];
|
||||
|
||||
/*CSI-RS*/
|
||||
extern short filt24_start[24];
|
||||
extern short filt24_end[24];
|
||||
extern short filt24_middle[24];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,410 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* FILENAME : csi_rx.c
|
||||
*
|
||||
* MODULE :
|
||||
*
|
||||
* DESCRIPTION : function to receive the channel state information
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "nr_transport_proto_ue.h"
|
||||
#include "PHY/phy_extern_nr_ue.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/NR_UE_ESTIMATION/filt16a_32.h"
|
||||
|
||||
|
||||
//#define NR_CSIRS_DEBUG
|
||||
|
||||
bool is_csi_rs_in_symbol(fapi_nr_dl_config_csirs_pdu_rel15_t csirs_config_pdu, int symbol) {
|
||||
|
||||
bool ret = false;
|
||||
|
||||
// 38.211-Table 7.4.1.5.3-1: CSI-RS locations within a slot
|
||||
switch(csirs_config_pdu.row){
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
case 9:
|
||||
if(symbol == csirs_config_pdu.symb_l0) {
|
||||
ret = true;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case 7:
|
||||
case 8:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
if(symbol == csirs_config_pdu.symb_l0 || symbol == (csirs_config_pdu.symb_l0+1) ) {
|
||||
ret = true;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 16:
|
||||
case 17:
|
||||
if(symbol == csirs_config_pdu.symb_l0 || symbol == (csirs_config_pdu.symb_l0+1) ||
|
||||
symbol == csirs_config_pdu.symb_l1 || symbol == (csirs_config_pdu.symb_l1+1)) {
|
||||
ret = true;
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
case 18:
|
||||
if(symbol == csirs_config_pdu.symb_l0 || symbol == (csirs_config_pdu.symb_l0+1) || symbol == (csirs_config_pdu.symb_l0+2) ) {
|
||||
ret = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0==1, "Row %d is not valid for CSI Table 7.4.1.5.3-1\n", csirs_config_pdu.row);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int nr_get_csi_rs_signal(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
|
||||
nr_csi_rs_info_t *nr_csi_rs_info,
|
||||
int32_t **csi_rs_received_signal) {
|
||||
|
||||
int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
|
||||
for (int ant_rx = 0; ant_rx < frame_parms->nb_antennas_rx; ant_rx++) {
|
||||
memset(csi_rs_received_signal[ant_rx], 0, frame_parms->samples_per_frame_wCP*sizeof(int32_t));
|
||||
|
||||
for (int rb = csirs_config_pdu->start_rb; rb < (csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs); rb++) {
|
||||
|
||||
// for freq density 0.5 checks if even or odd RB
|
||||
if(csirs_config_pdu->freq_density <= 1 && csirs_config_pdu->freq_density != (rb % 2)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int cdm_id = 0; cdm_id < nr_csi_rs_info->N_cdm_groups; cdm_id++) {
|
||||
for (int s = 0; s < nr_csi_rs_info->CDM_group_size; s++) {
|
||||
|
||||
// loop over frequency resource elements within a group
|
||||
for (int kp = 0; kp <= nr_csi_rs_info->kprime; kp++) {
|
||||
|
||||
uint16_t k = (frame_parms->first_carrier_offset + (rb*NR_NB_SC_PER_RB)+nr_csi_rs_info->koverline[cdm_id] + kp) % frame_parms->ofdm_symbol_size;
|
||||
|
||||
// loop over time resource elements within a group
|
||||
for (int lp = 0; lp <= nr_csi_rs_info->lprime; lp++) {
|
||||
uint16_t symb = lp + nr_csi_rs_info->loverline[cdm_id];
|
||||
uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size;
|
||||
int16_t *rx_signal = (int16_t*)&rxdataF[ant_rx][symbol_offset];
|
||||
int16_t *rx_csi_rs_signal = (int16_t*)&csi_rs_received_signal[ant_rx][symbol_offset];
|
||||
rx_csi_rs_signal[k<<1] = rx_signal[k<<1];
|
||||
rx_csi_rs_signal[(k<<1)+1] = rx_signal[(k<<1)+1];
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
int dataF_offset = proc->nr_slot_rx*ue->frame_parms.samples_per_slot_wCP;
|
||||
uint16_t port_tx = s+nr_csi_rs_info->j[cdm_id]*nr_csi_rs_info->CDM_group_size;
|
||||
int16_t *tx_csi_rs_signal = (int16_t*)&nr_csi_rs_info->csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset];
|
||||
LOG_I(NR_PHY, "l,k (%2d,%4d) |\tport_tx %d (%4d,%4d)\tant_rx %d (%4d,%4d)\n",
|
||||
symb,
|
||||
k,
|
||||
port_tx+3000,
|
||||
tx_csi_rs_signal[k<<1],
|
||||
tx_csi_rs_signal[(k<<1)+1],
|
||||
ant_rx,
|
||||
rx_csi_rs_signal[k<<1],
|
||||
rx_csi_rs_signal[(k<<1)+1]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_wf(int kp, int s) {
|
||||
int wf = 0;
|
||||
if (kp == 0) {
|
||||
wf = 1;
|
||||
} else {
|
||||
wf = -2*(s%2)+1;
|
||||
}
|
||||
return wf;
|
||||
}
|
||||
|
||||
int get_wt(int lp, int s) {
|
||||
int wt = 0;
|
||||
if (s < 2) {
|
||||
wt = 1;
|
||||
} else if (s < 4) {
|
||||
wt = -2*(lp%2)+1;
|
||||
} else if (s < 6) {
|
||||
wt = -2*(lp/2)+1;
|
||||
} else {
|
||||
if ((lp == 0) || (lp == 3)) {
|
||||
wt = 1;
|
||||
} else {
|
||||
wt = -1;
|
||||
}
|
||||
}
|
||||
return wt;
|
||||
}
|
||||
|
||||
uint32_t calc_power_csirs(uint16_t *x, fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu) {
|
||||
uint64_t sum_x = 0;
|
||||
uint64_t sum_x2 = 0;
|
||||
uint16_t size = 0;
|
||||
for (int rb = csirs_config_pdu->start_rb; rb < (csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs); rb++) {
|
||||
if (csirs_config_pdu->freq_density <= 1 && csirs_config_pdu->freq_density != (rb % 2)) {
|
||||
continue;
|
||||
}
|
||||
sum_x = sum_x + x[rb-csirs_config_pdu->start_rb];
|
||||
sum_x2 = sum_x2 + x[rb]*x[rb-csirs_config_pdu->start_rb];
|
||||
size++;
|
||||
}
|
||||
return sum_x2/size - (sum_x/size)*(sum_x/size);
|
||||
}
|
||||
|
||||
int nr_csi_rs_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
|
||||
nr_csi_rs_info_t *nr_csi_rs_info,
|
||||
int32_t **csi_rs_generated_signal,
|
||||
int32_t **csi_rs_received_signal,
|
||||
int32_t ***csi_rs_estimated_channel_freq,
|
||||
uint32_t *noise_power) {
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
int dataF_offset = proc->nr_slot_rx*ue->frame_parms.samples_per_slot_wCP;
|
||||
*noise_power = 0;
|
||||
|
||||
for (int ant_rx = 0; ant_rx < frame_parms->nb_antennas_rx; ant_rx++) {
|
||||
|
||||
/// LS channel estimation
|
||||
|
||||
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) {
|
||||
memset(nr_csi_rs_info->csi_rs_ls_estimated_channel[ant_rx][port_tx], 0, frame_parms->ofdm_symbol_size*sizeof(int32_t));
|
||||
}
|
||||
|
||||
for (int rb = csirs_config_pdu->start_rb; rb < (csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs); rb++) {
|
||||
|
||||
// for freq density 0.5 checks if even or odd RB
|
||||
if(csirs_config_pdu->freq_density <= 1 && csirs_config_pdu->freq_density != (rb % 2)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int cdm_id = 0; cdm_id < nr_csi_rs_info->N_cdm_groups; cdm_id++) {
|
||||
for (int s = 0; s < nr_csi_rs_info->CDM_group_size; s++) {
|
||||
|
||||
uint16_t port_tx = s+nr_csi_rs_info->j[cdm_id]*nr_csi_rs_info->CDM_group_size;
|
||||
|
||||
// loop over frequency resource elements within a group
|
||||
for (int kp = 0; kp <= nr_csi_rs_info->kprime; kp++) {
|
||||
|
||||
uint16_t kinit = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size;
|
||||
uint16_t k = kinit + nr_csi_rs_info->koverline[cdm_id] + kp;
|
||||
|
||||
// loop over time resource elements within a group
|
||||
for (int lp = 0; lp <= nr_csi_rs_info->lprime; lp++) {
|
||||
uint16_t symb = lp + nr_csi_rs_info->loverline[cdm_id];
|
||||
uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size;
|
||||
int16_t *tx_csi_rs_signal = (int16_t*)&csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset];
|
||||
int16_t *rx_csi_rs_signal = (int16_t*)&csi_rs_received_signal[ant_rx][symbol_offset];
|
||||
int16_t *csi_rs_ls_estimated_channel = (int16_t*)&nr_csi_rs_info->csi_rs_ls_estimated_channel[ant_rx][port_tx][0];
|
||||
|
||||
int16_t csi_rs_ls_estimated_channel_re = (int16_t)(((int32_t)tx_csi_rs_signal[k<<1]*rx_csi_rs_signal[k<<1] + (int32_t)tx_csi_rs_signal[(k<<1)+1]*rx_csi_rs_signal[(k<<1)+1])>>nr_csi_rs_info->csi_rs_generated_signal_bits);
|
||||
int16_t csi_rs_ls_estimated_channel_im = (int16_t)(((int32_t)tx_csi_rs_signal[k<<1]*rx_csi_rs_signal[(k<<1)+1] - (int32_t)tx_csi_rs_signal[(k<<1)+1]*rx_csi_rs_signal[k<<1])>>nr_csi_rs_info->csi_rs_generated_signal_bits);
|
||||
|
||||
// This is not just the LS estimation for each (k,l), but also the sum of the different contributions
|
||||
// for the sake of optimizing the memory used.
|
||||
int w = get_wf(kp,s)*get_wt(lp,s);
|
||||
csi_rs_ls_estimated_channel[kinit<<1] += w*csi_rs_ls_estimated_channel_re;
|
||||
csi_rs_ls_estimated_channel[(kinit<<1)+1] += w*csi_rs_ls_estimated_channel_im;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
for(int symb = 0; symb < NR_SYMBOLS_PER_SLOT; symb++) {
|
||||
if(!is_csi_rs_in_symbol(*csirs_config_pdu,symb)) {
|
||||
continue;
|
||||
}
|
||||
for(int k = 0; k<frame_parms->ofdm_symbol_size; k++) {
|
||||
LOG_I(NR_PHY, "l,k (%2d,%4d) | ", symb, k);
|
||||
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) {
|
||||
uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size;
|
||||
int16_t *tx_csi_rs_signal = (int16_t*)&csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset];
|
||||
int16_t *rx_csi_rs_signal = (int16_t*)&csi_rs_received_signal[ant_rx][symbol_offset];
|
||||
int16_t *csi_rs_ls_estimated_channel = (int16_t*)&nr_csi_rs_info->csi_rs_ls_estimated_channel[ant_rx][port_tx][0];
|
||||
printf("port_tx %d --> ant_rx %d, tx (%4d,%4d), rx (%4d,%4d), ls (%4d,%4d) | ",
|
||||
port_tx+3000, ant_rx,
|
||||
tx_csi_rs_signal[k<<1], tx_csi_rs_signal[(k<<1)+1],
|
||||
rx_csi_rs_signal[k<<1], rx_csi_rs_signal[(k<<1)+1],
|
||||
csi_rs_ls_estimated_channel[k<<1], csi_rs_ls_estimated_channel[(k<<1)+1]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Channel interpolation
|
||||
|
||||
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) {
|
||||
memset(csi_rs_estimated_channel_freq[ant_rx][port_tx], 0, frame_parms->ofdm_symbol_size*sizeof(int32_t));
|
||||
}
|
||||
|
||||
for (int rb = csirs_config_pdu->start_rb; rb < (csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs); rb++) {
|
||||
|
||||
// for freq density 0.5 checks if even or odd RB
|
||||
if(csirs_config_pdu->freq_density <= 1 && csirs_config_pdu->freq_density != (rb % 2)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint16_t k = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size;
|
||||
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) {
|
||||
int16_t *csi_rs_ls_estimated_channel = (int16_t*)&nr_csi_rs_info->csi_rs_ls_estimated_channel[ant_rx][port_tx][k];
|
||||
int16_t *csi_rs_estimated_channel16 = (int16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][k];
|
||||
if( (k == 0) || (k == frame_parms->first_carrier_offset) ) { // Start of OFDM symbol case or first occupied subcarrier case
|
||||
multadd_real_vector_complex_scalar(filt24_start, csi_rs_ls_estimated_channel, csi_rs_estimated_channel16, 24);
|
||||
} else if( ( (k + NR_NB_SC_PER_RB) >= frame_parms->ofdm_symbol_size) ||
|
||||
(rb == (csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs-1)) ) { // End of OFDM symbol case or Last occupied subcarrier case
|
||||
multadd_real_vector_complex_scalar(filt24_end, csi_rs_ls_estimated_channel, csi_rs_estimated_channel16 - 3*sizeof(uint64_t), 24);
|
||||
} else { // Middle case
|
||||
multadd_real_vector_complex_scalar(filt24_middle, csi_rs_ls_estimated_channel, csi_rs_estimated_channel16 - 3*sizeof(uint64_t), 24);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Power noise estimation
|
||||
uint16_t noise_real[frame_parms->nb_antennas_rx][nr_csi_rs_info->N_ports][csirs_config_pdu->nr_of_rbs];
|
||||
uint16_t noise_imag[frame_parms->nb_antennas_rx][nr_csi_rs_info->N_ports][csirs_config_pdu->nr_of_rbs];
|
||||
for (int rb = csirs_config_pdu->start_rb; rb < (csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs); rb++) {
|
||||
if (csirs_config_pdu->freq_density <= 1 && csirs_config_pdu->freq_density != (rb % 2)) {
|
||||
continue;
|
||||
}
|
||||
uint16_t k = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size;
|
||||
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) {
|
||||
int16_t *csi_rs_ls_estimated_channel = (int16_t*)&nr_csi_rs_info->csi_rs_ls_estimated_channel[ant_rx][port_tx][k];
|
||||
int16_t *csi_rs_estimated_channel16 = (int16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][k];
|
||||
noise_real[ant_rx][port_tx][rb-csirs_config_pdu->start_rb] = abs(csi_rs_ls_estimated_channel[0]-csi_rs_estimated_channel16[0]);
|
||||
noise_imag[ant_rx][port_tx][rb-csirs_config_pdu->start_rb] = abs(csi_rs_ls_estimated_channel[1]-csi_rs_estimated_channel16[1]);
|
||||
}
|
||||
}
|
||||
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) {
|
||||
*noise_power += (calc_power_csirs(noise_real[ant_rx][port_tx], csirs_config_pdu) + calc_power_csirs(noise_imag[ant_rx][port_tx],csirs_config_pdu));
|
||||
}
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
for(int k = 0; k<frame_parms->ofdm_symbol_size; k++) {
|
||||
int rb = k >= frame_parms->first_carrier_offset ?
|
||||
(k - frame_parms->first_carrier_offset)/NR_NB_SC_PER_RB :
|
||||
(k + frame_parms->ofdm_symbol_size - frame_parms->first_carrier_offset)/NR_NB_SC_PER_RB;
|
||||
LOG_I(NR_PHY, "(k = %4d) |\t", k);
|
||||
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) {
|
||||
int16_t *csi_rs_ls_estimated_channel = (int16_t*)&nr_csi_rs_info->csi_rs_ls_estimated_channel[ant_rx][port_tx][0];
|
||||
int16_t *csi_rs_estimated_channel16 = (int16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][0];
|
||||
printf("Channel port_tx %d --> ant_rx %d : ls (%4d,%4d), int (%4d,%4d), noise (%4d,%4d) |",
|
||||
port_tx+3000, ant_rx,
|
||||
csi_rs_ls_estimated_channel[k<<1], csi_rs_ls_estimated_channel[(k<<1)+1],
|
||||
csi_rs_estimated_channel16[k<<1], csi_rs_estimated_channel16[(k<<1)+1],
|
||||
rb >= csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs ? 0 : noise_real[ant_rx][port_tx][rb-csirs_config_pdu->start_rb],
|
||||
rb >= csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs ? 0 : noise_imag[ant_rx][port_tx][rb-csirs_config_pdu->start_rb]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
*noise_power /= (frame_parms->nb_antennas_rx*nr_csi_rs_info->N_ports);
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
LOG_I(NR_PHY, "Noise power estimation based on CSI-RS: %i\n", *noise_power);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id) {
|
||||
|
||||
if(!ue->csirs_vars[gNB_id]->active) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = (fapi_nr_dl_config_csirs_pdu_rel15_t*)&ue->csirs_vars[gNB_id]->csirs_config_pdu;
|
||||
|
||||
#ifdef NR_CSIRS_DEBUG
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->subcarrier_spacing = %i\n", csirs_config_pdu->subcarrier_spacing);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->cyclic_prefix = %i\n", csirs_config_pdu->cyclic_prefix);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->start_rb = %i\n", csirs_config_pdu->start_rb);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->nr_of_rbs = %i\n", csirs_config_pdu->nr_of_rbs);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->csi_type = %i (0:TRS, 1:CSI-RS NZP, 2:CSI-RS ZP)\n", csirs_config_pdu->csi_type);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->row = %i\n", csirs_config_pdu->row);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->freq_domain = %i\n", csirs_config_pdu->freq_domain);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->symb_l0 = %i\n", csirs_config_pdu->symb_l0);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->symb_l1 = %i\n", csirs_config_pdu->symb_l1);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->cdm_type = %i\n", csirs_config_pdu->cdm_type);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->freq_density = %i (0: dot5 (even RB), 1: dot5 (odd RB), 2: one, 3: three)\n", csirs_config_pdu->freq_density);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->scramb_id = %i\n", csirs_config_pdu->scramb_id);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->power_control_offset = %i\n", csirs_config_pdu->power_control_offset);
|
||||
LOG_I(NR_PHY, "csirs_config_pdu->power_control_offset_ss = %i\n", csirs_config_pdu->power_control_offset_ss);
|
||||
#endif
|
||||
|
||||
nr_generate_csi_rs(ue->frame_parms,
|
||||
ue->nr_csi_rs_info->csi_rs_generated_signal,
|
||||
AMP,
|
||||
ue->nr_csi_rs_info,
|
||||
(nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *) csirs_config_pdu,
|
||||
ue->frame_parms.first_carrier_offset,
|
||||
proc->nr_slot_rx);
|
||||
|
||||
nr_get_csi_rs_signal(ue,
|
||||
proc,
|
||||
csirs_config_pdu,
|
||||
ue->nr_csi_rs_info,
|
||||
ue->nr_csi_rs_info->csi_rs_received_signal);
|
||||
|
||||
nr_csi_rs_channel_estimation(ue,
|
||||
proc,
|
||||
csirs_config_pdu,
|
||||
ue->nr_csi_rs_info,
|
||||
ue->nr_csi_rs_info->csi_rs_generated_signal,
|
||||
ue->nr_csi_rs_info->csi_rs_received_signal,
|
||||
ue->nr_csi_rs_info->csi_rs_estimated_channel_freq,
|
||||
ue->nr_csi_rs_info->noise_power);
|
||||
return 0;
|
||||
}
|
||||
@@ -354,6 +354,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
|
||||
|
||||
nr_gold_pdsch(ue,ue->scramblingID);
|
||||
|
||||
nr_init_csi_rs(fp, ue->nr_csi_rs_info->nr_gold_csi_rs, fp->Nid_cell);
|
||||
|
||||
// initialize the pusch dmrs
|
||||
uint16_t N_n_scid[2] = {fp->Nid_cell,fp->Nid_cell};
|
||||
int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization
|
||||
|
||||
@@ -782,6 +782,9 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// SRS variables
|
||||
nr_srs_info_t *nr_srs_info[NUMBER_OF_NR_SRS_MAX];
|
||||
|
||||
/// CSI-RS variables
|
||||
nr_csi_rs_info_t *nr_csi_rs_info[NUMBER_OF_NR_CSIRS_MAX];
|
||||
|
||||
uint8_t pbch_configured;
|
||||
char gNB_generate_rar;
|
||||
|
||||
@@ -806,9 +809,6 @@ typedef struct PHY_VARS_gNB_s {
|
||||
// Mask of occupied RBs, per symbol and PRB
|
||||
uint32_t rb_mask_ul[14][9];
|
||||
|
||||
/// CSI RS sequence
|
||||
uint32_t ***nr_gold_csi_rs;
|
||||
|
||||
/// Indicator set to 0 after first SR
|
||||
uint8_t first_sr[NUMBER_OF_NR_SR_MAX];
|
||||
|
||||
|
||||
@@ -666,6 +666,16 @@ typedef struct {
|
||||
fapi_nr_ul_config_prach_pdu prach_pdu;
|
||||
} NR_UE_PRACH;
|
||||
|
||||
typedef struct {
|
||||
bool active;
|
||||
fapi_nr_dl_config_csiim_pdu_rel15_t csiim_config_pdu;
|
||||
} NR_UE_CSI_IM;
|
||||
|
||||
typedef struct {
|
||||
bool active;
|
||||
fapi_nr_dl_config_csirs_pdu_rel15_t csirs_config_pdu;
|
||||
} NR_UE_CSI_RS;
|
||||
|
||||
typedef struct {
|
||||
bool active;
|
||||
fapi_nr_ul_config_srs_pdu srs_config_pdu;
|
||||
@@ -779,6 +789,8 @@ typedef struct {
|
||||
NR_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_CSI_IM *csiim_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_CSI_RS *csirs_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_SRS *srs_vars[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_PUCCH *pucch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_LAYERS>4 ? 2:1]; // two RxTx Threads
|
||||
@@ -934,6 +946,9 @@ typedef struct {
|
||||
/// SRS variables
|
||||
nr_srs_info_t *nr_srs_info;
|
||||
|
||||
/// CSI-RS variables
|
||||
nr_csi_rs_info_t *nr_csi_rs_info;
|
||||
|
||||
//#if defined(UPGRADE_RAT_NR)
|
||||
#if 1
|
||||
SystemInformationBlockType1_nr_t systemInformationBlockType1_nr;
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
|
||||
#define NR_MAX_NB_RBG 18
|
||||
#define NR_MAX_NB_LAYERS 4 // 8
|
||||
#define NR_MAX_NB_PORTS 32
|
||||
#define NR_MAX_NB_HARQ_PROCESSES 16
|
||||
|
||||
#define NR_MAX_PDSCH_TBS 3824
|
||||
@@ -244,6 +245,24 @@ typedef struct {
|
||||
uint32_t *noise_power;
|
||||
} nr_srs_info_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t N_cdm_groups;
|
||||
uint8_t CDM_group_size;
|
||||
uint8_t kprime;
|
||||
uint8_t lprime;
|
||||
uint8_t N_ports;
|
||||
uint8_t j[16];
|
||||
uint8_t koverline[16];
|
||||
uint8_t loverline[16];
|
||||
uint32_t ***nr_gold_csi_rs;
|
||||
uint8_t csi_rs_generated_signal_bits;
|
||||
int32_t **csi_rs_generated_signal;
|
||||
int32_t **csi_rs_received_signal;
|
||||
int32_t ***csi_rs_ls_estimated_channel;
|
||||
int32_t ***csi_rs_estimated_channel_freq;
|
||||
uint32_t *noise_power;
|
||||
} nr_csi_rs_info_t;
|
||||
|
||||
typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS;
|
||||
|
||||
typedef uint32_t (*get_samples_per_slot_t)(int slot, NR_DL_FRAME_PARMS* fp);
|
||||
|
||||
@@ -177,8 +177,8 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
|
||||
NR_gNB_CSIRS_t *csirs = &msgTx->csirs_pdu[i];
|
||||
if (csirs->active == 1) {
|
||||
LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot);
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params = csirs->csirs_pdu.csi_rs_pdu_rel15;
|
||||
nr_generate_csi_rs(gNB, AMP, csi_params, gNB->gNB_config.cell_config.phy_cell_id.value, slot);
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params = &csirs->csirs_pdu.csi_rs_pdu_rel15;
|
||||
nr_generate_csi_rs(gNB->frame_parms, gNB->common_vars.txdataF, AMP, gNB->nr_csi_rs_info[i], csi_params, gNB->gNB_config.cell_config.phy_cell_id.value, slot);
|
||||
csirs->active = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,6 +371,7 @@ int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx);
|
||||
|
||||
int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp);
|
||||
int is_ssb_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp);
|
||||
bool is_csi_rs_in_symbol(fapi_nr_dl_config_csirs_pdu_rel15_t csirs_config_pdu, int symbol);
|
||||
|
||||
/*! \brief This function prepares the dl indication to pass to the MAC
|
||||
@param
|
||||
@@ -421,6 +422,9 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
int n_ss);
|
||||
|
||||
int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id);
|
||||
|
||||
int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
|
||||
|
||||
const char *dl_pdu_type[]={"DCI", "DLSCH", "RA_DLSCH", "SI_DLSCH", "P_DLSCH"};
|
||||
const char *dl_pdu_type[]={"DCI", "DLSCH", "RA_DLSCH", "SI_DLSCH", "P_DLSCH", "CSI_RS", "CSI_IM"};
|
||||
const char *ul_pdu_type[]={"PRACH", "PUCCH", "PUSCH", "SRS"};
|
||||
queue_t nr_rx_ind_queue;
|
||||
queue_t nr_crc_ind_queue;
|
||||
@@ -282,11 +282,15 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0];
|
||||
NR_UE_ULSCH_t *ulsch = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0];
|
||||
NR_UE_PUCCH *pucch_vars = PHY_vars_UE_g[module_id][cc_id]->pucch_vars[thread_id][0];
|
||||
NR_UE_CSI_IM *csiim_vars = PHY_vars_UE_g[module_id][cc_id]->csiim_vars[0];
|
||||
NR_UE_CSI_RS *csirs_vars = PHY_vars_UE_g[module_id][cc_id]->csirs_vars[0];
|
||||
|
||||
if(scheduled_response->dl_config != NULL){
|
||||
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu;
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config;
|
||||
fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu;
|
||||
fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu;
|
||||
pdcch_vars->nb_search_space = 0;
|
||||
|
||||
for (int i = 0; i < dl_config->number_pdus; ++i){
|
||||
@@ -305,10 +309,14 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space);
|
||||
break;
|
||||
case FAPI_NR_DL_CONFIG_TYPE_CSI_IM:
|
||||
LOG_I(PHY,"Received CSI-IM PDU at FAPI\n");
|
||||
csiim_config_pdu = &dl_config->dl_config_list[i].csiim_config_pdu.csiim_config_rel15;
|
||||
memcpy((void*)&(csiim_vars->csiim_config_pdu), (void*)csiim_config_pdu, sizeof(fapi_nr_dl_config_csiim_pdu_rel15_t));
|
||||
csirs_vars->active = true;
|
||||
break;
|
||||
case FAPI_NR_DL_CONFIG_TYPE_CSI_RS:
|
||||
LOG_I(PHY,"Received CSI-RS PDU at FAPI\n");
|
||||
csirs_config_pdu = &dl_config->dl_config_list[i].csirs_config_pdu.csirs_config_rel15;
|
||||
memcpy((void*)&(csirs_vars->csirs_config_pdu), (void*)csirs_config_pdu, sizeof(fapi_nr_dl_config_csirs_pdu_rel15_t));
|
||||
csirs_vars->active = true;
|
||||
break;
|
||||
case FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH:
|
||||
dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
|
||||
|
||||
@@ -1361,7 +1361,6 @@ int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t gNB_id,
|
||||
@@ -1654,6 +1653,23 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
|
||||
}
|
||||
|
||||
// do procedures for CSI-IM
|
||||
if ((ue->csiim_vars[gNB_id]) && (ue->csiim_vars[gNB_id]->active == 1)) {
|
||||
nr_ue_csi_im_procedures(ue, proc, gNB_id);
|
||||
ue->csiim_vars[gNB_id]->active = 0;
|
||||
}
|
||||
|
||||
// do procedures for CSI-RS
|
||||
if ((ue->csirs_vars[gNB_id]) && (ue->csirs_vars[gNB_id]->active == 1)) {
|
||||
for(int symb = 0; symb < NR_SYMBOLS_PER_SLOT; symb++) {
|
||||
if(is_csi_rs_in_symbol(ue->csirs_vars[gNB_id]->csirs_config_pdu,symb)) {
|
||||
nr_slot_fep(ue, proc, symb, nr_slot_rx);
|
||||
}
|
||||
}
|
||||
nr_ue_csi_rs_procedures(ue, proc, gNB_id);
|
||||
ue->csirs_vars[gNB_id]->active = 0;
|
||||
}
|
||||
|
||||
start_meas(&ue->generic_stat);
|
||||
|
||||
if (nr_slot_rx==9) {
|
||||
|
||||
@@ -614,7 +614,7 @@ int main(int argc, char **argv)
|
||||
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
|
||||
printf("-F Input filename (.txt format) for RX conformance testing\n");
|
||||
printf("-G Offset of samples to read from file (0 default)\n");
|
||||
printf("-L <log level, 0(errors), 1(warning), 2(info) 3(debug) 4 (trace)>\n");
|
||||
printf("-L <log level, 0(errors), 1(warning), 2(info) 3(debug) 4 (trace)>\n");
|
||||
printf("-M Multiple SSB positions in burst\n");
|
||||
printf("-N Nid_cell\n");
|
||||
printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||
|
||||
@@ -879,10 +879,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
(get_softmodem_params()->nsa) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_0->number_symbols,
|
||||
dlsch_config_pdu_1_0->start_symbol,
|
||||
mappingtype, 1);
|
||||
mappingtype,
|
||||
1);
|
||||
dlsch_config_pdu_1_0->dmrsConfigType = (mac->DLbwp[0] != NULL) ?
|
||||
(mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
|
||||
|
||||
/* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */
|
||||
if (dlsch_config_pdu_1_0->number_symbols == 2)
|
||||
dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1;
|
||||
@@ -2438,7 +2438,8 @@ uint8_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac,
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI:
|
||||
AssertFatal(1==0,"Measurement report based on CSI-RS not availalble\n");
|
||||
LOG_D(NR_MAC,"Measurement report based on CSI-RS not available\n");
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid CSI report quantity type %d\n",csi_reportconfig->reportQuantity.present);
|
||||
}
|
||||
|
||||
@@ -1047,9 +1047,6 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
|
||||
if(mac->cg != NULL){ // we have a cg
|
||||
|
||||
nr_schedule_csirs_reception(mac, rx_frame, rx_slot);
|
||||
nr_schedule_csi_for_im(mac, rx_frame, rx_slot);
|
||||
|
||||
dcireq.module_id = mod_id;
|
||||
dcireq.gNB_index = gNB_index;
|
||||
dcireq.cc_id = cc_id;
|
||||
@@ -1059,6 +1056,10 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
|
||||
mac->dl_config_request = dcireq.dl_config_req;
|
||||
|
||||
nr_schedule_csirs_reception(mac, rx_frame, rx_slot);
|
||||
nr_schedule_csi_for_im(mac, rx_frame, rx_slot);
|
||||
dcireq.dl_config_req = mac->dl_config_request;
|
||||
|
||||
fill_scheduled_response(&scheduled_response, &dcireq.dl_config_req, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
@@ -2357,9 +2358,17 @@ void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
NR_CSI_IM_Resource_t *imcsi;
|
||||
int period, offset;
|
||||
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
|
||||
int mu = mac->DLbwp[dl_bwp_id-1] ?
|
||||
mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing :
|
||||
mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing;
|
||||
|
||||
NR_BWP_t *genericParameters = NULL;
|
||||
if(dl_bwp_id > 0 && mac->DLbwp[dl_bwp_id-1]) {
|
||||
genericParameters = &mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters;
|
||||
} else {
|
||||
genericParameters = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
|
||||
}
|
||||
|
||||
int mu = genericParameters->subcarrierSpacing;
|
||||
uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
for (int id = 0; id < csi_measconfig->csi_IM_ResourceToAddModList->list.count; id++){
|
||||
imcsi = csi_measconfig->csi_IM_ResourceToAddModList->list.array[id];
|
||||
@@ -2367,11 +2376,8 @@ void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0)
|
||||
continue;
|
||||
fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csiim_config_pdu.csiim_config_rel15;
|
||||
const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1];
|
||||
const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth:
|
||||
mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth;
|
||||
csiim_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE);
|
||||
csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE);
|
||||
csiim_config_pdu->bwp_size = bwp_size;
|
||||
csiim_config_pdu->bwp_start = bwp_start;
|
||||
csiim_config_pdu->subcarrier_spacing = mu;
|
||||
csiim_config_pdu->start_rb = imcsi->freqBand->startingRB;
|
||||
csiim_config_pdu->nr_of_rbs = imcsi->freqBand->nrofRBs;
|
||||
@@ -2393,7 +2399,7 @@ void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
AssertFatal(1==0, "Invalid CSI-IM pattern\n");
|
||||
}
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_IM;
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
dl_config->number_pdus += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2417,9 +2423,17 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi;
|
||||
int period, offset;
|
||||
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
|
||||
int mu = mac->DLbwp[dl_bwp_id-1] ?
|
||||
mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing :
|
||||
mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing;
|
||||
|
||||
NR_BWP_t *genericParameters = NULL;
|
||||
if(dl_bwp_id > 0 && mac->DLbwp[dl_bwp_id-1]) {
|
||||
genericParameters = &mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters;
|
||||
} else {
|
||||
genericParameters = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
|
||||
}
|
||||
|
||||
int mu = genericParameters->subcarrierSpacing;
|
||||
uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
|
||||
for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){
|
||||
nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id];
|
||||
@@ -2428,17 +2442,23 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
continue;
|
||||
LOG_D(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot);
|
||||
fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15;
|
||||
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping;
|
||||
|
||||
const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1];
|
||||
const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth:
|
||||
mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth;
|
||||
csirs_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE);
|
||||
csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE);
|
||||
csirs_config_pdu->subcarrier_spacing = mu;
|
||||
csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB;
|
||||
csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs;
|
||||
csirs_config_pdu->cyclic_prefix = genericParameters->cyclicPrefix ? *genericParameters->cyclicPrefix : 0;
|
||||
|
||||
// According to last paragraph of TS 38.214 5.2.2.3.1
|
||||
if (resourceMapping.freqBand.startingRB < bwp_start) {
|
||||
csirs_config_pdu->start_rb = bwp_start;
|
||||
} else {
|
||||
csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB;
|
||||
}
|
||||
if (resourceMapping.freqBand.nrofRBs > (bwp_start + bwp_size - csirs_config_pdu->start_rb)) {
|
||||
csirs_config_pdu->nr_of_rbs = bwp_start + bwp_size - csirs_config_pdu->start_rb;
|
||||
} else {
|
||||
csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs;
|
||||
}
|
||||
AssertFatal(csirs_config_pdu->nr_of_rbs >= 24, "CSI-RS has %d RBs, but the minimum is 24\n", csirs_config_pdu->nr_of_rbs);
|
||||
|
||||
csirs_config_pdu->csi_type = 1; // NZP-CSI-RS
|
||||
csirs_config_pdu->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain;
|
||||
if (resourceMapping.firstOFDMSymbolInTimeDomain2)
|
||||
@@ -2449,6 +2469,11 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
&& (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs))
|
||||
csirs_config_pdu->freq_density--;
|
||||
csirs_config_pdu->scramb_id = nzpcsi->scramblingID;
|
||||
csirs_config_pdu->power_control_offset = nzpcsi->powerControlOffset + 8;
|
||||
if (nzpcsi->powerControlOffsetSS)
|
||||
csirs_config_pdu->power_control_offset_ss = *nzpcsi->powerControlOffsetSS;
|
||||
else
|
||||
csirs_config_pdu->power_control_offset_ss = 1; // 0 dB
|
||||
switch(resourceMapping.frequencyDomainAllocation.present){
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1:
|
||||
csirs_config_pdu->row = 1;
|
||||
@@ -2529,7 +2554,7 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n");
|
||||
}
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_RS;
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
dl_config->number_pdus += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *
|
||||
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
|
||||
if (rlc_bearer2add_list)
|
||||
// keep lcids
|
||||
for (int i=0;i<rlc_bearer2add_list->list.count;i++) {
|
||||
@@ -433,9 +432,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int minRXTXTIMEpdsch,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
NR_BCCH_BCH_Message_t *mib,
|
||||
int add_ue,
|
||||
int add_ue,
|
||||
uint32_t rnti,
|
||||
NR_CellGroupConfig_t *CellGroup) {
|
||||
NR_CellGroupConfig_t *CellGroup) {
|
||||
|
||||
if (scc != NULL ) {
|
||||
AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present);
|
||||
@@ -645,6 +644,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
}
|
||||
else
|
||||
AssertFatal(1==0,"Either initial BWP or active BWP should always be present\n");
|
||||
|
||||
sched_ctrl->search_space = get_searchspace(scc, bwpd, target_ss);
|
||||
sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss);
|
||||
sched_ctrl->sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP],
|
||||
@@ -654,16 +654,17 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
genericParameters,
|
||||
NULL);
|
||||
sched_ctrl->maxL = 2;
|
||||
|
||||
if (CellGroup->spCellConfig &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup
|
||||
)
|
||||
compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, Mod_idP);
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup) {
|
||||
compute_csi_bitlen(CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, Mod_idP);
|
||||
}
|
||||
}
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT);
|
||||
|
||||
|
||||
return(0);
|
||||
|
||||
}// END rrc_mac_config_req_gNB
|
||||
|
||||
@@ -1381,7 +1381,8 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position,
|
||||
nrOfSymbols,
|
||||
startSymbolIndex,
|
||||
mappingtype, 1);
|
||||
mappingtype,
|
||||
1);
|
||||
|
||||
uint8_t tb_scaling = 0;
|
||||
int R, Qm;
|
||||
@@ -1660,7 +1661,8 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
scc->dmrs_TypeA_Position,
|
||||
nrOfSymbols,
|
||||
startSymbolIndex,
|
||||
mappingtype, 1);
|
||||
mappingtype,
|
||||
1);
|
||||
|
||||
uint16_t N_DMRS_SLOT = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
@@ -1701,7 +1703,6 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
int rbSize = 0;
|
||||
uint8_t tb_scaling = 0;
|
||||
uint16_t *vrb_map = cc[CC_id].vrb_map;
|
||||
// increase PRBs until we get to BWPSize or TBS is bigger than MAC PDU size
|
||||
do {
|
||||
if(rbSize < BWPSize)
|
||||
rbSize++;
|
||||
@@ -1833,7 +1834,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dci_payload.pucch_resource_indicator = delta_PRI; // This is delta_PRI from 9.2.1 in 38.213
|
||||
dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator;
|
||||
|
||||
LOG_I(NR_MAC,
|
||||
LOG_D(NR_MAC,
|
||||
"[RAPROC] DCI 1_0 payload: freq_alloc %d (%d,%d,%d), time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d pucchres %d harqtiming %d\n",
|
||||
dci_payload.frequency_domain_assignment.val,
|
||||
pdsch_pdu_rel15->rbStart,
|
||||
@@ -1846,7 +1847,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
dci_payload.pucch_resource_indicator,
|
||||
dci_payload.pdsch_to_harq_feedback_timing_indicator.val);
|
||||
|
||||
LOG_I(NR_MAC,
|
||||
LOG_D(NR_MAC,
|
||||
"[RAPROC] DCI params: rnti 0x%x, rnti_type %d, dci_format %d coreset params: FreqDomainResource %llx, start_symbol %d n_symb %d, BWPsize %d\n",
|
||||
pdcch_pdu_rel15->dci_pdu[0].RNTI,
|
||||
NR_RNTI_TC,
|
||||
|
||||
@@ -599,7 +599,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
/* the retransmission will use a different time domain allocation, check
|
||||
* that we have enough resources */
|
||||
NR_pdsch_semi_static_t temp_ps = *ps;
|
||||
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd,tda, ps->nrOfLayers, sched_ctrl, &temp_ps);
|
||||
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, &temp_ps);
|
||||
while (rbStart < bwpSize &&
|
||||
!(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
|
||||
rbStart++;
|
||||
@@ -724,7 +724,7 @@ 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;
|
||||
|
||||
layers[UE_id] = ps->nrOfLayers; // initialization of layers to the previous value in the strcuture
|
||||
layers[UE_id] = ps->nrOfLayers; // initialization of layers to the previous value in the structure
|
||||
|
||||
/* Calculate Throughput */
|
||||
const float a = 0.0005f; // corresponds to 200ms window
|
||||
@@ -868,9 +868,7 @@ 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;
|
||||
|
||||
if (ps->nrOfLayers != layers[UE_id] ||
|
||||
ps->time_domain_allocation != tda ||
|
||||
sched_ctrl->update_pdsch_ps) {
|
||||
if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) {
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, layers[UE_id], sched_ctrl, ps);
|
||||
sched_ctrl->update_pdsch_ps = false;
|
||||
}
|
||||
@@ -1009,8 +1007,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
if (!is_xlsch_in_slot(gNB_mac->dlsch_slot_bitmap[slot / 64], slot))
|
||||
return;
|
||||
|
||||
//if (slot==7 || slot == 17) return;
|
||||
|
||||
/* PREPROCESSOR */
|
||||
gNB_mac->pre_processor_dl(module_id, frame, slot);
|
||||
|
||||
@@ -1384,7 +1380,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
break;
|
||||
struct timespec time_request;
|
||||
clock_gettime(CLOCK_REALTIME, &time_request);
|
||||
if (lcid>=4)
|
||||
if (lcid>=4)
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d [UE %04x]: Time %lu.%lu: %d bytes %s %d -> DLSCH (ndata %lu, remaining size %lu)\n",
|
||||
frame,
|
||||
|
||||
@@ -163,7 +163,8 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
scc->dmrs_TypeA_Position,
|
||||
NrOfSymbols,
|
||||
StartSymbolIndex,
|
||||
mappingtype, 1);
|
||||
mappingtype,
|
||||
1);
|
||||
|
||||
/*
|
||||
AssertFatal(k0==0,"k0 is not zero for Initial DL BWP TimeDomain Alloc\n");
|
||||
|
||||
@@ -156,7 +156,7 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch,
|
||||
uint16_t target_coderate,target_qm;
|
||||
if (cqi_idx>0) {
|
||||
int cqi_table = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table;
|
||||
if (cqi_table != mcs_table_idx)
|
||||
if (cqi_table != mcs_table_idx)
|
||||
LOG_W(NR_MAC,"Indices of MCS tables don't correspond yet, cri_ri_li_pmi_cqi_report.cqi_table %d, mcs_table_index %d\n",cqi_table,mcs_table_idx);
|
||||
switch (cqi_table) {
|
||||
case 0:
|
||||
@@ -456,7 +456,6 @@ void fill_pdcch_vrb_map(gNB_MAC_INST *mac,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool nr_find_nb_rb(uint16_t Qm,
|
||||
uint16_t R,
|
||||
uint8_t nrOfLayers,
|
||||
@@ -516,8 +515,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
{
|
||||
bool reset_dmrs = false;
|
||||
|
||||
NR_BWP_DownlinkDedicated_t *bwpd;
|
||||
|
||||
NR_BWP_DownlinkDedicated_t *bwpd = NULL;
|
||||
if (bwp && bwp->bwp_Dedicated) {
|
||||
bwpd = bwp->bwp_Dedicated;
|
||||
} else {
|
||||
@@ -577,8 +575,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
ps->nrOfLayers = 1;
|
||||
}
|
||||
else {
|
||||
if (ps->nrOfLayers != layers ||
|
||||
ps->numDmrsCdmGrpsNoData == 0) {
|
||||
LOG_D(NR_MAC,"checking layers\n");
|
||||
if (ps->nrOfLayers != layers || ps->numDmrsCdmGrpsNoData == 0) {
|
||||
reset_dmrs = true;
|
||||
ps->nrOfLayers = layers;
|
||||
set_dl_dmrs_ports(ps);
|
||||
@@ -968,8 +966,6 @@ int nr_get_default_pucch_res(int pucch_ResourceCommon) {
|
||||
return(default_pucch_csset[pucch_ResourceCommon]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
|
||||
NR_ControlResourceSet_t *coreset,
|
||||
NR_BWP_t *bwp,
|
||||
@@ -1284,7 +1280,6 @@ void set_r_pucch_parms(int rsetindex,
|
||||
*start_symbol_index = default_pucch_firstsymb[rsetindex];
|
||||
}
|
||||
|
||||
|
||||
void prepare_dci(const NR_CellGroupConfig_t *CellGroup,
|
||||
dci_pdu_rel15_t *dci_pdu_rel15,
|
||||
nr_dci_format_t format,
|
||||
@@ -2201,16 +2196,16 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
|
||||
UE_info->CellGroup[UE_id] = CellGroup;
|
||||
add_nr_list(&UE_info->list, UE_id);
|
||||
memset(&UE_info->mac_stats[UE_id], 0, sizeof(NR_mac_stats_t));
|
||||
if (CellGroup &&
|
||||
CellGroup->spCellConfig &&
|
||||
if (CellGroup &&
|
||||
CellGroup->spCellConfig &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig &&
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup
|
||||
)
|
||||
CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup) {
|
||||
compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP);
|
||||
}
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
memset(sched_ctrl, 0, sizeof(*sched_ctrl));
|
||||
sched_ctrl->set_mcs = TRUE;
|
||||
sched_ctrl->set_mcs = true;
|
||||
sched_ctrl->lcid_mask = 0;
|
||||
if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) {
|
||||
sched_ctrl->lcid_mask = 1<<DL_SCH_LCID_DTCH;
|
||||
@@ -2478,7 +2473,6 @@ void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
pdsch_to_harq_feedback[i] = i+1;
|
||||
if(pdsch_to_harq_feedback[i]>*max_fb_time)
|
||||
*max_fb_time = pdsch_to_harq_feedback[i];
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -2496,8 +2490,6 @@ void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void nr_csirs_scheduling(int Mod_idP,
|
||||
frame_t frame,
|
||||
sub_frame_t slot,
|
||||
@@ -2525,7 +2517,7 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
int period, offset;
|
||||
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
|
||||
NR_BWP_t *genericParameters = sched_ctrl->active_bwp ?
|
||||
NR_BWP_t *genericParameters = sched_ctrl->active_bwp ?
|
||||
&sched_ctrl->active_bwp->bwp_Common->genericParameters:
|
||||
&gNB_mac->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){
|
||||
@@ -2544,16 +2536,27 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
|
||||
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csirs_pdu_rel15 = &dl_tti_csirs_pdu->csi_rs_pdu.csi_rs_pdu_rel15;
|
||||
|
||||
csirs_pdu_rel15->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth,275);
|
||||
csirs_pdu_rel15->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,275);
|
||||
csirs_pdu_rel15->subcarrier_spacing = genericParameters->subcarrierSpacing;
|
||||
if (genericParameters->cyclicPrefix)
|
||||
csirs_pdu_rel15->cyclic_prefix = *genericParameters->cyclicPrefix;
|
||||
else
|
||||
csirs_pdu_rel15->cyclic_prefix = 0;
|
||||
|
||||
csirs_pdu_rel15->start_rb = resourceMapping.freqBand.startingRB;
|
||||
csirs_pdu_rel15->nr_of_rbs = resourceMapping.freqBand.nrofRBs;
|
||||
// According to last paragraph of TS 38.214 5.2.2.3.1
|
||||
uint16_t BWPSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
uint16_t BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
|
||||
if (resourceMapping.freqBand.startingRB < BWPStart) {
|
||||
csirs_pdu_rel15->start_rb = BWPStart;
|
||||
} else {
|
||||
csirs_pdu_rel15->start_rb = resourceMapping.freqBand.startingRB;
|
||||
}
|
||||
if (resourceMapping.freqBand.nrofRBs > (BWPStart + BWPSize - csirs_pdu_rel15->start_rb)) {
|
||||
csirs_pdu_rel15->nr_of_rbs = BWPStart + BWPSize - csirs_pdu_rel15->start_rb;
|
||||
} else {
|
||||
csirs_pdu_rel15->nr_of_rbs = resourceMapping.freqBand.nrofRBs;
|
||||
}
|
||||
AssertFatal(csirs_pdu_rel15->nr_of_rbs >= 24, "CSI-RS has %d RBs, but the minimum is 24\n", csirs_pdu_rel15->nr_of_rbs);
|
||||
|
||||
csirs_pdu_rel15->csi_type = 1; // NZP-CSI-RS
|
||||
csirs_pdu_rel15->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain;
|
||||
if (resourceMapping.firstOFDMSymbolInTimeDomain2)
|
||||
@@ -2574,20 +2577,20 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
csirs_pdu_rel15->row = 1;
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2:
|
||||
csirs_pdu_rel15->row = 2;
|
||||
csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) |
|
||||
((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0));
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4:
|
||||
csirs_pdu_rel15->row = 4;
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other:
|
||||
csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f;
|
||||
@@ -2599,18 +2602,18 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p2:
|
||||
csirs_pdu_rel15->row = 3;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p4:
|
||||
csirs_pdu_rel15->row = 5;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p8:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 8;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
}
|
||||
else{
|
||||
int num_k = 0;
|
||||
@@ -2619,12 +2622,12 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
if(num_k==4) {
|
||||
csirs_pdu_rel15->row = 6;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 7;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2632,12 +2635,12 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 10;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 9;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
}
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p16:
|
||||
@@ -2646,24 +2649,24 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
else
|
||||
csirs_pdu_rel15->row = 11;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2);
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p24:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 14;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2));
|
||||
vrb_map[rb] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2));
|
||||
}
|
||||
else{
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) {
|
||||
csirs_pdu_rel15->row = 15;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 3);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 3);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 13;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2));
|
||||
vrb_map[rb] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2671,18 +2674,18 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) {
|
||||
csirs_pdu_rel15->row = 17;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2));
|
||||
vrb_map[rb] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2));
|
||||
}
|
||||
else{
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) {
|
||||
csirs_pdu_rel15->row = 18;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 3);
|
||||
vrb_map[rb] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 3);
|
||||
}
|
||||
else {
|
||||
csirs_pdu_rel15->row = 16;
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2));
|
||||
vrb_map[rb] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -284,7 +284,6 @@ void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void get_n1n2_o1o2_singlepanel(int *n1, int *n2, int *o1, int *o2,
|
||||
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo *morethantwo) {
|
||||
|
||||
@@ -551,7 +550,6 @@ void compute_cqi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
AssertFatal(1==0,"Sub-band CQI reporting not yet supported");
|
||||
}
|
||||
|
||||
|
||||
//!TODO : same function can be written to handle csi_resources
|
||||
void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_info, int UE_id, module_id_t Mod_idP){
|
||||
uint8_t csi_report_id = 0;
|
||||
@@ -716,7 +714,6 @@ void nr_csi_meas_reporting(int Mod_idP,
|
||||
pucch_Config = RC.nrmac[Mod_idP]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
|
||||
}
|
||||
|
||||
|
||||
for (int csi_report_id = 0; csi_report_id < csi_measconfig->csi_ReportConfigToAddModList->list.count; csi_report_id++){
|
||||
NR_CSI_ReportConfig_t *csirep = csi_measconfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
|
||||
|
||||
@@ -739,7 +736,7 @@ void nr_csi_meas_reporting(int Mod_idP,
|
||||
if (*pucchresset->resourceList.list.array[res_index] == pucchcsires->pucch_Resource)
|
||||
break;
|
||||
AssertFatal(res_index < n,
|
||||
"CSI pucch resource %ld not found among PUCCH resources\n",pucchcsires->pucch_Resource);
|
||||
"CSI pucch resource %ld not found among PUCCH resources\n", pucchcsires->pucch_Resource);
|
||||
|
||||
// find free PUCCH that is in order with possibly existing PUCCH
|
||||
// schedulings (other CSI, SR)
|
||||
@@ -934,13 +931,10 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
|
||||
uint8_t idx = 0;
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
int bwp_id = sched_ctrl->active_bwp ? 1 : 0;
|
||||
int bwp_id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0;
|
||||
NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_Downlink_t *bwp = bwp_id>0 ?
|
||||
sched_ctrl->active_bwp:
|
||||
NULL;
|
||||
NR_BWP_Downlink_t *bwp = bwp_id>0 ? sched_ctrl->active_bwp : NULL;
|
||||
|
||||
|
||||
//bwp indicator
|
||||
int n_dl_bwp=0;
|
||||
if (CellGroup->spCellConfig->spCellConfigDedicated &&
|
||||
@@ -1591,7 +1585,6 @@ bool test_acknack_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// this function returns an index to NR_sched_pucch structure
|
||||
// currently this structure contains PUCCH0 at index 0 and PUCCH2 at index 1
|
||||
// if the function returns -1 it was not possible to schedule acknack
|
||||
@@ -1664,10 +1657,10 @@ int nr_acknack_scheduling(int mod_id,
|
||||
const int f = pucch->frame;
|
||||
const int s = pucch->ul_slot;
|
||||
LOG_D(NR_MAC, "In %s: %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n", __FUNCTION__, frame, slot, f, s);
|
||||
if (!(csi_pucch
|
||||
if (!(csi_pucch
|
||||
&& csi_pucch->csi_bits > 0
|
||||
&& csi_pucch->frame == f
|
||||
&& csi_pucch->ul_slot == s))
|
||||
&& csi_pucch->ul_slot == s))
|
||||
nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id);
|
||||
memset(pucch, 0, sizeof(*pucch));
|
||||
pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f;
|
||||
@@ -1679,7 +1672,7 @@ int nr_acknack_scheduling(int mod_id,
|
||||
// skip the CSI PUCCH if it is present and if in the next frame/slot
|
||||
// and if we don't multiplex
|
||||
csi_pucch->r_pucch=-1;
|
||||
if (csi_pucch
|
||||
if (csi_pucch
|
||||
&& csi_pucch->csi_bits > 0
|
||||
&& csi_pucch->frame == pucch->frame
|
||||
&& csi_pucch->ul_slot == pucch->ul_slot
|
||||
@@ -2008,7 +2001,6 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot)
|
||||
pdu->sr_flag = 1;
|
||||
nfapi_allocated = true;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -932,7 +932,7 @@ bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t
|
||||
}
|
||||
else {
|
||||
num_slots_per_period = n;
|
||||
last_ul_slot = sched_ctrl->last_ul_slot;
|
||||
last_ul_slot = sched_ctrl->last_ul_slot;
|
||||
}
|
||||
|
||||
last_ul_sched = sched_ctrl->last_ul_frame * n + last_ul_slot;
|
||||
|
||||
+245
-298
@@ -395,7 +395,6 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
NR_BWP_DownlinkCommon_t *initialDownlinkBWP=&ServCellCom->downlinkConfigCommon.initialDownlinkBWP;
|
||||
initialDownlinkBWP->genericParameters=
|
||||
configuration->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
|
||||
|
||||
for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.count; i++) {
|
||||
asn1cSequenceAdd(ServCellCom->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list,
|
||||
@@ -403,7 +402,6 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
nrMultiBandInfo->freqBandIndicatorNR = configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[i];
|
||||
}
|
||||
|
||||
|
||||
int scs_scaling0 = 1<<(configuration->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing);
|
||||
int scs_scaling = scs_scaling0;
|
||||
int scs_scaling2 = scs_scaling0;
|
||||
@@ -512,7 +510,6 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
ss7->searchSpaceType->choice.common=calloc(1,sizeof(*ss7->searchSpaceType->choice.common));
|
||||
ss7->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0 = calloc(1,sizeof(*ss7->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0));
|
||||
|
||||
|
||||
asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1, 0);
|
||||
asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation, 7);
|
||||
asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->pagingSearchSpace, 5);
|
||||
@@ -1005,60 +1002,221 @@ long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS) {
|
||||
return c_srs;
|
||||
}
|
||||
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
int dl_antenna_ports,
|
||||
int curr_bwp,
|
||||
int do_csirs) {
|
||||
void fill_default_csi_MeasConfig(int uid,
|
||||
NR_SetupRelease_CSI_MeasConfig_t *setupRelease_csi_MeasConfig,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
rrc_gNB_carrier_data_t *carrier) {
|
||||
|
||||
if (do_csirs) {
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
|
||||
nzpcsi0->nzp_CSI_RS_ResourceId = 0;
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping;
|
||||
switch (dl_antenna_ports) {
|
||||
case 1:
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
|
||||
break;
|
||||
case 2:
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Number of ports not yet supported\n");
|
||||
}
|
||||
resourceMapping.firstOFDMSymbolInTimeDomain = 6;
|
||||
resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL;
|
||||
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
|
||||
resourceMapping.density.choice.one = (NULL_t)0;
|
||||
resourceMapping.freqBand.startingRB = 0;
|
||||
resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2;
|
||||
nzpcsi0->resourceMapping = resourceMapping;
|
||||
nzpcsi0->powerControlOffset = 0;
|
||||
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
|
||||
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
|
||||
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
|
||||
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots320 = 20;
|
||||
nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS));
|
||||
*nzpcsi0->qcl_InfoPeriodicCSI_RS=0;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
|
||||
}
|
||||
else
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL;
|
||||
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
|
||||
setupRelease_csi_MeasConfig->present = NR_SetupRelease_CSI_MeasConfig_PR_setup;
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig));
|
||||
setupRelease_csi_MeasConfig->choice.setup = csi_MeasConfig;
|
||||
|
||||
if (carrier->pdsch_AntennaPorts > 1) {
|
||||
csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList));
|
||||
NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0));
|
||||
imres0->csi_IM_ResourceId = 0;
|
||||
imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern));
|
||||
imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1;
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1));
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4;
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6;
|
||||
imres0->freqBand = calloc(1,sizeof(*imres0->freqBand));
|
||||
imres0->freqBand->startingRB = 0;
|
||||
imres0->freqBand->nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2;
|
||||
imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset));
|
||||
imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||
imres0->periodicityAndOffset->choice.slots320 = 0;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0);
|
||||
csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList));
|
||||
NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0));
|
||||
imset0->csi_IM_ResourceSetId = 0;
|
||||
NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0));
|
||||
*res0 = 0;
|
||||
ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0);
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0);
|
||||
}
|
||||
else {
|
||||
csi_MeasConfig->csi_IM_ResourceToAddModList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL;
|
||||
}
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
|
||||
|
||||
config_csirs(scc, csi_MeasConfig, uid, carrier->pdsch_AntennaPorts, curr_bwp, carrier->do_CSIRS);
|
||||
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
|
||||
|
||||
NR_CSI_SSB_ResourceSet_t *ssbresset0 = calloc(1,sizeof(*ssbresset0));
|
||||
ssbresset0->csi_SSB_ResourceSetId=0;
|
||||
|
||||
uint64_t bitmap=0;
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
case 1 :
|
||||
bitmap = ((uint64_t) scc->ssb_PositionsInBurst->choice.shortBitmap.buf[0])<<56;
|
||||
break;
|
||||
case 2 :
|
||||
bitmap = ((uint64_t) scc->ssb_PositionsInBurst->choice.mediumBitmap.buf[0])<<56;
|
||||
break;
|
||||
case 3 :
|
||||
for (int i=0; i<8; i++) {
|
||||
bitmap |= (((uint64_t) scc->ssb_PositionsInBurst->choice.longBitmap.buf[i])<<((7-i)*8));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"SSB bitmap size value %d undefined (allowed values 1,2,3) \n", scc->ssb_PositionsInBurst->present);
|
||||
}
|
||||
|
||||
NR_SSB_Index_t *ssbresset[64];
|
||||
for (int i=0;i<64;i++) {
|
||||
if ((bitmap>>(63-i))&0x01){
|
||||
ssbresset[i]=calloc(1,sizeof(*ssbresset[i]));
|
||||
*ssbresset[i] = i;
|
||||
ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset[i]);
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0);
|
||||
|
||||
csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList));
|
||||
|
||||
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
|
||||
NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0));
|
||||
csires0->csi_ResourceConfigId=0;
|
||||
csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
|
||||
NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0));
|
||||
*nzp0 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0);
|
||||
csires0->bwp_Id = 0;
|
||||
csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0);
|
||||
|
||||
|
||||
NR_CSI_ResourceConfig_t *csires1 = calloc(1,sizeof(*csires1));
|
||||
csires1->csi_ResourceConfigId=1;
|
||||
csires1->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList));
|
||||
NR_CSI_SSB_ResourceSetId_t *ssbres00 = calloc(1,sizeof(*ssbres00));
|
||||
*ssbres00 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00);
|
||||
csires1->bwp_Id = 0;
|
||||
csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1);
|
||||
|
||||
if (carrier->pdsch_AntennaPorts > 1) {
|
||||
NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2));
|
||||
csires2->csi_ResourceConfigId=2;
|
||||
csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList;
|
||||
csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList));
|
||||
NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00));
|
||||
*csiim00 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00);
|
||||
csires2->bwp_Id=0;
|
||||
csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2);
|
||||
}
|
||||
|
||||
NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1));
|
||||
pucchcsires1->uplinkBandwidthPartId=0;
|
||||
pucchcsires1->pucch_Resource=1;
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
|
||||
csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
|
||||
if (carrier->pdsch_AntennaPorts > 1) {
|
||||
LOG_I(NR_RRC,"Filling CSI Report Config for RI_PMI_CQI\n");
|
||||
NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1));
|
||||
csirep1->reportConfigId=0;
|
||||
csirep1->carrier=NULL;
|
||||
csirep1->resourcesForChannelMeasurement=0;
|
||||
csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference));
|
||||
*csirep1->csi_IM_ResourcesForInterference=2;
|
||||
csirep1->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic));
|
||||
csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 9 + (20 * uid) % 320;
|
||||
ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI;
|
||||
csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0;
|
||||
csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration));
|
||||
csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator));
|
||||
*csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI;
|
||||
csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator));
|
||||
*csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand = NULL;
|
||||
/*calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand));
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.bits_unused=1;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf=malloc(1);
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf[0]=254;*/
|
||||
csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_notConfigured;
|
||||
csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_notConfigured;
|
||||
csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig));
|
||||
csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=
|
||||
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two=
|
||||
calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1);
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1);
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1;
|
||||
csirep1->dummy = NULL;
|
||||
csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled));
|
||||
//csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
//*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table));
|
||||
*csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1;
|
||||
csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2;
|
||||
csirep1->non_PMI_PortIndication = NULL;
|
||||
csirep1->ext1 = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1);
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC,"Filling CSI Report Config for CRI_RSRP\n");
|
||||
NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2));
|
||||
csirep2->reportConfigId=1;
|
||||
csirep2->carrier=NULL;
|
||||
csirep2->resourcesForChannelMeasurement=0;
|
||||
csirep2->csi_IM_ResourcesForInterference=NULL;
|
||||
csirep2->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic));
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320;
|
||||
ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP;
|
||||
csirep2->reportQuantity.choice.cri_RSRP=(NULL_t)0;
|
||||
csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration));
|
||||
csirep2->reportFreqConfiguration->cqi_FormatIndicator = NULL;
|
||||
csirep2->reportFreqConfiguration->pmi_FormatIndicator=NULL;
|
||||
csirep2->reportFreqConfiguration->csi_ReportingBand=NULL;
|
||||
csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
|
||||
csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
|
||||
csirep2->codebookConfig=NULL;
|
||||
csirep2->dummy = NULL;
|
||||
csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled));
|
||||
csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
csirep2->cqi_Table = NULL;
|
||||
csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1;
|
||||
csirep2->non_PMI_PortIndication = NULL;
|
||||
csirep2->ext1 = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2);
|
||||
}
|
||||
|
||||
void fill_initial_SpCellConfig(int uid,
|
||||
@@ -1144,25 +1302,18 @@ void fill_initial_SpCellConfig(int uid,
|
||||
pucchfmt2->pi2BPSK=NULL;
|
||||
pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
|
||||
*pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
|
||||
|
||||
|
||||
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
|
||||
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
|
||||
pucchspatial->pucch_SpatialRelationInfoId = 1;
|
||||
pucchspatial->servingCellId = NULL;
|
||||
if(carrier->do_CSIRS) {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
|
||||
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
|
||||
}
|
||||
else {
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
|
||||
pucchspatial->referenceSignal.choice.ssb_Index = 0;
|
||||
}
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
|
||||
pucchspatial->referenceSignal.choice.ssb_Index = 0;
|
||||
pucchspatial->pucch_PathlossReferenceRS_Id = 0;
|
||||
pucchspatial->p0_PUCCH_Id = 1;
|
||||
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
|
||||
ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
|
||||
|
||||
|
||||
initialUplinkBWP->pusch_Config = calloc(1,sizeof(*initialUplinkBWP->pusch_Config));
|
||||
initialUplinkBWP->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
|
||||
NR_PUSCH_Config_t *pusch_Config = calloc(1,sizeof(*pusch_Config));
|
||||
@@ -1451,233 +1602,6 @@ void fill_initial_SpCellConfig(int uid,
|
||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->present = NR_SetupRelease_PDSCH_ServingCellConfig_PR_setup;
|
||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup = pdsch_servingcellconfig;
|
||||
|
||||
if (carrier->do_CSIRS) {
|
||||
|
||||
SpCellConfig->spCellConfigDedicated->csi_MeasConfig=calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->csi_MeasConfig));
|
||||
SpCellConfig->spCellConfigDedicated->csi_MeasConfig->present = NR_SetupRelease_CSI_MeasConfig_PR_setup;
|
||||
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig));
|
||||
SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig;
|
||||
|
||||
if (carrier->pdsch_AntennaPorts > 1) {
|
||||
csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList));
|
||||
NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0));
|
||||
imres0->csi_IM_ResourceId = 0;
|
||||
imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern));
|
||||
imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1;
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1));
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4;
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6;
|
||||
imres0->freqBand = calloc(1,sizeof(*imres0->freqBand));
|
||||
imres0->freqBand->startingRB = 0;
|
||||
imres0->freqBand->nrofRBs = 108;
|
||||
imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset));
|
||||
imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||
imres0->periodicityAndOffset->choice.slots320 = 0;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0);
|
||||
csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList));
|
||||
NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0));
|
||||
imset0->csi_IM_ResourceSetId = 0;
|
||||
NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0));
|
||||
*res0 = 0;
|
||||
ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0);
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0);
|
||||
}
|
||||
else {
|
||||
csi_MeasConfig->csi_IM_ResourceToAddModList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL;
|
||||
}
|
||||
|
||||
csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL;
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList));
|
||||
NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0));
|
||||
nzpcsirs0->nzp_CSI_ResourceSetId = 0;
|
||||
NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0));
|
||||
*nzpid0 = 0;
|
||||
ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0);
|
||||
nzpcsirs0->repetition = NULL;
|
||||
nzpcsirs0->aperiodicTriggeringOffset = NULL;
|
||||
nzpcsirs0->trs_Info = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0);
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
|
||||
|
||||
config_csirs(scc, csi_MeasConfig,carrier->pdsch_AntennaPorts,curr_bwp,carrier->do_CSIRS);
|
||||
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
|
||||
|
||||
NR_CSI_SSB_ResourceSet_t *ssbresset0 = calloc(1,sizeof(*ssbresset0));
|
||||
ssbresset0->csi_SSB_ResourceSetId=0;
|
||||
|
||||
uint64_t bitmap=0;
|
||||
switch (scc->ssb_PositionsInBurst->present) {
|
||||
case 1 :
|
||||
bitmap = ((uint64_t) scc->ssb_PositionsInBurst->choice.shortBitmap.buf[0])<<56;
|
||||
break;
|
||||
case 2 :
|
||||
bitmap = ((uint64_t) scc->ssb_PositionsInBurst->choice.mediumBitmap.buf[0])<<56;
|
||||
break;
|
||||
case 3 :
|
||||
for (int i=0; i<8; i++) {
|
||||
bitmap |= (((uint64_t) scc->ssb_PositionsInBurst->choice.longBitmap.buf[i])<<((7-i)*8));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"SSB bitmap size value %d undefined (allowed values 1,2,3) \n", scc->ssb_PositionsInBurst->present);
|
||||
}
|
||||
|
||||
NR_SSB_Index_t *ssbresset[64];
|
||||
for (int i=0;i<64;i++) {
|
||||
if ((bitmap>>(63-i))&0x01){
|
||||
ssbresset[i]=calloc(1,sizeof(*ssbresset[i]));
|
||||
*ssbresset[i] = i;
|
||||
ASN_SEQUENCE_ADD(&ssbresset0->csi_SSB_ResourceList.list,ssbresset[i]);
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0);
|
||||
|
||||
csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList));
|
||||
|
||||
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
|
||||
NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0));
|
||||
csires0->csi_ResourceConfigId=0;
|
||||
csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
|
||||
NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0));
|
||||
*nzp0 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0);
|
||||
csires0->bwp_Id = 0;
|
||||
csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0);
|
||||
|
||||
|
||||
NR_CSI_ResourceConfig_t *csires1 = calloc(1,sizeof(*csires1));
|
||||
csires1->csi_ResourceConfigId=1;
|
||||
csires1->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList));
|
||||
NR_CSI_SSB_ResourceSetId_t *ssbres00 = calloc(1,sizeof(*ssbres00));
|
||||
*ssbres00 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00);
|
||||
csires1->bwp_Id = 0;
|
||||
csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1);
|
||||
|
||||
if (carrier->pdsch_AntennaPorts > 1) {
|
||||
NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2));
|
||||
csires2->csi_ResourceConfigId=2;
|
||||
csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList;
|
||||
csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList));
|
||||
NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00));
|
||||
*csiim00 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00);
|
||||
csires2->bwp_Id=0;
|
||||
csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2);
|
||||
}
|
||||
|
||||
NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1));
|
||||
pucchcsires1->uplinkBandwidthPartId=0;
|
||||
pucchcsires1->pucch_Resource=1;
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
|
||||
csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
|
||||
if (carrier->pdsch_AntennaPorts > 1) {
|
||||
LOG_I(NR_RRC,"Filling CSI Report Config for RI_PMI_CQI\n");
|
||||
NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1));
|
||||
csirep1->reportConfigId=0;
|
||||
csirep1->carrier=NULL;
|
||||
csirep1->resourcesForChannelMeasurement=0;
|
||||
csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference));
|
||||
*csirep1->csi_IM_ResourcesForInterference=2;
|
||||
csirep1->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic));
|
||||
csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = (8 + (20 * uid)) % 320;
|
||||
ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI;
|
||||
csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0;
|
||||
csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration));
|
||||
csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator));
|
||||
*csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI;
|
||||
csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator));
|
||||
*csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand = NULL;
|
||||
/*calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand));
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.bits_unused=1;
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf=malloc(1);
|
||||
csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf[0]=254;*/
|
||||
csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_notConfigured;
|
||||
csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_notConfigured;
|
||||
csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig));
|
||||
csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=
|
||||
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two=
|
||||
calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two));
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1);
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1);
|
||||
csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03;
|
||||
csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1;
|
||||
csirep1->dummy = NULL;
|
||||
csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled));
|
||||
//csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
//*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table));
|
||||
*csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1;
|
||||
csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2;
|
||||
csirep1->non_PMI_PortIndication = NULL;
|
||||
csirep1->ext1 = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1);
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC,"Filling CSI Report Config for CRI_RSRP\n");
|
||||
NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2));
|
||||
csirep2->reportConfigId=1;
|
||||
csirep2->carrier=NULL;
|
||||
csirep2->resourcesForChannelMeasurement=0;
|
||||
csirep2->csi_IM_ResourcesForInterference=NULL;
|
||||
csirep2->nzp_CSI_RS_ResourcesForInterference=NULL;
|
||||
csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic;
|
||||
csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic));
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320;
|
||||
csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = (28 + (20 * uid)) % 320;
|
||||
ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1);
|
||||
csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP;
|
||||
csirep2->reportQuantity.choice.cri_RSRP=(NULL_t)0;
|
||||
csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration));
|
||||
csirep2->reportFreqConfiguration->cqi_FormatIndicator = NULL;
|
||||
csirep2->reportFreqConfiguration->pmi_FormatIndicator=NULL;
|
||||
csirep2->reportFreqConfiguration->csi_ReportingBand=NULL;
|
||||
csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured;
|
||||
csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured;
|
||||
csirep2->codebookConfig=NULL;
|
||||
csirep2->dummy = NULL;
|
||||
csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled;
|
||||
csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled));
|
||||
csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS));
|
||||
*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1;
|
||||
csirep2->cqi_Table = NULL;
|
||||
csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1;
|
||||
csirep2->non_PMI_PortIndication = NULL;
|
||||
csirep2->ext1 = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2);
|
||||
}
|
||||
pdsch_servingcellconfig->codeBlockGroupTransmission = NULL;
|
||||
pdsch_servingcellconfig->xOverhead = NULL;
|
||||
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
|
||||
@@ -1750,10 +1674,12 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
|
||||
rlc_BearerConfig_drb->reestablishRLC = NULL;
|
||||
rlc_Config_drb = calloc(1, sizeof(NR_RLC_Config_t));
|
||||
|
||||
if (use_rlc_um_for_drb) nr_drb_config(rlc_Config_drb, NR_RLC_Config_PR_um_Bi_Directional);
|
||||
else nr_drb_config(rlc_Config_drb, NR_RLC_Config_PR_am);
|
||||
if (use_rlc_um_for_drb) {
|
||||
nr_drb_config(rlc_Config_drb, NR_RLC_Config_PR_um_Bi_Directional);
|
||||
} else {
|
||||
nr_drb_config(rlc_Config_drb, NR_RLC_Config_PR_am);
|
||||
}
|
||||
|
||||
|
||||
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));
|
||||
@@ -1774,6 +1700,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
|
||||
|
||||
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
rrc_gNB_carrier_data_t *carrier,
|
||||
int uid,
|
||||
NR_UE_NR_Capability_t *uecap) {
|
||||
|
||||
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
|
||||
@@ -1781,6 +1708,26 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon;
|
||||
|
||||
// Config CSI-RS
|
||||
if (carrier->do_CSIRS) {
|
||||
struct NR_PUCCH_Config__spatialRelationInfoToAddModList *spatialRelationInfoToAddModList = calloc(1,sizeof(*spatialRelationInfoToAddModList));
|
||||
NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
|
||||
pucchspatial->pucch_SpatialRelationInfoId = 1;
|
||||
pucchspatial->servingCellId = NULL;
|
||||
pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
|
||||
pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
|
||||
pucchspatial->pucch_PathlossReferenceRS_Id = 0;
|
||||
pucchspatial->p0_PUCCH_Id = 1;
|
||||
pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
|
||||
ASN_SEQUENCE_ADD(&spatialRelationInfoToAddModList->list,pucchspatial);
|
||||
SpCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->spatialRelationInfoToAddModList = spatialRelationInfoToAddModList;
|
||||
if(!SpCellConfig->spCellConfigDedicated->csi_MeasConfig) {
|
||||
SpCellConfig->spCellConfigDedicated->csi_MeasConfig=calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->csi_MeasConfig));
|
||||
}
|
||||
fill_default_csi_MeasConfig(uid, SpCellConfig->spCellConfigDedicated->csi_MeasConfig, scc, carrier);
|
||||
}
|
||||
|
||||
// Set DL MCS table
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,
|
||||
uecap, SpCellConfig, bwp_Dedicated, scc);
|
||||
@@ -1795,7 +1742,6 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fill_initial_cellGroupConfig(int uid,
|
||||
NR_CellGroupConfig_t *cellGroupConfig,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
@@ -2006,7 +1952,7 @@ int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC,"RRCSetup Encoded %zd bits (%zd bytes)\n",
|
||||
LOG_D(NR_RRC,"RRCSetup Encoded %zd bits (%zd bytes)\n",
|
||||
enc_rval.encoded,(enc_rval.encoded+7)/8);
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
@@ -2270,6 +2216,7 @@ int16_t do_RRCReconfiguration(
|
||||
if(cellGroupConfig!=NULL){
|
||||
update_cellGroupConfig(cellGroupConfig,
|
||||
carrier,
|
||||
ue_context_pP->local_uid,
|
||||
ue_context_pP->ue_context.UE_Capability_nr);
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
NULL,
|
||||
|
||||
@@ -112,6 +112,7 @@ void fill_initial_cellGroupConfig(int uid,
|
||||
|
||||
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
rrc_gNB_carrier_data_t *carrier,
|
||||
int uid,
|
||||
NR_UE_NR_Capability_t *uecap);
|
||||
|
||||
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup,int use_rlc_um_for_drb);
|
||||
|
||||
@@ -31,6 +31,145 @@
|
||||
#include "nr_rrc_config.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
|
||||
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
|
||||
|
||||
|
||||
void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0, int uid, int nb_slots_per_period) {
|
||||
|
||||
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
|
||||
int ideal_period = nb_slots_per_period*MAX_MOBILES_PER_GNB;
|
||||
if (ideal_period<5) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots4;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots4 = nb_slots_per_period*uid;
|
||||
}
|
||||
else if (ideal_period<6) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots5;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots5 = nb_slots_per_period*uid;
|
||||
}
|
||||
else if (ideal_period<9) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots8;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots8 = nb_slots_per_period*uid;
|
||||
}
|
||||
else if (ideal_period<11) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots10;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots10 = nb_slots_per_period*uid;
|
||||
}
|
||||
else if (ideal_period<17) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots16;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots16 = nb_slots_per_period*uid;
|
||||
}
|
||||
else if (ideal_period<21) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots20;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots20 = nb_slots_per_period*uid;
|
||||
}
|
||||
else if (ideal_period<41) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots40;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots40 = nb_slots_per_period*uid;
|
||||
}
|
||||
else if (ideal_period<81) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots80;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots80 = nb_slots_per_period*uid;
|
||||
}
|
||||
else if (ideal_period<161) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots160 = nb_slots_per_period*uid;
|
||||
}
|
||||
else {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots320 = (nb_slots_per_period*uid)%320 + (nb_slots_per_period*uid)/320;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
int uid,
|
||||
int num_dl_antenna_ports,
|
||||
int curr_bwp,
|
||||
int do_csirs) {
|
||||
|
||||
if (do_csirs) {
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList));
|
||||
NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0));
|
||||
nzpcsirs0->nzp_CSI_ResourceSetId = 0;
|
||||
NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0));
|
||||
*nzpid0 = 0;
|
||||
ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0);
|
||||
nzpcsirs0->repetition = NULL;
|
||||
nzpcsirs0->aperiodicTriggeringOffset = NULL;
|
||||
nzpcsirs0->trs_Info = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0);
|
||||
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon ?
|
||||
&servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
|
||||
const int n_slots_frame = slotsperframe[*servingcellconfigcommon->ssbSubcarrierSpacing];
|
||||
|
||||
int nb_slots_per_period = n_slots_frame;
|
||||
if (tdd)
|
||||
nb_slots_per_period = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
|
||||
nzpcsi0->nzp_CSI_RS_ResourceId = 0;
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping;
|
||||
switch (num_dl_antenna_ports) {
|
||||
case 1:
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
|
||||
break;
|
||||
case 2:
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
|
||||
break;
|
||||
case 4:
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row4.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.row4.size = 1;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row4.bits_unused = 5;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row4.buf[0] = 32;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p4;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Number of ports not yet supported\n");
|
||||
}
|
||||
resourceMapping.firstOFDMSymbolInTimeDomain = 13; // last symbol of slot
|
||||
resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL;
|
||||
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
|
||||
resourceMapping.density.choice.one = (NULL_t)0;
|
||||
resourceMapping.freqBand.startingRB = 0;
|
||||
resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2;
|
||||
nzpcsi0->resourceMapping = resourceMapping;
|
||||
nzpcsi0->powerControlOffset = 0;
|
||||
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
|
||||
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
|
||||
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
|
||||
set_csirs_periodicity(nzpcsi0, uid, nb_slots_per_period);
|
||||
nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS));
|
||||
*nzpcsi0->qcl_InfoPeriodicCSI_RS = 0;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
|
||||
}
|
||||
else {
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL;
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL;
|
||||
}
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToReleaseList = NULL;
|
||||
}
|
||||
|
||||
void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int numerology,
|
||||
@@ -70,8 +209,7 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
||||
}
|
||||
fs_cc->supportedModulationOrderDL = CALLOC(1,sizeof(*fs_cc->supportedModulationOrderDL));
|
||||
*fs_cc->supportedModulationOrderDL = NR_ModulationOrder_qam256;
|
||||
ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list,
|
||||
fs_cc);
|
||||
ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list, fs_cc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +304,6 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
|
||||
@@ -223,5 +360,3 @@ void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
|
||||
bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -113,6 +113,12 @@ typedef struct physicalcellgroup_s{
|
||||
|
||||
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc);
|
||||
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
int uid,
|
||||
int num_dl_antenna_ports,
|
||||
int curr_bwp,
|
||||
int do_csirs);
|
||||
void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
|
||||
|
||||
@@ -286,10 +286,10 @@ typedef struct gNB_RRC_UE_s {
|
||||
NR_DRB_ToReleaseList_t *DRB_Release_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
uint8_t DRB_active[8];
|
||||
|
||||
NR_SRB_INFO SI;
|
||||
NR_SRB_INFO Srb0;
|
||||
NR_SRB_INFO_TABLE_ENTRY Srb1;
|
||||
NR_SRB_INFO_TABLE_ENTRY Srb2;
|
||||
NR_SRB_INFO SI;
|
||||
NR_SRB_INFO Srb0;
|
||||
NR_SRB_INFO_TABLE_ENTRY Srb1;
|
||||
NR_SRB_INFO_TABLE_ENTRY Srb2;
|
||||
NR_MeasConfig_t *measConfig;
|
||||
HANDOVER_INFO *handover_info;
|
||||
NR_MeasResults_t *measResults;
|
||||
|
||||
@@ -85,13 +85,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
int do_srs,
|
||||
int uid);
|
||||
|
||||
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
int dl_antenna_ports,
|
||||
int curr_bwp,
|
||||
int do_csirs);
|
||||
|
||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_RRCReconfiguration_IEs_t *reconfig,
|
||||
|
||||
@@ -3489,7 +3489,6 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
|
||||
if (fd) fclose(fd);
|
||||
|
||||
|
||||
/* send a tick to x2ap */
|
||||
if (is_x2ap_enabled()){
|
||||
msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_SUBFRAME_PROCESS);
|
||||
|
||||
@@ -560,9 +560,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
}
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL;
|
||||
|
||||
if ((get_softmodem_params()->do_ra ||
|
||||
get_softmodem_params()->phy_test) &&
|
||||
dl_antenna_ports > 1) // for MIMO, we use DMRS Config Type 2 but only with OAI UE
|
||||
if ((get_softmodem_params()->do_ra || get_softmodem_params()->phy_test) && dl_antenna_ports > 1) // for MIMO, we use DMRS Config Type 2 but only with OAI UE
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type));
|
||||
else
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;
|
||||
@@ -1064,24 +1062,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL;
|
||||
|
||||
if (do_csirs) {
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList));
|
||||
NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0));
|
||||
nzpcsirs0->nzp_CSI_ResourceSetId = 0;
|
||||
NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0));
|
||||
*nzpid0 = 0;
|
||||
ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0);
|
||||
nzpcsirs0->repetition = NULL;
|
||||
nzpcsirs0->aperiodicTriggeringOffset = NULL;
|
||||
nzpcsirs0->trs_Info = NULL;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0);
|
||||
}
|
||||
else
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL;
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
|
||||
|
||||
config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,curr_bwp,do_csirs);
|
||||
config_csirs(servingcellconfigcommon, csi_MeasConfig, uid, dl_antenna_ports, curr_bwp, do_csirs);
|
||||
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
|
||||
@@ -1100,9 +1081,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0);
|
||||
|
||||
csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList));
|
||||
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
|
||||
|
||||
if (do_csirs) {
|
||||
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
|
||||
NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0));
|
||||
csires0->csi_ResourceConfigId=0;
|
||||
csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
@@ -1281,9 +1262,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_RRCReconfiguration_IEs_t *reconfig,
|
||||
|
||||
@@ -1338,13 +1338,6 @@ static void rrc_ue_generate_RRCSetupComplete(
|
||||
uint8_t size;
|
||||
const char *nas_msg;
|
||||
int nas_msg_length;
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
|
||||
if (mac->cg &&
|
||||
mac->cg->spCellConfig &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->csi_MeasConfig)
|
||||
AssertFatal(1==0,"2 > csi_MeasConfig is not null\n");
|
||||
|
||||
if (AMF_MODE_ENABLED) {
|
||||
#if defined(ITTI_SIM)
|
||||
|
||||
@@ -674,7 +674,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
}
|
||||
if (samples_received == nsamps) s->wait_for_first_pps=0;
|
||||
|
||||
// bring RX data into 12 LSBs for softmodem RX
|
||||
// bring RX data into 12 LSBs for softmodem RX
|
||||
for (int i=0; i<cc; i++) {
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -1116,6 +1116,7 @@ extern "C" {
|
||||
if (device->type==USRP_X300_DEV) {
|
||||
openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
|
||||
std::cerr << "-- Using calibration table: calib_table_x310" << std::endl;
|
||||
s->usrp->set_rx_dc_offset(true);
|
||||
}
|
||||
|
||||
if (device->type==USRP_N300_DEV) {
|
||||
|
||||
@@ -35,9 +35,10 @@ gNBs =
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
min_rxtxtime = 6;
|
||||
min_rxtxtime = 2;
|
||||
sib1_tda = 0;
|
||||
do_SRS = 1;
|
||||
do_CSIRS = 1;
|
||||
do_SRS = 0;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
|
||||
@@ -35,8 +35,10 @@ gNBs =
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 2;
|
||||
min_rxtxtime = 2;
|
||||
sib1_tda = 0;
|
||||
do_SRS = 1;
|
||||
do_CSIRS = 1;
|
||||
do_SRS = 0;
|
||||
ul_prbblacklist = "51,52,53,54"
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
|
||||
@@ -35,8 +35,10 @@ gNBs =
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
min_rxtxtime = 6;
|
||||
min_rxtxtime = 2;
|
||||
sib1_tda = 0;
|
||||
do_CSIRS = 1;
|
||||
do_SRS = 0;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
|
||||
@@ -35,9 +35,12 @@ gNBs =
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 2;
|
||||
# do_CSIRS = 1;
|
||||
min_rxtxtime_pdsch = 2;
|
||||
min_rxtxtime = 2;
|
||||
sib1_tda = 0;
|
||||
do_CSIRS = 1;
|
||||
do_SRS = 0;
|
||||
ul_prbblacklist = "79,80,81,82"
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
controlResourceSetZero = 11;
|
||||
|
||||
@@ -1135,7 +1135,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
}
|
||||
for (int i=0;i<NUMBER_OF_ULSCH_MAX; i++) {
|
||||
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,NUMBER_OF_ULSCH_MAX);
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffers for ULSCH %d/%d\n",i,NUMBER_OF_ULSCH_MAX);
|
||||
eNB->ulsch[i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0);
|
||||
|
||||
if (!eNB->ulsch[i]) {
|
||||
|
||||
Reference in New Issue
Block a user