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
zzha zzha
OpenXG-RAN
Commits
5db5657d
Commit
5db5657d
authored
Jan 29, 2021
by
hardy
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/lte_uplink_improvement' into integration_2021_wk04_b
parents
4a263eb6
bbaef509
Changes
30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
1087 additions
and
255 deletions
+1087
-255
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+29
-9
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
+22
-17
openair1/PHY/LTE_TRANSPORT/dci_tools.c
openair1/PHY/LTE_TRANSPORT/dci_tools.c
+2
-0
openair1/PHY/LTE_TRANSPORT/phich.c
openair1/PHY/LTE_TRANSPORT/phich.c
+8
-3
openair1/PHY/LTE_TRANSPORT/phich_common.c
openair1/PHY/LTE_TRANSPORT/phich_common.c
+28
-0
openair1/PHY/LTE_TRANSPORT/prach.c
openair1/PHY/LTE_TRANSPORT/prach.c
+1
-1
openair1/PHY/LTE_TRANSPORT/pucch.c
openair1/PHY/LTE_TRANSPORT/pucch.c
+150
-7
openair1/PHY/LTE_TRANSPORT/transport_proto.h
openair1/PHY/LTE_TRANSPORT/transport_proto.h
+5
-1
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
+36
-11
openair1/PHY/TOOLS/dB_routines.c
openair1/PHY/TOOLS/dB_routines.c
+315
-0
openair1/PHY/TOOLS/dB_routines.h
openair1/PHY/TOOLS/dB_routines.h
+1
-0
openair1/PHY/TOOLS/signal_energy.c
openair1/PHY/TOOLS/signal_energy.c
+109
-92
openair1/PHY/TOOLS/tools_defs.h
openair1/PHY/TOOLS/tools_defs.h
+4
-0
openair1/PHY/defs_eNB.h
openair1/PHY/defs_eNB.h
+5
-0
openair1/SCHED/fapi_l1.c
openair1/SCHED/fapi_l1.c
+26
-5
openair1/SCHED/phy_procedures_lte_common.c
openair1/SCHED/phy_procedures_lte_common.c
+1
-1
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+8
-6
openair1/SCHED/ru_procedures.c
openair1/SCHED/ru_procedures.c
+0
-1
openair2/ENB_APP/L1_paramdef.h
openair2/ENB_APP/L1_paramdef.h
+4
-1
openair2/ENB_APP/enb_config.c
openair2/ENB_APP/enb_config.c
+4
-0
openair2/LAYER2/MAC/eNB_scheduler.c
openair2/LAYER2/MAC/eNB_scheduler.c
+31
-3
openair2/LAYER2/MAC/eNB_scheduler_RA.c
openair2/LAYER2/MAC/eNB_scheduler_RA.c
+0
-7
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+4
-2
openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
+139
-36
openair2/LAYER2/MAC/eNB_scheduler_phytest.c
openair2/LAYER2/MAC/eNB_scheduler_phytest.c
+1
-1
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+17
-3
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+108
-26
openair2/LAYER2/MAC/mac.h
openair2/LAYER2/MAC/mac.h
+26
-7
openair2/RRC/LTE/rrc_defs.h
openair2/RRC/LTE/rrc_defs.h
+1
-1
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+2
-14
No files found.
nfapi/oai_integration/nfapi_vnf.c
View file @
5db5657d
...
...
@@ -333,11 +333,11 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
// wake up TX for subframe n+sf_ahead
// lock the TX mutex and make sure the thread is ready
if
(
pthread_mutex_timedlock
(
&
L1_proc
->
mutex
,
&
wait
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)
\n
"
,
L1_proc
->
subframe_rx
&
1
,
L1_proc
->
instance_cnt
);
exit_fun
(
"error locking mutex_rxtx"
);
return
(
-
1
);
}
//
if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) {
//
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)\n", L1_proc->subframe_rx&1,L1_proc->instance_cnt );
//
exit_fun( "error locking mutex_rxtx" );
//
return(-1);
//
}
{
static
uint16_t
old_sf
=
0
;
...
...
@@ -358,8 +358,31 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
proc
->
frame_rx
,
proc
->
subframe_rx
);
}
// wake up TX for subframe n+sf_ahead
// lock the TX mutex and make sure the thread is ready
if
(
pthread_mutex_timedlock
(
&
L1_proc
->
mutex
,
&
wait
)
!=
0
)
{
LOG_E
(
PHY
,
"[eNB] ERROR pthread_mutex_lock for eNB RXTX thread %d (IC %d)
\n
"
,
L1_proc
->
subframe_rx
&
1
,
L1_proc
->
instance_cnt
);
//exit_fun( "error locking mutex_rxtx" );
return
(
-
1
);
}
static
int
busy_log_cnt
=
0
;
if
(
L1_proc
->
instance_cnt
<
0
){
++
L1_proc
->
instance_cnt
;
if
(
busy_log_cnt
!=
0
){
LOG_E
(
MAC
,
"RCC singal to rxtx frame %d subframe %d busy end %d (frame %d subframe %d)
\n
"
,
L1_proc
->
frame_rx
,
L1_proc
->
subframe_rx
,
busy_log_cnt
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
}
busy_log_cnt
=
0
;
}
else
{
if
(
busy_log_cnt
==
0
){
LOG_E
(
MAC
,
"RCC singal to rxtx frame %d subframe %d busy %d (frame %d subframe %d)
\n
"
,
L1_proc
->
frame_rx
,
L1_proc
->
subframe_rx
,
L1_proc
->
instance_cnt
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
}
pthread_mutex_unlock
(
&
L1_proc
->
mutex
);
busy_log_cnt
++
;
return
(
0
);
}
pthread_mutex_unlock
(
&
L1_proc
->
mutex
);
++
L1_proc
->
instance_cnt
;
//LOG_D( PHY,"[VNF-subframe_ind] sfn/sf:%d:%d proc[frame_rx:%d subframe_rx:%d] L1_proc->instance_cnt_rxtx:%d \n", sfn, sf, proc->frame_rx, proc->subframe_rx, L1_proc->instance_cnt_rxtx);
// We have just received and processed the common part of a subframe, say n.
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
...
...
@@ -382,9 +405,6 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) {
return
(
-
1
);
}
//LOG_D(PHY,"%s() About to attempt pthread_mutex_unlock\n", __FUNCTION__);
pthread_mutex_unlock
(
&
L1_proc
->
mutex
);
//LOG_D(PHY,"%s() UNLOCKED pthread_mutex_unlock\n", __FUNCTION__);
return
(
0
);
}
...
...
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
View file @
5db5657d
...
...
@@ -786,33 +786,38 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms,
Ravg
[
0
]
=
0
;
Ravg
[
1
]
=
0
;
int16_t
iv
,
rv
,
phase_idx
=
0
;
__m128i
avg128U1
,
avg128U2
,
R
[
3
],
mmtmpD0
,
mmtmpD1
,
mmtmpD2
,
mmtmpD3
;
__m128i
R
[
3
],
mmtmpD0
,
mmtmpD1
,
mmtmpD2
,
mmtmpD3
;
__m128
avg128U1
,
avg128U2
;
// round(tan((pi/4)*[1:1:N]/N)*pow2(15))
int16_t
alpha
[
128
]
=
{
201
,
402
,
603
,
804
,
1006
,
1207
,
1408
,
1610
,
1811
,
2013
,
2215
,
2417
,
2619
,
2822
,
3024
,
3227
,
3431
,
3634
,
3838
,
4042
,
4246
,
4450
,
4655
,
4861
,
5066
,
5272
,
5479
,
5686
,
5893
,
6101
,
6309
,
6518
,
6727
,
6937
,
7147
,
7358
,
7570
,
7782
,
7995
,
8208
,
8422
,
8637
,
8852
,
9068
,
9285
,
9503
,
9721
,
9940
,
10160
,
10381
,
10603
,
10825
,
11049
,
11273
,
11498
,
11725
,
11952
,
12180
,
12410
,
12640
,
12872
,
13104
,
13338
,
13573
,
13809
,
14046
,
14285
,
14525
,
14766
,
15009
,
15253
,
15498
,
15745
,
15993
,
16243
,
16494
,
16747
,
17001
,
17257
,
17515
,
17774
,
18035
,
18298
,
18563
,
18829
,
19098
,
19368
,
19640
,
19915
,
20191
,
20470
,
20750
,
21033
,
21318
,
21605
,
21895
,
22187
,
22481
,
22778
,
23078
,
23380
,
23685
,
23992
,
24302
,
24615
,
24931
,
25250
,
25572
,
25897
,
26226
,
26557
,
26892
,
27230
,
27572
,
27917
,
28266
,
28618
,
28975
,
29335
,
29699
,
30067
,
30440
,
30817
,
31198
,
31583
,
31973
,
32368
,
32767
};
// compute log2_maxh (output_shift)
avg128U1
=
_mm_setzero_
si128
();
avg128U2
=
_mm_setzero_
si128
();
avg128U1
=
_mm_setzero_
ps
();
avg128U2
=
_mm_setzero_
ps
();
for
(
rb
=
0
;
rb
<
nb_rb
;
rb
++
)
{
avg128U1
=
_mm_add_epi32
(
avg128U1
,
_mm_madd_epi16
(
ul_ch1
[
0
],
ul_ch1
[
0
]));
avg128U1
=
_mm_add_epi32
(
avg128U1
,
_mm_madd_epi16
(
ul_ch1
[
1
],
ul_ch1
[
1
]));
avg128U1
=
_mm_add_epi32
(
avg128U1
,
_mm_madd_epi16
(
ul_ch1
[
2
],
ul_ch1
[
2
]));
avg128U2
=
_mm_add_epi32
(
avg128U2
,
_mm_madd_epi16
(
ul_ch2
[
0
],
ul_ch2
[
0
]));
avg128U2
=
_mm_add_epi32
(
avg128U2
,
_mm_madd_epi16
(
ul_ch2
[
1
],
ul_ch2
[
1
]));
avg128U2
=
_mm_add_epi32
(
avg128U2
,
_mm_madd_epi16
(
ul_ch2
[
2
],
ul_ch2
[
2
]));
avg128U1
=
_mm_add_ps
(
avg128U1
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch1
[
0
],
ul_ch1
[
0
])));
avg128U1
=
_mm_add_ps
(
avg128U1
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch1
[
1
],
ul_ch1
[
1
])));
avg128U1
=
_mm_add_ps
(
avg128U1
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch1
[
2
],
ul_ch1
[
2
])));
avg128U2
=
_mm_add_ps
(
avg128U2
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch2
[
0
],
ul_ch2
[
0
])));
avg128U2
=
_mm_add_ps
(
avg128U2
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch2
[
1
],
ul_ch2
[
1
])));
avg128U2
=
_mm_add_ps
(
avg128U2
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
ul_ch2
[
2
],
ul_ch2
[
2
])));
ul_ch1
+=
3
;
ul_ch2
+=
3
;
}
avg
[
0
]
=
(((
int
*
)
&
avg128U1
)[
0
]
+
((
int
*
)
&
avg128U1
)[
1
]
+
((
int
*
)
&
avg128U1
)[
2
]
+
((
int
*
)
&
avg128U1
)[
3
])
/
(
nb_rb
*
12
);
avg
[
1
]
=
(((
int
*
)
&
avg128U2
)[
0
]
+
((
int
*
)
&
avg128U2
)[
1
]
+
((
int
*
)
&
avg128U2
)[
2
]
+
((
int
*
)
&
avg128U2
)[
3
])
/
(
nb_rb
*
12
);
avg
[
0
]
=
(
int
)(
(((
float
*
)
&
avg128U1
)[
0
]
+
((
float
*
)
&
avg128U1
)[
1
]
+
((
float
*
)
&
avg128U1
)[
2
]
+
((
float
*
)
&
avg128U1
)[
3
])
/
(
float
)(
nb_rb
*
12
)
);
avg
[
1
]
=
(
int
)(
(((
float
*
)
&
avg128U2
)[
0
]
+
((
float
*
)
&
avg128U2
)[
1
]
+
((
float
*
)
&
avg128U2
)[
2
]
+
((
float
*
)
&
avg128U2
)[
3
])
/
(
float
)(
nb_rb
*
12
)
);
// msg("avg0 = %d, avg1 = %d\n",avg[0],avg[1]);
avg
[
0
]
=
cmax
(
avg
[
0
],
avg
[
1
]);
avg
[
1
]
=
log2_approx
(
avg
[
0
]);
...
...
openair1/PHY/LTE_TRANSPORT/dci_tools.c
View file @
5db5657d
...
...
@@ -2071,6 +2071,8 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
ulsch
->
harq_processes
[
harq_pid
]
->
round
++
;
ulsch
->
harq_processes
[
harq_pid
]
->
TBS
=
ulsch_pdu
->
ulsch_pdu_rel8
.
size
<<
3
;
ulsch
->
harq_processes
[
harq_pid
]
->
Msc_initial
=
12
*
ulsch_pdu
->
ulsch_pdu_rel8
.
number_of_resource_blocks
;
ulsch
->
harq_processes
[
harq_pid
]
->
Or1
=
0
;
ulsch
->
harq_processes
[
harq_pid
]
->
Or2
=
0
;
}
ulsch
->
rnti
=
ulsch_pdu
->
ulsch_pdu_rel8
.
rnti
;
...
...
openair1/PHY/LTE_TRANSPORT/phich.c
View file @
5db5657d
...
...
@@ -716,6 +716,7 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
uint8_t
NSF_PHICH
=
4
;
uint8_t
pusch_subframe
=-
1
;
uint8_t
i
;
uint8_t
harq_pid
=
0
;
int
subframe
=
proc
->
subframe_tx
;
phich_config_t
*
phich
;
...
...
@@ -748,16 +749,20 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
nseq_PHICH
=
((
phich
->
first_rb
/
Ngroup_PHICH
)
+
phich
->
n_DMRS
)
%
(
2
*
NSF_PHICH
);
harq_pid
=
subframe2harq_pid
(
frame_parms
,
phich_frame2_pusch_frame
(
frame_parms
,
proc
->
frame_tx
,
subframe
),
pusch_subframe
);
if
(
harq_pid
==
255
)
{
LOG_E
(
PHY
,
"FATAL ERROR: illegal harq_pid, returning
\n
"
);
return
;
}
LOG_D
(
PHY
,
"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, AMP %d ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d)
\n
"
,
eNB
->
Mod_id
,
subframe2harq_pid
(
frame_parms
,
phich_frame2_pusch_frame
(
frame_parms
,
proc
->
frame_tx
,
subframe
),
pusch_subframe
),
proc
->
frame_tx
,
eNB
->
Mod_id
,
harq_pid
,
proc
->
frame_tx
,
subframe
,
amp
,
ngroup_PHICH
,
Ngroup_PHICH
,
nseq_PHICH
,
phich
->
hi
,
phich
->
first_rb
);
T
(
T_ENB_PHY_PHICH
,
T_INT
(
eNB
->
Mod_id
),
T_INT
(
proc
->
frame_tx
),
T_INT
(
subframe
),
T_INT
(
-
1
/* TODO: rnti */
),
T_INT
(
subframe2harq_pid
(
frame_parms
,
phich_frame2_pusch_frame
(
frame_parms
,
proc
->
frame_tx
,
subframe
),
pusch_subframe
)
),
T_INT
(
harq_pid
),
T_INT
(
Ngroup_PHICH
),
T_INT
(
NSF_PHICH
),
T_INT
(
ngroup_PHICH
),
T_INT
(
nseq_PHICH
),
T_INT
(
phich
->
hi
),
...
...
openair1/PHY/LTE_TRANSPORT/phich_common.c
View file @
5db5657d
...
...
@@ -102,6 +102,34 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su
return
(
subframe
&
7
);
switch
(
frame_parms
->
tdd_config
)
{
case
1
:
if
(
subframe
==
6
)
{
return
(
0
);
}
else
if
(
subframe
==
9
){
return
(
1
);
}
else
if
(
subframe
==
1
){
return
(
2
);
}
else
if
(
subframe
==
4
){
return
(
3
);
}
else
{
LOG_E
(
PHY
,
"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d
\n
"
,
subframe
,
frame_parms
->
tdd_config
);
return
(
0
);
}
break
;
case
2
:
if
(
subframe
==
3
)
{
return
(
1
);
}
else
if
(
subframe
==
8
){
return
(
0
);
}
else
{
LOG_E
(
PHY
,
"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d
\n
"
,
subframe
,
frame_parms
->
tdd_config
);
return
(
0
);
}
break
;
case
3
:
if
(
(
subframe
==
8
)
||
(
subframe
==
9
)
)
{
return
(
subframe
-
8
);
...
...
openair1/PHY/LTE_TRANSPORT/prach.c
View file @
5db5657d
...
...
@@ -626,7 +626,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
for
(
i
=
0
;
i
<
NCS2
;
i
++
)
{
lev
=
(
int32_t
)
prach_ifft
[(
preamble_shift2
+
i
)];
avg_en
+=
lev
;
levdB
=
dB_fixed_
times
10
(
lev
);
levdB
=
dB_fixed_
x
10
(
lev
);
if
(
levdB
>*
max_preamble_energy
)
{
*
max_preamble_energy
=
levdB
;
...
...
openair1/PHY/LTE_TRANSPORT/pucch.c
View file @
5db5657d
...
...
@@ -721,6 +721,137 @@ int16_t pucchfmt3_Decode( int16_t b[48],
}
}
uint32_t
calc_pucch_1x_interference
(
PHY_VARS_eNB
*
eNB
,
int
frame
,
uint8_t
subframe
,
uint8_t
shortened_format
)
//-----------------------------------------------------------------------------
{
LTE_eNB_COMMON
*
common_vars
=
&
eNB
->
common_vars
;
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
eNB
->
frame_parms
;
uint32_t
u
,
v
,
n
,
aa
;
uint32_t
z
[
12
*
14
];
int16_t
*
zptr
;
int16_t
rxcomp
[
NB_ANTENNAS_RX
][
2
*
12
*
14
];
uint8_t
ns
,
N_UL_symb
,
nsymb
,
n_cs_base
;
uint16_t
i
,
j
,
re_offset
;
uint8_t
m
,
l
;
uint8_t
n_cs
,
alpha_ind
;
int16_t
tmp_re
,
tmp_im
,
W_re
=
0
,
W_im
=
0
;
int16_t
W4_nouse
[
4
]
=
{
32767
,
32767
,
-
32768
,
-
32768
};
int32_t
n0_IQ
[
2
];
double
interference_power
;
int16_t
*
rxptr
;
uint32_t
symbol_offset
;
uint32_t
u0
=
(
frame_parms
->
pucch_config_common
.
grouphop
[
subframe
<<
1
])
%
30
;
uint32_t
u1
=
(
frame_parms
->
pucch_config_common
.
grouphop
[
1
+
(
subframe
<<
1
)])
%
30
;
uint32_t
v0
=
frame_parms
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
seqhop
[
subframe
<<
1
];
uint32_t
v1
=
frame_parms
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
seqhop
[
1
+
(
subframe
<<
1
)];
int
calc_cnt
;
zptr
=
(
int16_t
*
)
z
;
N_UL_symb
=
(
frame_parms
->
Ncp
==
NORMAL
)
?
7
:
6
;
interference_power
=
0
.
0
;
calc_cnt
=
0
;
// loop over 2 slots
for
(
n_cs_base
=
0
;
n_cs_base
<
12
;
n_cs_base
++
)
{
zptr
=
(
int16_t
*
)
z
;
for
(
ns
=
(
subframe
<<
1
),
u
=
u0
,
v
=
v0
;
ns
<
(
2
+
(
subframe
<<
1
));
ns
++
,
u
=
u1
,
v
=
v1
)
{
//loop over symbols in slot
for
(
l
=
0
;
l
<
N_UL_symb
;
l
++
)
{
n_cs
=
eNB
->
ncs_cell
[
ns
][
l
]
+
n_cs_base
;
if
(((
l
>
1
)
&&
(
l
<
N_UL_symb
-
2
))
||
((
ns
==
(
1
+
(
subframe
<<
1
)))
&&
(
shortened_format
==
1
))
){
zptr
+=
24
;
continue
;
}
if
(
l
<
2
)
{
// data
W_re
=
W4_nouse
[
l
];
W_im
=
0
;
}
else
if
((
l
>=
N_UL_symb
-
2
))
{
// data
W_re
=
W4_nouse
[
l
-
N_UL_symb
+
4
];
W_im
=
0
;
}
alpha_ind
=
0
;
// compute output sequence
for
(
n
=
0
;
n
<
12
;
n
++
)
{
// this is r_uv^alpha(n)
tmp_re
=
(
int16_t
)(((
int32_t
)
alpha_re
[
alpha_ind
]
*
ul_ref_sigs
[
u
][
v
][
0
][
n
<<
1
]
-
(
int32_t
)
alpha_im
[
alpha_ind
]
*
ul_ref_sigs
[
u
][
v
][
0
][
1
+
(
n
<<
1
)])
>>
15
);
tmp_im
=
(
int16_t
)(((
int32_t
)
alpha_re
[
alpha_ind
]
*
ul_ref_sigs
[
u
][
v
][
0
][
1
+
(
n
<<
1
)]
+
(
int32_t
)
alpha_im
[
alpha_ind
]
*
ul_ref_sigs
[
u
][
v
][
0
][
n
<<
1
])
>>
15
);
// this is S(ns)*w_noc(m)*r_uv^alpha(n)
zptr
[
n
<<
1
]
=
(
tmp_re
*
W_re
-
tmp_im
*
W_im
)
>>
15
;
zptr
[
1
+
(
n
<<
1
)]
=
-
(
tmp_re
*
W_im
+
tmp_im
*
W_re
)
>>
15
;
alpha_ind
=
(
alpha_ind
+
n_cs
)
%
12
;
}
// n
zptr
+=
24
;
}
// l
}
// ns
m
=
1
;
nsymb
=
N_UL_symb
<<
1
;
zptr
=
(
int16_t
*
)
z
;
// Do detection
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_rx
;
aa
++
)
{
n0_IQ
[
0
]
=
0
;
n0_IQ
[
1
]
=
0
;
for
(
j
=
0
,
l
=
0
;
l
<
nsymb
;
l
++
)
{
if
((((
l
%
N_UL_symb
)
>
1
)
&&
((
l
%
N_UL_symb
)
<
N_UL_symb
-
2
))
||
((
nsymb
>=
N_UL_symb
)
&&
(
shortened_format
==
1
))
){
j
+=
24
;
continue
;
}
if
((
l
<
(
nsymb
>>
1
))
&&
((
m
&
1
)
==
0
))
re_offset
=
(
m
*
6
)
+
frame_parms
->
first_carrier_offset
;
else
if
((
l
<
(
nsymb
>>
1
))
&&
((
m
&
1
)
==
1
))
re_offset
=
frame_parms
->
first_carrier_offset
+
(
frame_parms
->
N_RB_DL
-
(
m
>>
1
)
-
1
)
*
12
;
else
if
((
m
&
1
)
==
0
)
re_offset
=
frame_parms
->
first_carrier_offset
+
(
frame_parms
->
N_RB_DL
-
(
m
>>
1
)
-
1
)
*
12
;
else
re_offset
=
((
m
-
1
)
*
6
)
+
frame_parms
->
first_carrier_offset
;
if
(
re_offset
>
frame_parms
->
ofdm_symbol_size
)
re_offset
-=
(
frame_parms
->
ofdm_symbol_size
);
symbol_offset
=
(
unsigned
int
)
frame_parms
->
ofdm_symbol_size
*
l
;
rxptr
=
(
int16_t
*
)
&
common_vars
->
rxdataF
[
aa
][
symbol_offset
];
for
(
i
=
0
;
i
<
12
;
i
++
,
j
+=
2
,
re_offset
++
)
{
if
(
re_offset
==
frame_parms
->
ofdm_symbol_size
)
re_offset
=
0
;
rxcomp
[
aa
][
j
]
=
(
int16_t
)((
rxptr
[
re_offset
<<
1
]
*
(
int32_t
)
zptr
[
j
])
>>
15
)
-
((
rxptr
[
1
+
(
re_offset
<<
1
)]
*
(
int32_t
)
zptr
[
1
+
j
])
>>
15
);
rxcomp
[
aa
][
1
+
j
]
=
(
int16_t
)((
rxptr
[
re_offset
<<
1
]
*
(
int32_t
)
zptr
[
1
+
j
])
>>
15
)
+
((
rxptr
[
1
+
(
re_offset
<<
1
)]
*
(
int32_t
)
zptr
[
j
])
>>
15
);
n0_IQ
[
0
]
+=
rxcomp
[
aa
][
j
];
n0_IQ
[
1
]
+=
rxcomp
[
aa
][
1
+
j
];
}
//re
calc_cnt
++
;
}
// symbol
n0_IQ
[
0
]
/=
12
;
n0_IQ
[
1
]
/=
12
;
interference_power
+=
(
double
)(
n0_IQ
[
0
]
*
n0_IQ
[
0
]
+
n0_IQ
[
1
]
*
n0_IQ
[
1
]);
}
// antenna
}
interference_power
/=
calc_cnt
;
eNB
->
measurements
.
n0_pucch_dB
=
dB_fixed_x10
((
int
)
interference_power
)
/
10
;
LOG_D
(
PHY
,
"estimate pucch noise %lf %d %d
\n
"
,
interference_power
,
calc_cnt
,
eNB
->
measurements
.
n0_pucch_dB
);
return
0
;
}
/* PUCCH format3 << */
uint32_t
rx_pucch
(
PHY_VARS_eNB
*
eNB
,
...
...
@@ -740,7 +871,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
static
int
first_call
=
1
;
LTE_eNB_COMMON
*
common_vars
=
&
eNB
->
common_vars
;
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
eNB
->
frame_parms
;
int8_t
sigma2_dB
=
max
(
eNB
->
measurements
.
n0_subband_power_tot_dB
[
0
],
eNB
->
measurements
.
n0_subband_power_tot_dB
[
eNB
->
frame_parms
.
N_RB_UL
-
1
]);
int8_t
sigma2_dB
=
eNB
->
measurements
.
n0_pucch_dB
;
uint32_t
u
,
v
,
n
,
aa
;
uint32_t
z
[
12
*
14
];
int16_t
*
zptr
;
...
...
@@ -765,8 +897,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
uint8_t
deltaPUCCH_Shift
=
frame_parms
->
pucch_config_common
.
deltaPUCCH_Shift
;
uint8_t
NRB2
=
frame_parms
->
pucch_config_common
.
nRB_CQI
;
uint8_t
Ncs1_div_deltaPUCCH_Shift
=
frame_parms
->
pucch_config_common
.
nCS_AN
;
uint32_t
u0
=
(
frame_parms
->
Nid_cell
+
frame_parms
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
grouphop
[
subframe
<<
1
])
%
30
;
uint32_t
u1
=
(
frame_parms
->
Nid_cell
+
frame_parms
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
grouphop
[
1
+
(
subframe
<<
1
)])
%
30
;
uint32_t
u0
=
(
frame_parms
->
pucch_config_common
.
grouphop
[
subframe
<<
1
])
%
30
;
uint32_t
u1
=
(
frame_parms
->
pucch_config_common
.
grouphop
[
1
+
(
subframe
<<
1
)])
%
30
;
uint32_t
v0
=
frame_parms
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
seqhop
[
subframe
<<
1
];
uint32_t
v1
=
frame_parms
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
seqhop
[
1
+
(
subframe
<<
1
)];
int
chL
;
...
...
@@ -1141,8 +1274,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
}
// this is total energy received, summed over data and reference
stat
+=
((((
stat_re
*
stat_re
))
+
((
stat_im
*
stat_im
))
+
((
stat_ref_re
*
stat_ref_re
))
+
((
stat_ref_im
*
stat_ref_im
)))
/
nsymb
);
if
(
fmt
==
pucch_format1a
){
stat
+=
((((
stat_re
*
stat_re
))
+
((
stat_ref_re
*
stat_ref_re
))
+
((
stat_ref_im
*
stat_ref_im
)))
/
nsymb
);
}
else
{
stat
+=
((((
stat_re
*
stat_re
))
+
((
stat_im
*
stat_im
))
+
((
stat_ref_re
*
stat_ref_re
))
+
((
stat_ref_im
*
stat_ref_im
)))
/
nsymb
);
}
// now second slot
stat_re
=
0
;
stat_im
=
0
;
...
...
@@ -1170,8 +1308,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
printf
(
"aa%d re %d : phase %d : stat %d
\n
"
,
aa
,
re
,
phase
,
stat
);
#endif
stat
+=
((((
stat_re
*
stat_re
))
+
((
stat_im
*
stat_im
))
+
((
stat_ref_re
*
stat_ref_re
))
+
((
stat_ref_im
*
stat_ref_im
)))
/
nsymb
);
if
(
fmt
==
pucch_format1a
){
stat
+=
((((
stat_re
*
stat_re
))
+
((
stat_ref_re
*
stat_ref_re
))
+
((
stat_ref_im
*
stat_ref_im
)))
/
nsymb
);
}
else
{
stat
+=
((((
stat_re
*
stat_re
))
+
((
stat_im
*
stat_im
))
+
((
stat_ref_re
*
stat_ref_re
))
+
((
stat_ref_im
*
stat_ref_im
)))
/
nsymb
);
}
}
//re
}
// aa
...
...
openair1/PHY/LTE_TRANSPORT/transport_proto.h
View file @
5db5657d
...
...
@@ -621,7 +621,11 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
uint16_t
frame
,
uint8_t
Ns
);
uint32_t
calc_pucch_1x_interference
(
PHY_VARS_eNB
*
eNB
,
int
frame
,
uint8_t
subframe
,
uint8_t
shortened_format
);
uint32_t
rx_pucch
(
PHY_VARS_eNB
*
phy_vars_eNB
,
PUCCH_FMT_t
fmt
,
...
...
openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
View file @
5db5657d
...
...
@@ -755,6 +755,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
__m128i
*
ul_ch128
,
*
ul_ch_mag128
,
*
ul_ch_mag128b
,
*
rxdataF128
,
*
rxdataF_comp128
;
uint8_t
aarx
;
//,symbol_mod;
__m128i
mmtmpU0
,
mmtmpU1
,
mmtmpU2
,
mmtmpU3
;
#elif defined(__arm__)
int16x4_t
*
ul_ch128
,
*
rxdataF128
;
int16x8_t
*
ul_ch_mag128
,
*
ul_ch_mag128b
,
*
rxdataF_comp128
;
...
...
@@ -762,6 +763,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
int32x4_t
mmtmpU0
,
mmtmpU1
,
mmtmpU0b
,
mmtmpU1b
;
int16_t
conj
[
4
]
__attribute__
((
aligned
(
16
)))
=
{
1
,
-
1
,
1
,
-
1
};
int32x4_t
output_shift128
=
vmovq_n_s32
(
-
(
int32_t
)
output_shift
);
#endif
for
(
aarx
=
0
;
aarx
<
frame_parms
->
nb_antennas_rx
;
aarx
++
)
{
...
...
@@ -872,6 +874,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
rxdataF_comp128
[
0
]
=
_mm_add_epi16
(
rxdataF_comp128
[
0
],(
*
(
__m128i
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
1
]
=
_mm_add_epi16
(
rxdataF_comp128
[
1
],(
*
(
__m128i
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
2
]
=
_mm_add_epi16
(
rxdataF_comp128
[
2
],(
*
(
__m128i
*
)
&
jitter
[
0
]));
ul_ch128
+=
3
;
ul_ch_mag128
+=
3
;
ul_ch_mag128b
+=
3
;
...
...
@@ -918,9 +921,10 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU1
=
vqshlq_s32
(
mmtmpU1
,
-
output_shift128
);
rxdataF_comp128
[
2
]
=
vcombine_s16
(
vmovn_s32
(
mmtmpU0
),
vmovn_s32
(
mmtmpU1
));
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
rxdataF_comp128
[
0
]
=
vqaddq_s16
(
rxdataF_comp128
[
0
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
1
]
=
vqaddq_s16
(
rxdataF_comp128
[
1
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
2
]
=
vqaddq_s16
(
rxdataF_comp128
[
2
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
0
]
=
vqaddq_s16
(
rxdataF_comp128
[
0
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
1
]
=
vqaddq_s16
(
rxdataF_comp128
[
1
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
rxdataF_comp128
[
2
]
=
vqaddq_s16
(
rxdataF_comp128
[
2
],(
*
(
int16x8_t
*
)
&
jitter
[
0
]));
ul_ch128
+=
6
;
ul_ch_mag128
+=
3
;
ul_ch_mag128b
+=
3
;
...
...
@@ -1031,6 +1035,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
AssertFatal
(
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
>
0
,
"PUSCH (%d/%x) nb_rb=0!
\n
"
,
harq_pid
,
ulsch
[
UE_id
]
->
rnti
);
for
(
l
=
0
;
l
<
(
frame_parms
->
symbols_per_tti
-
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
srs_active
);
l
++
)
{
if
(
LOG_DEBUGFLAG
(
DEBUG_ULSCH
))
{
LOG_I
(
PHY
,
"rx_ulsch : symbol %d (first_rb %d,nb_rb %d), rxdataF %p, rxdataF_ext %p
\n
"
,
l
,
...
...
@@ -1064,18 +1069,38 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
if
(
deltaMCS
==
1
)
{
// Note we're using TBS instead of sumKr, since didn't run segmentation yet!
MPR_times_100Ks
=
500
*
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
TBS
/
(
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
*
4
*
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
Nsymb_pusch
);
AssertFatal
(
MPR_times_100Ks
<
750
&&
MPR_times_100Ks
>=
0
,
"Impossible value for MPR_times_100Ks %d (TBS %d,Nre %d)
\n
"
,
MPR_times_100Ks
,
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
TBS
,
(
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
*
4
*
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
Nsymb_pusch
));
if
(
MPR_times_100Ks
>
0
)
correction_factor
=
ulsch_power_LUT
[
MPR_times_100Ks
];
if
((
MPR_times_100Ks
>
0
)
&&
(
MPR_times_100Ks
<
750
)){
correction_factor
=
ulsch_power_LUT
[
MPR_times_100Ks
];
}
else
{
correction_factor
=
1
;
}
}
for
(
i
=
0
;
i
<
frame_parms
->
nb_antennas_rx
;
i
++
)
{
pusch_vars
->
ulsch_power
[
i
]
=
signal_energy_nodc
(
pusch_vars
->
drs_ch_estimates
[
i
],
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
)
/
correction_factor
;
LOG_D
(
PHY
,
"%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
,
harq_pid
,
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
,
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
TBS
,
MPR_times_100Ks
,
correction_factor
,
dB_fixed_times10
(
pusch_vars
->
ulsch_power
[
i
]));
//symbol 3
int
symbol_offset
=
frame_parms
->
N_RB_UL
*
12
*
(
3
-
frame_parms
->
Ncp
);
pusch_vars
->
ulsch_interference_power
[
i
]
=
interference_power
(
&
pusch_vars
->
drs_ch_estimates
[
i
][
symbol_offset
],
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
);
pusch_vars
->
ulsch_power
[
i
]
=
signal_power
(
&
pusch_vars
->
drs_ch_estimates
[
i
][
symbol_offset
],
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
);
//symbol 3+7
symbol_offset
=
frame_parms
->
N_RB_UL
*
12
*
((
3
-
frame_parms
->
Ncp
)
+
(
7
-
frame_parms
->
Ncp
));
pusch_vars
->
ulsch_interference_power
[
i
]
+=
interference_power
(
&
pusch_vars
->
drs_ch_estimates
[
i
][
symbol_offset
],
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
);
pusch_vars
->
ulsch_power
[
i
]
+=
signal_power
(
&
pusch_vars
->
drs_ch_estimates
[
i
][
symbol_offset
],
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
*
12
);
pusch_vars
->
ulsch_interference_power
[
i
]
=
pusch_vars
->
ulsch_interference_power
[
i
]
/
correction_factor
;
pusch_vars
->
ulsch_power
[
i
]
=
pusch_vars
->
ulsch_power
[
i
]
/
correction_factor
;
if
(
pusch_vars
->
ulsch_power
[
i
]
>
0x20000000
){
pusch_vars
->
ulsch_power
[
i
]
=
0x20000000
;
pusch_vars
->
ulsch_interference_power
[
i
]
=
1
;
}
else
{
pusch_vars
->
ulsch_power
[
i
]
-=
pusch_vars
->
ulsch_interference_power
[
i
];
if
(
pusch_vars
->
ulsch_power
[
i
]
<
1
)
pusch_vars
->
ulsch_power
[
i
]
=
1
;
if
(
pusch_vars
->
ulsch_interference_power
[
i
]
<
1
)
pusch_vars
->
ulsch_interference_power
[
i
]
=
1
;
}
LOG_D
(
PHY
,
"%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
,
harq_pid
,
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
,
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
TBS
,
MPR_times_100Ks
,
correction_factor
,
dB_fixed_x10
(
pusch_vars
->
ulsch_power
[
i
]));
}
ulsch_channel_level
(
pusch_vars
->
drs_ch_estimates
,
...
...
openair1/PHY/TOOLS/dB_routines.c
View file @
5db5657d
...
...
@@ -540,6 +540,289 @@ int16_t dB_table_times10[256] = {
240
,
240
};
uint32_t
bit_seach_mask
[
32
]
=
{
0x80000000
,
0x40000000
,
0x20000000
,
0x10000000
,
0x08000000
,
0x04000000
,
0x02000000
,
0x01000000
,
0x00800000
,
0x00400000
,
0x00200000
,
0x00100000
,
0x00080000
,
0x00040000
,
0x00020000
,
0x00010000
,
0x00008000
,
0x00004000
,
0x00002000
,
0x00001000
,
0x00000800
,
0x00000400
,
0x00000200
,
0x00000100
,
0x00000080
,
0x00000040
,
0x00000020
,
0x00000010
,
0x00000008
,
0x00000004
,
0x00000002
,
0x00000001
};
uint32_t
bit_seach_res
[
32
]
=
{
31
,
30
,
29
,
28
,
27
,
26
,
25
,
24
,
23
,
22
,
21
,
20
,
19
,
18
,
17
,
16
,
15
,
14
,
13
,
12
,
11
,
10
,
9
,
8
,
7
,
6
,
5
,
4
,
3
,
2
,
1
,
0
};
uint32_t
dB_fix_x10_tbl
[
128
]
=
{
0
,
0
,
1
,
1
,
1
,
2
,
2
,
2
,
3
,
3
,
3
,
4
,
4
,
4
,
5
,
5
,
5
,
5
,
6
,
6
,
6
,
7
,
7
,
7
,
7
,
8
,
8
,
8
,
9
,
9
,
9
,
9
,
10
,
10
,
10
,
10
,
11
,
11
,
11
,
12
,
12
,
12
,
12
,
13
,
13
,
13
,
13
,
14
,
14
,
14
,
14
,
15
,
15
,
15
,
15
,
16
,
16
,
16
,
16
,
16
,
17
,
17
,
17
,
17
,
18
,
18
,
18
,
18
,
19
,
19
,
19
,
19
,
19
,
20
,
20
,
20
,
20
,
20
,
21
,
21
,
21
,
21
,
22
,
22
,
22
,
22
,
22
,
23
,
23
,
23
,
23
,
23
,
24
,
24
,
24
,
24
,
24
,
24
,
25
,
25
,
25
,
25
,
25
,
26
,
26
,
26
,
26
,
26
,
27
,
27
,
27
,
27
,
27
,
27
,
28
,
28
,
28
,
28
,
28
,
29
,
29
,
29
,
29
,
29
,
29
,
30
,
30
,
30
};
uint32_t
dB_fix_x10_tbl_low
[
128
]
=
{
0
,
0
,
30
,
48
,
60
,
70
,
78
,
85
,
90
,
95
,
100
,
104
,
108
,
111
,
115
,
118
,
120
,
123
,
126
,
128
,
130
,
132
,
134
,
136
,
138
,
140
,
141
,
143
,
145
,
146
,
148
,
149
,
151
,
152
,
153
,
154
,
156
,
157
,
158
,
159
,
160
,
161
,
162
,
163
,
164
,
165
,
166
,
167
,
168
,
169
,
170
,
171
,
172
,
172
,
173
,
174
,
175
,
176
,
176
,
177
,
178
,
179
,
179
,
180
,
181
,
181
,
182
,
183
,
183
,
184
,
185
,
185
,
186
,
186
,
187
,
188
,
188
,
189
,
189
,
190
,
190
,
191
,
191
,
192
,
192
,
193
,
193
,
194
,
194
,
195
,
195
,
196
,
196
,
197
,
197
,
198
,
198
,
199
,
199
,
200
,
200
,
200
,
201
,
201
,
202
,
202
,
203
,
203
,
203
,
204
,
204
,
205
,
205
,
205
,
206
,
206
,
206
,
207
,
207
,
208
,
208
,
208
,
209
,
209
,
209
,
210
,
210
,
210
};
/*
int8_t dB_fixed(int x) {
...
...
@@ -571,6 +854,38 @@ int8_t dB_fixed(int x) {
}
*/
int16_t
dB_fixed_x10
(
uint32_t
x
)
{
int16_t
dB_power
=
0
;
//for new algorithm
uint32_t
cnt
;
uint32_t
Exponent
;
uint32_t
Mantissa
;
uint32_t
shift_right
;
uint32_t
tbl_resolution
=
7
;
uint32_t
tbl_addr_mask
;
if
(
x
<
128
){
//OAI alogrithm
dB_power
=
dB_fix_x10_tbl_low
[
x
];
}
else
{
//new algorithm
tbl_addr_mask
=
0x0000007Fu
;
// (1 << tbl_resolution) - 1;//i.e. 0x0000007F
Mantissa
=
0
;
Exponent
=
0
;
for
(
cnt
=
0
;
cnt
<
32
;
cnt
++
)
{
if
((
bit_seach_mask
[
cnt
]
&
x
)
!=
0
)
{
Exponent
=
bit_seach_res
[
cnt
];
Mantissa
=
x
&
(
~
bit_seach_mask
[
cnt
]);
break
;
}
}
shift_right
=
Exponent
-
tbl_resolution
;
Mantissa
=
(
Mantissa
>>
shift_right
)
&
tbl_addr_mask
;
dB_power
=
dB_fix_x10_tbl
[
Mantissa
]
+
Exponent
*
30u
;
}
return
dB_power
;
}
int16_t
dB_fixed_times10
(
uint32_t
x
)
{
int16_t
dB_power
=
0
;
...
...
openair1/PHY/TOOLS/dB_routines.h
View file @
5db5657d
...
...
@@ -30,5 +30,6 @@
#define DB_ROUTINES_H_
int16_t
dB_fixed_times10
(
uint32_t
x
);
int16_t
dB_fixed_x10
(
uint32_t
x
);
#endif
/* DB_ROUTINES_H_ */
openair1/PHY/TOOLS/signal_energy.c
View file @
5db5657d
...
...
@@ -29,6 +29,7 @@
#define shift 4
//#define shift_DC 0
#define SHRT_MIN -32768
#if defined(__x86_64__) || defined(__i386__)
#ifdef LOCALIZATION
...
...
@@ -67,52 +68,39 @@ int32_t subcarrier_energy(int32_t *input,uint32_t length, int32_t *subcarrier_en
}
#endif
//-----------------------------------------------------------------
// Average Power calculation with DC removing
//-----------------------------------------------------------------
int32_t
signal_energy
(
int32_t
*
input
,
uint32_t
length
)
{
int32_t
i
;
int32_t
temp
,
temp2
;
register
__m64
mm0
,
mm1
,
mm2
,
mm3
;
__m64
*
in
=
(
__m64
*
)
input
;
mm0
=
_mm_setzero_si64
();
//pxor(mm0,mm0
);
mm3
=
_mm_setzero_si64
();
//pxor(mm3,mm3
);
for
(
i
=
0
;
i
<
length
>>
1
;
i
++
)
{
mm1
=
in
[
i
];
mm2
=
mm1
;
mm1
=
_m_pmaddwd
(
mm1
,
mm1
);
mm1
=
_m_psradi
(
mm1
,
shift
);
// shift any 32 bits blocs of the word by the value shift
mm0
=
_m_paddd
(
mm0
,
mm1
);
// add the two 64 bits words 4 bytes by 4 bytes
// mm2 = _m_psrawi(mm2,shift_DC);
mm3
=
_m_paddw
(
mm3
,
mm2
);
// add the two 64 bits words 2 bytes by 2 bytes
uint32_t
i
;
int32_t
temp
;
__m128i
in
,
in_clp
,
i16_min
,
coe1
;
__m128
num0
,
num1
,
num2
,
num3
,
recp1
;
//init
num0
=
_mm_setzero_ps
();
num1
=
_mm_setzero_ps
(
);
i16_min
=
_mm_set1_epi16
(
SHRT_MIN
);
coe1
=
_mm_set1_epi16
(
1
);
recp1
=
_mm_rcp_ps
(
_mm_cvtepi32_ps
(
_mm_set1_epi32
(
length
)));
//Acc
for
(
i
=
0
;
i
<
(
length
>>
2
);
i
++
)
{
in
=
_mm_loadu_si128
((
__m128i
*
)
input
);
in_clp
=
_mm_subs_epi16
(
in
,
_mm_cmpeq_epi16
(
in
,
i16_min
));
//if in=SHRT_MIN in+1, else in
num0
=
_mm_add_ps
(
num0
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
in_clp
,
in_clp
)));
num1
=
_mm_add_ps
(
num1
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
in
,
coe1
)));
//DC
input
+=
4
;
}
mm1
=
mm0
;
mm0
=
_m_psrlqi
(
mm0
,
32
);
mm0
=
_m_paddd
(
mm0
,
mm1
);
temp
=
_m_to_int
(
mm0
);
temp
/=
length
;
temp
<<=
shift
;
// this is the average of x^2
// now remove the DC component
mm2
=
_m_psrlqi
(
mm3
,
32
);
mm2
=
_m_paddw
(
mm2
,
mm3
);
mm2
=
_m_pmaddwd
(
mm2
,
mm2
);
temp2
=
_m_to_int
(
mm2
);
temp2
/=
(
length
*
length
);
// temp2<<=(2*shift_DC);
temp
-=
temp2
;
_mm_empty
();
_m_empty
();
return
((
temp
>
0
)
?
temp
:
1
);
//Ave
num2
=
_mm_dp_ps
(
num0
,
recp1
,
0xFF
);
//AC power
num3
=
_mm_dp_ps
(
num1
,
recp1
,
0xFF
);
//DC
num3
=
_mm_mul_ps
(
num3
,
num3
);
//DC power
//remove DC
temp
=
_mm_cvtsi128_si32
(
_mm_cvttps_epi32
(
_mm_sub_ps
(
num2
,
num3
)));
return
temp
;
}
int32_t
signal_energy_amp_shift
(
int32_t
*
input
,
uint32_t
length
)
...
...
@@ -163,61 +151,27 @@ int32_t signal_energy_amp_shift(int32_t *input,uint32_t length)
int32_t
signal_energy_nodc
(
int32_t
*
input
,
uint32_t
length
)
{
int32_t
i
;
int32_t
temp
;
register
__m64
mm0
,
mm1
;
//,mm2,mm3;
__m64
*
in
=
(
__m64
*
)
input
;
#ifdef MAIN
int16_t
*
printb
;
#endif
mm0
=
_mm_setzero_si64
();
//_pxor(mm0,mm0);
// mm3 = _mm_setzero_si64();//pxor(mm3,mm3);
for
(
i
=
0
;
i
<
length
>>
1
;
i
++
)
{
mm1
=
in
[
i
];
mm1
=
_m_pmaddwd
(
mm1
,
mm1
);
// SIMD complex multiplication
mm1
=
_m_psradi
(
mm1
,
shift
);
mm0
=
_m_paddd
(
mm0
,
mm1
);
// temp2 = mm0;
// printf("%d %d\n",((int *)&in[i])[0],((int *)&in[i])[1]);
// printb = (int16_t *)&mm2;
// printf("mm2 %d : %d %d %d %d\n",i,printb[0],printb[1],printb[2],printb[3]);
__m128i
in
;
__m128
mm0
;
//init
mm0
=
_mm_setzero_ps
();
//Acc
for
(
i
=
0
;
i
<
(
length
>>
2
);
i
++
)
{
in
=
_mm_loadu_si128
((
__m128i
*
)
input
);
mm0
=
_mm_add_ps
(
mm0
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
in
,
in
)));
input
+=
4
;
}
//Ave
temp
=
(
int
)((((
float
*
)
&
mm0
)[
0
]
+
((
float
*
)
&
mm0
)[
1
]
+
((
float
*
)
&
mm0
)[
2
]
+
((
float
*
)
&
mm0
)[
3
])
/
(
float
)
length
);
/*
#ifdef MAIN
printb = (int16_t *)&mm3;
printf("%d %d %d %d\n",printb[0],printb[1],printb[2],printb[3]);
#endif
*/
mm1
=
mm0
;
mm0
=
_m_psrlqi
(
mm0
,
32
);
mm0
=
_m_paddd
(
mm0
,
mm1
);
temp
=
_m_to_int
(
mm0
);
temp
/=
length
;
temp
<<=
shift
;
// this is the average of x^2
#ifdef MAIN
printf
(
"E x^2 = %d
\n
"
,
temp
);
#endif
_mm_empty
();
_m_empty
();
return
((
temp
>
0
)
?
temp
:
1
);
return
temp
;
}
#elif defined(__arm__)
...
...
@@ -364,3 +318,66 @@ main(int argc,char **argv)
}
#endif
#define SHRT_MIN -32768
int32_t
signal_power
(
int32_t
*
input
,
uint32_t
length
)
{
uint32_t
i
;
int32_t
temp
;
__m128i
in
,
in_clp
,
i16_min
;
__m128
num0
,
num1
;
__m128
recp1
;
//init
num0
=
_mm_setzero_ps
();
i16_min
=
_mm_set1_epi16
(
SHRT_MIN
);
recp1
=
_mm_rcp_ps
(
_mm_cvtepi32_ps
(
_mm_set1_epi32
(
length
)));
//Acc
for
(
i
=
0
;
i
<
(
length
>>
2
);
i
++
)
{
in
=
_mm_loadu_si128
((
__m128i
*
)
input
);
in_clp
=
_mm_subs_epi16
(
in
,
_mm_cmpeq_epi16
(
in
,
i16_min
));
//if in=SHRT_MIN in+1, else in
num0
=
_mm_add_ps
(
num0
,
_mm_cvtepi32_ps
(
_mm_madd_epi16
(
in_clp
,
in_clp
)));
input
+=
4
;
}
//Ave
num1
=
_mm_dp_ps
(
num0
,
recp1
,
0xFF
);
temp
=
_mm_cvtsi128_si32
(
_mm_cvttps_epi32
(
num1
));
return
temp
;
}
int32_t
interference_power
(
int32_t
*
input
,
uint32_t
length
)
{
uint32_t
i
;
int32_t
temp
;
__m128i
in
,
in_clp
,
i16_min
;
__m128i
num0
,
num1
,
num2
,
num3
;
__m128
num4
,
num5
,
num6
;
__m128
recp1
;
//init
i16_min
=
_mm_set1_epi16
(
SHRT_MIN
);
num5
=
_mm_setzero_ps
();
recp1
=
_mm_rcp_ps
(
_mm_cvtepi32_ps
(
_mm_set1_epi32
(
length
>>
2
)));
// 1/n, n= length/4
//Acc
for
(
i
=
0
;
i
<
(
length
>>
2
);
i
++
)
{
in
=
_mm_loadu_si128
((
__m128i
*
)
input
);
in_clp
=
_mm_subs_epi16
(
in
,
_mm_cmpeq_epi16
(
in
,
i16_min
));
//if in=SHRT_MIN, in+1, else in
num0
=
_mm_cvtepi16_epi32
(
in_clp
);
//lower 2 complex [0], [1]
num1
=
_mm_cvtepi16_epi32
(
_mm_shuffle_epi32
(
in_clp
,
0x4E
));
//upper 2 complex [2], [3]
num2
=
_mm_srai_epi32
(
_mm_add_epi32
(
num0
,
num1
),
0x01
);
//average A=complex( [0] + [2] ) / 2, B=complex( [1] + [3] ) / 2
num3
=
_mm_sub_epi32
(
num2
,
_mm_shuffle_epi32
(
num2
,
0x4E
));
//complexA-complexB, B-A
num4
=
_mm_dp_ps
(
_mm_cvtepi32_ps
(
num3
),
_mm_cvtepi32_ps
(
num3
),
0x3F
);
//C = num3 lower complex power, C, C, C
num5
=
_mm_add_ps
(
num5
,
num4
);
//Acc Cn, Cn, Cn, Cn,
input
+=
4
;
}
//Interference ve
num6
=
_mm_mul_ps
(
num5
,
recp1
);
//Cn / n
temp
=
_mm_cvtsi128_si32
(
_mm_cvttps_epi32
(
num6
));
return
temp
;
}
openair1/PHY/TOOLS/tools_defs.h
View file @
5db5657d
...
...
@@ -431,6 +431,9 @@ int32_t subcarrier_energy(int32_t *,uint32_t, int32_t* subcarrier_energy, uint16
*/
int32_t
signal_energy_nodc
(
int32_t
*
,
uint32_t
);
int32_t
signal_power
(
int32_t
*
,
uint32_t
);
int32_t
interference_power
(
int32_t
*
,
uint32_t
);
/*!\fn double signal_energy_fp(double *s_re[2], double *s_im[2],uint32_t, uint32_t,uint32_t);
\brief Computes the signal energy per subcarrier
*/
...
...
@@ -469,6 +472,7 @@ uint8_t dB_fixed64(uint64_t x);
int8_t
dB_fixed2
(
uint32_t
x
,
uint32_t
y
);
int16_t
dB_fixed_times10
(
uint32_t
x
);
int16_t
dB_fixed_x10
(
uint32_t
x
);
int32_t
phy_phase_compensation_top
(
uint32_t
pilot_type
,
uint32_t
initial_pilot
,
...
...
openair1/PHY/defs_eNB.h
View file @
5db5657d
...
...
@@ -166,6 +166,8 @@ typedef struct {
int32_t
**
ul_ch_magb
;
/// measured RX power based on DRS
int
ulsch_power
[
2
];
/// measured Interference power based on DRS
int
ulsch_interference_power
[
2
];
/// \brief llr values.
/// - first index: ? [0..1179743] (hard coded)
int16_t
*
llr
;
...
...
@@ -419,6 +421,8 @@ typedef struct {
int
subband_cqi_tot_dB
[
NUMBER_OF_UE_MAX
][
100
];
/// PRACH background noise level
int
prach_I0
;
/// PUCCH background noise level
int
n0_pucch_dB
;
}
PHY_MEASUREMENTS_eNB
;
...
...
@@ -667,6 +671,7 @@ typedef struct PHY_VARS_eNB_s {
int32_t
pusch_stats_bsr
[
NUMBER_OF_UE_MAX
][
10240
];
int32_t
pusch_stats_BO
[
NUMBER_OF_UE_MAX
][
10240
];
uint8_t
*
FS6bufferZone
;
int32_t
pusch_signal_threshold
;
}
PHY_VARS_eNB
;
...
...
openair1/SCHED/fapi_l1.c
View file @
5db5657d
...
...
@@ -992,11 +992,32 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
if
(
NFAPI_MODE
!=
NFAPI_MONOLITHIC
)
{
if
(
number_ul_pdu
>
0
)
{
//LOG_D(PHY, "UL_CONFIG to send to PNF\n");
UL_req
->
sfn_sf
=
frame
<<
4
|
subframe
;
oai_nfapi_ul_config_req
(
UL_req
);
UL_req
->
ul_config_request_body
.
number_of_pdus
=
0
;
number_ul_pdu
=
0
;
uint8_t
ulsch_pdu_num
=
0
;
for
(
i
=
0
;
i
<
number_ul_pdu
;
i
++
)
{
if
((
UL_req
->
ul_config_request_body
.
ul_config_pdu_list
[
i
].
pdu_type
==
NFAPI_UL_CONFIG_ULSCH_PDU_TYPE
)
||
(
UL_req
->
ul_config_request_body
.
ul_config_pdu_list
[
i
].
pdu_type
==
NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE
)
||
(
UL_req
->
ul_config_request_body
.
ul_config_pdu_list
[
i
].
pdu_type
==
NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE
)
||
(
UL_req
->
ul_config_request_body
.
ul_config_pdu_list
[
i
].
pdu_type
==
NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE
)){
ulsch_pdu_num
++
;
}
}
if
(
RC
.
mac
[
Mod_id
]
->
scheduler_mode
==
SCHED_MODE_DEFAULT
)
{
//LOG_D(PHY, "UL_CONFIG to send to PNF\n");
UL_req
->
sfn_sf
=
frame
<<
4
|
subframe
;
oai_nfapi_ul_config_req
(
UL_req
);
UL_req
->
ul_config_request_body
.
number_of_pdus
=
0
;
number_ul_pdu
=
0
;
}
else
if
(
RC
.
mac
[
Mod_id
]
->
scheduler_mode
==
SCHED_MODE_FAIR_RR
)
{
if
(
ulsch_pdu_num
<=
RC
.
rrc
[
Mod_id
]
->
configuration
.
radioresourceconfig
[
CC_id
].
ue_multiple_max
){
UL_req
->
sfn_sf
=
frame
<<
4
|
subframe
;
oai_nfapi_ul_config_req
(
UL_req
);
UL_req
->
ul_config_request_body
.
number_of_pdus
=
0
;
number_ul_pdu
=
0
;
}
else
{
LOG_E
(
MAC
,
"NFAPI: frame %d subframe %d ul_req num %d ul pdu %d
\n
"
,
frame
,
subframe
,
number_ul_pdu
,
ulsch_pdu_num
);
}
}
}
}
else
{
for
(
i
=
0
;
i
<
number_ul_pdu
;
i
++
)
{
...
...
openair1/SCHED/phy_procedures_lte_common.c
View file @
5db5657d
...
...
@@ -1146,7 +1146,7 @@ int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only,
//(beta_offset_pusch_x8=ue->ulsch[eNB_id]->harq_processes[harq_pid]->control_only == 1) ? ue->ulsch[eNB_id]->beta_offset_cqi_times8:8;
// if deltamcs_enabledm
delta_mcs
=
((
hundred_times_delta_TF
[
MPR_x100
/
6
]
+
10
*
dB_fixed_
times
10
((
beta_offset_pusch_x8
)
>>
3
))
/
100
.
0
);
delta_mcs
=
((
hundred_times_delta_TF
[
MPR_x100
/
6
]
+
10
*
dB_fixed_
x
10
((
beta_offset_pusch_x8
)
>>
3
))
/
100
.
0
);
bw_factor
=
(
hundred_times_log10_NPRB
[
nb_rb
-
1
]
/
100
.
0
);
#ifdef DEBUG_SEGMENTATION
printf
(
"estimated ue tx power %d (num_re %d, sumKr %d, mpr_x100 %d, delta_mcs %f, bw_factor %f)
\n
"
,
...
...
openair1/SCHED/phy_procedures_lte_eNb.c
View file @
5db5657d
...
...
@@ -87,9 +87,9 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t
// This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch)
if
(
bw_factor
==
1
)
{
uint8_t
nb_rb
=
eNB
->
ulsch
[
UE_id
]
->
harq_processes
[
harq_pid
]
->
nb_rb
;
return
(
hundred_times_delta_TF
[
MPR_x100
/
6
]
+
10
*
dB_fixed_
times
10
((
beta_offset_pusch
)
>>
3
))
+
hundred_times_log10_NPRB
[
nb_rb
-
1
];
return
(
hundred_times_delta_TF
[
MPR_x100
/
6
]
+
10
*
dB_fixed_
x
10
((
beta_offset_pusch
)
>>
3
))
+
hundred_times_log10_NPRB
[
nb_rb
-
1
];
}
else
return
(
hundred_times_delta_TF
[
MPR_x100
/
6
]
+
10
*
dB_fixed_
times
10
((
beta_offset_pusch
)
>>
3
));
return
(
hundred_times_delta_TF
[
MPR_x100
/
6
]
+
10
*
dB_fixed_
x
10
((
beta_offset_pusch
)
>>
3
));
}
else
{
return
(
0
);
}
...
...
@@ -757,8 +757,8 @@ void fill_sr_indication(int UEid, PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int
// pdu->rx_ue_information.handle = handle;
pdu
->
rx_ue_information
.
tl
.
tag
=
NFAPI_RX_UE_INFORMATION_TAG
;
pdu
->
rx_ue_information
.
rnti
=
rnti
;
int
SNRtimes10
=
dB_fixed_
times10
(
stat
)
-
10
*
eNB
->
measurements
.
n0_subband_power_avg
_dB
;
LOG_D
(
PHY
,
"stat %d
subband n0 %d, SNRtimes10 %d
\n
"
,
stat
,
eNB
->
measurements
.
n0_subband_power_avg_dB
,
SNRtimes10
);
int
SNRtimes10
=
dB_fixed_
x10
(
stat
)
-
10
*
eNB
->
measurements
.
n0_pucch
_dB
;
LOG_D
(
PHY
,
"stat %d
n0 %d, SNRtimes10 %d
\n
"
,
stat
,
eNB
->
measurements
.
n0_subband_power_dB
[
0
][
0
]
,
SNRtimes10
);
pdu
->
ul_cqi_information
.
tl
.
tag
=
NFAPI_UL_CQI_INFORMATION_TAG
;
if
(
SNRtimes10
<
-
640
)
pdu
->
ul_cqi_information
.
ul_cqi
=
0
;
...
...
@@ -791,6 +791,8 @@ uci_procedures(PHY_VARS_eNB *eNB,
LTE_eNB_UCI
*
uci
=
NULL
;
LTE_DL_FRAME_PARMS
*
fp
=
&
(
eNB
->
frame_parms
);
calc_pucch_1x_interference
(
eNB
,
frame
,
subframe
,
0
);
for
(
int
i
=
0
;
i
<
NUMBER_OF_UCI_VARS_MAX
;
i
++
)
{
uci
=
&
(
eNB
->
uci_vars
[
i
]);
...
...
@@ -1605,7 +1607,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
pdu
->
rx_indication_rel8
.
timing_advance
=
timing_advance_update
;
// estimate UL_CQI for MAC
int
SNRtimes10
=
dB_fixed_
times10
(
eNB
->
pusch_vars
[
UE_id
]
->
ulsch_power
[
0
]
+
((
eNB
->
frame_parms
.
nb_antennas_rx
>
1
)
?
eNB
->
pusch_vars
[
UE_id
]
->
ulsch_power
[
1
]
:
0
))
-
10
*
eNB
->
measurements
.
n0_subband_power_avg_dB
;
int
SNRtimes10
=
dB_fixed_
x10
(
eNB
->
pusch_vars
[
UE_id
]
->
ulsch_power
[
0
]
+
((
eNB
->
frame_parms
.
nb_antennas_rx
>
1
)
?
eNB
->
pusch_vars
[
UE_id
]
->
ulsch_power
[
1
]
:
0
)
)
-
dB_fixed_x10
(
eNB
->
pusch_vars
[
UE_id
]
->
ulsch_interference_power
[
0
]
+
((
eNB
->
frame_parms
.
nb_antennas_rx
>
1
)
?
eNB
->
pusch_vars
[
UE_id
]
->
ulsch_interference_power
[
1
]
:
0
)
)
;
if
(
SNRtimes10
<
-
640
)
pdu
->
rx_indication_rel8
.
ul_cqi
=
0
;
...
...
@@ -1919,7 +1921,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
pdu
->
rx_ue_information
.
rnti
=
uci
->
rnti
;
// estimate UL_CQI for MAC (from antenna port 0 only)
pdu
->
ul_cqi_information
.
tl
.
tag
=
NFAPI_UL_CQI_INFORMATION_TAG
;
int
SNRtimes10
=
dB_fixed_
times10
(
uci
->
stat
)
-
10
*
eNB
->
measurements
.
n0_subband_power_avg
_dB
;
int
SNRtimes10
=
dB_fixed_
x10
(
uci
->
stat
)
-
10
*
eNB
->
measurements
.
n0_pucch
_dB
;
if
(
SNRtimes10
<
-
100
)
LOG_I
(
PHY
,
"uci->stat %d
\n
"
,
uci
->
stat
);
...
...
openair1/SCHED/ru_procedures.c
View file @
5db5657d
...
...
@@ -775,7 +775,6 @@ void fep_full(RU_t *ru,
if
((
fp
->
frame_type
==
TDD
)
&&
(
subframe_select
(
fp
,
subframe
)
!=
SF_UL
))
return
;
start_meas
(
&
ru
->
ofdm_demod_stats
);
if
(
ru
->
idx
==
0
)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX
+
ru
->
idx
,
1
);
...
...
openair2/ENB_APP/L1_paramdef.h
View file @
5db5657d
...
...
@@ -61,6 +61,7 @@
#define CONFIG_STRING_L1_PRACH_DTX_EMTC3_THRESHOLD "prach_dtx_emtc3_threshold"
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC3_THRESHOLD "pucch1_dtx_emtc3_threshold"
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC3_THRESHOLD "pucch1ab_dtx_emtc3_threshold"
#define CONFIG_STRING_L1_PUSCH_SIGNAL_THRESHOLD "pusch_signal_threshold"
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* L1 configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
...
...
@@ -89,7 +90,8 @@
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC2_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PRACH_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0} \
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
{CONFIG_STRING_L1_PUSCH_SIGNAL_THRESHOLD, NULL, 0, iptr:NULL, defintval:635, TYPE_INT, 0} \
}
#define L1_CC_IDX 0
#define L1_TRANSPORT_N_PREFERENCE_IDX 1
...
...
@@ -115,6 +117,7 @@
#define L1_PRACH_DTX_EMTC3_THRESHOLD_IDX 21
#define L1_PUCCH1_DTX_EMTC3_THRESHOLD_IDX 22
#define L1_PUCCH1AB_DTX_EMTC3_THRESHOLD_IDX 23
#define L1_PUSCH_SIGNAL_THRESHOLD_IDX 24
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
#endif
openair2/ENB_APP/enb_config.c
View file @
5db5657d
...
...
@@ -169,6 +169,10 @@ void RCconfig_L1(void) {
RC
.
eNB
[
j
][
0
]
->
pucch1_DTX_threshold_emtc
[
ce_level
]
=
*
(
L1_ParamList
.
paramarray
[
j
][
L1_PUCCH1_DTX_EMTC0_THRESHOLD_IDX
+
ce_level
].
iptr
);
RC
.
eNB
[
j
][
0
]
->
pucch1ab_DTX_threshold_emtc
[
ce_level
]
=
*
(
L1_ParamList
.
paramarray
[
j
][
L1_PUCCH1AB_DTX_EMTC0_THRESHOLD_IDX
+
ce_level
].
iptr
);
}
RC
.
eNB
[
j
][
0
]
->
pusch_signal_threshold
=
*
(
L1_ParamList
.
paramarray
[
j
][
L1_PUSCH_SIGNAL_THRESHOLD_IDX
].
iptr
);
LOG_I
(
ENB_APP
,
"PUSCH singal threshold = %d
\n
"
,
RC
.
eNB
[
j
][
0
]
->
pusch_signal_threshold
);
}
// j=0..num_inst
LOG_I
(
ENB_APP
,
"Initializing northbound interface for L1
\n
"
);
...
...
openair2/LAYER2/MAC/eNB_scheduler.c
View file @
5db5657d
...
...
@@ -596,13 +596,41 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
UE_scheduling_control
=
&
(
UE_info
->
UE_sched_ctrl
[
UE_id
]);
if
(((
frameP
&
127
)
==
0
)
&&
(
subframeP
==
0
))
{
LOG_I
(
MAC
,
"UE rnti %x : %s, PHR %d dB DL CQI %d PUSCH SNR %d PUCCH SNR %d
\n
"
,
double
total_bler
;
if
(
UE_scheduling_control
->
pusch_rx_num
[
CC_id
]
==
0
&&
UE_scheduling_control
->
pusch_rx_error_num
[
CC_id
]
==
0
)
{
total_bler
=
0
;
}
else
{
total_bler
=
(
double
)
UE_scheduling_control
->
pusch_rx_error_num
[
CC_id
]
/
(
double
)(
UE_scheduling_control
->
pusch_rx_error_num
[
CC_id
]
+
UE_scheduling_control
->
pusch_rx_num
[
CC_id
])
*
100
;
}
LOG_I
(
MAC
,
"UE %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf mcsoff %d bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d
\n
"
,
rnti
,
UE_scheduling_control
->
ul_out_of_sync
==
0
?
"in synch"
:
"out of sync"
,
UE_info
->
UE_template
[
CC_id
][
UE_id
].
phr_info
,
UE_scheduling_control
->
dl_cqi
[
CC_id
],
(
5
*
UE_scheduling_control
->
pusch_snr
[
CC_id
]
-
640
)
/
10
,
(
5
*
UE_scheduling_control
->
pucch1_snr
[
CC_id
]
-
640
)
/
10
);
UE_scheduling_control
->
pusch_snr_avg
[
CC_id
],
UE_scheduling_control
->
pucch1_snr
[
CC_id
],
UE_scheduling_control
->
rlc_out_of_resources_cnt
,
UE_scheduling_control
->
pusch_rx_num
[
CC_id
],
UE_scheduling_control
->
pusch_rx_error_num
[
CC_id
],
total_bler
,
UE_scheduling_control
->
mcs_offset
[
CC_id
],
UE_info
->
UE_template
[
CC_id
][
UE_id
].
estimated_ul_buffer
,
UE_info
->
UE_template
[
CC_id
][
UE_id
].
scheduled_ul_bytes
,
UE_info
->
eNB_UE_stats
[
CC_id
][
UE_id
].
total_pdu_bytes_rx
,
UE_info
->
eNB_UE_stats
[
CC_id
][
UE_id
].
total_num_pdus_rx
,
UE_info
->
eNB_UE_stats
[
CC_id
][
UE_id
].
total_pdu_bytes
,
UE_info
->
eNB_UE_stats
[
CC_id
][
UE_id
].
total_num_pdus
,
UE_info
->
eNB_UE_stats
[
CC_id
][
UE_id
].
total_rbs_used
,
#if defined(PRE_SCD_THREAD)
UE_info
->
UE_template
[
CC_id
][
UE_id
].
dl_buffer_total
,
#else
0
,
#endif
UE_scheduling_control
->
first_cnt
[
CC_id
],
UE_scheduling_control
->
ret_cnt
[
CC_id
],
UE_scheduling_control
->
aperiodic_ri_received
[
CC_id
]
);
}
RC
.
eNB
[
module_idP
][
CC_id
]
->
pusch_stats_bsr
[
UE_id
][(
frameP
*
10
)
+
subframeP
]
=
-
63
;
...
...
openair2/LAYER2/MAC/eNB_scheduler_RA.c
View file @
5db5657d
...
...
@@ -212,13 +212,6 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
hi_dci0_req
->
sfn_sf
=
sfnsf_add_subframe
(
frameP
,
subframeP
,
sf_ahead_dl
);
hi_dci0_req
->
header
.
message_id
=
NFAPI_HI_DCI0_REQUEST
;
if
(
NFAPI_MODE
!=
NFAPI_MONOLITHIC
)
{
oai_nfapi_hi_dci0_req
(
hi_dci0_req
);
hi_dci0_req_body
->
number_of_hi
=
0
;
}
LOG_D
(
MAC
,
"MSG3: HI_DCI0 SFN/SF:%d number_of_dci:%d number_of_hi:%d
\n
"
,
NFAPI_SFNSF2DEC
(
hi_dci0_req
->
sfn_sf
),
hi_dci0_req_body
->
number_of_dci
,
hi_dci0_req_body
->
number_of_hi
);
// save UL scheduling information for preprocessor
for
(
j
=
0
;
j
<
ra
->
msg3_nb_rb
;
j
++
)
cc
->
vrb_map_UL
[
ra
->
msg3_first_rb
+
j
]
=
1
;
...
...
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
View file @
5db5657d
...
...
@@ -821,6 +821,7 @@ schedule_ue_spec(module_id_t module_idP,
/* reset ta_update */
ue_sched_ctrl
->
ta_update
=
31
;
ue_sched_ctrl
->
ta_update_f
=
31
.
0
;
}
int
ta_len
=
(
ta_update
!=
31
)
?
2
:
0
;
...
...
@@ -1050,7 +1051,7 @@ schedule_ue_spec(module_id_t module_idP,
// this is the snr
// unit is not dBm, it's special from nfapi
// converting to dBm
int
snr
=
(
5
*
ue_sched_ctrl
->
pucch1_snr
[
CC_id
]
-
640
)
/
10
;
int
snr
=
ue_sched_ctrl
->
pucch1_snr
[
CC_id
]
;
int
target_snr
=
eNB
->
puCch10xSnr
/
10
;
// this assumes accumulated tpc
// make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
...
...
@@ -1366,6 +1367,7 @@ schedule_ue_spec_br(module_id_t module_idP,
/* Reset ta_update */
ue_sched_ctl
->
ta_update
=
31
;
ue_sched_ctl
->
ta_update_f
=
31
.
0
;
}
else
{
ta_update
=
31
;
}
...
...
@@ -1684,7 +1686,7 @@ schedule_ue_spec_br(module_id_t module_idP,
/* Do PUCCH power control */
/* This is the snr */
/* unit is not dBm, it's special from nfapi, convert to dBm */
snr
=
(
5
*
ue_sched_ctl
->
pucch1_snr
[
CC_id
]
-
640
)
/
10
;
snr
=
ue_sched_ctl
->
pucch1_snr
[
CC_id
]
;
target_snr
=
mac
->
puCch10xSnr
/
10
;
/* This assumes accumulated tpc */
/* Make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out */
...
...
openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
View file @
5db5657d
This diff is collapsed.
Click to expand it.
openair2/LAYER2/MAC/eNB_scheduler_phytest.c
View file @
5db5657d
...
...
@@ -238,7 +238,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
//power control
//compute the expected ULSCH RX power (for the stats)
// this is the snr and this should be constant (regardless of mcs)
snr
=
(
5
*
UE_sched_ctrl
->
pusch_snr
[
CC_id
]
-
640
)
/
10
;
snr
=
UE_sched_ctrl
->
pusch_snr
[
CC_id
]
;
// new transmission
ndi
=
1
-
UE_template
->
oldNDI_UL
[
harq_pid
];
UE_template
->
oldNDI_UL
[
harq_pid
]
=
ndi
;
...
...
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
View file @
5db5657d
...
...
@@ -2173,6 +2173,7 @@ add_new_ue(module_id_t mod_idP,
)
//------------------------------------------------------------------------------
{
eNB_MAC_INST
*
eNB
=
RC
.
mac
[
mod_idP
];
int
UE_id
;
int
i
,
j
;
UE_info_t
*
UE_info
=
&
RC
.
mac
[
mod_idP
]
->
UE_info
;
...
...
@@ -2215,7 +2216,19 @@ add_new_ue(module_id_t mod_idP,
0
,
sizeof
(
eNB_UE_STATS
));
UE_info
->
UE_sched_ctrl
[
UE_id
].
ue_reestablishment_reject_timer
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
ta_update_f
=
31
.
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
ta_update
=
31
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_snr
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_cqi_f
[
cc_idP
]
=
(
eNB
->
puSch10xSnr
+
640
)
/
5
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_cqi
[
cc_idP
]
=
(
eNB
->
puSch10xSnr
+
640
)
/
5
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_snr_avg
[
cc_idP
]
=
eNB
->
puSch10xSnr
/
10
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_rx_num
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_rx_num_old
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_rx_error_num
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_rx_error_num_old
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_bler
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
ret_cnt
[
cc_idP
]
=
0
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
first_cnt
[
cc_idP
]
=
0
;
for
(
j
=
0
;
j
<
8
;
j
++
)
{
UE_info
->
UE_template
[
cc_idP
][
UE_id
].
oldNDI
[
j
]
=
0
;
...
...
@@ -4934,6 +4947,7 @@ cqi_indication(module_id_t mod_idP,
{
int
UE_id
=
find_UE_id
(
mod_idP
,
rntiP
);
UE_info_t
*
UE_info
=
&
RC
.
mac
[
mod_idP
]
->
UE_info
;
uint64_t
pdu_val
=
*
(
uint64_t
*
)
pdu
;
if
(
UE_id
==
-
1
)
{
LOG_W
(
MAC
,
"cqi_indication: UE %x not found
\n
"
,
rntiP
);
...
...
@@ -4973,10 +4987,10 @@ cqi_indication(module_id_t mod_idP,
subframeP
,
pdu
,
rel9
->
length
);
LOG_D
(
MAC
,
"Frame %d Subframe %d update CQI:%d
\n
"
,
LOG_D
(
MAC
,
"Frame %d Subframe %d update CQI:%d
pdu 0x%016"
PRIx64
"
\n
"
,
frameP
,
subframeP
,
sched_ctl
->
dl_cqi
[
CC_idP
]);
sched_ctl
->
dl_cqi
[
CC_idP
]
,
pdu_val
);
sched_ctl
->
cqi_req_flag
&=
(
~
(
1
<<
subframeP
));
sched_ctl
->
cqi_received
=
1
;
}
...
...
@@ -5164,7 +5178,7 @@ harq_indication(module_id_t mod_idP,
/* don't care about cqi reporting if NACK/DTX is there */
if
(
channel
==
0
&&
!
nack_or_dtx_reported
(
cc
,
harq_pdu
))
{
sched_ctl
->
pucch1_snr
[
CC_idP
]
=
ul_cqi
;
sched_ctl
->
pucch1_snr
[
CC_idP
]
=
(
5
*
ul_cqi
-
640
)
/
10
;
sched_ctl
->
pucch1_cqi_update
[
CC_idP
]
=
1
;
}
...
...
openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
View file @
5db5657d
This diff is collapsed.
Click to expand it.
openair2/LAYER2/MAC/mac.h
View file @
5db5657d
...
...
@@ -469,6 +469,7 @@ typedef struct {
#define BSR_TRIGGER_PADDING (4)
/* For Padding BSR Trigger */
/*! \brief Downlink SCH PDU Structure */
typedef
struct
{
uint8_t
payload
[
8
][
SCH_PAYLOAD_SIZE_MAX
];
...
...
@@ -906,6 +907,11 @@ typedef struct {
uint32_t
pucch_tpc_tx_frame
;
uint32_t
pucch_tpc_tx_subframe
;
/// stores the frame where the last bler was calculated
uint32_t
pusch_bler_calc_frame
;
uint32_t
pusch_bler_calc_subframe
;
uint8_t
rach_resource_type
;
uint16_t
mpdcch_repetition_cnt
;
frame_t
Msg2_frame
;
...
...
@@ -928,6 +934,8 @@ typedef struct {
/// Current DL harq round per harq_pid on each CC
uint8_t
round
[
NFAPI_CC_MAX
][
10
];
uint32_t
ret_cnt
[
NFAPI_CC_MAX
];
uint32_t
first_cnt
[
NFAPI_CC_MAX
];
/// Current Active TBs per harq_pid on each CC
uint8_t
tbcnt
[
NFAPI_CC_MAX
][
10
];
/// Current UL harq round per harq_pid on each CC
...
...
@@ -937,6 +945,7 @@ typedef struct {
unsigned
char
rballoc_sub_UE
[
NFAPI_CC_MAX
][
N_RBG_MAX
];
int
pre_dci_dl_pdu_idx
;
uint16_t
ta_timer
;
double
ta_update_f
;
int16_t
ta_update
;
uint16_t
ul_consecutive_errors
;
int32_t
context_active_timer
;
...
...
@@ -954,13 +963,22 @@ typedef struct {
int32_t
phr_received
;
uint8_t
periodic_ri_received
[
NFAPI_CC_MAX
];
uint8_t
aperiodic_ri_received
[
NFAPI_CC_MAX
];
uint8_t
pucch1_cqi_update
[
NFAPI_CC_MAX
];
uint8_t
pucch1_snr
[
NFAPI_CC_MAX
];
uint8_t
pucch2_cqi_update
[
NFAPI_CC_MAX
];
uint8_t
pucch2_snr
[
NFAPI_CC_MAX
];
uint8_t
pucch3_cqi_update
[
NFAPI_CC_MAX
];
uint8_t
pucch3_snr
[
NFAPI_CC_MAX
];
uint8_t
pusch_snr
[
NFAPI_CC_MAX
];
int16_t
pucch1_cqi_update
[
NFAPI_CC_MAX
];
int16_t
pucch1_snr
[
NFAPI_CC_MAX
];
int16_t
pucch2_cqi_update
[
NFAPI_CC_MAX
];
int16_t
pucch2_snr
[
NFAPI_CC_MAX
];
int16_t
pucch3_cqi_update
[
NFAPI_CC_MAX
];
int16_t
pucch3_snr
[
NFAPI_CC_MAX
];
double
pusch_cqi_f
[
NFAPI_CC_MAX
];
int16_t
pusch_cqi
[
NFAPI_CC_MAX
];
int16_t
pusch_snr
[
NFAPI_CC_MAX
];
int16_t
pusch_snr_avg
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_num
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_num_old
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_error_num
[
NFAPI_CC_MAX
];
uint64_t
pusch_rx_error_num_old
[
NFAPI_CC_MAX
];
double
pusch_bler
[
NFAPI_CC_MAX
];
uint8_t
mcs_offset
[
NFAPI_CC_MAX
];
uint16_t
feedback_cnt
[
NFAPI_CC_MAX
];
uint16_t
timing_advance
;
uint16_t
timing_advance_r9
;
...
...
@@ -1039,6 +1057,7 @@ typedef struct {
/// DRX UL retransmission timer, one per UL HARQ process
/* Not implemented yet */
/* End of C-DRX related timers */
uint32_t
rlc_out_of_resources_cnt
;
}
UE_sched_ctrl_t
;
/*! \brief eNB template for the Random access information */
...
...
openair2/RRC/LTE/rrc_defs.h
View file @
5db5657d
...
...
@@ -554,7 +554,7 @@ typedef struct eNB_RRC_UE_s {
LTE_DRB_ToAddModList_t
*
DRB_configList
;
LTE_DRB_ToAddModList_t
*
DRB_configList2
[
RRC_TRANSACTION_IDENTIFIER_NUMBER
];
LTE_DRB_ToReleaseList_t
*
DRB_Release_configList2
[
RRC_TRANSACTION_IDENTIFIER_NUMBER
];
uint8_t
DRB_active
[
8
];
uint8_t
DRB_active
[
NB_RB_MAX
-
2
];
struct
LTE_PhysicalConfigDedicated
*
physicalConfigDedicated
;
struct
LTE_SPS_Config
*
sps_Config
;
LTE_MeasObjectToAddMod_t
*
MeasObj
[
MAX_MEAS_OBJ
];
...
...
openair2/RRC/LTE/rrc_eNB.c
View file @
5db5657d
...
...
@@ -6711,22 +6711,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
);
}
}
else
{
// remove LCHAN from MAC/PHY
if
(
ue_context_pP
->
ue_context
.
DRB_active
[
drb_id
]
==
1
)
{
// DRB has just been removed so remove RLC + PDCP for DRB
/* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE,
(ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE);
*/
if
(
!
NODE_IS_CU
(
RC
.
rrc
[
ctxt_pP
->
module_id
]
->
node_type
))
{
rrc_rlc_config_req
(
ctxt_pP
,
SRB_FLAG_NO
,
MBMS_FLAG_NO
,
CONFIG_ACTION_REMOVE
,
DRB2LCHAN
[
i
],
Rlc_info_um
);
}
if
(
DRB_configList
->
list
.
array
[
i
]
->
logicalChannelIdentity
)
{
DRB2LCHAN
[
i
]
=
(
uint8_t
)
*
DRB_configList
->
list
.
array
[
i
]
->
logicalChannelIdentity
;
}
ue_context_pP
->
ue_context
.
DRB_active
[
drb_id
]
=
0
;
LOG_D
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" RRC_eNB --- MAC_CONFIG_REQ (DRB) ---> MAC_eNB
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
));
...
...
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