Commit cdd11008 authored by Raymond Knopp's avatar Raymond Knopp

memory allocation bugs for 2x2 transmission in dlsim

parent 4ca3b304
......@@ -335,7 +335,8 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
RU_t **rup,
unsigned char N_tx_port_eNB,
unsigned char N_tx_phy,
unsigned char N_rx,
unsigned char N_rx_ru,
unsigned char N_rx_ue,
unsigned char transmission_mode,
uint8_t extended_prefix_flag,
frame_t frame_type,
......
......@@ -39,7 +39,8 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
RU_t **rup,
unsigned char N_tx_port_eNB,
unsigned char N_tx_phy,
unsigned char N_rx,
unsigned char N_rx_ru,
unsigned char N_rx_ue,
unsigned char transmission_mode,
uint8_t extended_prefix_flag,
frame_t frame_type,
......@@ -90,7 +91,7 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = Nid_cell%6;
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->phich_config_common.phich_resource = oneSixth;
frame_parms->phich_config_common.phich_duration = normal;
......@@ -109,11 +110,11 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
UE->is_secondary_ue = 0;
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;
ru->frame_parms = *frame_parms;
ru->nb_tx = N_tx_phy;
ru->nb_rx = N_rx;
ru->nb_rx = N_rx_ru;
ru->if_south = LOCAL_RF;
eNB->configured=1;
......
......@@ -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);
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]);
((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));
......@@ -1099,6 +1099,7 @@ int main(int argc, char **argv)
lte_param_init(&eNB,&UE,&ru,
n_tx_port,
n_tx_phy,
1,
n_rx,
transmission_mode,
extended_prefix_flag,
......@@ -1304,6 +1305,7 @@ int main(int argc, char **argv)
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,
UE->frame_parms.nb_antennas_rx,
channel_model,
......
......@@ -721,6 +721,7 @@ int main(int argc, char **argv)
1,
n_rx,
1,
1,
extended_prefix_flag,
frame_type,
0,
......
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