Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alex037yang
OpenXG-RAN
Commits
8649f178
Commit
8649f178
authored
Oct 09, 2018
by
magounak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing bugs for tdd mode
parent
58800db2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
91 additions
and
38 deletions
+91
-38
common/utils/LOG/vcd_signal_dumper.c
common/utils/LOG/vcd_signal_dumper.c
+4
-0
common/utils/LOG/vcd_signal_dumper.h
common/utils/LOG/vcd_signal_dumper.h
+4
-0
common/utils/T/T_defs.h
common/utils/T/T_defs.h
+1
-1
common/utils/T/T_messages.txt
common/utils/T/T_messages.txt
+20
-0
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+1
-1
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+29
-20
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+32
-16
No files found.
common/utils/LOG/vcd_signal_dumper.c
View file @
8649f178
...
...
@@ -79,6 +79,10 @@ const char* eurecomVariablesNames[] = {
"subframe_number_TX1_RU"
,
"subframe_number_RX0_RU"
,
"subframe_number_RX1_RU"
,
"subframe_number_if4p5_south_out"
,
"frame_number_if4p5_south_out"
,
"subframe_number_if4p5_south_in"
,
"frame_number_if4p5_south_in"
,
"runtime_TX_eNB"
,
"runtime_RX_eNB"
,
"frame_number_TX0_UE"
,
...
...
common/utils/LOG/vcd_signal_dumper.h
View file @
8649f178
...
...
@@ -55,6 +55,10 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_RU
,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU
,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_RU
,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT
,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT
,
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN
,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN
,
VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB
,
VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB
,
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_UE
,
...
...
common/utils/T/T_defs.h
View file @
8649f178
...
...
@@ -44,7 +44,7 @@ typedef struct {
#define VCD_NUM_FUNCTIONS (218)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (1
28)
#define VCD_NUM_VARIABLES (1
32)
/*(128)*/
/* first VCD function (to be kept up to date! see in T_messages.txt) */
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
...
...
common/utils/T/T_messages.txt
View file @
8649f178
...
...
@@ -1010,6 +1010,26 @@ ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_RU
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_RX1_RU
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_OUT
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_south_out
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_OUT
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_OUT
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_south_out
ID = VCD_VARIABLE_SUBFRAME_NUMBER_IF4P5_SOUTH_IN
DESC = VCD variable SUBFRAME_NUMBER_IF4P5_SOUTH_IN
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = subframe_number_if4p5_south_in
ID = VCD_VARIABLE_FRAME_NUMBER_IF4P5_SOUTH_IN
DESC = VCD variable FRAME_NUMBER_IF4P5_SOUTH_IN
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = frame_number_if4p5_south_in
ID = VCD_VARIABLE_RUNTIME_TX_ENB
DESC = VCD variable RUNTIME_TX_ENB
GROUP = ALL:VCD:ENB:VCD_VARIABLE
...
...
openair1/SCHED/phy_procedures_lte_eNb.c
View file @
8649f178
...
...
@@ -189,7 +189,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) {
int
**
txdataF
=
eNB
->
common_vars
.
txdataF
;
uint8_t
*
pbch_pdu
=&
eNB
->
pbch_pdu
[
0
];
//LOG_D
(PHY,"common_signal_procedures: frame %d, subframe %d fdd:%s dir:%s\n",frame,subframe,fp->frame_type == FDD?"FDD":"TDD", subframe_select(fp,subframe) == SF_DL?"DL":"UL?");
LOG_I
(
PHY
,
"common_signal_procedures: frame %d, subframe %d fdd:%s dir:%s
\n
"
,
frame
,
subframe
,
fp
->
frame_type
==
FDD
?
"FDD"
:
"TDD"
,
subframe_select
(
fp
,
subframe
)
==
SF_DL
?
"DL"
:
"UL?"
);
// generate Cell-Specific Reference Signals for both slots
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX
,
1
);
...
...
targets/RT/USER/lte-enb.c
View file @
8649f178
...
...
@@ -177,7 +177,6 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
static
inline
int
rxtx
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
char
*
thread_name
)
{
start_meas
(
&
softmodem_stats_rxtx_sf
);
// *******************************************************************
if
(
nfapi_mode
==
1
)
{
...
...
@@ -238,10 +237,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER
,
1
);
if
(
!
eNB
->
single_thread_flag
&&
get_nprocs
()
>=
8
){
//printf("Entering rxtx, proc1->cond_rxtx, proc1->pipe_ready, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if
(
wait_on_condition
(
&
proc
[
1
].
mutex_rxtx
,
&
proc
[
1
].
cond_rxtx
,
&
proc
[
1
].
pipe_ready
,
"wakeup_tx"
)
<
0
)
{
LOG_E
(
PHY
,
"Frame %d, subframe %d: TX1 not ready
\n
"
,
proc
[
1
].
frame_rx
,
proc
[
1
].
subframe_rx
);
return
(
-
1
);
}
//printf("Passed rxtx, proc1->cond_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if
(
release_thread
(
&
proc
[
1
].
mutex_rxtx
,
&
proc
[
1
].
pipe_ready
,
"wakeup_tx"
)
<
0
)
return
(
-
1
);
}
...
...
@@ -319,7 +320,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
static
void
*
tx_thread
(
void
*
param
)
{
PHY_VARS_eNB
*
eNB
=
(
PHY_VARS_eNB
*
)
param
;
eNB_proc_t
*
eNB_proc
=
&
eNB
->
proc
;
eNB_rxtx_proc_t
*
proc
=
&
eNB_proc
->
proc_rxtx
[
1
];
...
...
@@ -332,10 +332,10 @@ static void* tx_thread(void* param) {
//wait_sync("tx_thread");
while
(
!
oai_exit
)
{
//printf("Entering tx_thread, proc1->cond_rxtx, proc1->instance_cnt_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if
(
wait_on_condition
(
&
proc
->
mutex_rxtx
,
&
proc
->
cond_rxtx
,
&
proc
->
instance_cnt_rxtx
,
thread_name
)
<
0
)
break
;
if
(
oai_exit
)
break
;
//printf("Passed tx_thread proc1->cond_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if
(
oai_exit
)
break
;
// *****************************************
// TX processing for subframe n+4
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
...
...
@@ -356,6 +356,7 @@ static void* tx_thread(void* param) {
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
}
//printf("Sent tx_thread, proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
pthread_mutex_unlock
(
&
proc
->
mutex_rxtx
);
wakeup_txfh
(
proc
,
eNB
);
}
...
...
@@ -410,9 +411,9 @@ static void* eNB_thread_rxtx( void* param ) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0
+
(
proc
->
subframe_rx
&
1
),
0
);
T
(
T_ENB_MASTER_TICK
,
T_INT
(
0
),
T_INT
(
proc
->
frame_rx
),
T_INT
(
proc
->
subframe_rx
));
//printf("Entering eNB_thread_rxtx, proc0->cond_rxtx, instance_cnt_rxtx, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
if
(
wait_on_condition
(
&
proc
->
mutex_rxtx
,
&
proc
->
cond_rxtx
,
&
proc
->
instance_cnt_rxtx
,
thread_name
)
<
0
)
break
;
//printf("Passed eNB_thread_rxtx proc0->cond_rxtx , frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX
,
sched_getcpu
());
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0
+
(
proc
->
subframe_rx
&
1
),
1
);
...
...
@@ -439,6 +440,7 @@ static void* eNB_thread_rxtx( void* param ) {
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
}
//printf("Sent eNB_thread_rxtx proc0-> cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx);
pthread_mutex_unlock
(
&
proc
->
mutex_rxtx
);
if
(
nfapi_mode
!=
2
){
if
(
get_nprocs
()
>=
8
)
wakeup_tx
(
eNB
,
eNB
->
proc
.
ru_proc
);
...
...
@@ -451,7 +453,7 @@ static void* eNB_thread_rxtx( void* param ) {
}
// while !oai_exit
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0
+
(
proc
->
subframe_rx
&
1
),
0
);
//
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
LOG_D
(
PHY
,
" *** Exiting eNB thread RXn_TXnp4
\n
"
);
...
...
@@ -488,22 +490,28 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
}
int
wakeup_txfh
(
eNB_rxtx_proc_t
*
proc
,
PHY_VARS_eNB
*
eNB
)
{
RU_proc_t
*
ru_proc
;
struct
timespec
wait
;
wait
.
tv_sec
=
0
;
wait
.
tv_nsec
=
5000000L
;
LTE_DL_FRAME_PARMS
*
fp
;
for
(
int
ru_id
=
0
;
ru_id
<
eNB
->
num_RU
;
ru_id
++
){
ru_proc
=
&
eNB
->
RU_list
[
ru_id
]
->
proc
;
fp
=
&
eNB
->
RU_list
[
ru_id
]
->
frame_parms
;
if
((
fp
->
frame_type
==
TDD
)
&&
(
subframe_select
(
fp
,
proc
->
subframe_tx
)
==
SF_UL
))
continue
;
// skip the RUs that are not synced
if
(
eNB
->
RU_list
[
ru_id
]
->
state
==
RU_SYNC
)
{
LOG_I
(
PHY
,
"wakeup_txfh: eNB %d : Skipping ru %d
\n
"
,
eNB
->
Mod_id
,
ru_id
);
continue
;
}
if
(
ru_proc
==
NULL
)
return
(
0
);
//printf("Entering wakeup_txfh, ru_proc->cond_eNBs, ru_proc->ru_tx_ready, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,ru_proc->frame_tx,ru_proc->subframe_tx);
if
(
wait_on_condition
(
&
ru_proc
->
mutex_eNBs
,
&
ru_proc
->
cond_eNBs
,
&
ru_proc
->
ru_tx_ready
,
"wakeup_txfh"
)
<
0
)
{
LOG_E
(
PHY
,
"Frame %d, subframe %d: TX FH not ready
\n
"
,
ru_proc
->
frame_tx
,
ru_proc
->
subframe_tx
);
return
(
-
1
);
}
//printf("Passed wakeup_txfh ru_proc->cond_eNBs, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", ru_proc->frame_rx,ru_proc->subframe_rx,ru_proc->frame_tx,ru_proc->subframe_tx);
if
(
release_thread
(
&
ru_proc
->
mutex_eNBs
,
&
ru_proc
->
ru_tx_ready
,
"wakeup_txfh"
)
<
0
)
return
(
-
1
);
if
(
ru_proc
->
instance_cnt_eNBs
==
0
)
{
LOG_E
(
PHY
,
"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d
\n
"
,
ru_proc
->
frame_tx
,
ru_proc
->
subframe_tx
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
return
(
-
1
);
...
...
@@ -518,27 +526,28 @@ int wakeup_txfh(eNB_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
ru_proc
->
timestamp_tx
=
proc
->
timestamp_tx
;
ru_proc
->
subframe_tx
=
proc
->
subframe_tx
;
ru_proc
->
frame_tx
=
proc
->
frame_tx
;
// the thread can now be woken up
if
(
pthread_cond_signal
(
&
ru_proc
->
cond_eNBs
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
return
(
-
1
);
}
//printf("Sent wakeup_txfh ru_proc->cond_eNBs to tx_thread\n, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc->frame_rx,proc->subframe_rx,ru_proc->frame_tx,ru_proc->subframe_tx);
pthread_mutex_unlock
(
&
ru_proc
->
mutex_eNBs
);
}
return
(
0
);
}
int
wakeup_tx
(
PHY_VARS_eNB
*
eNB
,
RU_proc_t
*
ru_proc
)
{
eNB_proc_t
*
proc
=&
eNB
->
proc
;
eNB_rxtx_proc_t
*
proc_rxtx1
=&
proc
->
proc_rxtx
[
1
];
/
/*proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1];
eNB_rxtx_proc_t
*
proc_rxtx1
=&
proc
->
proc_rxtx
[
1
];
/
**proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1];*/
eNB_rxtx_proc_t
*
proc_rxtx0
=&
proc
->
proc_rxtx
[
0
];
/* LTE_DL_FRAME_PARMS *fp;
fp = &eNB->frame_parms;
if ((fp->frame_type == TDD) && (subframe_select(fp,proc_rxtx0->subframe_tx)==SF_UL)) return;
*/
struct
timespec
wait
;
wait
.
tv_sec
=
0
;
wait
.
tv_nsec
=
5000000L
;
...
...
@@ -571,14 +580,13 @@ int wakeup_tx(PHY_VARS_eNB *eNB,RU_proc_t *ru_proc) {
exit_fun
(
"ERROR pthread_cond_signal"
);
return
(
-
1
);
}
//printf("Sent wakeup_tx proc1->cond_rxtx to tx_thread, frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d\n", proc_rxtx1->frame_rx,proc_rxtx1->subframe_rx,proc_rxtx1->frame_tx,proc_rxtx1->subframe_tx);
pthread_mutex_unlock
(
&
proc_rxtx1
->
mutex_rxtx
);
return
(
0
);
}
int
wakeup_rxtx
(
PHY_VARS_eNB
*
eNB
,
RU_t
*
ru
)
{
eNB_proc_t
*
proc
=&
eNB
->
proc
;
RU_proc_t
*
ru_proc
=&
ru
->
proc
;
...
...
@@ -618,11 +626,12 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
wait
.
tv_sec
=
0
;
wait
.
tv_nsec
=
5000000L
;
//printf("Entering wakeup_rxtx, cond_rxtx, proc0->pipe_ready, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
if
(
wait_on_condition
(
&
proc_rxtx0
->
mutex_rxtx
,
&
proc_rxtx0
->
cond_rxtx
,
&
proc_rxtx0
->
pipe_ready
,
"wakeup_rxtx"
)
<
0
)
{
LOG_E
(
PHY
,
"Frame %d, subframe %d: RXTX0 not ready
\n
"
,
proc_rxtx0
->
frame_rx
,
proc_rxtx0
->
subframe_rx
);
return
(
-
1
);
}
//printf("Passed wakeup_rxtx proc0->cond_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
if
(
release_thread
(
&
proc_rxtx0
->
mutex_rxtx
,
&
proc_rxtx0
->
pipe_ready
,
"wakeup_rxtx"
)
<
0
)
return
(
-
1
);
if
(
proc_rxtx0
->
instance_cnt_rxtx
==
0
)
{
...
...
@@ -659,7 +668,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
exit_fun
(
"ERROR pthread_cond_signal"
);
return
(
-
1
);
}
//printf("Sent wakeup_rxtx proc0->cond_rxtx to eNB_thread_rxtx, frame %d, subframe %d\n", proc_rxtx0->frame_rx,proc_rxtx0->subframe_rx,proc_rxtx0->frame_tx,proc_rxtx0->subframe_tx);
pthread_mutex_unlock
(
&
proc_rxtx0
->
mutex_rxtx
);
return
(
0
);
...
...
targets/RT/USER/lte-ru.c
View file @
8649f178
...
...
@@ -154,11 +154,18 @@ static inline void fh_if5_south_out(RU_t *ru) {
// southbound IF4p5 fronthaul
static
inline
void
fh_if4p5_south_out
(
RU_t
*
ru
)
{
if
(
ru
==
RC
.
ru
[
0
])
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST
,
ru
->
proc
.
timestamp_tx
&
0xffffffff
);
LOG_
D
(
PHY
,
"
Sending IF4p5 for frame %d subframe %d
\n
"
,
ru
->
proc
.
frame_tx
,
ru
->
proc
.
subframe_tx
);
LOG_
I
(
PHY
,
"[OOOOOOOOOOOOOOOOOOOOUUUUUTTTTTTT] fh_if4p5_south_out:
Sending IF4p5 for frame %d subframe %d
\n
"
,
ru
->
proc
.
frame_tx
,
ru
->
proc
.
subframe_tx
);
if
(
subframe_select
(
&
ru
->
frame_parms
,
ru
->
proc
.
subframe_tx
)
!=
SF_UL
)
{
send_IF4p5
(
ru
,
ru
->
proc
.
frame_tx
,
ru
->
proc
.
subframe_tx
,
IF4p5_PDLFFT
);
ru
->
south_out_cnt
++
;
}
/*if (ru == RC.ru[0] || ru == RC.ru[1]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, ru->proc.frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU+ru->idx, ru->proc.subframe_tx );
}*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT
,
ru
->
proc
.
frame_tx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_OUT
,
ru
->
proc
.
subframe_tx
);
}
/*************************************************************/
...
...
@@ -211,7 +218,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
symbol_mask_full
=
(
1
<<
fp
->
ul_symbols_in_S_subframe
)
-
1
;
else
symbol_mask_full
=
(
1
<<
fp
->
symbols_per_tti
)
-
1
;
LOG_I
(
PHY
,
"[IIIIIIIIIIIIIIIIIIIINNNNNNNN] fh_if4p5_south_in: RU %d, frame %d, subframe %d
\n
"
,
ru
->
idx
,
*
frame
,
*
subframe
);
AssertFatal
(
proc
->
symbol_mask
[
*
subframe
]
==
0
,
"rx_fh_if4p5: proc->symbol_mask[%d] = %x
\n
"
,
*
subframe
,
proc
->
symbol_mask
[
*
subframe
]);
do
{
recv_IF4p5
(
ru
,
&
f
,
&
sf
,
&
packet_type
,
&
symbol_number
);
...
...
@@ -224,11 +231,11 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
}
else
if
(
packet_type
==
IF4p5_PRACH
)
{
// nothing in RU for RAU
}
}
ru
->
south_out_cnt
=
0
;
LOG_D
(
PHY
,
"rx_fh_if4p5: subframe %d symbol mask %x
\n
"
,
*
subframe
,
proc
->
symbol_mask
[
*
subframe
]);
}
while
(
proc
->
symbol_mask
[
*
subframe
]
!=
symbol_mask_full
);
//caculate timestamp_rx, timestamp_tx based on frame and subframe
//ca
l
culate timestamp_rx, timestamp_tx based on frame and subframe
proc
->
subframe_rx
=
sf
;
proc
->
frame_rx
=
f
;
proc
->
timestamp_rx
=
((
proc
->
frame_rx
*
10
)
+
proc
->
subframe_rx
)
*
fp
->
samples_per_tti
;
...
...
@@ -238,7 +245,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
}
if
(
proc
->
first_rx
==
0
)
{
if
(
proc
->
subframe_rx
!=
*
subframe
){
if
(
proc
->
subframe_rx
!=
*
subframe
){
LOG_E
(
PHY
,
"Received Timestamp (IF4p5) doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)
\n
"
,
proc
->
subframe_rx
,
*
subframe
);
exit_fun
(
"Exiting"
);
}
...
...
@@ -256,12 +263,14 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
*
subframe
=
proc
->
subframe_rx
;
}
if
(
ru
==
RC
.
ru
[
0
]
||
ru
==
RC
.
ru
[
1
])
{
/*
if (ru == RC.ru[0] || ru == RC.ru[1]) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU+ru->idx, f );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU+ru->idx, sf );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU
+
ru
->
idx
,
proc
->
frame_tx
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU
+
ru
->
idx
,
proc
->
subframe_tx
);
}
}*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_IN
,
f
);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_SOUTH_IN
,
sf
);
proc
->
symbol_mask
[
sf
]
=
0
;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME
(
VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS
,
proc
->
timestamp_rx
&
0xffffffff
);
...
...
@@ -352,11 +361,14 @@ void fh_if4p5_north_in(RU_t *ru,int *frame,int *subframe) {
symbol_number
=
0
;
symbol_mask
=
0
;
symbol_mask_full
=
(
1
<<
ru
->
frame_parms
.
symbols_per_tti
)
-
1
;
LOG_I
(
PHY
,
"fh_if4p5_north_in: RU %d, frame %d, subframe %d
\n
"
,
ru
->
idx
,
*
frame
,
*
subframe
);
do
{
recv_IF4p5
(
ru
,
frame
,
subframe
,
&
packet_type
,
&
symbol_number
);
symbol_mask
=
symbol_mask
|
(
1
<<
symbol_number
);
}
while
(
symbol_mask
!=
symbol_mask_full
);
// dump VCD output for first RU in list
if
(
ru
==
RC
.
ru
[
0
])
{
...
...
@@ -1464,9 +1476,9 @@ static void* ru_thread_tx( void* param ) {
//CPU_SET(5, &cpuset);
//pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
//wait_sync("ru_thread_tx");
//printf("Entering ru_thread_tx, ru_proc->cond_FH1, ru_proc->instance_cnt_FH1\n");
wait_on_condition
(
&
proc
->
mutex_FH1
,
&
proc
->
cond_FH1
,
&
proc
->
instance_cnt_FH1
,
"ru_thread_tx"
);
//printf("Passed ru_thread_tx ru_proc->cond_FH1\n");
printf
(
"ru_thread_tx ready
\n
"
);
while
(
!
oai_exit
)
{
...
...
@@ -1475,11 +1487,13 @@ static void* ru_thread_tx( void* param ) {
if
(
oai_exit
)
break
;
LOG_D
(
PHY
,
"ru_thread_tx: Waiting for TX processing
\n
"
);
// wait until eNBs are finished subframe RX n and TX n+4
LOG_I
(
PHY
,
"ru_thread_tx (ru %d): Waiting for TX processing
\n
"
,
ru
->
idx
);
// wait until eNBs are finished subframe RX n and TX n+4
//printf("ru_thread_tx, ru_proc->cond_eNBs, ru_proc->instance_cnt_eNBs\n");
wait_on_condition
(
&
proc
->
mutex_eNBs
,
&
proc
->
cond_eNBs
,
&
proc
->
instance_cnt_eNBs
,
"ru_thread_tx"
);
LOG_D
(
PHY
,
"ru_thread_tx: Woken from condition
\n
"
);
if
(
oai_exit
)
break
;
//printf("Passed ru_thread_tx ru_proc->cond_eNBs\n");
LOG_I
(
PHY
,
"ru_thread_tx (ru %d): Woken from condition
\n
"
,
ru
->
idx
);
if
(
oai_exit
)
break
;
// do TX front-end processing if needed (precoding and/or IDFTs)
if
(
ru
->
feptx_prec
)
ru
->
feptx_prec
(
ru
);
...
...
@@ -1496,11 +1510,13 @@ static void* ru_thread_tx( void* param ) {
pthread_mutex_lock
(
&
proc
->
mutex_eNBs
);
proc
->
ru_tx_ready
++
;
//printf("~~~~~~~~~~~~~~~~~~proc->ru_tx_ready = %d\n", proc->ru_tx_ready);
// the thread can now be woken up
if
(
pthread_cond_signal
(
&
proc
->
cond_eNBs
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread
\n
"
);
exit_fun
(
"ERROR pthread_cond_signal"
);
}
//printf("Sent ru_thread_tx, ru_proc->cond_eNBs to tx_thread\n");
pthread_mutex_unlock
(
&
proc
->
mutex_eNBs
);
}
release_thread
(
&
proc
->
mutex_FH1
,
&
proc
->
instance_cnt_FH1
,
"ru_thread_tx"
);
...
...
@@ -1714,7 +1730,7 @@ static void* ru_thread( void* param ) {
}
else
{
LOG_
D
(
PHY
,
"RU thread %d, frame %d, subframe %d
\n
"
,
LOG_
I
(
PHY
,
"RU thread %d, frame %d, subframe %d
\n
"
,
ru
->
idx
,
frame
,
subframe
);
if
((
ru
->
do_prach
>
0
)
&&
(
is_prach_subframe
(
fp
,
proc
->
frame_rx
,
proc
->
subframe_rx
)
==
1
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment