Commit a432a7c1 authored by Xiwen JIANG's avatar Xiwen JIANG

use do_OFDM_mod_symbol in do_OFDM_mod_thread

parent 1a785e30
......@@ -298,12 +298,10 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
aa = antenna;
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
for (l=0; l<frame_parms->symbols_per_tti>>1; l++) {
//printf("do_OFDM_mod_l, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
//printf("do_OFDM_mod_symbol, slot=%d, l=%d, NUMBER_OF_OFDM_CARRIERS=%d,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES=%d\n",next_slot, l,NUMBER_OF_OFDM_CARRIERS,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,1);
beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l,aa);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0);
......@@ -333,12 +331,10 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
/* printf("txdata[%d][%d]=%d\n",aa,slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES]);
* */
// printf("txdata[%d][%d]=%d\n",aa,slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES]);
}
}
}
}
// OFDM modulation thread
......@@ -346,57 +342,13 @@ void *do_OFDM_mod_thread(PHY_VARS_eNB *eNB)
{
thread_pool *pool = eNB->pool;
int eNB_id = 0;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
int32_t **txdataF = eNB->common_vars.txdataF[eNB_id];
int32_t **txdataF_BF = eNB->common_vars.txdataF_BF[eNB_id];
int32_t **txdata = eNB->common_vars.txdata[eNB_id];
int aa, l, slot_offset;
//printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc());
int aa;
while(1) {
aa = thread_pool_wait(pool);
slot_offset = (pool->next_slot)*(frame_parms->samples_per_tti>>1);
printf("OFDM mod thread %ld starts processing antenna %d slot %d\n", syscall(SYS_gettid), aa, pool->next_slot);
for (l=0; l<frame_parms->symbols_per_tti>>1; l++) {
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,1);
beam_precoding(txdataF,txdataF_BF,frame_parms,eNB->common_vars.beam_weights[eNB_id],pool->next_slot,l,aa);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0);
//PMCH case not implemented...
if (frame_parms->Ncp == 1)
PHY_ofdm_mod(txdataF_BF[aa], // input
&txdata[aa][slot_offset+l*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
frame_parms->ofdm_symbol_size,
1, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
else {
if (l==0) {
PHY_ofdm_mod(txdataF_BF[aa], // input
&txdata[aa][slot_offset], // output
frame_parms->ofdm_symbol_size,
1, // number of symbols
frame_parms->nb_prefix_samples0, // number of prefix samples
CYCLIC_PREFIX);
} else {
PHY_ofdm_mod(txdataF_BF[aa], // input
&txdata[aa][slot_offset+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(l-1)*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES], // output
frame_parms->ofdm_symbol_size,
1, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples
CYCLIC_PREFIX);
}
}
}
do_OFDM_mod_symbol(&eNB->common_vars, eNB_id, eNB->pool->next_slot, &eNB->frame_parms, aa);
printf("OFDM mod thread %ld finished processing antenna %d slot %d\n", syscall(SYS_gettid), aa, pool->next_slot);
......
......@@ -2431,19 +2431,15 @@ int main(int argc, char **argv)
}
} else {
eNB->pool->next_slot = 2*subframe;
//printf("dlsim:slot=%d\n", eNB->pool->next_slot);
while (eNB->pool->next_slot < subframe*2+2) {
/* start all threads */
thread_pool_start(eNB->pool);
///* wait all threads finishes */
thread_pool_join(eNB->pool);
//usleep(1000*1000);
/* set next_slot */
eNB->pool->next_slot++;
//pool->next_slot %= 20;
}
}
......@@ -2456,10 +2452,17 @@ int main(int argc, char **argv)
phy_procedures_eNB_TX(eNB,proc_eNB,no_relay,NULL,0);
do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
/*do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
eNB->common_vars.txdata[eNB_id],
(subframe*2)+2,
&eNB->frame_parms);
&eNB->frame_parms);*/
for (aa=0; aa<eNB->frame_parms.nb_antennas_tx; aa++)
do_OFDM_mod_symbol(&eNB->common_vars,
eNB_id,
(subframe*2)+2,
&eNB->frame_parms,
aa);
proc_eNB->frame_tx++;
......
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