improvements for 4-layer MIMO at gNB
This commit is contained in:
@@ -85,11 +85,9 @@ static const int tables_5_3_2[5][12] = {
|
|||||||
{32, 66, 132, 264, -1, -1, -1, -1, -1, -1, -1, -1} // 120FR2
|
{32, 66, 132, 264, -1, -1, -1, -1, -1, -1, -1, -1} // 120FR2
|
||||||
};
|
};
|
||||||
|
|
||||||
int get_supported_band_index(int scs, int band, int n_rbs)
|
int get_supported_band_index(int scs, frequency_range_t freq_range, int n_rbs)
|
||||||
{
|
{
|
||||||
int scs_index = scs;
|
int scs_index = scs + freq_range;
|
||||||
if (band > 256)
|
|
||||||
scs_index++;
|
|
||||||
for (int i = 0; i < 12; i++) {
|
for (int i = 0; i < 12; i++) {
|
||||||
if(n_rbs == tables_5_3_2[scs_index][i])
|
if(n_rbs == tables_5_3_2[scs_index][i])
|
||||||
return i;
|
return i;
|
||||||
@@ -224,7 +222,7 @@ bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_
|
|||||||
// 38.101-1 section 6.2.2
|
// 38.101-1 section 6.2.2
|
||||||
// Relative channel bandwidth <= 4% for TDD bands and <= 3% for FDD bands
|
// Relative channel bandwidth <= 4% for TDD bands and <= 3% for FDD bands
|
||||||
int index = get_nr_table_idx(nr_band, scs);
|
int index = get_nr_table_idx(nr_band, scs);
|
||||||
int bw_index = get_supported_band_index(scs, nr_band, nb_ul);
|
int bw_index = get_supported_band_index(scs, nr_band > 256 ? FR2 : FR1, nb_ul);
|
||||||
int band_size_khz = get_supported_bw_mhz(nr_band > 256 ? FR2 : FR1, bw_index) * 1000;
|
int band_size_khz = get_supported_bw_mhz(nr_band > 256 ? FR2 : FR1, bw_index) * 1000;
|
||||||
float limit = frame_type == TDD ? 0.04 : 0.03;
|
float limit = frame_type == TDD ? 0.04 : 0.03;
|
||||||
float rel_bw = (float) (2 * band_size_khz) / (float) (nr_bandtable[index].ul_max + nr_bandtable[index].ul_min);
|
float rel_bw = (float) (2 * band_size_khz) / (float) (nr_bandtable[index].ul_max + nr_bandtable[index].ul_min);
|
||||||
|
|||||||
@@ -187,11 +187,11 @@ void SLIV2SL(int SLIV,int *S,int *L);
|
|||||||
int get_dmrs_port(int nl, uint16_t dmrs_ports);
|
int get_dmrs_port(int nl, uint16_t dmrs_ports);
|
||||||
uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols);
|
uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols);
|
||||||
int get_nb_periods_per_frame(uint8_t tdd_period);
|
int get_nb_periods_per_frame(uint8_t tdd_period);
|
||||||
int get_supported_band_index(int scs, int band, int n_rbs);
|
|
||||||
long rrc_get_max_nr_csrs(const int max_rbs, long b_SRS);
|
long rrc_get_max_nr_csrs(const int max_rbs, long b_SRS);
|
||||||
void get_K1_K2(int N1, int N2, int *K1, int *K2);
|
void get_K1_K2(int N1, int N2, int *K1, int *K2);
|
||||||
bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_t frame_type);
|
bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_t frame_type);
|
||||||
int get_supported_bw_mhz(frequency_range_t frequency_range, int bw_index);
|
int get_supported_bw_mhz(frequency_range_t frequency_range, int bw_index);
|
||||||
|
int get_supported_band_index(int scs, frequency_range_t freq_range, int n_rbs);
|
||||||
void get_samplerate_and_bw(int mu,
|
void get_samplerate_and_bw(int mu,
|
||||||
int n_rb,
|
int n_rb,
|
||||||
int8_t threequarter_fs,
|
int8_t threequarter_fs,
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ Furthermore, the gNB and UE support
|
|||||||
- Single and multiple DMRS symbols
|
- Single and multiple DMRS symbols
|
||||||
- PTRS support
|
- PTRS support
|
||||||
- Support for 1, 2 and 4 TX antennas
|
- Support for 1, 2 and 4 TX antennas
|
||||||
- Support for up to 2 layers (currently limited to DMRS configuration type 2)
|
- Support for up to 2 layers
|
||||||
- Support for 256 QAM
|
- Support for 256 QAM
|
||||||
* NR-CSIRS Generation of sequence at PHY
|
* NR-CSIRS Generation of sequence at PHY
|
||||||
* NR-PUSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc).
|
* NR-PUSCH (including Segmentation, LDPC encoding, rate matching, scrambling, modulation, RB mapping, etc).
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fp->threequarter_fs = 0;
|
fp->threequarter_fs = 0;
|
||||||
int bw_index = get_supported_band_index(mu, fp->nr_band, N_RB_DL);
|
int bw_index = get_supported_band_index(mu, fp->nr_band > 256 ? FR2 : FR1, N_RB_DL);
|
||||||
gNB_config->carrier_config.dl_bandwidth.value = get_supported_bw_mhz(fp->nr_band > 256 ? FR2 : FR1, bw_index);
|
gNB_config->carrier_config.dl_bandwidth.value = get_supported_bw_mhz(fp->nr_band > 256 ? FR2 : FR1, bw_index);
|
||||||
|
|
||||||
nr_init_frame_parms(gNB_config, fp);
|
nr_init_frame_parms(gNB_config, fp);
|
||||||
|
|||||||
@@ -1015,7 +1015,8 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
int frame,
|
int frame,
|
||||||
int slot,
|
int slot,
|
||||||
nfapi_nr_uci_pucch_pdu_format_2_3_4_t* uci_pdu,
|
nfapi_nr_uci_pucch_pdu_format_2_3_4_t* uci_pdu,
|
||||||
nfapi_nr_pucch_pdu_t* pucch_pdu) {
|
nfapi_nr_pucch_pdu_t* pucch_pdu)
|
||||||
|
{
|
||||||
|
|
||||||
c16_t **rxdataF = gNB->common_vars.rxdataF;
|
c16_t **rxdataF = gNB->common_vars.rxdataF;
|
||||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ void nr_phy_config_request_sim_pbchsim(PHY_VARS_gNB *gNB,
|
|||||||
else fp->nr_band = 78;
|
else fp->nr_band = 78;
|
||||||
fp->threequarter_fs= 0;
|
fp->threequarter_fs= 0;
|
||||||
|
|
||||||
int bw_index = get_supported_band_index(mu, fp->nr_band, N_RB_DL);
|
int bw_index = get_supported_band_index(mu, fp->nr_band > 256 ? FR2 : FR1, N_RB_DL);
|
||||||
gNB_config->carrier_config.dl_bandwidth.value = get_supported_bw_mhz(fp->nr_band > 256 ? FR2 : FR1, bw_index);
|
gNB_config->carrier_config.dl_bandwidth.value = get_supported_bw_mhz(fp->nr_band > 256 ? FR2 : FR1, bw_index);
|
||||||
|
|
||||||
fp->ofdm_offset_divisor = UINT_MAX;
|
fp->ofdm_offset_divisor = UINT_MAX;
|
||||||
|
|||||||
@@ -499,6 +499,9 @@ typedef struct{
|
|||||||
uint8_t li_bitlen[8];
|
uint8_t li_bitlen[8];
|
||||||
uint8_t pmi_x1_bitlen[8];
|
uint8_t pmi_x1_bitlen[8];
|
||||||
uint8_t pmi_x2_bitlen[8];
|
uint8_t pmi_x2_bitlen[8];
|
||||||
|
uint8_t pmi_i11_bitlen[8];
|
||||||
|
uint8_t pmi_i12_bitlen[8];
|
||||||
|
uint8_t pmi_i13_bitlen[8];
|
||||||
uint8_t cqi_bitlen[8];
|
uint8_t cqi_bitlen[8];
|
||||||
} CSI_Meas_bitlen_t;
|
} CSI_Meas_bitlen_t;
|
||||||
|
|
||||||
|
|||||||
@@ -4733,29 +4733,30 @@ void compute_rsrp_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||||
nr_csi_report_t *csi_report) {
|
nr_csi_report_t *csi_report)
|
||||||
|
{
|
||||||
|
|
||||||
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
|
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
|
||||||
uint8_t nb_allowed_ri, ri_bitlen;
|
uint8_t nb_allowed_ri, ri_bitlen;
|
||||||
uint8_t ri_restriction = 0;
|
uint8_t ri_restriction = 0;
|
||||||
|
|
||||||
if (codebookConfig == NULL) {
|
if (codebookConfig == NULL) {
|
||||||
csi_report->csi_meas_bitlen.ri_bitlen=0;
|
csi_report->csi_meas_bitlen.ri_bitlen = 0;
|
||||||
return ri_restriction;
|
return ri_restriction;
|
||||||
}
|
}
|
||||||
|
|
||||||
// codebook type1 single panel
|
// codebook type1 single panel
|
||||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){
|
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present) {
|
||||||
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
|
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
|
||||||
if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two){
|
if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) {
|
||||||
|
|
||||||
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||||
|
|
||||||
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
||||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||||
|
|
||||||
ri_bitlen = ri_bitlen<1?ri_bitlen:1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
ri_bitlen = ri_bitlen < 1 ? ri_bitlen : 1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||||
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
csi_report->csi_meas_bitlen.ri_bitlen = ri_bitlen;
|
||||||
}
|
}
|
||||||
if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo){
|
if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo){
|
||||||
if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present ==
|
if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present ==
|
||||||
@@ -4767,8 +4768,8 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
|||||||
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
||||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||||
|
|
||||||
ri_bitlen = ri_bitlen<2?ri_bitlen:2; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
ri_bitlen = ri_bitlen < 2 ? ri_bitlen : 2; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||||
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
csi_report->csi_meas_bitlen.ri_bitlen = ri_bitlen;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// more than 4 ports
|
// more than 4 ports
|
||||||
@@ -4778,7 +4779,7 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
|||||||
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
||||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||||
|
|
||||||
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
csi_report->csi_meas_bitlen.ri_bitlen = ri_bitlen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ri_restriction;
|
return ri_restriction;
|
||||||
@@ -4894,145 +4895,171 @@ void get_n1n2_o1o2_singlepanel(int *n1, int *n2, int *o1, int *o2,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_x1x2_bitlen_singlepanel(int n1, int n2, int o1, int o2,
|
static void set_bitlen_size_singlepanel(CSI_Meas_bitlen_t *csi_bitlen, int n1, int n2, int o1, int o2, int rank, int codebook_mode)
|
||||||
int *x1, int *x2, int rank, int codebook_mode) {
|
{
|
||||||
|
int i = rank - 1;
|
||||||
// Table 6.3.1.1.2-1 in 38.212
|
// Table 6.3.1.1.2-1 in 38.212
|
||||||
switch(rank){
|
switch(rank){
|
||||||
case 1:
|
case 1:
|
||||||
if(n2>1) {
|
if(n2 > 1) {
|
||||||
if (codebook_mode == 1) {
|
if (codebook_mode == 1) {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 2;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1 / 2));
|
||||||
*x2 = 4;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2 / 2));
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (codebook_mode == 1) {
|
if (codebook_mode == 1) {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 2;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*x1 = ceil(log2(n1*o1/2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1 / 2));
|
||||||
*x2 = 4;
|
csi_bitlen->pmi_i12_bitlen[i] = 0;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
csi_bitlen->pmi_i13_bitlen[i] = 0;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if(n1*n2 == 2) {
|
if(n1 * n2 == 2) {
|
||||||
if (codebook_mode == 1) {
|
if (codebook_mode == 1) {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*x1 = ceil(log2(n1*o1/2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1 / 2));
|
||||||
*x2 = 3;
|
csi_bitlen->pmi_i12_bitlen[i] = 0;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 3;
|
||||||
}
|
}
|
||||||
*x1 += 1;
|
csi_bitlen->pmi_i13_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(n2>1) {
|
if(n2 > 1) {
|
||||||
if (codebook_mode == 1) {
|
if (codebook_mode == 1) {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 3;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1 / 2));
|
||||||
*x2 = 3;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2 / 2));
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (codebook_mode == 1) {
|
if (codebook_mode == 1) {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*x1 = ceil(log2(n1*o1/2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1 / 2));
|
||||||
*x2 = 3;
|
csi_bitlen->pmi_i12_bitlen[i] = 0;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*x1 += 2;
|
csi_bitlen->pmi_i13_bitlen[i] = 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
if(n1*n2 == 2) {
|
if(n1*n2 == 2) {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_i13_bitlen[i] = 0;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(n1*n2 >= 8) {
|
if(n1*n2 >= 8) {
|
||||||
*x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2)) + 2;
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1 / 2));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_i13_bitlen[i] = 2;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)) + 2;
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_i13_bitlen[i] = 2;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
case 6:
|
case 6:
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_i13_bitlen[i] = 0;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
case 8:
|
case 8:
|
||||||
if(n1 == 4 && n2 == 1) {
|
if(n1 == 4 && n2 == 1) {
|
||||||
*x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2 / 2));
|
||||||
|
csi_bitlen->pmi_i13_bitlen[i] = 0;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(n1 > 2 && n2 == 2) {
|
if(n1 > 2 && n2 == 2) {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2/2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2 / 2));
|
||||||
|
csi_bitlen->pmi_i13_bitlen[i] = 0;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
csi_bitlen->pmi_i11_bitlen[i] = ceil(log2(n1 * o1));
|
||||||
*x2 = 1;
|
csi_bitlen->pmi_i12_bitlen[i] = ceil(log2(n2 * o2));
|
||||||
|
csi_bitlen->pmi_i13_bitlen[i] = 0;
|
||||||
|
csi_bitlen->pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
AssertFatal(1==0,"Invalid rank in x1 x2 bit length computation\n");
|
AssertFatal(1==0,"Invalid rank in x1 x2 bit length computation\n");
|
||||||
}
|
}
|
||||||
|
csi_bitlen->pmi_x1_bitlen[i] = csi_bitlen->pmi_i11_bitlen[i] + csi_bitlen->pmi_i12_bitlen[i] + csi_bitlen->pmi_i13_bitlen[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||||
uint8_t ri_restriction,
|
uint8_t ri_restriction,
|
||||||
nr_csi_report_t *csi_report) {
|
nr_csi_report_t *csi_report)
|
||||||
|
{
|
||||||
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
|
NR_CodebookConfig_t *codebookConfig = csi_reportconfig->codebookConfig;
|
||||||
for(int i=0; i<8; i++) {
|
for(int i = 0; i < 8; i++) {
|
||||||
csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=0;
|
csi_report->csi_meas_bitlen.pmi_x1_bitlen[i] = 0;
|
||||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=0;
|
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i] = 0;
|
||||||
if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0)
|
if (codebookConfig == NULL || ((ri_restriction >> i) & 0x01) == 0)
|
||||||
return;
|
return;
|
||||||
else {
|
else {
|
||||||
if(codebookConfig->codebookType.present == NR_CodebookConfig__codebookType_PR_type1) {
|
if(codebookConfig->codebookType.present == NR_CodebookConfig__codebookType_PR_type1) {
|
||||||
if(codebookConfig->codebookType.choice.type1->subType.present == NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) {
|
struct NR_CodebookConfig__codebookType__type1 *type1 = codebookConfig->codebookType.choice.type1;
|
||||||
if(codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present ==
|
if(type1->subType.present == NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) {
|
||||||
|
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *sp = type1->subType.choice.typeI_SinglePanel;
|
||||||
|
if(sp->nrOfAntennaPorts.present ==
|
||||||
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) {
|
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) {
|
||||||
csi_report->N1 = 1;
|
csi_report->N1 = 1;
|
||||||
csi_report->N2 = 1;
|
csi_report->N2 = 1;
|
||||||
if (i==0)
|
if (i == 0)
|
||||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=2;
|
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i] = 2;
|
||||||
if (i==1)
|
if (i == 1)
|
||||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=1;
|
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i] = 1;
|
||||||
}
|
}
|
||||||
else { // more than two
|
else { // more than two
|
||||||
int n1,n2,o1,o2,x1,x2;
|
int n1, n2, o1, o2;
|
||||||
get_n1n2_o1o2_singlepanel(&n1,&n2,&o1,&o2,codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo);
|
get_n1n2_o1o2_singlepanel(&n1, &n2, &o1, &o2, sp->nrOfAntennaPorts.choice.moreThanTwo);
|
||||||
get_x1x2_bitlen_singlepanel(n1,n2,o1,o2,&x1,&x2,i+1,codebookConfig->codebookType.choice.type1->codebookMode);
|
set_bitlen_size_singlepanel(&csi_report->csi_meas_bitlen, n1, n2, o1, o2, i + 1, type1->codebookMode);
|
||||||
csi_report->N1 = n1;
|
csi_report->N1 = n1;
|
||||||
csi_report->N2 = n2;
|
csi_report->N2 = n2;
|
||||||
csi_report->codebook_mode = codebookConfig->codebookType.choice.type1->codebookMode;
|
csi_report->codebook_mode = type1->codebookMode;
|
||||||
csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=x1;
|
|
||||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=x2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5117,7 +5144,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, nr_csi_report_t *cs
|
|||||||
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceSetId ==
|
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceSetId ==
|
||||||
*(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.array[0])){
|
*(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.array[0])){
|
||||||
//We can configure only one SSB resource set from spec 38.331 IE CSI-ResourceConfig
|
//We can configure only one SSB resource set from spec 38.331 IE CSI-ResourceConfig
|
||||||
nb_resources= csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceList.list.count;
|
nb_resources = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceList.list.count;
|
||||||
csi_report->SSB_Index_list = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceList.list.array;
|
csi_report->SSB_Index_list = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[csi_idx]->csi_SSB_ResourceList.list.array;
|
||||||
csi_report->CSI_Index_list = NULL;
|
csi_report->CSI_Index_list = NULL;
|
||||||
break;
|
break;
|
||||||
@@ -5190,14 +5217,14 @@ uint16_t nr_get_csi_bitlen(nr_csi_report_t *csi_report_template, uint8_t csi_rep
|
|||||||
} else {
|
} else {
|
||||||
csi_meas_bitlen = &(csi_report_template[csi_report_id].csi_meas_bitlen); //This might need to be moodif for Aperiodic CSI-RS measurements
|
csi_meas_bitlen = &(csi_report_template[csi_report_id].csi_meas_bitlen); //This might need to be moodif for Aperiodic CSI-RS measurements
|
||||||
uint16_t temp_bitlen;
|
uint16_t temp_bitlen;
|
||||||
for (int i=0; i<8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
temp_bitlen = (csi_meas_bitlen->cri_bitlen+
|
temp_bitlen = (csi_meas_bitlen->cri_bitlen+
|
||||||
csi_meas_bitlen->ri_bitlen+
|
csi_meas_bitlen->ri_bitlen+
|
||||||
csi_meas_bitlen->li_bitlen[i]+
|
csi_meas_bitlen->li_bitlen[i]+
|
||||||
csi_meas_bitlen->cqi_bitlen[i]+
|
csi_meas_bitlen->cqi_bitlen[i]+
|
||||||
csi_meas_bitlen->pmi_x1_bitlen[i]+
|
csi_meas_bitlen->pmi_x1_bitlen[i]+
|
||||||
csi_meas_bitlen->pmi_x2_bitlen[i]);
|
csi_meas_bitlen->pmi_x2_bitlen[i]);
|
||||||
if(temp_bitlen>max_bitlen)
|
if(temp_bitlen > max_bitlen)
|
||||||
max_bitlen = temp_bitlen;
|
max_bitlen = temp_bitlen;
|
||||||
}
|
}
|
||||||
csi_bitlen += max_bitlen;
|
csi_bitlen += max_bitlen;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
|
|||||||
AssertFatal(frequencyInfoDL->frequencyBandList.list.array[0]->freqBandIndicatorNR, "Field mandatory present for DL in SIB1\n");
|
AssertFatal(frequencyInfoDL->frequencyBandList.list.array[0]->freqBandIndicatorNR, "Field mandatory present for DL in SIB1\n");
|
||||||
mac->nr_band = *frequencyInfoDL->frequencyBandList.list.array[0]->freqBandIndicatorNR;
|
mac->nr_band = *frequencyInfoDL->frequencyBandList.list.array[0]->freqBandIndicatorNR;
|
||||||
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||||
mac->nr_band,
|
mac->nr_band > 256 ? FR2 : FR1,
|
||||||
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
||||||
cfg->carrier_config.dl_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
|
cfg->carrier_config.dl_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
|
|||||||
NR_FrequencyInfoUL_SIB_t *frequencyInfoUL = &scc->uplinkConfigCommon->frequencyInfoUL;
|
NR_FrequencyInfoUL_SIB_t *frequencyInfoUL = &scc->uplinkConfigCommon->frequencyInfoUL;
|
||||||
mac->p_Max = frequencyInfoUL->p_Max ? *frequencyInfoUL->p_Max : INT_MIN;
|
mac->p_Max = frequencyInfoUL->p_Max ? *frequencyInfoUL->p_Max : INT_MIN;
|
||||||
bw_index = get_supported_band_index(frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
bw_index = get_supported_band_index(frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||||
mac->nr_band,
|
mac->nr_band > 256 ? FR2 : FR1,
|
||||||
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
||||||
cfg->carrier_config.uplink_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
|
cfg->carrier_config.uplink_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ static void config_common_ue(NR_UE_MAC_INST_t *mac,
|
|||||||
mac->frequency_range = mac->nr_band < 256 ? FR1 : FR2;
|
mac->frequency_range = mac->nr_band < 256 ? FR1 : FR2;
|
||||||
|
|
||||||
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||||
mac->nr_band,
|
mac->nr_band > 256 ? FR2 : FR1,
|
||||||
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
||||||
cfg->carrier_config.dl_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
|
cfg->carrier_config.dl_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ static void config_common_ue(NR_UE_MAC_INST_t *mac,
|
|||||||
mac->p_Max = frequencyInfoUL->p_Max ? *frequencyInfoUL->p_Max : INT_MIN;
|
mac->p_Max = frequencyInfoUL->p_Max ? *frequencyInfoUL->p_Max : INT_MIN;
|
||||||
|
|
||||||
int bw_index = get_supported_band_index(frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
int bw_index = get_supported_band_index(frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||||
*frequencyInfoUL->frequencyBandList->list.array[0],
|
*frequencyInfoUL->frequencyBandList->list.array[0] > 256 ? FR2 : FR1,
|
||||||
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
||||||
cfg->carrier_config.uplink_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
|
cfg->carrier_config.uplink_bandwidth = get_supported_bw_mhz(mac->frequency_range, bw_index);
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ static void sl_prepare_phy_config(int module_id,
|
|||||||
AssertFatal(carriercfg, "SCS_SpecificCarrier cannot be NULL");
|
AssertFatal(carriercfg, "SCS_SpecificCarrier cannot be NULL");
|
||||||
|
|
||||||
int bw_index = get_supported_band_index(carriercfg->subcarrierSpacing,
|
int bw_index = get_supported_band_index(carriercfg->subcarrierSpacing,
|
||||||
sl_band,
|
sl_band > 256 ? FR2 : FR1,
|
||||||
carriercfg->carrierBandwidth);
|
carriercfg->carrierBandwidth);
|
||||||
phycfg->sl_carrier_config.sl_bandwidth = get_supported_bw_mhz(FR1, bw_index);
|
phycfg->sl_carrier_config.sl_bandwidth = get_supported_bw_mhz(FR1, bw_index);
|
||||||
|
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ static void config_common(gNB_MAC_INST *nrmac, nr_pdsch_AntennaPorts_t pdsch_Ant
|
|||||||
// Carrier configuration
|
// Carrier configuration
|
||||||
struct NR_FrequencyInfoDL *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
|
struct NR_FrequencyInfoDL *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
|
||||||
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||||
*frequencyInfoDL->frequencyBandList.list.array[0],
|
*frequencyInfoDL->frequencyBandList.list.array[0] > 256 ? FR2 : FR1,
|
||||||
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
||||||
cfg->carrier_config.dl_bandwidth.value =
|
cfg->carrier_config.dl_bandwidth.value =
|
||||||
get_supported_bw_mhz(*frequencyInfoDL->frequencyBandList.list.array[0] > 256 ? FR2 : FR1, bw_index);
|
get_supported_bw_mhz(*frequencyInfoDL->frequencyBandList.list.array[0] > 256 ? FR2 : FR1, bw_index);
|
||||||
@@ -525,7 +525,7 @@ static void config_common(gNB_MAC_INST *nrmac, nr_pdsch_AntennaPorts_t pdsch_Ant
|
|||||||
}
|
}
|
||||||
struct NR_FrequencyInfoUL *frequencyInfoUL = scc->uplinkConfigCommon->frequencyInfoUL;
|
struct NR_FrequencyInfoUL *frequencyInfoUL = scc->uplinkConfigCommon->frequencyInfoUL;
|
||||||
bw_index = get_supported_band_index(frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
bw_index = get_supported_band_index(frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||||
*frequencyInfoUL->frequencyBandList->list.array[0],
|
*frequencyInfoUL->frequencyBandList->list.array[0] > 256 ? FR2 : FR1,
|
||||||
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth);
|
||||||
cfg->carrier_config.uplink_bandwidth.value =
|
cfg->carrier_config.uplink_bandwidth.value =
|
||||||
get_supported_bw_mhz(*frequencyInfoUL->frequencyBandList->list.array[0] > 256 ? FR2 : FR1, bw_index);
|
get_supported_bw_mhz(*frequencyInfoUL->frequencyBandList->list.array[0] > 256 ? FR2 : FR1, bw_index);
|
||||||
@@ -762,8 +762,8 @@ static void config_common(gNB_MAC_INST *nrmac, nr_pdsch_AntennaPorts_t pdsch_Ant
|
|||||||
num_ssb++;
|
num_ssb++;
|
||||||
}
|
}
|
||||||
cfg->num_tlv++;
|
cfg->num_tlv++;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
cfg->ssb_table.ssb_beam_id_list[32 + i].beam_id.tl.tag = NFAPI_NR_CONFIG_BEAM_ID_TAG;
|
cfg->ssb_table.ssb_beam_id_list[32 + i].beam_id.tl.tag = NFAPI_NR_CONFIG_BEAM_ID_TAG;
|
||||||
if ((cfg->ssb_table.ssb_mask_list[1].ssb_mask.value >> (31 - i)) & 1) {
|
if ((cfg->ssb_table.ssb_mask_list[1].ssb_mask.value >> (31 - i)) & 1) {
|
||||||
cfg->ssb_table.ssb_beam_id_list[32 + i].beam_id.value = num_ssb;
|
cfg->ssb_table.ssb_beam_id_list[32 + i].beam_id.value = num_ssb;
|
||||||
|
|||||||
@@ -130,6 +130,46 @@ uint8_t get_dl_nrOfLayers(const NR_UE_sched_ctrl_t *sched_ctrl,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Table 5.2.2.2.1-3 and Table 5.2.2.2.1-4 in 38.214
|
||||||
|
void get_k1_k2_indices(const int layers, const int N1, const int N2, const int i13, int *k1, int *k2)
|
||||||
|
{
|
||||||
|
AssertFatal(layers > 0 && layers < 5, "Number of layers %d not supported\n", layers);
|
||||||
|
*k1 = 0;
|
||||||
|
*k2 = 0;
|
||||||
|
if (layers == 2) {
|
||||||
|
if (N2 == 1)
|
||||||
|
*k1 = i13;
|
||||||
|
else if (N1 == N2) {
|
||||||
|
*k1 = i13 & 1;
|
||||||
|
*k2 = i13 >> 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*k1 = (i13 & 1) + (i13 == 3);
|
||||||
|
*k2 = (i13 == 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (layers == 3 || layers == 4) {
|
||||||
|
if (N2 == 1)
|
||||||
|
*k1 = i13 + 1;
|
||||||
|
else if (N1 == 2 && N2 == 2) {
|
||||||
|
*k1 = !(i13 & 1);
|
||||||
|
*k2 = (i13 > 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (i13 == 0)
|
||||||
|
*k1 = 1;
|
||||||
|
if (i13 == 1)
|
||||||
|
*k2 = 1;
|
||||||
|
if (i13 == 2) {
|
||||||
|
*k1 = 1;
|
||||||
|
*k2 = 1;
|
||||||
|
}
|
||||||
|
if (i13 == 3)
|
||||||
|
*k1 = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t get_pm_index(const gNB_MAC_INST *nrmac,
|
uint16_t get_pm_index(const gNB_MAC_INST *nrmac,
|
||||||
const NR_UE_info_t *UE,
|
const NR_UE_info_t *UE,
|
||||||
nr_dci_format_t dci_format,
|
nr_dci_format_t dci_format,
|
||||||
@@ -138,14 +178,16 @@ uint16_t get_pm_index(const gNB_MAC_INST *nrmac,
|
|||||||
{
|
{
|
||||||
if (dci_format == NR_DL_DCI_FORMAT_1_0 || nrmac->identity_pm || xp_pdsch_antenna_ports == 1)
|
if (dci_format == NR_DL_DCI_FORMAT_1_0 || nrmac->identity_pm || xp_pdsch_antenna_ports == 1)
|
||||||
return 0; //identity matrix (basic 5G configuration handled by PMI report is with XP antennas)
|
return 0; //identity matrix (basic 5G configuration handled by PMI report is with XP antennas)
|
||||||
|
|
||||||
const NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
|
const NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
|
||||||
const int report_id = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.csi_report_id;
|
const int report_id = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.csi_report_id;
|
||||||
const nr_csi_report_t *csi_report = &UE->csi_report_template[report_id];
|
const nr_csi_report_t *csi_report = &UE->csi_report_template[report_id];
|
||||||
const int N1 = csi_report->N1;
|
const int N1 = csi_report->N1;
|
||||||
const int N2 = csi_report->N2;
|
const int N2 = csi_report->N2;
|
||||||
const int antenna_ports = (N1 * N2) << 1;
|
const int antenna_ports = (N1 * N2) << 1;
|
||||||
const int x1 = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1;
|
if (antenna_ports < 2)
|
||||||
|
return 0; // single antenna port
|
||||||
|
|
||||||
|
int x1 = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1;
|
||||||
const int x2 = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2;
|
const int x2 = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2;
|
||||||
LOG_D(NR_MAC,"PMI report: x1 %d x2 %d layers: %d\n", x1, x2, layers);
|
LOG_D(NR_MAC,"PMI report: x1 %d x2 %d layers: %d\n", x1, x2, layers);
|
||||||
|
|
||||||
@@ -160,8 +202,44 @@ uint16_t get_pm_index(const gNB_MAC_INST *nrmac,
|
|||||||
// elements from n+1 to m for 2 layers etc.
|
// elements from n+1 to m for 2 layers etc.
|
||||||
if (antenna_ports == 2)
|
if (antenna_ports == 2)
|
||||||
return 1 + prev_layers_size + x2; // 0 for identity matrix
|
return 1 + prev_layers_size + x2; // 0 for identity matrix
|
||||||
else
|
else {
|
||||||
AssertFatal(1==0,"More than 2 antenna ports not yet supported\n");
|
int idx = layers - 1;
|
||||||
|
// the order of i1x in X1 report needs to be verified
|
||||||
|
// the standard is not very clear (Table 6.3.1.1.2-7 in 38.212)
|
||||||
|
// it says: PMI wideband information fields X1 , from left to right
|
||||||
|
int bitlen = csi_report->csi_meas_bitlen.pmi_i13_bitlen[idx];
|
||||||
|
if (layers == 1 && bitlen != 0) {
|
||||||
|
LOG_E(NR_MAC, "Invalid i13 bit length %d for single layer! It should be 0\n", bitlen);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
const int i13 = x1 & ((1 << bitlen) - 1);
|
||||||
|
x1 >>= bitlen;
|
||||||
|
bitlen = csi_report->csi_meas_bitlen.pmi_i12_bitlen[idx];
|
||||||
|
const int i12 = x1 & ((1 << bitlen) - 1);
|
||||||
|
x1 >>= bitlen;
|
||||||
|
bitlen = csi_report->csi_meas_bitlen.pmi_i11_bitlen[idx];
|
||||||
|
const int i11 = x1 & ((1 << bitlen) - 1);
|
||||||
|
const int i2 = x2;
|
||||||
|
int k1, k2;
|
||||||
|
get_k1_k2_indices(layers, N1, N2, i13, &k1, &k2); // get indices k1 and k2 for PHY matrix (not actual k1 and k2 values)
|
||||||
|
const int O2 = N2 == 1 ? 1 : 4;
|
||||||
|
int max_i2 = 0;
|
||||||
|
int lay_index = 0;
|
||||||
|
if (layers == 1) {
|
||||||
|
max_i2 = 4;
|
||||||
|
// computing precoding matrix index according to rule set in allocation function init_codebook_gNB
|
||||||
|
lay_index = i2 + (i12 * max_i2) + (i11 * max_i2 * N2 * O2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
max_i2 = 2;
|
||||||
|
// num of allowed k1 and k2 according to 5.2.2.2.1-3 and -4 in 38.214
|
||||||
|
int K1, K2;
|
||||||
|
get_K1_K2(N1, N2, &K1, &K2);
|
||||||
|
// computing precoding matrix index according to rule set in allocation function init_codebook_gNB
|
||||||
|
lay_index = i2 + (k2 * max_i2) + (k1 * max_i2 * K2) + (i12 * max_i2 * K2 * K1) + (i11 * max_i2 * K2 * K1 * N2 * O2);
|
||||||
|
}
|
||||||
|
return 1 + prev_layers_size + lay_index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx)
|
uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx)
|
||||||
|
|||||||
@@ -761,12 +761,12 @@ static int evaluate_ri_report(uint8_t *payload,
|
|||||||
NR_UE_sched_ctrl_t *sched_ctrl)
|
NR_UE_sched_ctrl_t *sched_ctrl)
|
||||||
{
|
{
|
||||||
uint8_t ri_index = pickandreverse_bits(payload, ri_bitlen, cumul_bits);
|
uint8_t ri_index = pickandreverse_bits(payload, ri_bitlen, cumul_bits);
|
||||||
int count=0;
|
int count = 0;
|
||||||
for (int i=0; i<8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
if ((ri_restriction>>i)&0x01) {
|
if ((ri_restriction >> i) & 0x01) {
|
||||||
if(count == ri_index) {
|
if(count == ri_index) {
|
||||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri = i;
|
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri = i;
|
||||||
LOG_D(MAC,"CSI Reported Rank %d\n", i+1);
|
LOG_D(MAC,"CSI Reported Rank %d\n", i + 1);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
@@ -821,8 +821,8 @@ static uint8_t evaluate_pmi_report(uint8_t *payload,
|
|||||||
//in case of 2 port CSI configuration x1 is empty and the information bits are in x2
|
//in case of 2 port CSI configuration x1 is empty and the information bits are in x2
|
||||||
int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits);
|
int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits);
|
||||||
|
|
||||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<<x1_bitlen)-1);
|
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi & ((1 << x1_bitlen) - 1);
|
||||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<<x2_bitlen)-1);
|
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi >> x1_bitlen) & ((1 << x2_bitlen) - 1);
|
||||||
LOG_D(MAC,"PMI Report: X1 %d X2 %d\n",
|
LOG_D(MAC,"PMI Report: X1 %d X2 %d\n",
|
||||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1,
|
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1,
|
||||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2);
|
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2);
|
||||||
|
|||||||
+163
-114
@@ -363,7 +363,7 @@ static void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigco
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
|
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
|
||||||
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t));
|
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(1, sizeof(uint8_t));
|
||||||
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
|
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
|
||||||
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
|
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
|
||||||
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
|
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
|
||||||
@@ -372,7 +372,7 @@ static void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigco
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4;
|
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4;
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row4.buf = calloc(2, sizeof(uint8_t));
|
resourceMapping.frequencyDomainAllocation.choice.row4.buf = calloc(1, sizeof(uint8_t));
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row4.size = 1;
|
resourceMapping.frequencyDomainAllocation.choice.row4.size = 1;
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row4.bits_unused = 5;
|
resourceMapping.frequencyDomainAllocation.choice.row4.bits_unused = 5;
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row4.buf[0] = 32;
|
resourceMapping.frequencyDomainAllocation.choice.row4.buf[0] = 32;
|
||||||
@@ -507,6 +507,47 @@ static void config_csiim(int do_csirs,
|
|||||||
csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL;
|
csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void set_dl_maxmimolayers(NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig,
|
||||||
|
const NR_ServingCellConfigCommon_t *scc,
|
||||||
|
const NR_UE_NR_Capability_t *uecap)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!pdsch_servingcellconfig->ext1)
|
||||||
|
pdsch_servingcellconfig->ext1=calloc(1,sizeof(*pdsch_servingcellconfig->ext1));
|
||||||
|
if(!pdsch_servingcellconfig->ext1->maxMIMO_Layers)
|
||||||
|
pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1,sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers));
|
||||||
|
|
||||||
|
NR_SCS_SpecificCarrier_t *scs_carrier = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0];
|
||||||
|
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||||
|
const frequency_range_t freq_range = band < 100 ? FR1 : FR2;
|
||||||
|
const int scs = scs_carrier->subcarrierSpacing;
|
||||||
|
const int bw_size = scs_carrier->carrierBandwidth;
|
||||||
|
|
||||||
|
NR_FeatureSets_t *fs = uecap ? uecap->featureSets : NULL;
|
||||||
|
if (fs) {
|
||||||
|
const int bw_index = get_supported_band_index(scs, freq_range, bw_size);
|
||||||
|
AssertFatal(bw_index >= 0, "BW corresponding to %d PRBs not found\n", bw_size);
|
||||||
|
// go through UL feature sets and look for one with current SCS
|
||||||
|
for (int i = 0; i < fs->featureSetsDownlinkPerCC->list.count; i++) {
|
||||||
|
NR_FeatureSetDownlinkPerCC_t *dl_fs = fs->featureSetsDownlinkPerCC->list.array[i];
|
||||||
|
long supported_bw;
|
||||||
|
if (freq_range == FR1)
|
||||||
|
supported_bw = dl_fs->supportedBandwidthDL.choice.fr1;
|
||||||
|
else
|
||||||
|
supported_bw = dl_fs->supportedBandwidthDL.choice.fr2;
|
||||||
|
if (scs == dl_fs->supportedSubcarrierSpacingDL &&
|
||||||
|
bw_index == supported_bw &&
|
||||||
|
dl_fs->maxNumberMIMO_LayersPDSCH) {
|
||||||
|
long ue_supported_layers = (2 << *dl_fs->maxNumberMIMO_LayersPDSCH);
|
||||||
|
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = NR_MAX_SUPPORTED_DL_LAYERS < ue_supported_layers ? NR_MAX_SUPPORTED_DL_LAYERS : ue_supported_layers;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Implement to b_SRS = 1 and b_SRS = 2
|
// TODO: Implement to b_SRS = 1 and b_SRS = 2
|
||||||
long rrc_get_max_nr_csrs(const int max_rbs, const long b_SRS) {
|
long rrc_get_max_nr_csrs(const int max_rbs, const long b_SRS) {
|
||||||
|
|
||||||
@@ -759,8 +800,9 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
|||||||
*bandNRinfo->pusch_256QAM = NR_BandNR__pusch_256QAM_supported;
|
*bandNRinfo->pusch_256QAM = NR_BandNR__pusch_256QAM_supported;
|
||||||
}
|
}
|
||||||
if (mcs_table_dl == 1) {
|
if (mcs_table_dl == 1) {
|
||||||
int bw = get_supported_band_index(numerology, band, rbsize);
|
const frequency_range_t freq_range = band < 257 ? FR1 : FR2;
|
||||||
if (band>256) {
|
int bw = get_supported_band_index(numerology, freq_range, rbsize);
|
||||||
|
if (freq_range == FR2) {
|
||||||
bandNRinfo->pdsch_256QAM_FR2 = CALLOC(1,sizeof(*bandNRinfo->pdsch_256QAM_FR2));
|
bandNRinfo->pdsch_256QAM_FR2 = CALLOC(1,sizeof(*bandNRinfo->pdsch_256QAM_FR2));
|
||||||
*bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported;
|
*bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported;
|
||||||
}
|
}
|
||||||
@@ -775,7 +817,7 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
|||||||
fs->featureSetsDownlinkPerCC = CALLOC(1,sizeof(*fs->featureSetsDownlinkPerCC));
|
fs->featureSetsDownlinkPerCC = CALLOC(1,sizeof(*fs->featureSetsDownlinkPerCC));
|
||||||
NR_FeatureSetDownlinkPerCC_t *fs_cc = CALLOC(1,sizeof(NR_FeatureSetDownlinkPerCC_t));
|
NR_FeatureSetDownlinkPerCC_t *fs_cc = CALLOC(1,sizeof(NR_FeatureSetDownlinkPerCC_t));
|
||||||
fs_cc->supportedSubcarrierSpacingDL = numerology;
|
fs_cc->supportedSubcarrierSpacingDL = numerology;
|
||||||
if(band>256) {
|
if(freq_range == FR2) {
|
||||||
fs_cc->supportedBandwidthDL.present = NR_SupportedBandwidth_PR_fr2;
|
fs_cc->supportedBandwidthDL.present = NR_SupportedBandwidth_PR_fr2;
|
||||||
fs_cc->supportedBandwidthDL.choice.fr2 = bw;
|
fs_cc->supportedBandwidthDL.choice.fr2 = bw;
|
||||||
}
|
}
|
||||||
@@ -1135,17 +1177,18 @@ static void set_dl_mcs_table(int scs,
|
|||||||
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||||
struct NR_FrequencyInfoDL__scs_SpecificCarrierList scs_list = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList;
|
struct NR_FrequencyInfoDL__scs_SpecificCarrierList scs_list = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList;
|
||||||
int bw_rb = -1;
|
int bw_rb = -1;
|
||||||
for(int i=0; i<scs_list.list.count; i++){
|
for(int i = 0; i < scs_list.list.count; i++){
|
||||||
if(scs == scs_list.list.array[i]->subcarrierSpacing){
|
if(scs == scs_list.list.array[i]->subcarrierSpacing){
|
||||||
bw_rb = scs_list.list.array[i]->carrierBandwidth;
|
bw_rb = scs_list.list.array[i]->carrierBandwidth;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AssertFatal(bw_rb>0,"Could not find scs-SpecificCarrierList element for scs %d",scs);
|
AssertFatal(bw_rb > 0,"Could not find scs-SpecificCarrierList element for scs %d", scs);
|
||||||
|
|
||||||
bool supported = false;
|
bool supported = false;
|
||||||
if (band>256) {
|
const frequency_range_t freq_range = band > 256 ? FR2 : FR1;
|
||||||
for (int i=0;i<cap->rf_Parameters.supportedBandListNR.list.count;i++) {
|
if (freq_range == FR2) {
|
||||||
|
for (int i = 0; i < cap->rf_Parameters.supportedBandListNR.list.count; i++) {
|
||||||
NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
|
NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
|
||||||
if(bandNRinfo->bandNR == band && bandNRinfo->pdsch_256QAM_FR2) {
|
if(bandNRinfo->bandNR == band && bandNRinfo->pdsch_256QAM_FR2) {
|
||||||
supported = true;
|
supported = true;
|
||||||
@@ -1514,10 +1557,12 @@ static void config_csi_codebook(const nr_pdsch_AntennaPorts_t *antennaports,
|
|||||||
{
|
{
|
||||||
const int num_ant_ports = antennaports->N1 * antennaports->N2 * antennaports->XP;
|
const int num_ant_ports = antennaports->N1 * antennaports->N2 * antennaports->XP;
|
||||||
codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1;
|
codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1;
|
||||||
codebookConfig->codebookType.choice.type1 = calloc(1, sizeof(*codebookConfig->codebookType.choice.type1));
|
if(!codebookConfig->codebookType.choice.type1)
|
||||||
|
codebookConfig->codebookType.choice.type1 = calloc(1, sizeof(*codebookConfig->codebookType.choice.type1));
|
||||||
// Single panel configuration
|
// Single panel configuration
|
||||||
codebookConfig->codebookType.choice.type1->subType.present = NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel;
|
codebookConfig->codebookType.choice.type1->subType.present = NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel;
|
||||||
codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel = calloc(1, sizeof(*codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel));
|
if(!codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)
|
||||||
|
codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel = calloc(1, sizeof(*codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel));
|
||||||
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *singlePanelConfig = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
|
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *singlePanelConfig = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
|
||||||
singlePanelConfig->typeI_SinglePanel_ri_Restriction.size = 1;
|
singlePanelConfig->typeI_SinglePanel_ri_Restriction.size = 1;
|
||||||
singlePanelConfig->typeI_SinglePanel_ri_Restriction.bits_unused = 0;
|
singlePanelConfig->typeI_SinglePanel_ri_Restriction.bits_unused = 0;
|
||||||
@@ -1525,85 +1570,88 @@ static void config_csi_codebook(const nr_pdsch_AntennaPorts_t *antennaports,
|
|||||||
singlePanelConfig->typeI_SinglePanel_ri_Restriction.buf[0] = (1 << max_layers) - 1; // max_layers bit set to 1
|
singlePanelConfig->typeI_SinglePanel_ri_Restriction.buf[0] = (1 << max_layers) - 1; // max_layers bit set to 1
|
||||||
if (num_ant_ports == 2) {
|
if (num_ant_ports == 2) {
|
||||||
singlePanelConfig->nrOfAntennaPorts.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two;
|
singlePanelConfig->nrOfAntennaPorts.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two;
|
||||||
singlePanelConfig->nrOfAntennaPorts.choice.two = calloc(1, sizeof(*singlePanelConfig->nrOfAntennaPorts.choice.two));
|
if(!singlePanelConfig->nrOfAntennaPorts.choice.two) {
|
||||||
singlePanelConfig->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size = 1;
|
asn1cCalloc(singlePanelConfig->nrOfAntennaPorts.choice.two, two);
|
||||||
singlePanelConfig->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused = 2;
|
two->twoTX_CodebookSubsetRestriction.size = 1;
|
||||||
singlePanelConfig->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf = calloc(1, sizeof(uint8_t));
|
two->twoTX_CodebookSubsetRestriction.bits_unused = 2;
|
||||||
singlePanelConfig->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0] = 0xfc; // no restriction (all 6 bits enabled)
|
asn1cCallocOne(two->twoTX_CodebookSubsetRestriction.buf, 0xfc); // no restriction (all 6 bits enabled)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
singlePanelConfig->nrOfAntennaPorts.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo;
|
singlePanelConfig->nrOfAntennaPorts.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo;
|
||||||
singlePanelConfig->nrOfAntennaPorts.choice.moreThanTwo = calloc(1, sizeof(*singlePanelConfig->nrOfAntennaPorts.choice.moreThanTwo));
|
if(!singlePanelConfig->nrOfAntennaPorts.choice.moreThanTwo) {
|
||||||
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo *moreThanTwo = singlePanelConfig->nrOfAntennaPorts.choice.moreThanTwo;
|
singlePanelConfig->nrOfAntennaPorts.choice.moreThanTwo = calloc(1, sizeof(*singlePanelConfig->nrOfAntennaPorts.choice.moreThanTwo));
|
||||||
switch (num_ant_ports) {
|
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo *moreThanTwo = singlePanelConfig->nrOfAntennaPorts.choice.moreThanTwo;
|
||||||
case 4:
|
switch (num_ant_ports) {
|
||||||
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction;
|
case 4:
|
||||||
moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.size = 1;
|
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction;
|
||||||
moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.size = 1;
|
||||||
moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.buf = calloc(1, sizeof(uint8_t));
|
moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
||||||
moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.buf[0] = 0xff; // TODO verify the meaning of this parameter
|
// TODO verify the meaning of this parameter
|
||||||
break;
|
asn1cCallocOne(moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.buf, 0xff);
|
||||||
case 8:
|
break;
|
||||||
if (antennaports->N1 == 2) {
|
case 8:
|
||||||
AssertFatal(antennaports->N2 == 2, "N1 and N2 not in accordace with the specifications\n");
|
if (antennaports->N1 == 2) {
|
||||||
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction;
|
AssertFatal(antennaports->N2 == 2, "N1 and N2 not in accordace with the specifications\n");
|
||||||
moreThanTwo->n1_n2.choice.two_two_TypeI_SinglePanel_Restriction.size = 8;
|
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction;
|
||||||
moreThanTwo->n1_n2.choice.two_two_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
moreThanTwo->n1_n2.choice.two_two_TypeI_SinglePanel_Restriction.size = 8;
|
||||||
moreThanTwo->n1_n2.choice.two_two_TypeI_SinglePanel_Restriction.buf = calloc(8, sizeof(uint8_t));
|
moreThanTwo->n1_n2.choice.two_two_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
||||||
for (int i = 0; i < 8; i++)
|
moreThanTwo->n1_n2.choice.two_two_TypeI_SinglePanel_Restriction.buf = calloc(8, sizeof(uint8_t));
|
||||||
moreThanTwo->n1_n2.choice.two_two_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
for (int i = 0; i < 8; i++)
|
||||||
} else if (antennaports->N1 == 4) {
|
moreThanTwo->n1_n2.choice.two_two_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
||||||
AssertFatal(antennaports->N2 == 1, "N1 and N2 not in accordace with the specifications\n");
|
} else if (antennaports->N1 == 4) {
|
||||||
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction;
|
AssertFatal(antennaports->N2 == 1, "N1 and N2 not in accordace with the specifications\n");
|
||||||
moreThanTwo->n1_n2.choice.four_one_TypeI_SinglePanel_Restriction.size = 2;
|
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction;
|
||||||
moreThanTwo->n1_n2.choice.four_one_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
moreThanTwo->n1_n2.choice.four_one_TypeI_SinglePanel_Restriction.size = 2;
|
||||||
moreThanTwo->n1_n2.choice.four_one_TypeI_SinglePanel_Restriction.buf = calloc(2, sizeof(uint8_t));
|
moreThanTwo->n1_n2.choice.four_one_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
||||||
for (int i = 0; i < 2; i++)
|
moreThanTwo->n1_n2.choice.four_one_TypeI_SinglePanel_Restriction.buf = calloc(2, sizeof(uint8_t));
|
||||||
moreThanTwo->n1_n2.choice.four_one_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
for (int i = 0; i < 2; i++)
|
||||||
} else
|
moreThanTwo->n1_n2.choice.four_one_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
||||||
AssertFatal(1 == 0, "N1 %d and N2 %d not supported for %d antenna ports\n", antennaports->N1, antennaports->N2, num_ant_ports);
|
} else
|
||||||
break;
|
AssertFatal(1 == 0, "N1 %d and N2 %d not supported for %d antenna ports\n", antennaports->N1, antennaports->N2, num_ant_ports);
|
||||||
case 12:
|
break;
|
||||||
if (antennaports->N1 == 3) {
|
case 12:
|
||||||
AssertFatal(antennaports->N2 == 2, "N1 and N2 not in accordace with the specifications\n");
|
if (antennaports->N1 == 3) {
|
||||||
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction;
|
AssertFatal(antennaports->N2 == 2, "N1 and N2 not in accordace with the specifications\n");
|
||||||
moreThanTwo->n1_n2.choice.three_two_TypeI_SinglePanel_Restriction.size = 12;
|
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction;
|
||||||
moreThanTwo->n1_n2.choice.three_two_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
moreThanTwo->n1_n2.choice.three_two_TypeI_SinglePanel_Restriction.size = 12;
|
||||||
moreThanTwo->n1_n2.choice.three_two_TypeI_SinglePanel_Restriction.buf = calloc(12, sizeof(uint8_t));
|
moreThanTwo->n1_n2.choice.three_two_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
||||||
for (int i = 0; i < 12; i++)
|
moreThanTwo->n1_n2.choice.three_two_TypeI_SinglePanel_Restriction.buf = calloc(12, sizeof(uint8_t));
|
||||||
moreThanTwo->n1_n2.choice.three_two_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
for (int i = 0; i < 12; i++)
|
||||||
} else if (antennaports->N1 == 6) {
|
moreThanTwo->n1_n2.choice.three_two_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
||||||
AssertFatal(antennaports->N2 == 1, "N1 and N2 not in accordace with the specifications\n");
|
} else if (antennaports->N1 == 6) {
|
||||||
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction;
|
AssertFatal(antennaports->N2 == 1, "N1 and N2 not in accordace with the specifications\n");
|
||||||
moreThanTwo->n1_n2.choice.six_one_TypeI_SinglePanel_Restriction.size = 3;
|
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction;
|
||||||
moreThanTwo->n1_n2.choice.six_one_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
moreThanTwo->n1_n2.choice.six_one_TypeI_SinglePanel_Restriction.size = 3;
|
||||||
moreThanTwo->n1_n2.choice.six_one_TypeI_SinglePanel_Restriction.buf = calloc(3, sizeof(uint8_t));
|
moreThanTwo->n1_n2.choice.six_one_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
||||||
for (int i = 0; i < 3; i++)
|
moreThanTwo->n1_n2.choice.six_one_TypeI_SinglePanel_Restriction.buf = calloc(3, sizeof(uint8_t));
|
||||||
moreThanTwo->n1_n2.choice.six_one_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
for (int i = 0; i < 3; i++)
|
||||||
} else
|
moreThanTwo->n1_n2.choice.six_one_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
||||||
AssertFatal(1 == 0, "N1 %d and N2 %d not supported for %d antenna ports\n", antennaports->N1, antennaports->N2, num_ant_ports);
|
} else
|
||||||
break;
|
AssertFatal(1 == 0, "N1 %d and N2 %d not supported for %d antenna ports\n", antennaports->N1, antennaports->N2, num_ant_ports);
|
||||||
case 16:
|
break;
|
||||||
if (antennaports->N1 == 4) {
|
case 16:
|
||||||
AssertFatal(antennaports->N2 == 2, "N1 and N2 not in accordace with the specifications\n");
|
if (antennaports->N1 == 4) {
|
||||||
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction;
|
AssertFatal(antennaports->N2 == 2, "N1 and N2 not in accordace with the specifications\n");
|
||||||
moreThanTwo->n1_n2.choice.four_two_TypeI_SinglePanel_Restriction.size = 16;
|
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction;
|
||||||
moreThanTwo->n1_n2.choice.four_two_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
moreThanTwo->n1_n2.choice.four_two_TypeI_SinglePanel_Restriction.size = 16;
|
||||||
moreThanTwo->n1_n2.choice.four_two_TypeI_SinglePanel_Restriction.buf = calloc(16, sizeof(uint8_t));
|
moreThanTwo->n1_n2.choice.four_two_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
||||||
for (int i = 0; i < 16; i++)
|
moreThanTwo->n1_n2.choice.four_two_TypeI_SinglePanel_Restriction.buf = calloc(16, sizeof(uint8_t));
|
||||||
moreThanTwo->n1_n2.choice.four_two_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
for (int i = 0; i < 16; i++)
|
||||||
} else if (antennaports->N1 == 8) {
|
moreThanTwo->n1_n2.choice.four_two_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
||||||
AssertFatal(antennaports->N2 == 1, "N1 and N2 not in accordace with the specifications\n");
|
} else if (antennaports->N1 == 8) {
|
||||||
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction;
|
AssertFatal(antennaports->N2 == 1, "N1 and N2 not in accordace with the specifications\n");
|
||||||
moreThanTwo->n1_n2.choice.eight_one_TypeI_SinglePanel_Restriction.size = 4;
|
moreThanTwo->n1_n2.present = NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction;
|
||||||
moreThanTwo->n1_n2.choice.eight_one_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
moreThanTwo->n1_n2.choice.eight_one_TypeI_SinglePanel_Restriction.size = 4;
|
||||||
moreThanTwo->n1_n2.choice.eight_one_TypeI_SinglePanel_Restriction.buf = calloc(4, sizeof(uint8_t));
|
moreThanTwo->n1_n2.choice.eight_one_TypeI_SinglePanel_Restriction.bits_unused = 0;
|
||||||
for (int i = 0; i < 4; i++)
|
moreThanTwo->n1_n2.choice.eight_one_TypeI_SinglePanel_Restriction.buf = calloc(4, sizeof(uint8_t));
|
||||||
moreThanTwo->n1_n2.choice.eight_one_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
for (int i = 0; i < 4; i++)
|
||||||
} else
|
moreThanTwo->n1_n2.choice.eight_one_TypeI_SinglePanel_Restriction.buf[i] = 0xff; // TODO verify the meaning of this parameter
|
||||||
AssertFatal(1 == 0, "N1 %d and N2 %d not supported for %d antenna ports\n", antennaports->N1, antennaports->N2, num_ant_ports);
|
} else
|
||||||
break;
|
AssertFatal(1 == 0, "N1 %d and N2 %d not supported for %d antenna ports\n", antennaports->N1, antennaports->N2, num_ant_ports);
|
||||||
default:
|
break;
|
||||||
AssertFatal(1 == 0, "%d antenna ports not supported\n", num_ant_ports);
|
default:
|
||||||
|
AssertFatal(1 == 0, "%d antenna ports not supported\n", num_ant_ports);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
codebookConfig->codebookType.choice.type1->codebookMode = 1;
|
codebookConfig->codebookType.choice.type1->codebookMode = 1;
|
||||||
@@ -1679,7 +1727,8 @@ static void config_rsrp_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
|||||||
NR_PUCCH_CSI_Resource_t *pucchcsires,
|
NR_PUCCH_CSI_Resource_t *pucchcsires,
|
||||||
int do_csi, // if rsrp is based on CSI or SSB
|
int do_csi, // if rsrp is based on CSI or SSB
|
||||||
int rep_id,
|
int rep_id,
|
||||||
int uid)
|
int uid,
|
||||||
|
int num_antenna_ports)
|
||||||
{
|
{
|
||||||
NR_CSI_ReportConfig_t *csirep = calloc(1, sizeof(*csirep));
|
NR_CSI_ReportConfig_t *csirep = calloc(1, sizeof(*csirep));
|
||||||
csirep->reportConfigId = rep_id;
|
csirep->reportConfigId = rep_id;
|
||||||
@@ -1688,7 +1737,7 @@ static void config_rsrp_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
|||||||
for (int csi_list = 0; csi_list < csi_MeasConfig->csi_ResourceConfigToAddModList->list.count; csi_list++) {
|
for (int csi_list = 0; csi_list < csi_MeasConfig->csi_ResourceConfigToAddModList->list.count; csi_list++) {
|
||||||
NR_CSI_ResourceConfig_t *csires = csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[csi_list];
|
NR_CSI_ResourceConfig_t *csires = csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[csi_list];
|
||||||
if (csires->csi_RS_ResourceSetList.present == NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB) {
|
if (csires->csi_RS_ResourceSetList.present == NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB) {
|
||||||
if (do_csi) {
|
if (do_csi && num_antenna_ports < 4) {
|
||||||
if (csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList)
|
if (csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList)
|
||||||
resource_id = csires->csi_ResourceConfigId;
|
resource_id = csires->csi_ResourceConfigId;
|
||||||
} else {
|
} else {
|
||||||
@@ -1707,7 +1756,7 @@ static void config_rsrp_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
|||||||
csirep->reportConfigType.choice.periodic = calloc(1, sizeof(*csirep->reportConfigType.choice.periodic));
|
csirep->reportConfigType.choice.periodic = calloc(1, sizeof(*csirep->reportConfigType.choice.periodic));
|
||||||
set_csi_meas_periodicity(servingcellconfigcommon, csirep, uid, true);
|
set_csi_meas_periodicity(servingcellconfigcommon, csirep, uid, true);
|
||||||
asn1cSeqAdd(&csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list, pucchcsires);
|
asn1cSeqAdd(&csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list, pucchcsires);
|
||||||
if (do_csi) {
|
if (do_csi && num_antenna_ports < 4) {
|
||||||
csirep->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP;
|
csirep->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP;
|
||||||
csirep->reportQuantity.choice.cri_RSRP = (NULL_t)0;
|
csirep->reportQuantity.choice.cri_RSRP = (NULL_t)0;
|
||||||
} else {
|
} else {
|
||||||
@@ -2264,6 +2313,13 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid,
|
|||||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->present = NR_SetupRelease_PDSCH_ServingCellConfig_PR_setup;
|
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->present = NR_SetupRelease_PDSCH_ServingCellConfig_PR_setup;
|
||||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup = pdsch_servingcellconfig;
|
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup = pdsch_servingcellconfig;
|
||||||
|
|
||||||
|
pdsch_servingcellconfig->codeBlockGroupTransmission = NULL;
|
||||||
|
pdsch_servingcellconfig->xOverhead = NULL;
|
||||||
|
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
|
||||||
|
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
|
||||||
|
pdsch_servingcellconfig->pucch_Cell = NULL;
|
||||||
|
set_dl_maxmimolayers(pdsch_servingcellconfig, scc, NULL);
|
||||||
|
|
||||||
// Downlink BWPs
|
// Downlink BWPs
|
||||||
int n_dl_bwp = 0;
|
int n_dl_bwp = 0;
|
||||||
if (servingcellconfigdedicated && servingcellconfigdedicated->downlinkBWP_ToAddModList
|
if (servingcellconfigdedicated && servingcellconfigdedicated->downlinkBWP_ToAddModList
|
||||||
@@ -2404,23 +2460,15 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid,
|
|||||||
pucchcsi,
|
pucchcsi,
|
||||||
pdsch_Config,
|
pdsch_Config,
|
||||||
&configuration->pdsch_AntennaPorts,
|
&configuration->pdsch_AntennaPorts,
|
||||||
NR_MAX_SUPPORTED_DL_LAYERS,
|
*pdsch_servingcellconfig->ext1->maxMIMO_Layers,
|
||||||
bwp_id,
|
bwp_id,
|
||||||
uid);
|
uid);
|
||||||
}
|
}
|
||||||
NR_PUCCH_CSI_Resource_t *pucchrsrp = calloc(1, sizeof(*pucchrsrp));
|
NR_PUCCH_CSI_Resource_t *pucchrsrp = calloc(1, sizeof(*pucchrsrp));
|
||||||
pucchrsrp->uplinkBandwidthPartId = bwp_id;
|
pucchrsrp->uplinkBandwidthPartId = bwp_id;
|
||||||
pucchrsrp->pucch_Resource = pucch_Resource;
|
pucchrsrp->pucch_Resource = pucch_Resource;
|
||||||
config_rsrp_meas_report(csi_MeasConfig, scc, pucchrsrp, configuration->do_CSIRS, bwp_id + 10, uid);
|
config_rsrp_meas_report(csi_MeasConfig, scc, pucchrsrp, configuration->do_CSIRS, bwp_id + 10, uid, pdsch_AntennaPorts);
|
||||||
}
|
}
|
||||||
pdsch_servingcellconfig->codeBlockGroupTransmission = NULL;
|
|
||||||
pdsch_servingcellconfig->xOverhead = NULL;
|
|
||||||
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
|
|
||||||
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
|
|
||||||
pdsch_servingcellconfig->pucch_Cell = NULL;
|
|
||||||
pdsch_servingcellconfig->ext1 = calloc(1, sizeof(*pdsch_servingcellconfig->ext1));
|
|
||||||
pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1, sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers));
|
|
||||||
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = 2;
|
|
||||||
|
|
||||||
if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
|
if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
|
||||||
xer_fprint(stdout, &asn_DEF_NR_SpCellConfig, SpCellConfig);
|
xer_fprint(stdout, &asn_DEF_NR_SpCellConfig, SpCellConfig);
|
||||||
@@ -2472,6 +2520,16 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
|||||||
|
|
||||||
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
|
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
|
||||||
|
|
||||||
|
NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig = SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup;
|
||||||
|
set_dl_maxmimolayers(pdsch_servingcellconfig, scc, uecap);
|
||||||
|
|
||||||
|
NR_CSI_MeasConfig_t *csi_MeasConfig = SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
|
||||||
|
for (int report = 0; report < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; report++) {
|
||||||
|
NR_CSI_ReportConfig_t *csirep = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[report];
|
||||||
|
if(csirep->codebookConfig)
|
||||||
|
config_csi_codebook(&configuration->pdsch_AntennaPorts, *pdsch_servingcellconfig->ext1->maxMIMO_Layers, csirep->codebookConfig);
|
||||||
|
}
|
||||||
|
|
||||||
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||||
NR_UplinkConfig_t *uplinkConfig =
|
NR_UplinkConfig_t *uplinkConfig =
|
||||||
SpCellConfig && SpCellConfig->spCellConfigDedicated ? SpCellConfig->spCellConfigDedicated->uplinkConfig : NULL;
|
SpCellConfig && SpCellConfig->spCellConfigDedicated ? SpCellConfig->spCellConfigDedicated->uplinkConfig : NULL;
|
||||||
@@ -2561,7 +2619,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
|||||||
ul_bwp->bwp_Dedicated->srs_Config = get_config_srs(scc, uecap, bwp_size, uid, i + 1, maxMIMO_Layers, configuration->do_SRS);
|
ul_bwp->bwp_Dedicated->srs_Config = get_config_srs(scc, uecap, bwp_size, uid, i + 1, maxMIMO_Layers, configuration->do_SRS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update_cqitables(bwp_Dedicated->pdsch_Config, SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup);
|
update_cqitables(bwp_Dedicated->pdsch_Config, csi_MeasConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig)
|
void free_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig)
|
||||||
@@ -2842,9 +2900,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
|||||||
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
|
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
|
||||||
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
|
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
|
||||||
pdsch_servingcellconfig->pucch_Cell = NULL;
|
pdsch_servingcellconfig->pucch_Cell = NULL;
|
||||||
pdsch_servingcellconfig->ext1 = calloc(1, sizeof(*pdsch_servingcellconfig->ext1));
|
set_dl_maxmimolayers(pdsch_servingcellconfig, servingcellconfigcommon, uecap);
|
||||||
pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1, sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers));
|
|
||||||
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = NR_MAX_SUPPORTED_DL_LAYERS;
|
|
||||||
pdsch_servingcellconfig->ext1->processingType2Enabled = NULL;
|
pdsch_servingcellconfig->ext1->processingType2Enabled = NULL;
|
||||||
|
|
||||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig = NULL;
|
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig = NULL;
|
||||||
@@ -2929,15 +2985,8 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
|||||||
pucchcsires1->uplinkBandwidthPartId = bwp->bwp_Id;
|
pucchcsires1->uplinkBandwidthPartId = bwp->bwp_Id;
|
||||||
pucchcsires1->pucch_Resource = 2;
|
pucchcsires1->pucch_Resource = 2;
|
||||||
|
|
||||||
config_csi_meas_report(csi_MeasConfig,
|
config_csi_meas_report(csi_MeasConfig, servingcellconfigcommon, pucchcsires1, bwp->bwp_Dedicated->pdsch_Config, pdschap, *pdsch_servingcellconfig->ext1->maxMIMO_Layers, bwp->bwp_Id, uid);
|
||||||
servingcellconfigcommon,
|
config_rsrp_meas_report(csi_MeasConfig, servingcellconfigcommon, pucchcsires1, do_csirs, bwp->bwp_Id + 10, uid, dl_antenna_ports);
|
||||||
pucchcsires1,
|
|
||||||
bwp->bwp_Dedicated->pdsch_Config,
|
|
||||||
pdschap,
|
|
||||||
NR_MAX_SUPPORTED_DL_LAYERS,
|
|
||||||
bwp->bwp_Id,
|
|
||||||
uid);
|
|
||||||
config_rsrp_meas_report(csi_MeasConfig, servingcellconfigcommon, pucchcsires1, do_csirs, bwp->bwp_Id + 10, uid);
|
|
||||||
}
|
}
|
||||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->sCellDeactivationTimer = NULL;
|
secondaryCellGroup->spCellConfig->spCellConfigDedicated->sCellDeactivationTimer = NULL;
|
||||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig = NULL;
|
secondaryCellGroup->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig = NULL;
|
||||||
|
|||||||
@@ -44,7 +44,8 @@
|
|||||||
#include "NR_SecurityConfig.h"
|
#include "NR_SecurityConfig.h"
|
||||||
#include "NR_CellGroupConfig.h"
|
#include "NR_CellGroupConfig.h"
|
||||||
|
|
||||||
#define NR_MAX_SUPPORTED_DL_LAYERS 2
|
#define NR_MAX_SUPPORTED_DL_LAYERS 4
|
||||||
|
void rrc_init_nr_srb_param(NR_LCHAN_DESC *chan);
|
||||||
|
|
||||||
void rrc_gNB_process_SgNBAdditionRequest(
|
void rrc_gNB_process_SgNBAdditionRequest(
|
||||||
const protocol_ctxt_t *const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ static int get_ssb_arfcn(const f1ap_served_cell_info_t *cell_info, const NR_MIB_
|
|||||||
else
|
else
|
||||||
AssertFatal(false, "Invalid absoluteFrequencyPointA: %d\n", dl_arfcn);
|
AssertFatal(false, "Invalid absoluteFrequencyPointA: %d\n", dl_arfcn);
|
||||||
|
|
||||||
int bw_index = get_supported_band_index(scs, band, get_dl_bw(cell_info));
|
int bw_index = get_supported_band_index(scs, band > 256 ? FR2 : FR1, get_dl_bw(cell_info));
|
||||||
int band_size_hz = get_supported_bw_mhz(band > 256 ? FR2 : FR1, bw_index) * 1000 * 1000;
|
int band_size_hz = get_supported_bw_mhz(band > 256 ? FR2 : FR1, bw_index) * 1000 * 1000;
|
||||||
uint32_t ssb_arfcn = to_nrarfcn(band, freqssb, scs, band_size_hz);
|
uint32_t ssb_arfcn = to_nrarfcn(band, freqssb, scs, band_size_hz);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user