Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
JenRungHuang
openairinterface5G
Commits
ed145f57
Commit
ed145f57
authored
Jul 17, 2017
by
tct-labo4
Browse files
[OAI-UE] slot0/1 parallelization part2
parent
bf7eb25c
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
View file @
ed145f57
...
...
@@ -112,10 +112,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
int
avg_0
[
2
];
int
avg_1
[
2
];
uint8_t
slot
=
0
;
unsigned
char
aatx
,
aarx
;
unsigned
short
nb_rb
=
0
,
round
;
int
avgs
,
rb
;
int
avgs
=
0
,
rb
;
LTE_DL_UE_HARQ_t
*
dlsch0_harq
,
*
dlsch1_harq
=
0
;
uint8_t
beamforming_mode
;
...
...
@@ -248,6 +250,11 @@ int rx_pdsch(PHY_VARS_UE *ue,
return
(
-
1
);
}
}
if
(
symbol
>
ue
->
frame_parms
.
symbols_per_tti
>>
1
)
{
slot
=
1
;
}
#ifdef DEBUG_HARQ
printf
(
"Demod dlsch0_harq->pmi_alloc %d
\n
"
,
dlsch0_harq
->
pmi_alloc
);
#endif
...
...
@@ -257,6 +264,9 @@ int rx_pdsch(PHY_VARS_UE *ue,
LOG_I
(
PHY
,
"dlsch: using pmi %x (%p), rb_alloc %x
\n
"
,
pmi2hex_2Ar1
(
dlsch0_harq
->
pmi_alloc
),
dlsch
[
0
],
dlsch0_harq
->
rb_alloc_even
[
0
]);
#endif
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#endif
nb_rb
=
dlsch_extract_rbs_dual
(
common_vars
->
common_vars_rx_data_per_thread
[
subframe
%
RX_NB_TH
].
rxdataF
,
common_vars
->
common_vars_rx_data_per_thread
[
subframe
%
RX_NB_TH
].
dl_ch_estimates
[
eNB_id
],
pdsch_vars
[
eNB_id
]
->
rxdataF_ext
,
...
...
@@ -364,12 +374,20 @@ int rx_pdsch(PHY_VARS_UE *ue,
return
(
-
1
);
}
#ifdef DEBUG_PHY
LOG_D
(
PHY
,
"[DLSCH] nb_rb %d log2_maxh = %d (%d,%d)
\n
"
,
nb_rb
,
pdsch_vars
[
eNB_id
]
->
log2_maxh
,
avg
[
0
],
avgs
);
LOG_D
(
PHY
,
"[DLSCH] mimo_mode = %d
\n
"
,
dlsch0_harq
->
mimo_mode
);
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#if DISABLE_LOG_X
printf
(
"[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
ue
->
high_speed_flag
,
type
,
symbol
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#else
LOG_I
(
PHY
,
"[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
ue
->
high_speed_flag
,
type
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#endif
#endif
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#endif
aatx
=
frame_parms
->
nb_antenna_ports_eNB
;
aarx
=
frame_parms
->
nb_antennas_rx
;
...
...
@@ -392,6 +410,18 @@ int rx_pdsch(PHY_VARS_UE *ue,
nb_rb
);
}
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#if DISABLE_LOG_X
printf
(
"[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#else
LOG_I
(
PHY
,
"[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#endif
#endif
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#endif
if
(
first_symbol_flag
==
1
)
{
if
(
beamforming_mode
==
0
){
if
(
dlsch0_harq
->
mimo_mode
<
LARGE_CDD
)
{
...
...
@@ -482,6 +512,16 @@ int rx_pdsch(PHY_VARS_UE *ue,
avg
[
0
],
avgs
);
//LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
#endif
//wait until pdcch is decoded
proc
->
channel_level
=
1
;
}
uint32_t
wait
=
0
;
while
(
proc
->
channel_level
==
0
)
{
usleep
(
1
);
wait
++
;
}
#if T_TRACER
...
...
@@ -492,6 +532,19 @@ int rx_pdsch(PHY_VARS_UE *ue,
}
#endif
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#if DISABLE_LOG_X
printf
(
"[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
first_symbol_flag
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#else
LOG_I
(
PHY
,
"[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
first_symbol_flag
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#endif
#endif
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#endif
// Now channel compensation
if
(
dlsch0_harq
->
mimo_mode
<
LARGE_CDD
)
{
dlsch_channel_compensation
(
pdsch_vars
[
eNB_id
]
->
rxdataF_ext
,
...
...
@@ -686,8 +739,18 @@ int rx_pdsch(PHY_VARS_UE *ue,
measurements
);
// log2_maxh+I0_shift
}
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#if DISABLE_LOG_X
printf
(
"[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
pdsch_vars
[
eNB_id
]
->
log2_maxh
,
proc
->
channel_level
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#else
LOG_I
(
PHY
,
"[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
pdsch_vars
[
eNB_id
]
->
log2_maxh
,
proc
->
channel_level
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#endif
#endif
// MRC
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#endif
if
(
frame_parms
->
nb_antennas_rx
>
1
)
{
if
((
dlsch0_harq
->
mimo_mode
==
LARGE_CDD
)
||
...
...
@@ -755,6 +818,18 @@ int rx_pdsch(PHY_VARS_UE *ue,
//i_mod should have been passed as a parameter
}
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#if DISABLE_LOG_X
printf
(
"[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#else
LOG_I
(
PHY
,
"[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#endif
#endif
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#endif
//printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
// compute LLRs
// -> // compute @pointer where llrs should filled for this ofdm-symbol
...
...
@@ -1102,6 +1177,14 @@ int rx_pdsch(PHY_VARS_UE *ue,
}
}
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
]);
#if DISABLE_LOG_X
printf
(
"[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#else
LOG_I
(
PHY
,
"[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f
\n
"
,
frame
,
subframe
,
slot
,
symbol
,
ue
->
generic_stat_bis
[
subframe
%
RX_NB_TH
][
slot
].
p_time
/
(
cpuf
*
1000
.
0
));
#endif
#endif
// Please keep it: useful for debugging
#if 0
if( (symbol == 13) && (subframe==0) && (dlsch0_harq->Qm == 6) /*&& (nb_rb==25)*/)
...
...
@@ -1148,10 +1231,6 @@ int rx_pdsch(PHY_VARS_UE *ue,
T_BUFFER
(
&
pdsch_vars
[
eNB_id
]
->
rxdataF_comp0
[
eNB_id
][
0
],
2
*
/* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */
frame_parms
->
N_RB_UL
*
12
*
frame_parms
->
symbols_per_tti
*
2
));
#endif
if
(
symbol
==
(
ue
->
frame_parms
.
symbols_per_tti
>>
1
))
//(first_symbol_flag)
proc
->
first_symbol_available
=
1
;
return
(
0
);
}
...
...
openair1/PHY/LTE_TRANSPORT/initial_sync.c
View file @
ed145f57
...
...
@@ -233,19 +233,17 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
break
;
}
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
=
(((
ue
->
pbch_vars
[
0
]
->
decoded_output
[
2
]
&
3
)
<<
6
)
+
(
ue
->
pbch_vars
[
0
]
->
decoded_output
[
1
]
>>
2
))
<<
2
;
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
+=
frame_mod4
;
ue
->
proc
.
proc_rxtx
[
1
].
frame_rx
=
(((
ue
->
pbch_vars
[
0
]
->
decoded_output
[
2
]
&
3
)
<<
6
)
+
(
ue
->
pbch_vars
[
0
]
->
decoded_output
[
1
]
>>
2
))
<<
2
;
ue
->
proc
.
proc_rxtx
[
1
].
frame_rx
+=
frame_mod4
;
for
(
int
i
=
0
;
i
<
RX_NB_TH
;
i
++
)
{
ue
->
proc
.
proc_rxtx
[
i
].
frame_rx
=
(((
ue
->
pbch_vars
[
0
]
->
decoded_output
[
2
]
&
3
)
<<
6
)
+
(
ue
->
pbch_vars
[
0
]
->
decoded_output
[
1
]
>>
2
))
<<
2
;
ue
->
proc
.
proc_rxtx
[
i
].
frame_rx
=
(((
ue
->
pbch_vars
[
0
]
->
decoded_output
[
2
]
&
3
)
<<
6
)
+
(
ue
->
pbch_vars
[
0
]
->
decoded_output
[
1
]
>>
2
))
<<
2
;
#ifndef USER_MODE
// one frame delay
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
++
;
ue
->
proc
.
proc_rxtx
[
1
].
frame_rx
++
;
// one frame delay
ue
->
proc
.
proc_rxtx
[
i
].
frame_rx
++
;
#endif
ue
->
proc
.
proc_rxtx
[
0
].
frame_tx
=
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
;
ue
->
proc
.
proc_rxtx
[
1
].
frame_tx
=
ue
->
proc
.
proc_rxtx
[
1
].
frame_rx
;
ue
->
proc
.
proc_rxtx
[
i
].
frame_tx
=
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
;
}
#ifdef DEBUG_INITIAL_SYNCH
LOG_I
(
PHY
,
"[UE%d] Initial sync: pbch decoded sucessfully mode1_flag %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!
\n
"
,
ue
->
Mod_id
,
...
...
openair1/PHY/defs.h
View file @
ed145f57
...
...
@@ -397,20 +397,27 @@ typedef struct {
struct
sched_param
sched_param_rxtx
;
/// internal This variable is protected by ref mutex_fep_slot1.
int
instance_cnt_fep_slot1
;
//int instance_cnt_slot0_dl_processing;
int
instance_cnt_slot1_dl_processing
;
/// pthread descriptor fep_slot1 thread
pthread_t
pthread_fep_slot1
;
//pthread_t pthread_slot0_dl_processing;
pthread_t
pthread_slot1_dl_processing
;
/// pthread attributes for fep_slot1 processing thread
pthread_attr_t
attr_fep_slot1
;
// pthread_attr_t attr_slot0_dl_processing;
pthread_attr_t
attr_slot1_dl_processing
;
/// condition variable for UE fep_slot1 thread;
pthread_cond_t
cond_fep_slot1
;
//pthread_cond_t cond_slot0_dl_processing;
pthread_cond_t
cond_slot1_dl_processing
;
/// mutex for UE synch thread
pthread_mutex_t
mutex_fep_slot1
;
//pthread_mutex_t mutex_slot0_dl_processing;
pthread_mutex_t
mutex_slot1_dl_processing
;
//
uint8_t
chan_est_pilot0_slot1_available
;
uint8_t
chan_est_slot1_available
;
uint8_t
llr_slot1_available
;
uint8_t
dci_slot0_available
;
uint8_t
first_symbol_available
;
uint8_t
channel_level
;
/// scheduling parameters for fep_slot1 thread
struct
sched_param
sched_param_fep_slot1
;
...
...
@@ -910,6 +917,7 @@ typedef struct {
time_stats_t
ulsch_multiplexing_stats
;
time_stats_t
generic_stat
;
time_stats_t
generic_stat_bis
[
RX_NB_TH
][
LTE_SLOTS_PER_SUBFRAME
];
time_stats_t
ue_front_end_stat
[
RX_NB_TH
];
time_stats_t
ue_front_end_per_slot_stat
[
RX_NB_TH
][
LTE_SLOTS_PER_SUBFRAME
];
time_stats_t
pdcch_procedures_stat
[
RX_NB_TH
];
...
...
openair1/SCHED/defs.h
View file @
ed145f57
...
...
@@ -140,9 +140,11 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t
@param phy_vars_rn pointer to RN variables
*/
int
phy_procedures_UE_RX
(
PHY_VARS_UE
*
phy_vars_ue
,
UE_rxtx_proc_t
*
proc
,
uint8_t
eNB_id
,
uint8_t
abstraction_flag
,
uint8_t
do_pdcch_flag
,
runmode_t
mode
,
relaying_type_t
r_type
,
PHY_VARS_RN
*
phy_vars_rn
);
int
phy_procedures_slot_parallelization_UE_RX
(
PHY_VARS_UE
*
ue
,
UE_rxtx_proc_t
*
proc
,
uint8_t
eNB_id
,
uint8_t
abstraction_flag
,
uint8_t
do_pdcch_flag
,
runmode_t
mode
,
relaying_type_t
r_type
,
PHY_VARS_RN
*
phy_vars_rn
);
#ifdef UE_SLOT_PARALLELISATION
void
*
UE_thread_
fep_
slot1
(
void
*
arg
);
void
*
UE_thread_slot1
_dl_processing
(
void
*
arg
);
#endif
/*! \brief Scheduling for UE TX procedures in TDD S-subframes.
...
...
openair1/SCHED/phy_procedures_lte_ue.c
View file @
ed145f57
This diff is collapsed.
Click to expand it.
targets/COMMON/threads_t.h
View file @
ed145f57
...
...
@@ -6,6 +6,9 @@ typedef struct threads_s {
int
one
;
int
two
;
int
three
;
int
slot1_proc_one
;
int
slot1_proc_two
;
int
slot1_proc_three
;
}
threads_t
;
#endif
/* _THREADS_T_H_ */
targets/RT/USER/lte-softmodem.c
View file @
ed145f57
...
...
@@ -222,7 +222,7 @@ double cpuf;
char
uecap_xer
[
1024
],
uecap_xer_in
=
0
;
int
oaisim_flag
=
0
;
threads_t
threads
=
{
-
1
,
-
1
,
-
1
,
-
1
};
threads_t
threads
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
};
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution
...
...
@@ -640,6 +640,9 @@ static void get_options (int argc, char **argv) {
LONG_OPTION_THREADONESUBFRAME
,
LONG_OPTION_THREADTWOSUBFRAME
,
LONG_OPTION_THREADTHREESUBFRAME
,
LONG_OPTION_THREADSLOT1PROCONE
,
LONG_OPTION_THREADSLOT1PROCTWO
,
LONG_OPTION_THREADSLOT1PROCTHREE
,
LONG_OPTION_DEMOD_SHIFT
,
#if T_TRACER
LONG_OPTION_T_PORT
,
...
...
@@ -677,6 +680,9 @@ static void get_options (int argc, char **argv) {
{
"threadOneSubframe"
,
required_argument
,
NULL
,
LONG_OPTION_THREADONESUBFRAME
},
{
"threadTwoSubframe"
,
required_argument
,
NULL
,
LONG_OPTION_THREADTWOSUBFRAME
},
{
"threadThreeSubframe"
,
required_argument
,
NULL
,
LONG_OPTION_THREADTHREESUBFRAME
},
{
"threadSlot1ProcOne"
,
required_argument
,
NULL
,
LONG_OPTION_THREADSLOT1PROCONE
},
{
"threadSlot1ProcTwo"
,
required_argument
,
NULL
,
LONG_OPTION_THREADSLOT1PROCTWO
},
{
"threadSlot1ProcThree"
,
required_argument
,
NULL
,
LONG_OPTION_THREADSLOT1PROCTHREE
},
{
"dlsch-demod-shift"
,
required_argument
,
NULL
,
LONG_OPTION_DEMOD_SHIFT
},
#if T_TRACER
{
"T_port"
,
required_argument
,
0
,
LONG_OPTION_T_PORT
},
...
...
@@ -811,6 +817,15 @@ static void get_options (int argc, char **argv) {
case
LONG_OPTION_THREADTHREESUBFRAME
:
threads
.
three
=
atoi
(
optarg
);
break
;
case
LONG_OPTION_THREADSLOT1PROCONE
:
threads
.
slot1_proc_one
=
atoi
(
optarg
);
break
;
case
LONG_OPTION_THREADSLOT1PROCTWO
:
threads
.
slot1_proc_two
=
atoi
(
optarg
);
break
;
case
LONG_OPTION_THREADSLOT1PROCTHREE
:
threads
.
slot1_proc_three
=
atoi
(
optarg
);
break
;
case
LONG_OPTION_DEMOD_SHIFT
:
{
extern
int16_t
dlsch_demod_shift
;
dlsch_demod_shift
=
atof
(
optarg
);
...
...
targets/RT/USER/lte-softmodem.h
View file @
ed145f57
...
...
@@ -81,6 +81,7 @@ extern void kill_eNB_proc(int inst);
extern
int
setup_ue_buffers
(
PHY_VARS_UE
**
phy_vars_ue
,
openair0_config_t
*
openair0_cfg
);
extern
void
fill_ue_band_info
(
void
);
extern
void
init_UE
(
int
);
extern
void
init_thread
(
int
sched_runtime
,
int
sched_deadline
,
int
sched_fifo
,
cpu_set_t
*
cpuset
,
char
*
name
);
extern
void
reset_opp_meas
(
void
);
extern
void
print_opp_meas
(
void
);
...
...
targets/RT/USER/lte-ue.c
View file @
ed145f57
...
...
@@ -498,12 +498,13 @@ static void *UE_thread_rxn_txnp4(void *arg) {
sprintf
(
threadname
,
"UE_%d_proc_%d"
,
UE
->
Mod_id
,
proc
->
sub_frame_start
);
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
if
(
(
proc
->
sub_frame_start
+
1
)
%
RX_NB_TH
==
0
&&
threads
.
one
!=
-
1
)
CPU_SET
(
threads
.
one
,
&
cpuset
);
if
(
(
proc
->
sub_frame_start
+
1
)
%
RX_NB_TH
==
1
&&
threads
.
two
!=
-
1
)
CPU_SET
(
threads
.
two
,
&
cpuset
);
if
(
(
proc
->
sub_frame_start
+
1
)
%
RX_NB_TH
==
2
&&
threads
.
three
!=
-
1
)
CPU_SET
(
threads
.
three
,
&
cpuset
);
CPU_SET
(
threads
.
three
,
&
cpuset
);
//CPU_SET(threads.three, &cpuset);
init_thread
(
900000
,
1000000
,
FIFO_PRIORITY
-
1
,
&
cpuset
,
threadname
);
...
...
@@ -549,7 +550,11 @@ static void *UE_thread_rxn_txnp4(void *arg) {
(
sf_type
==
SF_UL
?
"SF_UL"
:
(
sf_type
==
SF_S
?
"SF_S"
:
"UNKNOWN_SF_TYPE"
))));
}
#ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_UE_RX
(
UE
,
proc
,
0
,
0
,
1
,
UE
->
mode
,
no_relay
,
NULL
);
#else
phy_procedures_UE_RX
(
UE
,
proc
,
0
,
0
,
1
,
UE
->
mode
,
no_relay
,
NULL
);
#endif
}
#if UE_TIMING_TRACE
...
...
@@ -856,261 +861,6 @@ void *UE_thread(void *arg) {
return
NULL
;
}
#ifdef UE_SLOT_PARALLELISATION
void
*
UE_thread_fep_slot1
(
void
*
arg
)
{
static
__thread
int
UE_thread_rxtx_retval
;
struct
rx_tx_thread_data
*
rtd
=
arg
;
UE_rxtx_proc_t
*
proc
=
rtd
->
proc
;
PHY_VARS_UE
*
ue
=
rtd
->
UE
;
char
threadname
[
256
];
proc
->
subframe_rx
=
proc
->
sub_frame_start
;
sprintf
(
threadname
,
"UE_SLOT1_PROC_%d"
,
proc
->
sub_frame_start
);
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
if
(
(
proc
->
sub_frame_start
+
1
)
%
2
==
0
)
CPU_SET
(
0
,
&
cpuset
);
if
(
(
proc
->
sub_frame_start
+
1
)
%
2
==
1
)
CPU_SET
(
4
,
&
cpuset
);
init_thread
(
900000
,
1000000
,
FIFO_PRIORITY
-
1
,
&
cpuset
,
threadname
);
uint8_t
l
;
uint8_t
compute_llrs_slot1
;
proc
->
instance_cnt_fep_slot1
=-
1
;
while
(
!
oai_exit
)
{
if
(
pthread_mutex_lock
(
&
proc
->
mutex_fep_slot1
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE FEP Slo1
\n
"
);
exit_fun
(
"nothing to add"
);
}
while
(
proc
->
instance_cnt_fep_slot1
<
0
)
{
// most of the time, the thread is waiting here
pthread_cond_wait
(
&
proc
->
cond_fep_slot1
,
&
proc
->
mutex_fep_slot1
);
}
if
(
pthread_mutex_unlock
(
&
proc
->
mutex_fep_slot1
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error unlocking mutex for UE FEP Slo1
\n
"
);
exit_fun
(
"nothing to add"
);
}
// Start Thread Processing
LOG_I
(
PHY
,
" [Th-Slave] ==> execute fep slot1 thread for AbsSubframe %d.%d
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
#if 1
int
frame_rx
=
proc
->
frame_rx
;
int
subframe_rx
=
proc
->
subframe_rx
;
uint8_t
pilot0
;
uint8_t
pilot1
;
uint8_t
slot1
;
slot1
=
(
subframe_rx
<<
1
)
+
1
;
pilot0
=
0
;
if
(
ue
->
frame_parms
.
Ncp
==
0
)
{
// normal prefix
pilot1
=
4
;
}
else
{
// extended prefix
pilot1
=
3
;
}
// do first symbol of next downlink subframe for channel estimation
int
next_subframe_rx
=
(
1
+
subframe_rx
)
%
10
;
uint8_t
next_subframe_slot0
=
next_subframe_rx
<<
1
;
// 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next subframe ofdmSym11)
if
(
subframe_select
(
&
ue
->
frame_parms
,
next_subframe_rx
)
!=
SF_UL
)
{
//LOG_I(PHY,"[Th-Slave] FFT symbol %d slot %d \n", pilot0, next_subframe_slot0);
front_end_fft
(
ue
,
pilot0
,
next_subframe_slot0
,
0
,
0
);
}
//LOG_I(PHY,"[Th-Slave]FFT symbol %d slot %d \n",pilot1,slot1);
front_end_fft
(
ue
,
pilot1
,
slot1
,
0
,
0
);
// 2- perform FFT for other ofdm symbols other than pilots
for
(
l
=
1
;
l
<
ue
->
frame_parms
.
symbols_per_tti
>>
1
;
l
++
)
{
if
(
(
l
!=
pilot0
)
&&
(
l
!=
pilot1
))
{
//LOG_I(PHY,"[Th-Slave]FFT symbol %d slot %d\n",l,slot1);
start_meas
(
&
ue
->
ofdm_demod_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP
,
VCD_FUNCTION_IN
);
front_end_fft
(
ue
,
l
,
slot1
,
0
,
0
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP
,
VCD_FUNCTION_OUT
);
stop_meas
(
&
ue
->
ofdm_demod_stats
);
}
}
// for l=1..l2
// 3- perform Channel Estimation for slot1
for
(
l
=
1
;
l
<
ue
->
frame_parms
.
symbols_per_tti
>>
1
;
l
++
)
{
uint32_t
wait
=
0
;
if
(
l
==
pilot1
)
{
LOG_I
(
PHY
,
"[Th-Slave] ==> wait pilot0 slot1 channel estimation is ready
\n
"
);
while
(
proc
->
chan_est_pilot0_slot1_available
==
0
)
{
//wait until channel estimation for pilot0/slot1 is available
usleep
(
1
);
wait
++
;
}
}
front_end_chanEst
(
ue
,
l
,
slot1
,
0
);
//LOG_I(PHY,"[Th-Slave]ChanEst symbol %d slot %d wait%d\n",l,slot1,wait);
ue_measurement_procedures
(
l
-
1
,
ue
,
proc
,
0
,
1
+
(
subframe_rx
<<
1
),
0
,
ue
->
mode
);
}
//LOG_I(PHY,"[Th-Slave]ChanEst symbol %d slot %d\n",0,next_subframe_slot0);
front_end_chanEst
(
ue
,
0
,
next_subframe_slot0
,
0
);
if
(
(
subframe_rx
==
0
)
&&
(
ue
->
decode_MIB
==
1
))
{
ue_pbch_procedures
(
0
,
ue
,
proc
,
0
);
}
#endif
LOG_I
(
PHY
,
" [Th-Slave] ==> FFT/CHanEst Done for AbsSubframe %d.%d
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
LOG_I
(
PHY
,
" [Th-Slave] ==> Start LLR Comuptation slot1 for AbsSubframe %d.%d
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
#if 1
// wait until dci info are available
uint32_t
wait
=
0
;
while
(
proc
->
dci_slot0_available
==
0
)
// (proc->dci_slot0_available==0)
{
//wait until channel estimation for pilot0/slot1 is available
usleep
(
1
);
wait
++
;
}
// check if a dl grant was received on a DCI
compute_llrs_slot1
=
0
;
if
(
ue
->
dlsch
[
subframe_rx
&
0x1
][
0
][
0
]
->
active
||
((
ue
->
dlsch_SI
[
0
])
&&
(
ue
->
dlsch_SI
[
0
]
->
active
==
1
))
||
((
ue
->
dlsch_p
[
0
])
&&
(
ue
->
dlsch_p
[
0
]
->
active
==
1
))
||
((
ue
->
dlsch_ra
[
0
])
&&
(
ue
->
dlsch_ra
[
0
]
->
active
==
1
))
)
{
compute_llrs_slot1
=
1
;
}
else
{
proc
->
llr_slot1_available
=
1
;
}
LOG_I
(
PHY
,
"[Th-Slave] compute llrs slot-1 %d AbsSubframe %d.%d
\n
"
,
compute_llrs_slot1
,
frame_rx
%
1024
,
subframe_rx
);
if
(
compute_llrs_slot1
)
{
// wait until computation of first ofdm symbol is done
uint32_t
wait
=
0
;
while
(
proc
->
first_symbol_available
==
0
)
{
//wait until channel estimation for pilot0/slot1 is available
usleep
(
1
);
wait
++
;
}
// start slave thread for Pdsch Procedure (slot1)
// do procedures for C-RNTI
//LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure (slot1) wait %d \n",frame_rx%1024,subframe_rx,wait);
//LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure PDSCH Active %d \n",frame_rx%1024,subframe_rx, ue->dlsch[subframe_rx&0x1][0][0]->active);
if
(
ue
->
dlsch
[
subframe_rx
&
0x1
][
0
][
0
]
->
active
==
1
)
{
//LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure PDSCH \n",frame_rx%1024,subframe_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC
,
VCD_FUNCTION_IN
);
start_meas
(
&
ue
->
pdsch_procedures_stat
);
ue_pdsch_procedures
(
ue
,
proc
,
0
,
PDSCH
,
ue
->
dlsch
[
subframe_rx
&
0x1
][
0
][
0
],
NULL
,
1
+
(
ue
->
frame_parms
.
symbols_per_tti
>>
1
),
ue
->
frame_parms
.
symbols_per_tti
-
1
,
0
);
stop_meas
(
&
ue
->
pdsch_procedures_stat
);
}
// do procedures for SI-RNTI
if
((
ue
->
dlsch_SI
[
0
])
&&
(
ue
->
dlsch_SI
[
0
]
->
active
==
1
))
{
//LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure SI-PDSCH \n",frame_rx%1024,subframe_rx);
ue_pdsch_procedures
(
ue
,
proc
,
0
,
SI_PDSCH
,
ue
->
dlsch_SI
[
0
],
NULL
,
1
+
(
ue
->
frame_parms
.
symbols_per_tti
>>
1
),
ue
->
frame_parms
.
symbols_per_tti
-
1
,
0
);
}
// do procedures for P-RNTI
if
((
ue
->
dlsch_p
[
0
])
&&
(
ue
->
dlsch_p
[
0
]
->
active
==
1
))
{
//LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure P-PDSCH \n",frame_rx%1024,subframe_rx);
ue_pdsch_procedures
(
ue
,
proc
,
0
,
P_PDSCH
,
ue
->
dlsch_p
[
0
],
NULL
,
1
+
(
ue
->
frame_parms
.
symbols_per_tti
>>
1
),
ue
->
frame_parms
.
symbols_per_tti
-
1
,
0
);
}
// do procedures for RA-RNTI
if
((
ue
->
dlsch_ra
[
0
])
&&
(
ue
->
dlsch_ra
[
0
]
->
active
==
1
))
{
//LOG_I(PHY,"[Th-Slave] AbsSubframe %d.%d Pdsch Procedure RA-PDSCH \n",frame_rx%1024,subframe_rx);
ue_pdsch_procedures
(
ue
,
proc
,
0
,
RA_PDSCH
,
ue
->
dlsch_ra
[
0
],
NULL
,
1
+
(
ue
->
frame_parms
.
symbols_per_tti
>>
1
),
ue
->
frame_parms
.
symbols_per_tti
-
1
,
0
);
}
//LOG_I(PHY,"Set available llrs slot1 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx);
proc
->
llr_slot1_available
=
1
;
}
#endif
LOG_I
(
PHY
,
" [Th-Slave] ==> End slot1 Thread for AbsSubframe %d.%d
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
// End Thread Processing
if
(
pthread_mutex_lock
(
&
proc
->
mutex_fep_slot1
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE RXTX
\n
"
);
exit_fun
(
"noting to add"
);