Commit b42d83be authored by knopp's avatar knopp

memory allocation bugs for 2x2 transmission in dlsim

parent da83df84
...@@ -335,7 +335,8 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -335,7 +335,8 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
RU_t **rup, RU_t **rup,
unsigned char N_tx_port_eNB, unsigned char N_tx_port_eNB,
unsigned char N_tx_phy, unsigned char N_tx_phy,
unsigned char N_rx, unsigned char N_rx_ru,
unsigned char N_rx_ue,
unsigned char transmission_mode, unsigned char transmission_mode,
uint8_t extended_prefix_flag, uint8_t extended_prefix_flag,
frame_t frame_type, frame_t frame_type,
......
...@@ -39,7 +39,8 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -39,7 +39,8 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
RU_t **rup, RU_t **rup,
unsigned char N_tx_port_eNB, unsigned char N_tx_port_eNB,
unsigned char N_tx_phy, unsigned char N_tx_phy,
unsigned char N_rx, unsigned char N_rx_ru,
unsigned char N_rx_ue,
unsigned char transmission_mode, unsigned char transmission_mode,
uint8_t extended_prefix_flag, uint8_t extended_prefix_flag,
frame_t frame_type, frame_t frame_type,
...@@ -90,7 +91,7 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -90,7 +91,7 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
frame_parms->Nid_cell = Nid_cell; frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = Nid_cell%6; frame_parms->nushift = Nid_cell%6;
frame_parms->nb_antennas_tx = N_tx_phy; frame_parms->nb_antennas_tx = N_tx_phy;
frame_parms->nb_antennas_rx = N_rx; frame_parms->nb_antennas_rx = N_rx_ru;
frame_parms->nb_antenna_ports_eNB = N_tx_port_eNB; frame_parms->nb_antenna_ports_eNB = N_tx_port_eNB;
frame_parms->phich_config_common.phich_resource = oneSixth; frame_parms->phich_config_common.phich_resource = oneSixth;
frame_parms->phich_config_common.phich_duration = normal; frame_parms->phich_config_common.phich_duration = normal;
...@@ -109,11 +110,11 @@ void lte_param_init(PHY_VARS_eNB **eNBp, ...@@ -109,11 +110,11 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
UE->is_secondary_ue = 0; UE->is_secondary_ue = 0;
UE->frame_parms = *frame_parms; UE->frame_parms = *frame_parms;
UE->frame_parms.nb_antennas_rx=1; UE->frame_parms.nb_antennas_rx=N_rx_ue;
// eNB->frame_parms = *frame_parms; // eNB->frame_parms = *frame_parms;
ru->frame_parms = *frame_parms; ru->frame_parms = *frame_parms;
ru->nb_tx = N_tx_phy; ru->nb_tx = N_tx_phy;
ru->nb_rx = N_rx; ru->nb_rx = N_rx_ru;
ru->if_south = LOCAL_RF; ru->if_south = LOCAL_RF;
eNB->configured=1; eNB->configured=1;
......
...@@ -242,7 +242,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, ...@@ -242,7 +242,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
sigma2 = pow(10,sigma2_dB/10); sigma2 = pow(10,sigma2_dB/10);
for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) { for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) {
for (aa=0; aa<ru->frame_parms.nb_antennas_rx; aa++) { for (aa=0; aa<UE->frame_parms.nb_antennas_rx; aa++) {
//printf("s_re[0][%d]=> %f , r_re[0][%d]=> %f\n",i,s_re[aa][i],i,r_re[aa][i]); //printf("s_re[0][%d]=> %f , r_re[0][%d]=> %f\n",i,s_re[aa][i],i,r_re[aa][i]);
((short*) UE->common_vars.rxdata[aa])[(2*subframe*UE->frame_parms.samples_per_tti)+2*i] = ((short*) UE->common_vars.rxdata[aa])[(2*subframe*UE->frame_parms.samples_per_tti)+2*i] =
(short) (r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)); (short) (r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0));
...@@ -1099,7 +1099,8 @@ int main(int argc, char **argv) ...@@ -1099,7 +1099,8 @@ int main(int argc, char **argv)
lte_param_init(&eNB,&UE,&ru, lte_param_init(&eNB,&UE,&ru,
n_tx_port, n_tx_port,
n_tx_phy, n_tx_phy,
n_rx, 1,
n_rx,
transmission_mode, transmission_mode,
extended_prefix_flag, extended_prefix_flag,
frame_type, frame_type,
...@@ -1304,6 +1305,7 @@ int main(int argc, char **argv) ...@@ -1304,6 +1305,7 @@ int main(int argc, char **argv)
UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti = n_rnti; UE->pdcch_vars[UE->current_thread_id[subframe]][0]->crnti = n_rnti;
printf("Allocating %dx%d eNB->UE channel descriptor\n",eNB->frame_parms.nb_antennas_tx,UE->frame_parms.nb_antennas_rx);
eNB2UE[0] = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx, eNB2UE[0] = new_channel_desc_scm(eNB->frame_parms.nb_antennas_tx,
UE->frame_parms.nb_antennas_rx, UE->frame_parms.nb_antennas_rx,
channel_model, channel_model,
......
...@@ -720,6 +720,7 @@ int main(int argc, char **argv) ...@@ -720,6 +720,7 @@ int main(int argc, char **argv)
1, 1,
1, 1,
n_rx, n_rx,
1,
1, 1,
extended_prefix_flag, extended_prefix_flag,
frame_type, frame_type,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment