Commit 77159002 authored by Florian Kaltenberger's avatar Florian Kaltenberger

some more bugfixes (old and introcuded by merge) plus ability too use phy-test for tm7

parent f216bacb
......@@ -1251,9 +1251,17 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
common_vars->beam_weights[eNB_id][i] = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t*));
for (j=0; j<fp->nb_antennas_tx; j++) {
common_vars->beam_weights[eNB_id][i][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
if (((i<=4) && (i==j)) || (i>=5))
// antenna ports 0-3 are mapped on antennas 0-3
// antenna port 4 is mapped on antenna 0
// antenna ports 5-14 are mapped on all antennas
if (((i<4) && (i==j)) || ((i==4) && (j==0))) {
for (re=0; re<fp->ofdm_symbol_size; re++)
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff;
}
else if (i>4) {
for (re=0; re<fp->ofdm_symbol_size; re++)
common_vars->beam_weights[eNB_id][i][j][re] = 0x00007fff/fp->nb_antennas_tx;
}
#ifdef DEBUG_PHY
msg("[openair][LTE_PHY][INIT] lte_common_vars->beam_weights[%d][%d][%d] = %p (%d bytes)\n",
eNB_id,i,j,common_vars->beam_weights[eNB_id][i][j],
......
......@@ -678,15 +678,11 @@ x0[1+*jj]);
case 2: //QPSK
// printf("re %d %d(%d) : %d,%d => ",re,tti_offset,*jj,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
((int16_t*)&txdataF[aa][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
}
((int16_t*)&txdataF[0][tti_offset])[0] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
*jj = *jj + 1;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
((int16_t*)&txdataF[aa][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
}
((int16_t*)&txdataF[0][tti_offset])[1] += (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //Q //b_{i+1}
*jj = *jj + 1;
......@@ -719,12 +715,10 @@ x0[1+*jj]);
*jj=*jj+1;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
((int16_t *)&txdataF[aa][tti_offset])[0]+=qam_table_s0[qam16_table_offset_re];
((int16_t *)&txdataF[aa][tti_offset])[1]+=qam_table_s0[qam16_table_offset_im];
((int16_t *)&txdataF[0][tti_offset])[0]+=qam_table_s0[qam16_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[1]+=qam_table_s0[qam16_table_offset_im];
// ((int16_t *)&txdataF[aa][tti_offset])[0]+=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
// ((int16_t *)&txdataF[aa][tti_offset])[1]+=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
}
break;
......@@ -764,10 +758,8 @@ x0[1+*jj]);
*jj=*jj+1;
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
((int16_t *)&txdataF[aa][tti_offset])[0]+=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[aa][tti_offset])[1]+=qam_table_s0[qam64_table_offset_im];
}
((int16_t *)&txdataF[0][tti_offset])[0]+=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[1]+=qam_table_s0[qam64_table_offset_im];
break;
......@@ -970,7 +962,7 @@ x0[1+*jj]);
*re_allocated = *re_allocated + 1;
if (frame_parms->nb_antennas_tx == 2) {
if (frame_parms->nb_antenna_ports_eNB == 2) {
switch (mod_order0) {
default:
LOG_E(PHY,"Unknown mod_order0 %d\n",mod_order0);
......@@ -1186,7 +1178,7 @@ x0[1+*jj]);
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_SQRT2_Q15)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_SQRT2_Q15)>>15);
if (frame_parms->nb_antennas_tx == 2) {
if (frame_parms->nb_antenna_ports_eNB == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_SQRT2_Q15)>>15);
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_SQRT2_Q15)>>15);
......@@ -1226,7 +1218,7 @@ x0[1+*jj]);
((int16_t *)&txdataF[0][tti_offset])[0] += ((int16_t*)&tmp_sample1)[0];
((int16_t *)&txdataF[0][tti_offset])[1] += ((int16_t*)&tmp_sample1)[1];
if (frame_parms->nb_antennas_tx == 2) {
if (frame_parms->nb_antenna_ports_eNB == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index);
((int16_t*)&txdataF[1][tti_offset])[0] += ((int16_t*)&tmp_sample2)[0];
((int16_t*)&txdataF[1][tti_offset])[1] += ((int16_t*)&tmp_sample2)[1];
......@@ -1276,7 +1268,7 @@ x0[1+*jj]);
((int16_t *)&txdataF[0][tti_offset])[0] += ((int16_t*)&tmp_sample1)[0];
((int16_t *)&txdataF[0][tti_offset])[1] += ((int16_t*)&tmp_sample1)[1];
if (frame_parms->nb_antennas_tx == 2) {
if (frame_parms->nb_antenna_ports_eNB == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index);
((int16_t*)&txdataF[1][tti_offset])[0] += ((int16_t*)&tmp_sample2)[0];
((int16_t*)&txdataF[1][tti_offset])[1] += ((int16_t*)&tmp_sample2)[1];
......
......@@ -84,14 +84,13 @@ int beam_precoding(int32_t **txdataF,
((int16_t*)&txdataF_BF[aa][re])[1]);
*/
}
}
}
if (txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually using TM7
for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
((int16_t*)&txdataF_BF[aa][re])[0] = (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[5][aa][re])[0])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[5][aa][re])[0])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[5][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[5][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[5][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[5][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[5][aa][re])[0])>>15);
/* printf("beamforming.c:txdata[5][%d]=%d+j%d, beam_weights[5][%d][%d]=%d+j%d,txdata_BF[%d][%d]=%d+j%d\n",
......@@ -112,9 +111,9 @@ int beam_precoding(int32_t **txdataF,
for (p=7;p<15;p++) {
if (txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re]!=0) { //that means this RE is actually allocated
for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
((int16_t*)&txdataF_BF[aa][re])[0] = (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] = (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][slot_offset_F+symbol*frame_parms->ofdm_symbol_size+re])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
}
}
......
......@@ -63,6 +63,8 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
uint32_t bcch_pdu;
uint64_t dlsch_pdu;
LOG_I(PHY,"frame %d, subframe %d, transmission_mode %d\n",proc->frame_tx,proc->subframe_tx,transmission_mode);
DCI_pdu->Num_common_dci = 0;
DCI_pdu->Num_ue_spec_dci=0;
......
......@@ -37,8 +37,8 @@ eNBs =
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
nb_antennas_tx = 2;
nb_antennas_rx = 2;
tx_gain = 90;
rx_gain = 125;
prach_root = 0;
......
......@@ -128,6 +128,8 @@ extern pthread_cond_t sync_cond;
extern pthread_mutex_t sync_mutex;
extern int sync_var;
extern transmission_mode;
//pthread_t main_eNB_thread;
time_stats_t softmodem_stats_mt; // main thread
......@@ -467,8 +469,17 @@ void proc_tx_full(PHY_VARS_eNB *eNB,
// if TX fronthaul go ahead
if (eNB->tx_fh) eNB->tx_fh(eNB,proc);
/*
if (proc->frame_tx>1000) {
write_output("/tmp/txsig0.m","txs0", &eNB->common_vars.txdata[eNB->Mod_id][0][0], eNB->frame_parms.samples_per_tti*10,1,1);
write_output("/tmp/txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB->Mod_id][0][0],eNB->frame_parms.symbols_per_tti*eNB->frame_parms.ofdm_symbol_size*10,1,1);
write_output("/tmp/txsig1.m","txs1", &eNB->common_vars.txdata[eNB->Mod_id][1][0], eNB->frame_parms.samples_per_tti*10,1,1);
write_output("/tmp/txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB->Mod_id][1][0],eNB->frame_parms.symbols_per_tti*eNB->frame_parms.ofdm_symbol_size*10,1,1);
if (transmission_mode == 7)
write_output("/tmp/txsigF5.m","txsF5", &eNB->common_vars.txdataF[eNB->Mod_id][5][0],eNB->frame_parms.symbols_per_tti*eNB->frame_parms.ofdm_symbol_size*10,1,1);
exit_fun("");
}
*/
}
void proc_tx_rru_if4p5(PHY_VARS_eNB *eNB,
......
......@@ -234,7 +234,7 @@ uint64_t num_missed_slots=0; // counter for the number of missed slots
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
//int transmission_mode=1;
int transmission_mode=1;
int16_t glog_level = LOG_INFO;
int16_t glog_verbosity = LOG_MED;
......@@ -1189,8 +1189,13 @@ static void get_options (int argc, char **argv)
printf("Downlink frequency/ uplink offset of CC_id %d set to %ju/%d\n", CC_id,
enb_properties->properties[i]->downlink_frequency[CC_id],
enb_properties->properties[i]->uplink_frequency_offset[CC_id]);
} // CC_id
}// i
//this is needed for phy-test option
transmission_mode = enb_properties->properties[0]->ue_TransmissionMode[0]+1;
} else if (UE_flag == 1) {
if (conf_config_file_name != NULL) {
......@@ -1363,7 +1368,7 @@ void init_openair0() {
int main( int argc, char **argv )
{
int i,aa;
int i,j,k,aa,re;
#if defined (XFORMS)
void *status;
#endif
......@@ -1606,6 +1611,17 @@ int main( int argc, char **argv )
PHY_vars_eNB_g[0][CC_id]->ue_ul_nb_rb=6;
PHY_vars_eNB_g[0][CC_id]->target_ue_ul_mcs=target_ul_mcs;
// initialization for phy-test
for (k=0;k<NUMBER_OF_UE_MAX;k++) {
PHY_vars_eNB_g[0][CC_id]->transmission_mode[k] = transmission_mode;
if (transmission_mode==7)
lte_gold_ue_spec_port5(PHY_vars_eNB_g[0][CC_id]->lte_gold_uespec_port5_table[k],frame_parms[CC_id]->Nid_cell,0x1235+k);
}
if ((transmission_mode==1) || (transmission_mode==7)) {
for (j=0; j<frame_parms[CC_id]->nb_antennas_tx; j++)
for (re=0; re<frame_parms[CC_id]->ofdm_symbol_size; re++)
PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff/frame_parms[CC_id]->nb_antennas_tx;
}
if (phy_test==1) PHY_vars_eNB_g[0][CC_id]->mac_enabled = 0;
else PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1;
......
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