adding check on allowed pm index in dlsim
This commit is contained in:
@@ -236,8 +236,39 @@ nrUE_params_t *get_nrUE_params(void) {
|
||||
return &nrUE_params;
|
||||
}
|
||||
|
||||
void do_nothing(void *args) {
|
||||
|
||||
void validate_input_pmi(rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, int nrOfLayers, int pmi)
|
||||
{
|
||||
if (pmi == 0)
|
||||
return;
|
||||
|
||||
int num_antenna_ports = pdsch_AntennaPorts.N1 * pdsch_AntennaPorts.N2 * pdsch_AntennaPorts.XP;
|
||||
int N1 = pdsch_AntennaPorts.N1;
|
||||
int N2 = pdsch_AntennaPorts.N2;
|
||||
int O1 = N1 > 1 ? 4 : 1;
|
||||
int O2 = N2 > 1 ? 4 : 1;
|
||||
int K1, K2;
|
||||
if (num_antenna_ports > 2)
|
||||
get_K1_K2(N1, N2, &K1, &K2);
|
||||
else {
|
||||
K1 = 1; K2 = 1;
|
||||
}
|
||||
int num_pmi = 1; // pmi = 0 is the identity matrix
|
||||
switch (nrOfLayers) {
|
||||
case 1 :
|
||||
num_pmi += N1 * O1 * N2 * O2 * 4;
|
||||
AssertFatal(pmi < num_pmi, "Input PMI index %d exceeds the limit of configured matrices %d for %d layers\n", pmi, num_pmi, nrOfLayers);
|
||||
return;
|
||||
case 2 :
|
||||
num_pmi += N1 * O1 * N2 * O2 * K1 * K2 * 2;
|
||||
AssertFatal(pmi < num_pmi, "Input PMI index %d exceeds the limit of conigured matrices %d for %d layers\n", pmi, num_pmi, nrOfLayers);
|
||||
break;
|
||||
default :
|
||||
AssertFatal(false, "Precoding with more than 2 nrOfLayers not yet supported\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int NB_UE_INST = 1;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -544,6 +575,7 @@ int main(int argc, char **argv)
|
||||
printf("-y Number of TX antennas used in gNB\n");
|
||||
printf("-z Number of RX antennas used in UE\n");
|
||||
printf("-x Num of layer for PDSCH\n");
|
||||
printf("-p Precoding matrix index\n");
|
||||
printf("-i Change channel estimation technique. Arguments list: Frequency domain {0:Linear interpolation, 1:PRB based averaging}, Time domain {0:Estimates of last DMRS symbol, 1:Average of DMRS symbols}\n");
|
||||
//printf("-j Relative strength of second intefering gNB (in dB) - cell_id mod 3 = 2\n");
|
||||
printf("-R N_RB_DL\n");
|
||||
@@ -673,6 +705,8 @@ int main(int argc, char **argv)
|
||||
gNB->ap_N2 = pdsch_AntennaPorts.N2;
|
||||
gNB->ap_XP = pdsch_AntennaPorts.XP;
|
||||
|
||||
validate_input_pmi(pdsch_AntennaPorts, g_nrOfLayers, g_pmi);
|
||||
|
||||
NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t));
|
||||
prepare_sim_uecap(UE_Capability_nr,scc,mu,
|
||||
N_RB_DL,g_mcsTableIdx);
|
||||
|
||||
Reference in New Issue
Block a user