Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pasolini/openairinterface5g
  • odukan/openairinterface5g
  • ewa/openairinterface5g
  • deksprime/openairinterface5g
  • jackokie/openairinterface5g
  • Srushti16/openairinterface5g
  • BRodolphe/openairinterface5g
  • kramantas/openairinterface5g
  • suraj_4g5g/openairinterface5g
  • turletti/openairinterface5g
  • anandriisc/openairinterface5g
  • lvguorong/openairinterface5g
  • dast/openairinterface5g
  • yashwanthr/openairinterface5g
  • ajiti2tb/openairinterface5g
  • qzhou/openairinterface5g
  • nickmxxx/openairinterface5g
  • bin_he4/openairinterface5g
  • delarco/openairinterface5g
  • limx1980/openairinterface5g
  • Aniq/openairinterface5g
  • yassir63/openairinterface5g
  • orc318/openairinterface5g
  • vader/openairinterface5g
  • limx59/openairinterface5g
  • nadavaati_12345/openairinterface5g
  • jenshz/openairinterface5g
  • kuldeep/openairinterface5g
  • lurker/openairinterface5g
  • shariat/openairinterface5g
  • Alireza.najafzadeh/openairinterface5g
  • Ling/openairinterface5g
  • EvanKrall/openairinterface5g
  • youyih/openairinterface5g
  • anindya/openairinterface5g
  • ahan/openairinterface5g
  • beraoud/openairinterface5g
  • obejarano/openairinterface5g
  • Monti/openairinterface5g
  • akhamsi/openairinterface5g
  • Worker.N/openairinterface5g
  • zhangtu/openairinterface5g
  • desouza/openairinterface5g
  • zhijun/openairinterface5g
  • sureshkumar/openairinterface5g
  • milan/openairinterface5g
  • bigbangbingo/openairinterface5g
  • platini/openairinterface5g
  • muralir-nv/openairinterface5g
  • Joshua_Zhang/openairinterface5g
  • siddharthmurali1/openairinterface5g
  • sorinros/openairinterface5g
  • elainecao/openairinterface5g
  • sneltved/openairinterface5g
  • aikaterini.trilyraki/openairinterface5g
  • wujunning11/openairinterface5g
  • magounak/openairinterface5g
  • ycl1729020039/openairinterface5g
  • mayukhweb/openairinterface5g
  • wataru/openairinterface5g
  • afonsoli/openairinterface5g
  • ppokar/openairinterface5g
  • emest/openairinterface5g
  • Najib/openairinterface5g
  • liqing/openairinterface5g
  • gprshome/openairinterface5g
  • Dvevgedveccc/openairinterface5g
  • Elena_Lukashova/openairinterface5g
  • imaneouss/openairinterface5g
  • yangyuan/openairinterface5g
  • ycliang/openairinterface5g
  • rohanfds/openairinterface5g
  • cong2008abc/openairinterface5g
  • Giovanni/openairinterface5g
  • willvegapunk/openairinterface5g
  • Chen/openairinterface5g
  • Ella/openairinterface5g
  • kollabalu/openairinterface5g
  • tsaichanglan/openairinterface5g
  • Artifice/openairinterface5g
  • HJR0129/openairinterface5g
  • alextp/openairinterface5g
  • Changron/openairinterface5g
  • pedosb/openairinterface5g
  • Flozzen/openairinterface5g
  • hobei/openairinterface5g
  • WP_Jing/openairinterface5g
  • reset4/openairinterface5g
  • alexjoseph/openairinterface5g
  • latuan1710/openairinterface5g
  • wynter-wang/openairinterface5g
  • stt12706/openairinterface5g
  • sy/openairinterface5g
  • dzxu/openairinterface5g
  • ptizoom/openairinterface5g
  • Thierry/openairinterface5g
  • tjamc80/openairinterface5g
  • yenmuse/openairinterface5g
  • archerling/openairinterface5g
  • grahul/openairinterface5g
  • ashish.shri/openairinterface5g
  • TianyuChen/openairinterface5g
  • cuixf1/openairinterface5g
  • Jan/openairinterface5g
  • jboatenng/openairinterface5g_gpio
  • geokal/openairinterface5g
  • johannhg/openairinterface5g
  • TofunmiA/openairinterface5g
  • razvanursu/openairinterface5g-mac-scheduling
  • Julio/openairinterface5g
  • fredrichx/openairinterface5g
  • nems/openairinterface5g
  • wb_li/openairinterface5g
  • ferrieux/openairinterface5g
  • prajna_g/openairinterface-5-g-xnap-ho
  • mtinasc/openairinterface5g
  • Hofschroeer/openairinterface5g
  • buptxiaofeng/openairinterface5g
  • fjgh_759/openairinterface5g
  • calcel/openairinterface5g
  • Reem/openairinterface5g
  • havar_mind/openairinterface5g
  • shrinish/openairinterface5g
  • YANGHELINDE/openairinterface5g
  • lool/openairinterface5g
  • raghav1900/openairinterface5g
  • allan1201/openairinterface5g
  • ferris/openairinterface5g
  • seanzw/openairinterface5g
  • emad72/openairinterface5g
  • guojilong123/openairinterface5g
  • Rony99/openairinterface5g
  • lity/openairinterface5g
  • sshrivastava/openairinterface5g
  • zhihengzhang/openairinterface5g
  • Rakesh_B_B/openairinterface5g
  • baleeiro/openairinterface5g
  • 19125064/openairinterface5g
  • linlin/openairinterface5g
  • NA1VE/openairinterface5g
  • oai1B/openairinterface5g
  • daveprice/openairinterface5g
  • mo/openairinterface5g
  • dhanmeet/openairinterface5g
  • mv2290/openairinterface-5-g-test
  • pagmatt/openairinterface5g
  • mmTestNYU/openairinterface5g
  • mmezzavilla/openairinterface5g
  • sudhakarb/openairinterface5g
  • mekki/openairinterface5g
  • virtanen/openairinterface5g
  • dyyu/openairinterface5g
  • mohammed_safwan/openairinterface5g
  • venkat/openairinterface5g
  • rupadhya/openairinterface5g
  • adjou/openairinterface5g
  • samiemostafavi/openairinterface5g-edaf
  • Sreeram/openairinterface5g
  • oliverxsch/openairinterface5g
  • oai/openairinterface5g
