Commit b408fcb0 authored by Sakthivel Velumani's avatar Sakthivel Velumani Committed by Raymond Knopp

added toggling NDI from matlab

parent 685483eb
...@@ -960,17 +960,28 @@ void init_eNB_afterRU(void) { ...@@ -960,17 +960,28 @@ void init_eNB_afterRU(void) {
LOG_I(PHY,"RC.nb_nr_CC[inst:%d]:%p\n", inst, RC.gNB[inst]); LOG_I(PHY,"RC.nb_nr_CC[inst:%d]:%p\n", inst, RC.gNB[inst]);
gNB = RC.gNB[inst]; gNB = RC.gNB[inst];
phy_init_nr_gNB(gNB,0,0); phy_init_nr_gNB(gNB,0,0);
FILE *matlab_gen_file = fopen("/home/sakthi/pdsch_mcs28_dci46_matlab.dat","r"); FILE *matlab_gen_file = fopen("/home/eurecom/sakthi/pdsch_mcs28_dci_manual_matlab.dat","r");
if (matlab_gen_file==NULL) { if (matlab_gen_file==NULL) {
printf("problem opening file\n"); printf("problem opening file\n");
exit(-1); exit(-1);
} }
fread((void*)gNB->common_vars.debugBuff,sizeof(short),30720*2*2,matlab_gen_file); fread((void*)gNB->common_vars.debugBuff,sizeof(short),30720*2*2,matlab_gen_file);
for(int idx_samp=0; idx_samp<30720*2; idx_samp++) { for(int idx_samp=0; idx_samp<30720*2; idx_samp++) {
*((int16_t*)(gNB->common_vars.debugBuff+idx_samp))>>=2; *((int16_t*)(gNB->common_vars.debugBuff+idx_samp))>>=1;
*(((int16_t*)(gNB->common_vars.debugBuff+idx_samp))+1)>>=2; *(((int16_t*)(gNB->common_vars.debugBuff+idx_samp))+1)>>=1;
} }
fclose(matlab_gen_file);
matlab_gen_file = fopen("/home/eurecom/sakthi/pdsch_mcs28_dci_ndi0_manual_matlab.dat","r");
if (matlab_gen_file==NULL) {
printf("problem opening file\n");
exit(-1);
}
fread((void*)gNB->common_vars.debugBuff+200000,sizeof(short),30720*2*2,matlab_gen_file);
for(int idx_samp=0; idx_samp<30720*2; idx_samp++) {
*((int16_t*)(gNB->common_vars.debugBuff+200000+idx_samp))>>=1;
*(((int16_t*)(gNB->common_vars.debugBuff+200000+idx_samp))+1)>>=1;
}
// map antennas and PRACH signals to gNB RX // map antennas and PRACH signals to gNB RX
if (0) AssertFatal(gNB->num_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id); if (0) AssertFatal(gNB->num_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id);
......
...@@ -168,9 +168,14 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) { ...@@ -168,9 +168,14 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
} }
} }
static int ndi=0;
if(tti_tx==1) { if(tti_tx==1) {
//memset((void*)(&ru->common.txdata[aa][fp->get_samples_slot_timestamp(tti_tx,fp,0)]),0,sizeof(int16_t)*2*fp->get_samples_per_slot(tti_tx,fp)); //memset((void*)(&ru->common.txdata[aa][fp->get_samples_slot_timestamp(tti_tx,fp,0)]),0,sizeof(int16_t)*2*fp->get_samples_per_slot(tti_tx,fp));
if(ndi==1)
memcpy((void*)(&ru->common.txdata[aa][fp->get_samples_slot_timestamp(tti_tx,fp,0)]),(void*)&ru->gNB_list[0]->common_vars.debugBuff[30720],sizeof(int16_t)*2*fp->get_samples_per_slot(tti_tx,fp)); memcpy((void*)(&ru->common.txdata[aa][fp->get_samples_slot_timestamp(tti_tx,fp,0)]),(void*)&ru->gNB_list[0]->common_vars.debugBuff[30720],sizeof(int16_t)*2*fp->get_samples_per_slot(tti_tx,fp));
else
memcpy((void*)(&ru->common.txdata[aa][fp->get_samples_slot_timestamp(tti_tx,fp,0)]),(void*)&ru->gNB_list[0]->common_vars.debugBuff[200000+30720],sizeof(int16_t)*2*fp->get_samples_per_slot(tti_tx,fp));
ndi^=1;
} }
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 0); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 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