From 11006597c98994fdd78bee243e29f016fe6989ec Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Mon, 15 May 2017 10:52:55 +0200 Subject: [PATCH] integration fix: let dlsim and ulsim work again There is now the function copy_harq_proc_struct and some procedures for the UE have changed, which makes necessary to have UE->dlsch valid for both subframes (odd and even). We increase memory usage, maybe it's not the correct solution. To be kept in mind if something goes wrong at some point. --- openair1/SIMULATION/LTE_PHY/dlsim.c | 22 +++++++++++++++------- openair1/SIMULATION/LTE_PHY/ulsim.c | 28 +++++++++++++++++----------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index b8e23f2d98a..379f28c1907 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1379,6 +1379,7 @@ int main(int argc, char **argv) uint8_t Kmimo; uint8_t ue_category=4; uint32_t Nsoft; + int sf; @@ -2104,15 +2105,22 @@ int main(int argc, char **argv) } } - for (i=0; i<2; i++) { - UE->dlsch[subframe&0x1][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0); + /* allocate memory for both subframes (only one is really used + * but there is now "copy_harq_proc_struct" which needs both + * to be valid) + * TODO: refine this somehow (necessary?) + */ + for (sf = 0; sf < 2; sf++) { + for (i=0; i<2; i++) { + UE->dlsch[sf][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0); - if (!UE->dlsch[subframe&0x1][0][i]) { - printf("Can't get ue dlsch structures\n"); - exit(-1); - } + if (!UE->dlsch[sf][0][i]) { + printf("Can't get ue dlsch structures\n"); + exit(-1); + } - UE->dlsch[subframe&0x1][0][i]->rnti = n_rnti; + UE->dlsch[sf][0][i]->rnti = n_rnti; + } } UE->dlsch_SI[0] = new_ue_dlsch(1,1,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0); diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index f3abbb7e3de..60e7a74ed63 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -275,6 +275,7 @@ int main(int argc, char **argv) uint8_t max_turbo_iterations=4; uint8_t parallel_flag=0; int nb_rb_set = 0; + int sf; int threequarter_fs=0; int ndi; @@ -709,22 +710,27 @@ int main(int argc, char **argv) // Create transport channel structures for 2 transport blocks (MIMO) for (i=0; i<2; i++) { eNB->dlsch[0][i] = new_eNB_dlsch(1,8,1827072,N_RB_DL,0,&eNB->frame_parms); - UE->dlsch[subframe&1][0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0); - if (!eNB->dlsch[0][i]) { printf("Can't get eNB dlsch structures\n"); exit(-1); } - - if (!UE->dlsch[subframe&1][0][i]) { - printf("Can't get ue dlsch structures\n"); - exit(-1); - } - eNB->dlsch[0][i]->rnti = 14; - UE->dlsch[subframe&1][0][i]->rnti = 14; - - } + } + /* allocate memory for both subframes (only one is really used + * but there is now "copy_harq_proc_struct" which needs both + * to be valid) + * TODO: refine this somehow (necessary?) + */ + for (sf = 0; sf < 2; sf++) { + for (i=0; i<2; i++) { + UE->dlsch[sf][0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0); + if (!UE->dlsch[sf][0][i]) { + printf("Can't get ue dlsch structures\n"); + exit(-1); + } + UE->dlsch[sf][0][i]->rnti = 14; + } + } UE->dlsch_SI[0] = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0); UE->dlsch_ra[0] = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0); -- GitLab