Merge branch 'enhancement-16-tm_rrc_reconfig' into feature-59-tm4
This commit is contained in:
@@ -56,69 +56,7 @@
|
||||
PHY_VARS_eNB *PHY_vars_eNB;
|
||||
PHY_VARS_UE *PHY_vars_UE;
|
||||
|
||||
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,lte_frame_type_t frame_type, uint16_t Nid_cell,uint8_t tdd_config,
|
||||
uint8_t N_RB_DL,uint8_t osf,uint32_t perfect_ce)
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms;
|
||||
|
||||
|
||||
printf("Start lte_param_init\n");
|
||||
PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
|
||||
//PHY_config = malloc(sizeof(PHY_CONFIG));
|
||||
mac_xface = malloc(sizeof(MAC_xface));
|
||||
|
||||
srand(1);
|
||||
randominit(1);
|
||||
set_taus_seed(1);
|
||||
|
||||
lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
|
||||
|
||||
lte_frame_parms->N_RB_DL = N_RB_DL; //50 for 10MHz and 25 for 5 MHz
|
||||
lte_frame_parms->N_RB_UL = N_RB_DL;
|
||||
lte_frame_parms->Ncp = extended_prefix_flag;
|
||||
lte_frame_parms->Nid_cell = Nid_cell;
|
||||
lte_frame_parms->Nid_cell_mbsfn = 1;
|
||||
lte_frame_parms->nushift = Nid_cell%6;
|
||||
lte_frame_parms->nb_antennas_tx = N_tx;
|
||||
lte_frame_parms->nb_antennas_rx = N_rx;
|
||||
lte_frame_parms->phich_config_common.phich_resource = oneSixth;
|
||||
lte_frame_parms->tdd_config = tdd_config;
|
||||
lte_frame_parms->frame_type = frame_type;
|
||||
// lte_frame_parms->Csrs = 2;
|
||||
// lte_frame_parms->Bsrs = 0;
|
||||
// lte_frame_parms->kTC = 0;44
|
||||
// lte_frame_parms->n_RRC = 0;
|
||||
lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
|
||||
|
||||
init_frame_parms(lte_frame_parms,osf);
|
||||
|
||||
//copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
|
||||
|
||||
PHY_vars_UE->is_secondary_ue = 0;
|
||||
PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
|
||||
PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
|
||||
|
||||
phy_init_lte_top(lte_frame_parms);
|
||||
dump_frame_parms(lte_frame_parms);
|
||||
|
||||
PHY_vars_UE->PHY_measurements.n_adj_cells=2;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
|
||||
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
|
||||
|
||||
lte_gold_mbsfn(lte_frame_parms,PHY_vars_UE->lte_gold_mbsfn_table,Nid_cell);
|
||||
lte_gold_mbsfn(lte_frame_parms,PHY_vars_eNB->lte_gold_mbsfn_table,Nid_cell);
|
||||
|
||||
phy_init_lte_ue(PHY_vars_UE,1,0);
|
||||
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
|
||||
|
||||
|
||||
PHY_vars_UE->perfect_ce = perfect_ce;
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
}
|
||||
DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2_1E[2];
|
||||
#define UL_RB_ALLOC 0x1ff;
|
||||
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
|
||||
@@ -315,7 +253,7 @@ int main(int argc, char **argv)
|
||||
if (transmission_mode==2)
|
||||
n_tx=2;
|
||||
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,tdd_config,N_RB_DL,osf,perfect_ce);
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,tdd_config,N_RB_DL,0,osf,perfect_ce);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
|
||||
if (transmission_mode>=2)
|
||||
n_tx=2;
|
||||
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,N_RB_DL,osf);
|
||||
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,3,N_RB_DL,0,osf,0);
|
||||
|
||||
PHY_vars_eNB1 = malloc(sizeof(PHY_VARS_eNB));
|
||||
PHY_vars_eNB2 = malloc(sizeof(PHY_VARS_eNB));
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "OCG_vars.h"
|
||||
|
||||
|
||||
#ifdef XFORMS
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
#endif
|
||||
@@ -57,15 +56,17 @@ PHY_VARS_UE *PHY_vars_UE;
|
||||
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
|
||||
#define DLSCH_RB_ALLOC ((uint16_t)0x1fbf) // igore DC component,RB13
|
||||
|
||||
#define msg printf
|
||||
|
||||
DCI_PDU DCI_pdu;
|
||||
|
||||
DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2Lcommon, uint8_t format_selector, uint32_t rnti)
|
||||
DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2Lcommon, DCI_format_t format_selector[MAX_NUM_DCI], uint8_t num_dci, uint32_t rnti)
|
||||
{
|
||||
uint32_t BCCH_alloc_pdu[2];
|
||||
uint32_t DLSCH_alloc_pdu[2];
|
||||
uint32_t UL_alloc_pdu[2];
|
||||
|
||||
int i;
|
||||
int ind;
|
||||
int dci_length_bytes=0,dci_length=0;
|
||||
int BCCH_pdu_size_bits=0, BCCH_pdu_size_bytes=0;
|
||||
int UL_pdu_size_bits=0, UL_pdu_size_bytes=0;
|
||||
@@ -360,39 +361,39 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add common dci
|
||||
DCI_pdu.dci_alloc[0].dci_length = BCCH_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[0].L = log2Lcommon;
|
||||
DCI_pdu.dci_alloc[0].rnti = SI_RNTI;
|
||||
DCI_pdu.dci_alloc[0].format = format1A;
|
||||
DCI_pdu.dci_alloc[0].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes);
|
||||
DCI_pdu.Num_common_dci++;
|
||||
if (lte_frame_parms->N_RB_DL >= 25) {
|
||||
// add ue specific dci
|
||||
DCI_pdu.dci_alloc[1].dci_length = dci_length;
|
||||
DCI_pdu.dci_alloc[1].L = log2L;
|
||||
DCI_pdu.dci_alloc[1].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[1].format = format1;
|
||||
DCI_pdu.dci_alloc[1].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
|
||||
if (lte_frame_parms->N_RB_DL >= 50) {
|
||||
DCI_pdu.dci_alloc[2].dci_length = UL_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[2].L = log2L;
|
||||
DCI_pdu.dci_alloc[2].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[2].format = format0;
|
||||
DCI_pdu.dci_alloc[2].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
}
|
||||
for (ind = 0; ind<num_dci; ind++) {
|
||||
if (format_selector[ind]==format1A) {
|
||||
// add common dci
|
||||
DCI_pdu.dci_alloc[ind].dci_length = BCCH_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[ind].L = log2Lcommon;
|
||||
DCI_pdu.dci_alloc[ind].rnti = SI_RNTI;
|
||||
DCI_pdu.dci_alloc[ind].format = format1A;
|
||||
DCI_pdu.dci_alloc[ind].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes);
|
||||
DCI_pdu.Num_common_dci++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (format_selector[ind]==format1) {
|
||||
// add ue specific dci
|
||||
DCI_pdu.dci_alloc[ind].dci_length = dci_length;
|
||||
DCI_pdu.dci_alloc[ind].L = log2L;
|
||||
DCI_pdu.dci_alloc[ind].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[ind].format = format1;
|
||||
DCI_pdu.dci_alloc[ind].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
}
|
||||
|
||||
if (format_selector[ind]==format0) {
|
||||
DCI_pdu.dci_alloc[ind].dci_length = UL_pdu_size_bits;
|
||||
DCI_pdu.dci_alloc[ind].L = log2L;
|
||||
DCI_pdu.dci_alloc[ind].rnti = rnti;
|
||||
DCI_pdu.dci_alloc[ind].format = format0;
|
||||
DCI_pdu.dci_alloc[ind].ra_flag = 0;
|
||||
memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
|
||||
DCI_pdu.Num_ue_spec_dci++;
|
||||
}
|
||||
}
|
||||
|
||||
return(&DCI_pdu);
|
||||
}
|
||||
@@ -428,7 +429,9 @@ int main(int argc, char **argv)
|
||||
// int8_t interf1=-128,interf2=-128;
|
||||
uint8_t dci_cnt=0;
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
uint8_t log2L=2, log2Lcommon=2, format_selector=0;
|
||||
uint8_t log2L=2, log2Lcommon=2;
|
||||
DCI_format_t format_selector[MAX_NUM_DCI];
|
||||
uint8_t num_dci=0;
|
||||
uint8_t numCCE,common_active=0,ul_active=0,dl_active=0;
|
||||
|
||||
uint32_t n_trials_common=0,n_trials_ul=0,n_trials_dl=0,false_detection_cnt=0;
|
||||
@@ -470,6 +473,11 @@ int main(int argc, char **argv)
|
||||
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
||||
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
|
||||
*/
|
||||
|
||||
|
||||
logInit();
|
||||
|
||||
|
||||
while ((c = getopt (argc, argv, "hapFg:R:c:n:s:x:y:z:L:M:N:I:f:i:S:P:Y")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
@@ -613,7 +621,15 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
format_selector = atoi(optarg);
|
||||
format_selector[num_dci] = (DCI_format_t) atoi(optarg);
|
||||
if ((format_selector[num_dci]<format0) || (format_selector[num_dci] > format1A)) {
|
||||
printf("only formats 0, 1, and 1A supported for the moment\n");
|
||||
exit(-1);
|
||||
}
|
||||
if (format_selector[num_dci]==format0) ul_active=1;
|
||||
if (format_selector[num_dci]==format1A) common_active=1;
|
||||
if (format_selector[num_dci]==format1) dl_active=1;
|
||||
num_dci++;
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
@@ -663,25 +679,27 @@ int main(int argc, char **argv)
|
||||
printf("-y Number of TX antennas used in eNB\n");
|
||||
printf("-z Number of RX antennas used in UE\n");
|
||||
printf("-P Number of interfering PHICH\n");
|
||||
printf("-L log2 of Aggregation level for UE Specific DCI (1,2,4,8)\n");
|
||||
printf("-L log2 of Aggregation level for UE Specific DCI (0,1,2,3)\n");
|
||||
printf("-M log2 Aggregation level for Common DCI (4,8)\n");
|
||||
printf("-N Format for UE Spec DCI (0 - format1,\n");
|
||||
printf(" 1 - format1A,\n");
|
||||
printf(" 2 - format1B_2A,\n");
|
||||
printf(" 3 - format1B_4A,\n");
|
||||
printf(" 4 - format1C,\n");
|
||||
printf(" 5 - format1D_2A,\n");
|
||||
printf(" 6 - format1D_4A,\n");
|
||||
printf(" 7 - format2A_2A_L10PRB,\n");
|
||||
printf(" 8 - format2A_2A_M10PRB,\n");
|
||||
printf(" 9 - format2A_4A_L10PRB,\n");
|
||||
printf(" 10 - format2A_4A_M10PRB,\n");
|
||||
printf(" 11 - format2_2A_L10PRB,\n");
|
||||
printf(" 12 - format2_2A_M10PRB,\n");
|
||||
printf(" 13 - format2_4A_L10PRB,\n");
|
||||
printf(" 14 - format2_4A_M10PRB\n");
|
||||
printf(" 15 - format2_2D_M10PRB\n");
|
||||
printf(" 16 - format2_2D_L10PRB\n");
|
||||
printf("-N Format for UE Spec DCI (0 - format0,\n");
|
||||
printf(" 1 - format1,\n");
|
||||
printf(" 2 - format1A,\n");
|
||||
printf(" 3 - format1B_2A,\n");
|
||||
printf(" 4 - format1B_4A,\n");
|
||||
printf(" 5 - format1C,\n");
|
||||
printf(" 6 - format1D_2A,\n");
|
||||
printf(" 7 - format1D_4A,\n");
|
||||
printf(" 8 - format2A_2A_L10PRB,\n");
|
||||
printf(" 9 - format2A_2A_M10PRB,\n");
|
||||
printf(" 10 - format2A_4A_L10PRB,\n");
|
||||
printf(" 11 - format2A_4A_M10PRB,\n");
|
||||
printf(" 12 - format2_2A_L10PRB,\n");
|
||||
printf(" 13 - format2_2A_M10PRB,\n");
|
||||
printf(" 14 - format2_4A_L10PRB,\n");
|
||||
printf(" 15 - format2_4A_M10PRB\n");
|
||||
printf(" 16 - format2_2D_M10PRB\n");
|
||||
printf(" 17 - format2_2D_L10PRB\n");
|
||||
printf(" can be called multiple times to add more than one DCI\n");
|
||||
printf("-O Oversampling factor\n");
|
||||
printf("-I Cell Id\n");
|
||||
printf("-F Input sample stream\n");
|
||||
@@ -690,11 +708,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
logInit();
|
||||
|
||||
if ((transmission_mode>1) && (n_tx==1))
|
||||
n_tx=2;
|
||||
|
||||
@@ -730,7 +743,7 @@ int main(int argc, char **argv)
|
||||
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
||||
|
||||
frame_parms = &PHY_vars_eNB->lte_frame_parms;
|
||||
get_dci(frame_parms, log2L, log2Lcommon, format_selector, n_rnti);
|
||||
get_dci(frame_parms, log2L, log2Lcommon, format_selector, num_dci, n_rnti);
|
||||
|
||||
txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNb_id];
|
||||
|
||||
@@ -864,15 +877,14 @@ int main(int argc, char **argv)
|
||||
|
||||
if (input_fd == NULL) {
|
||||
numCCE=0;
|
||||
n_trials_common++;
|
||||
common_active = 1;
|
||||
if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 50) {
|
||||
n_trials_ul++;
|
||||
ul_active = 1;
|
||||
if (common_active==1) {
|
||||
n_trials_common++;
|
||||
}
|
||||
if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 25) {
|
||||
if (ul_active==1) {
|
||||
n_trials_ul++;
|
||||
}
|
||||
if (dl_active==1) {
|
||||
n_trials_dl++;
|
||||
dl_active = 1;
|
||||
}
|
||||
|
||||
num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
|
||||
@@ -918,8 +930,8 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (n_frames==1)
|
||||
printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i,DCI_pdu.dci_alloc[i].rnti, DCI_pdu.dci_alloc[i].format,
|
||||
DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].firstCCE, numCCE, DCI_pdu.dci_alloc[i].dci_length);
|
||||
printf("dci %d: rnti 0x%x, format %d, L %d (aggreg %d), nCCE %d/%d dci_length %d\n",i,DCI_pdu.dci_alloc[i].rnti, DCI_pdu.dci_alloc[i].format,
|
||||
DCI_pdu.dci_alloc[i].L, 1<<DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].firstCCE, numCCE, DCI_pdu.dci_alloc[i].dci_length);
|
||||
|
||||
if (DCI_pdu.dci_alloc[i].firstCCE==-1)
|
||||
exit(-1);
|
||||
@@ -1236,7 +1248,7 @@ int main(int argc, char **argv)
|
||||
|
||||
} //trials
|
||||
|
||||
printf("SNR %f : n_errors_common = %d/%d (%e)\n", SNR,n_errors_common,n_trials_common,(double)n_errors_common/n_trials_common);
|
||||
if (common_active) printf("SNR %f : n_errors_common = %d/%d (%e)\n", SNR,n_errors_common,n_trials_common,(double)n_errors_common/n_trials_common);
|
||||
if (ul_active==1) printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul);
|
||||
if (dl_active==1) printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl);
|
||||
printf("SNR %f : n_errors_cfi = %d/%d (%e)\n", SNR,n_errors_cfi,trial,(double)n_errors_cfi/trial);
|
||||
|
||||
Reference in New Issue
Block a user