160 results
Show changes
......@@ -1278,6 +1278,8 @@ void init_eNB_proc(int inst) {
eNB_rxtx_proc_t *proc_rxtx;
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_single=NULL,*attr_fep=NULL,*attr_td=NULL,*attr_te;
printf("%s()\n", __FUNCTION__);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
eNB = PHY_vars_eNB_g[inst][CC_id];
LOG_I(PHY,"Initializing eNB %d CC_id %d (%s,%s),\n",inst,CC_id,eNB_functions[eNB->node_function],eNB_timing[eNB->node_timing]);
......@@ -1673,10 +1675,15 @@ void init_RAN(RAN_CONTEXT *rc,eNB_func_t node_function[], eNB_timing_t node_timi
PHY_VARS_eNB *eNB;
int ret;
printf("%s() rc->nb_inst:%d\n", __FUNCTION__, rc->nb_inst);
for (inst=0;inst<rc->nb_inst;inst++) {
printf("%s() rc->nb_inst:%d rc->nb_CC:%d\n", __FUNCTION__, rc->nb_inst, rc->nb_CC);
for (CC_id=0;CC_id<rc->nb_CC;CC_id++) {
eNB = rc->eNB[inst][CC_id];
printf("%s() rc->nb_inst:%d rc->nb_CC:%d eNB:%p rc->eNB[%d][%d]:%p\n", __FUNCTION__, rc->nb_inst, rc->nb_CC, eNB, inst, CC_id, rc->eNB[inst][CC_id]);
if (eNB) {
eNB->node_function = node_function[CC_id];
eNB->node_timing = node_timing[CC_id];
eNB->abstraction_flag = 0;
......
......@@ -129,6 +129,8 @@ int attach_rru(RU_t *ru);
int connect_rau(RU_t *ru);
extern uint8_t nfapi_mode;
extern uint16_t sf_ahead;
/*************************************************************/
/* Functions to attach and configure RRU */
......@@ -387,8 +389,8 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
proc->frame_rx = f;
proc->timestamp_rx = ((proc->frame_rx * 10) + proc->subframe_rx ) * fp->samples_per_tti ;
// proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti);
proc->subframe_tx = (sf+4)%10;
proc->frame_tx = (sf>5) ? (f+1)&1023 : f;
proc->subframe_tx = (sf+sf_ahead)%10;
proc->frame_tx = (sf>(9-sf_ahead)) ? (f+1)&1023 : f;
if (proc->first_rx == 0) {
if (proc->subframe_rx != *subframe){
......@@ -594,12 +596,14 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
uint32_t symbol_number,symbol_mask,symbol_mask_full;
int subframe_tx,frame_tx;
LOG_E(PHY, "%s(ru:%p frame, subframe)\n", __FUNCTION__, ru);
symbol_number = 0;
symbol_mask = 0;
symbol_mask_full = (1<<fp->symbols_per_tti)-1;
do {
recv_IF4p5(ru, &frame_tx, &subframe_tx, &packet_type, &symbol_number);
LOG_E(PHY, "%s(ru:%p frame, subframe) frame_tx:%d/%d packet_type:%u symbol_number:%u proc->first_tx:%d\n", __FUNCTION__, ru, frame_tx, subframe_tx, packet_type, symbol_number, proc->first_tx);
if (proc->first_tx != 0) {
*frame = frame_tx;
*subframe = subframe_tx;
......@@ -677,6 +681,7 @@ void fh_if4p5_north_out(RU_t *ru) {
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
}
void rx_rf(RU_t *ru,int *frame,int *subframe) {
RU_proc_t *proc = &ru->proc;
......@@ -688,7 +693,7 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
for (i=0; i<ru->nb_rx; i++)
rxp[i] = (void*)&ru->common.rxdata[i][*subframe*fp->samples_per_tti];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
old_ts = proc->timestamp_rx;
......@@ -722,15 +727,17 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
// synchronize first reception to frame 0 subframe 0
proc->timestamp_tx = proc->timestamp_rx+(4*fp->samples_per_tti);
proc->subframe_tx = (proc->subframe_rx+4)%10;
proc->frame_tx = (proc->subframe_rx>5) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
proc->timestamp_tx = proc->timestamp_rx+(sf_ahead*fp->samples_per_tti);
proc->subframe_tx = (proc->subframe_rx+sf_ahead)%10;
proc->frame_tx = (proc->subframe_rx>(9-sf_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
#if 0
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, subframe %d\n",
ru->idx,
0,
(unsigned long long int)proc->timestamp_rx,
(int)ru->ts_offset,proc->frame_rx,proc->subframe_rx);
#endif
// dump VCD output for first RU in list
if (ru == RC.ru[0]) {
......@@ -761,10 +768,9 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
if (rxs != fp->samples_per_tti)
exit_fun( "problem receiving samples" );
{
//exit_fun( "problem receiving samples" );
}
}
......@@ -782,11 +788,18 @@ void tx_rf(RU_t *ru) {
lte_subframe_t SF_type = subframe_select(fp,proc->subframe_tx%10);
lte_subframe_t prevSF_type = subframe_select(fp,(proc->subframe_tx+9)%10);
lte_subframe_t nextSF_type = subframe_select(fp,(proc->subframe_tx+1)%10);
//struct timespec t;
//clock_gettime(CLOCK_MONOTONIC, &t);
//LOG_E(PHY,"%s() nb_tx:%d sf:%d tti:%d t:%ld.%09ld\n", __FUNCTION__, ru->nb_tx, proc->subframe_tx, fp->samples_per_tti, t.tv_sec, t.tv_nsec);
if ((SF_type == SF_DL) ||
(SF_type == SF_S)) {
for (i=0; i<ru->nb_tx; i++)
{
txp[i] = (void*)&ru->common.txdata[i][proc->subframe_tx*fp->samples_per_tti];
}
int siglen=fp->samples_per_tti,flags=1;
......@@ -818,12 +831,11 @@ void tx_rf(RU_t *ru) {
ru->nb_tx,
flags);
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx,
(long long unsigned int)proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx);
//LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx,
//(long long unsigned int)proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
if (txs != fp->samples_per_tti) {
LOG_E(PHY,"TX : Timeout (sent %d/%d)\n",txs, fp->samples_per_tti);
exit_fun( "problem transmitting samples" );
......@@ -947,22 +959,26 @@ static void* ru_thread_prach( void* param ) {
thread_top_init("ru_thread_prach",1,500000L,1000000L,20000000L);
LOG_E(PHY,"In rach thread\n");
while (RC.ru_mask>0) {
usleep(1e6);
LOG_I(PHY,"%s() RACH waiting for RU to be configured\n", __FUNCTION__);
}
LOG_I(PHY,"%s() RU configured - RACH processing thread running\n", __FUNCTION__);
while (!oai_exit) {
if (oai_exit) break;
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );
rx_prach(NULL,
ru,
NULL,
NULL,
NULL,
proc->frame_prach,
0
prach_procedures(
ru->eNB_list[0]
#ifdef Rel14
,0
,0
#endif
);
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 );
if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
}
......@@ -1112,21 +1128,29 @@ void wakeup_eNBs(RU_t *ru) {
int i;
PHY_VARS_eNB **eNB_list = ru->eNB_list;
LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d\n",ru->num_eNB,ru->idx);
//LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
if (ru->num_eNB==1) {
if (ru->num_eNB==1 && ru->eNB_top!=0) {
// call eNB function directly
char string[20];
sprintf(string,"Incoming RU %d",ru->idx);
LOG_D(PHY,"RU %d Waking up eNB\n",ru->idx);
//LOG_D(PHY,"RU %d Call eNB_top\n",ru->idx);
ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
}
else {
LOG_D(PHY,"ru->num_eNB:%d\n", ru->num_eNB);
for (i=0;i<ru->num_eNB;i++)
if (ru->wakeup_rxtx(eNB_list[i],ru) < 0)
{
LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx);
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
{
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
}
}
}
}
......@@ -1147,7 +1171,11 @@ static inline int wakeup_prach_ru(RU_t *ru) {
ru->proc.frame_prach = ru->proc.frame_rx;
ru->proc.subframe_prach = ru->proc.subframe_rx;
LOG_D(PHY,"RU %d: waking up PRACH thread\n",ru->idx);
// DJP - think prach_procedures() is looking at eNB frame_prach
ru->eNB_list[0]->proc.frame_prach = ru->proc.frame_rx;
ru->eNB_list[0]->proc.subframe_prach = ru->proc.subframe_rx;
//LOG_D(PHY,"RU %d: waking up PRACH thread\n",ru->idx);
// the thread can now be woken up
AssertFatal(pthread_cond_signal(&ru->proc.cond_prach) == 0, "ERROR pthread_cond_signal for RU prach thread\n");
}
......@@ -1186,6 +1214,40 @@ static inline int wakeup_prach_ru_br(RU_t *ru) {
}
#endif
#if 0
static inline int wakeup_nfapi_subframe_thread(RU_t *ru) {
int i;
PHY_VARS_eNB **eNB_list = ru->eNB_list;
LOG_D(PHY,"wakeup_nfapi_subframe_thread (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
if (ru->num_eNB==1 && ru->eNB_top!=0) {
// call eNB function directly
char string[20];
sprintf(string,"Incoming RU %d",ru->idx);
//LOG_D(PHY,"RU %d Call eNB_top\n",ru->idx);
ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string);
}
else {
LOG_D(PHY,"ru->num_eNB:%d\n", ru->num_eNB);
for (i=0;i<ru->num_eNB;i++)
{
LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx);
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
{
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
}
}
}
}
#endif
// this is for RU with local RF unit
void fill_rf_config(RU_t *ru, char *rf_config_file) {
......@@ -1373,7 +1435,6 @@ static void* ru_thread( void* param ) {
init_frame_parms(&ru->frame_parms,1);
phy_init_RU(ru);
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
}
if (setup_RU_buffers(ru)!=0) {
......@@ -1429,23 +1490,36 @@ static void* ru_thread( void* param ) {
subframe++;
}
LOG_D(PHY,"RU thread (proc %p), frame %d (%p), subframe %d (%p)\n",
proc, frame,&frame,subframe,&subframe);
// synchronization on input FH interface, acquire signals/data and block
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&subframe);
else AssertFatal(1==0, "No fronthaul interface at south port");
LOG_D(PHY,"AFTER fh_south_in - SFN/SF:%d%d RU->proc[RX:%d%d TX:%d%d] RC.eNB[0][0]:[RX:%d%d TX(SFN):%d]\n",
frame,subframe,
proc->frame_rx,proc->subframe_rx,
proc->frame_tx,proc->subframe_tx,
RC.eNB[0][0]->proc.frame_rx,RC.eNB[0][0]->proc.subframe_rx,
RC.eNB[0][0]->proc.frame_tx);
if (nfapi_mode == 1) // PNF
{
// This is the earliest I think we can do this
//wakeup_nfapi_subframe_thread();
}
LOG_D(PHY,"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d\n",
ru->do_prach,
is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
proc->frame_rx,proc->subframe_rx);
if (0 && is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx))
LOG_D(PHY,"RU thread (do_prach %d, is_prach_subframe %d), received frame %d, subframe %d\n",
ru->do_prach,
is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
proc->frame_rx,proc->subframe_rx);
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) wakeup_prach_ru(ru);
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) {
wakeup_prach_ru(ru);
}
#ifdef Rel14
else if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>1)) wakeup_prach_ru_br(ru);
else if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>1)) {
wakeup_prach_ru_br(ru);
}
#endif
// adjust for timing offset between RU
......@@ -1453,21 +1527,22 @@ static void* ru_thread( void* param ) {
// do RX front-end processing (frequency-shift, dft) if needed
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
//if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
if (ru->feprx) ru->feprx(ru);
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 0 );
// At this point, all information for subframe has been received on FH interface
// If this proc is to provide synchronization, do so
wakeup_slaves(proc);
LOG_D(PHY,"RU %d/%d frame_tx %d, subframe_tx %d\n",0,ru->idx,proc->frame_tx,proc->subframe_tx);
//LOG_E(PHY,"RU %d/%d frame_tx %d, subframe_tx %d - wakeup_eNBs...\n",0,ru->idx,proc->frame_tx,proc->subframe_tx);
// wakeup all eNB processes waiting for this RU
if (ru->num_eNB>0) wakeup_eNBs(ru);
// wait until eNBs are finished subframe RX n and TX n+4
//LOG_E(PHY,"%s() Before wait_on_condition()\n", __FUNCTION__);
// wait until eNBs are finished subframe RX n and TX n+sf_ahead
wait_on_condition(&proc->mutex_eNBs,&proc->cond_eNBs,&proc->instance_cnt_eNBs,"ru_thread");
//LOG_E(PHY,"%s() AFTER wait_on_condition() ru->feptx_prec:%p ru->fh_north_asynch_in:%p ru->feptx_ofdm:%p ru->fh_south_out:%p ru->fh_north_out:%p\n", __FUNCTION__, ru->feptx_prec, ru->fh_north_asynch_in, ru->feptx_ofdm, ru->fh_south_out, ru->fh_north_out);
// do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru);
......@@ -1478,7 +1553,6 @@ static void* ru_thread( void* param ) {
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru);
if (ru->fh_north_out) ru->fh_north_out(ru);
}
......@@ -1598,6 +1672,7 @@ void init_RU_proc(RU_t *ru) {
#endif
char name[100];
LOG_E(PHY,"Initializing RU proc %d (%s,%s),\n",ru->idx,eNB_functions[ru->function],eNB_timing[ru->if_timing]);
#ifndef OCP_FRAMEWORK
LOG_I(PHY,"Initializing RU proc %d (%s,%s),\n",ru->idx,eNB_functions[ru->function],eNB_timing[ru->if_timing]);
#endif
......@@ -1652,6 +1727,8 @@ void init_RU_proc(RU_t *ru) {
pthread_create( &proc->pthread_FH, attr_FH, ru_thread, (void*)ru );
LOG_E(PHY,"%s() DJP - ru->function:%d\n", __FUNCTION__, ru->function);
if (ru->function == NGFI_RRU_IF4p5) {
pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru );
#ifdef Rel14
......@@ -1668,6 +1745,10 @@ void init_RU_proc(RU_t *ru) {
pthread_setname_np( proc->pthread_FH, name );
}
else if (ru->function == eNodeB_3GPP && ru->if_south == LOCAL_RF) { // DJP - need something else to distinguish between monolithic and PNF
LOG_E(PHY,"%s() DJP - added creation of pthread_prach\n", __FUNCTION__);
pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru );
}
if (get_nprocs()>=2) {
if (ru->feprx) init_fep_thread(ru,NULL);
......@@ -1677,10 +1758,6 @@ void init_RU_proc(RU_t *ru) {
}
int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
FH_fmt_options_t fmt = cap->FH_fmt;
......@@ -1867,12 +1944,15 @@ void init_RU(char *rf_config_file) {
// read in configuration file)
printf("configuring RU from file\n");
RCconfig_RU();
printf("number of L1 instances %d, number of RU %d\n",RC.nb_L1_inst,RC.nb_RU);
printf("number of L1 instances %d, number of RU %d RC.nb_CC[0]:%d\n",RC.nb_L1_inst,RC.nb_RU, RC.nb_CC[0]);
for (i=0;i<RC.nb_L1_inst;i++)
for (CC_id=0;CC_id<RC.nb_CC[i];CC_id++) RC.eNB[i][CC_id]->num_RU=0;
if (RC.nb_CC != 0)
for (i=0;i<RC.nb_L1_inst;i++)
for (CC_id=0;CC_id<RC.nb_CC[i];CC_id++) RC.eNB[i][CC_id]->num_RU=0;
LOG_E(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
LOG_E(PHY,"Process RC.ru[%d]\n",ru_id);
ru = RC.ru[ru_id];
ru->rf_config_file = rf_config_file;
ru->idx = ru_id;
......@@ -1880,24 +1960,47 @@ void init_RU(char *rf_config_file) {
// use eNB_list[0] as a reference for RU frame parameters
// NOTE: multiple CC_id are not handled here yet!
eNB0 = ru->eNB_list[0];
if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5))
AssertFatal(eNB0!=NULL,"eNB0 is null!\n");
printf("%s() RC.ru[%d].num_eNB:%d ru->eNB_list[0]:%p RC.eNB[0][0]:%p rf_config_file:%s\n", __FUNCTION__, ru_id, ru->num_eNB, ru->eNB_list[0], RC.eNB[0][0], ru->rf_config_file);
if (eNB0) {
LOG_I(PHY,"Copying frame parms from eNB %d to ru %d\n",eNB0->Mod_id,ru->idx);
memcpy((void*)&ru->frame_parms,(void*)&eNB0->frame_parms,sizeof(LTE_DL_FRAME_PARMS));
if (ru->eNB_list[0] == 0)
{
LOG_E(PHY,"%s() DJP - ru->eNB_list ru->num_eNB are not initialized - so do it manually\n", __FUNCTION__);
ru->eNB_list[0] = RC.eNB[0][0];
ru->num_eNB=1;
//
// DJP - feptx_prec() / feptx_ofdm() parses the eNB_list (based on num_eNB) and copies the txdata_F to txdata in RU
//
}
else
{
LOG_E(PHY,"DJP - delete code above this %s:%d\n", __FILE__, __LINE__);
}
// attach all RU to all eNBs in its list/
for (i=0;i<ru->num_eNB;i++) {
eNB0 = ru->eNB_list[i];
eNB0->RU_list[eNB0->num_RU++] = ru;
eNB0 = ru->eNB_list[0];
printf("RU FUnction:%d ru->if_south:%d\n", ru->function, ru->if_south);
printf("eNB0:%p\n", eNB0);
if (eNB0)
{
if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5))
AssertFatal(eNB0!=NULL,"eNB0 is null!\n");
if (eNB0) {
LOG_I(PHY,"Copying frame parms from eNB %d to ru %d\n",eNB0->Mod_id,ru->idx);
memcpy((void*)&ru->frame_parms,(void*)&eNB0->frame_parms,sizeof(LTE_DL_FRAME_PARMS));
// attach all RU to all eNBs in its list/
LOG_E(PHY,"ru->num_eNB:%d eNB0->num_RU:%d\n", ru->num_eNB, eNB0->num_RU);
for (i=0;i<ru->num_eNB;i++) {
eNB0 = ru->eNB_list[i];
eNB0->RU_list[eNB0->num_RU++] = ru;
}
}
}
// LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function);
LOG_E(PHY,"ru->if_south:%d\n", ru->if_south);
switch (ru->if_south) {
case LOCAL_RF: // this is an RU with integrated RF (RRU, eNB)
if (ru->function == NGFI_RRU_IF5) { // IF5 RRU
......@@ -1968,7 +2071,8 @@ void init_RU(char *rf_config_file) {
if (setup_RU_buffers(ru)!=0) {
printf("Exiting, cannot initialize RU Buffers\n");
exit(-1);
}*/
}
*/
break;
case REMOTE_IF5: // the remote unit is IF5 RRU
......
......@@ -101,7 +101,6 @@ unsigned short config_frames[4] = {2,9,11,13};
#endif
#include "lte-softmodem.h"
#ifdef XFORMS
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
// at eNB 0, an UL scope for every UE
......@@ -113,9 +112,16 @@ unsigned char scope_enb_num_ue = 2;
static pthread_t forms_thread; //xforms
#endif //XFORMS
pthread_cond_t nfapi_sync_cond;
pthread_mutex_t nfapi_sync_mutex;
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
uint8_t nfapi_mode = 0;
pthread_cond_t sync_cond;
pthread_mutex_t sync_mutex;
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
int config_sync_var=-1;
uint16_t runtime_phy_rx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
......@@ -205,6 +211,12 @@ 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);
extern PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t UE_id,
uint8_t abstraction_flag);
extern void init_eNB_afterRU(void);
int transmission_mode=1;
......@@ -834,7 +846,7 @@ void init_openair0() {
void wait_RUs(void) {
LOG_I(PHY,"Waiting for RUs to be configured ...\n");
LOG_I(PHY,"Waiting for RUs to be configured ... RC.ru_mask:%02lx\n", RC.ru_mask);
// wait for all RUs to be configured over fronthaul
pthread_mutex_lock(&RC.ru_mutex);
......@@ -843,6 +855,7 @@ void wait_RUs(void) {
while (RC.ru_mask>0) {
pthread_cond_wait(&RC.ru_cond,&RC.ru_mutex);
printf("RC.ru_mask:%02lx\n", RC.ru_mask);
}
LOG_I(PHY,"RUs configured\n");
......@@ -856,18 +869,36 @@ void wait_eNBs(void) {
while (waiting==1) {
printf("Waiting for eNB L1 instances to all get configured ... sleeping 500ms (nb_L1_inst %d)\n",RC.nb_L1_inst);
usleep(500000);
usleep(5000000);
waiting=0;
for (i=0;i<RC.nb_L1_inst;i++)
for (j=0;j<RC.nb_L1_CC[i];j++)
for (i=0;i<RC.nb_L1_inst;i++) {
printf("RC.nb_L1_CC[%d]:%d\n", i, RC.nb_L1_CC[i]);
for (j=0;j<RC.nb_L1_CC[i];j++) {
if (RC.eNB[i][j]->configured==0) {
waiting=1;
break;
}
}
}
}
}
printf("eNB L1 are configured\n");
}
static inline void wait_nfapi_init(char *thread_name) {
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
pthread_mutex_lock( &nfapi_sync_mutex );
while (nfapi_sync_var<0)
pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex );
pthread_mutex_unlock(&nfapi_sync_mutex);
printf( "NFAPI: got sync (%s)\n", thread_name);
}
int main( int argc, char **argv )
{
int i;
......@@ -969,6 +1000,7 @@ int main( int argc, char **argv )
log_set_instance_type (LOG_INSTANCE_ENB);
}
printf("ITTI init\n");
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, itti_dump_file);
// initialize mscgen log after ITTI
......@@ -988,6 +1020,7 @@ int main( int argc, char **argv )
}
#ifdef PDCP_USE_NETLINK
printf("PDCP netlink\n");
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
......@@ -1021,6 +1054,7 @@ int main( int argc, char **argv )
printf("Before CC \n");
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
......@@ -1084,6 +1118,7 @@ int main( int argc, char **argv )
}
}
printf("Runtime table\n");
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
cpuf=get_cpu_freq_GHz();
......@@ -1091,6 +1126,7 @@ int main( int argc, char **argv )
#ifndef DEADLINE_SCHEDULER
printf("NO deadline scheduler\n");
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
cpu_set_t cpuset;
......@@ -1131,7 +1167,10 @@ int main( int argc, char **argv )
#if defined(ENABLE_ITTI)
printf("ITTI enabled\n");
printf("UE_flag:%d\n", UE_flag);
printf("RC.nb_inst:%d\n", RC.nb_inst);
if ((UE_flag == 1)||
(RC.nb_inst > 0)) {
......@@ -1157,9 +1196,29 @@ int main( int argc, char **argv )
}
}
#if 0
// Will have parsed the config files by now
printf("NFAPI MODE:%d\n", nfapi_mode);
if (nfapi_mode==1) // PNF
{
set_comp_log(PHY, LOG_DEBUG, LOG_FULL, 1);
printf("DJP - forcing PHY to DEBUG - should see similar line if it works\n");
LOG_E(PHY,"%s() DJP - forcing PHY to LOG_DEBUG for PNF\n", __FUNCTION__);
}
else if (nfapi_mode == 2) // VNF
{
set_comp_log(MAC, LOG_DEBUG, LOG_FULL, 1);
set_comp_log(RRC, LOG_DEBUG, LOG_FULL, 1);
set_comp_log(PHY, LOG_DEBUG, LOG_FULL, 1);
printf("DJP - forcing MAC to DEBUG - should see similar line if it works\n");
LOG_E(PHY,"%s() DJP - forcing MAC to LOG_DEBUG for VNF\n", __FUNCTION__);
}
#endif
printf("mlock\n");
mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_cond_init(&sync_cond,NULL);
......@@ -1168,6 +1227,8 @@ int main( int argc, char **argv )
#ifdef XFORMS
int UE_id;
printf("XFORMS\n");
if (do_forms==1) {
fl_initialize (&argc, argv, NULL, 0, 0);
......@@ -1224,8 +1285,35 @@ int main( int argc, char **argv )
rt_sleep_ns(10*100000000ULL);
if (nfapi_mode)
{
printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL);
}
const char *nfapi_mode_str = "<UNKNOWN>";
switch(nfapi_mode)
{
case 0:
nfapi_mode_str = "MONOLITHIC";
case 1:
nfapi_mode_str = "PNF";
break;
case 2:
nfapi_mode_str = "VNF";
break;
default:
nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
break;
}
printf("NFAPI MODE:%s\n", nfapi_mode_str);
if (nfapi_mode==2) // VNF
wait_nfapi_init("main?");
printf("START MAIN THREADS\n");
// start the main threads
if (UE_flag == 1) {
......@@ -1240,15 +1328,18 @@ int main( int argc, char **argv )
}
else {
number_of_cards = 1;
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
if (RC.nb_L1_inst > 0) {
printf("Initializing eNB threads\n");
printf("Initializing eNB threads single_thread_flag:%d wait_for_sync:%d\n", single_thread_flag,wait_for_sync);
init_eNB(single_thread_flag,wait_for_sync);
// for (inst=0;inst<RC.nb_L1_inst;inst++)
// for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0);
}
printf("wait_eNBs()\n");
wait_eNBs();
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
if (RC.nb_RU >0) {
printf("Initializing RU threads\n");
init_RU(rf_config_file);
......@@ -1258,10 +1349,35 @@ int main( int argc, char **argv )
}
}
config_sync_var=0;
if (nfapi_mode==1) // PNF
{
//set_comp_log(PHY, LOG_DEBUG, LOG_FULL, 1);
//printf("DJP - forcing PHY to DEBUG - should see similar line if it works\n");
//LOG_E(PHY,"%s() DJP - forcing PHY to LOG_DEBUG for PNF\n", __FUNCTION__);
wait_nfapi_init("main?");
}
printf("wait RUs\n");
wait_RUs();
printf("ALL RUs READY!\n");
printf("RC.nb_RU:%d\n", RC.nb_RU);
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
init_eNB_afterRU();
printf("ALL RUs ready - init eNBs\n");
if (nfapi_mode != 1 && nfapi_mode != 2)
{
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
init_eNB_afterRU();
}
else
{
printf("NFAPI mode - DO NOT call init_eNB_afterRU()\n");
}
printf("ALL RUs ready - ALL eNBs ready\n");
}
......@@ -1295,19 +1411,12 @@ int main( int argc, char **argv )
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
} else {
printf("eNB mode\n");
}
printf("Sending sync to all threads\n");
pthread_mutex_lock(&sync_mutex);
sync_var=0;
pthread_cond_broadcast(&sync_cond);
......@@ -1318,7 +1427,6 @@ int main( int argc, char **argv )
printf("TYPE <CTRL-C> TO TERMINATE\n");
//getchar();
#if defined(ENABLE_ITTI)
printf("Entering ITTI signals handler\n");
itti_wait_tasks_end();
......@@ -1369,6 +1477,9 @@ int main( int argc, char **argv )
pthread_cond_destroy(&sync_cond);
pthread_mutex_destroy(&sync_mutex);
pthread_cond_destroy(&nfapi_sync_cond);
pthread_mutex_destroy(&nfapi_sync_mutex);
// *** Handle per CC_id openair0
......
[*]
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
[*] Tue Jul 25 20:26:12 2017
[*]
[dumpfile] "/tmp/openair_dump_eNB.vcd"
[dumpfile_mtime] "Tue Jul 25 20:11:55 2017"
[dumpfile_size] 19201475
[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
[timestart] 29023604000
[size] 1236 578
[pos] 309 0
*-20.793451 29026062100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[sst_width] 386
[signals_width] 262
[sst_expanded] 1
[sst_vpaned_height] 146
@28
functions.trx_read
functions.trx_write
@24
variables.trx_ts[63:0]
variables.trx_tst[63:0]
@25
variables.frame_number_RX0_RU[63:0]
variables.subframe_number_RX0_RU[63:0]
@25
variables.frame_number_TX0_RU[63:0]
variables.subframe_number_TX0_RU[63:0]
@24
functions.phy_procedures_ru_feprx0
functions.phy_procedures_ru_feprx1
functions.phy_procedures_eNb_rx_uespec0
functions.phy_procedures_eNb_tx0
functions.eNB_thread_rxtx1
functions.phy_enb_prach_rx
functions.phy_enb_rs_tx
functions.phy_enb_pdcch_tx
functions.nfapi_subframe
functions.generate_pcfich
functions.generate_dci0
functions.pdcch_scrambling
functions.pdcch_modulation
functions.pdcch_interleaving
functions.pdcch_tx
functions.generate_dlsch
functions.generate_phich
functions.udp_enb_task
functions.phy_procedures_ru_feptx_ofdm0
functions.phy_procedures_ru_feptx_ofdm1
functions.phy_procedures_ru_feptx_prec0
functions.phy_procedures_ru_feptx_prec1
functions.phy_enb_prach_rx
[pattern_trace] 1
[pattern_trace] 0