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
lizhongxiao
OpenXG-RAN
Commits
65c427b1
Commit
65c427b1
authored
Mar 29, 2019
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'thread-pool' of
https://gitlab.eurecom.fr/oai/openairinterface5g
into thread-pool
parents
19d9693c
bda26020
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
151 additions
and
225 deletions
+151
-225
common/utils/LOG/log.c
common/utils/LOG/log.c
+1
-0
common/utils/LOG/log.h
common/utils/LOG/log.h
+1
-0
common/utils/utils.h
common/utils/utils.h
+16
-0
executables/nr-ue.c
executables/nr-ue.c
+5
-5
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+3
-4
openair1/PHY/MODULATION/slot_fep_nr.c
openair1/PHY/MODULATION/slot_fep_nr.c
+89
-186
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+8
-10
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+0
-2
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+6
-6
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+5
-6
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
+4
-4
openair1/PHY/TOOLS/nr_phy_scope.c
openair1/PHY/TOOLS/nr_phy_scope.c
+1
-1
openair1/PHY/TOOLS/time_meas.h
openair1/PHY/TOOLS/time_meas.h
+11
-0
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+1
-1
No files found.
common/utils/LOG/log.c
View file @
65c427b1
...
...
@@ -478,6 +478,7 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le
log_header
(
log_buffer
,
MAX_LOG_TOTAL
,
comp
,
level
,
format
);
g_log
->
log_component
[
comp
].
vprint
(
g_log
->
log_component
[
comp
].
stream
,
log_buffer
,
args
);
fflush
(
g_log
->
log_component
[
comp
].
stream
);
va_end
(
args
);
...
...
common/utils/LOG/log.h
View file @
65c427b1
...
...
@@ -53,6 +53,7 @@
#endif
#include <pthread.h>
#include "T.h"
#include <common/utils/utils.h>
/*----------------------------------------------------------------------------*/
#ifdef __cplusplus
...
...
common/utils/utils.h
View file @
65c427b1
...
...
@@ -3,6 +3,9 @@
#include <stdint.h>
#include <sys/types.h>
#ifdef __cplusplus
extern
"C"
{
#endif
void
*
calloc_or_fail
(
size_t
size
);
void
*
malloc_or_fail
(
size_t
size
);
...
...
@@ -14,4 +17,17 @@ int hex_string_to_hex_value (uint8_t *hex_value, const char *hex_string, int siz
char
*
itoa
(
int
i
);
#define findInList(keY, result, list, element_type) {\
int i;\
for (i=0; i<sizeof(list)/sizeof(element_type) ; i++)\
if (list[i].key==keY) {\
result=list[i].val;\
break;\
}\
AssertFatal(i < sizeof(list)/sizeof(element_type), "List %s doesn't contain %s\n",#list, #keY); \
}
#ifdef __cplusplus
}
#endif
#endif
executables/nr-ue.c
View file @
65c427b1
...
...
@@ -453,7 +453,7 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
for
(
int
x
=
0
;
x
<
10
;
x
++
)
{
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
rxp
[
i
]
=
((
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
0
])
+
4
*
x
*
UE
->
frame_parms
.
samples_per_subframe
;
rxp
[
i
]
=
((
void
*
)
&
UE
->
common_vars
.
rxdata
Time
[
i
][
0
])
+
4
*
x
*
UE
->
frame_parms
.
samples_per_subframe
;
AssertFatal
(
UE
->
frame_parms
.
samples_per_subframe
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
...
...
@@ -507,7 +507,7 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
AssertFatal
(
unitTransfer
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
timestamp
,
(
void
**
)
UE
->
common_vars
.
rxdata
,
(
void
**
)
UE
->
common_vars
.
rxdata
Time
,
unitTransfer
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
}
...
...
@@ -593,7 +593,7 @@ void *UE_thread(void *arg) {
AssertFatal
(
UE
->
frame_parms
.
ofdm_symbol_size
+
UE
->
frame_parms
.
nb_prefix_samples0
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
&
timestamp
,
(
void
**
)
UE
->
common_vars
.
rxdata
,
(
void
**
)
UE
->
common_vars
.
rxdata
Time
,
UE
->
frame_parms
.
ofdm_symbol_size
+
UE
->
frame_parms
.
nb_prefix_samples0
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
continue
;
...
...
@@ -614,7 +614,7 @@ void *UE_thread(void *arg) {
LOG_D
(
PHY
,
"Process slot %d thread Idx %d
\n
"
,
slot_nr
,
thread_idx
);
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
rxp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
UE
->
frame_parms
.
ofdm_symbol_size
+
rxp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
rxdata
Time
[
i
][
UE
->
frame_parms
.
ofdm_symbol_size
+
UE
->
frame_parms
.
nb_prefix_samples0
+
slot_nr
*
UE
->
frame_parms
.
samples_per_slot
];
...
...
@@ -661,7 +661,7 @@ void *UE_thread(void *arg) {
AssertFatal
(
first_symbols
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
&
timestamp
,
(
void
**
)
UE
->
common_vars
.
rxdata
,
(
void
**
)
UE
->
common_vars
.
rxdata
Time
,
first_symbols
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
else
...
...
openair1/PHY/INIT/nr_init_ue.c
View file @
65c427b1
...
...
@@ -19,7 +19,7 @@
* contact@openairinterface.org
*/
#include "phy_init.h"
#include "
PHY/INIT/
phy_init.h"
#include "SCHED_UE/sched_UE.h"
#include "PHY/phy_extern_nr_ue.h"
//#include "SIMULATION/TOOLS/sim.h"
...
...
@@ -34,7 +34,6 @@
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
//#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
#include "PHY/INIT/phy_init.h"
#include "PHY/NR_REFSIG/pss_nr.h"
#include "openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h"
...
...
@@ -711,13 +710,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
// init RX buffers
common_vars
->
rxdata
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
common_vars
->
rxdata
Time
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
common_vars
->
common_vars_rx_data_per_thread
[
th_id
].
rxdataF
=
(
int32_t
**
)
malloc16
(
fp
->
nb_antennas_rx
*
sizeof
(
int32_t
*
)
);
}
for
(
i
=
0
;
i
<
fp
->
nb_antennas_rx
;
i
++
)
{
common_vars
->
rxdata
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
(
fp
->
samples_per_subframe
*
10
+
2048
)
*
sizeof
(
int32_t
)
);
common_vars
->
rxdata
Time
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
(
fp
->
samples_per_subframe
*
10
+
2048
)
*
sizeof
(
int32_t
)
);
for
(
th_id
=
0
;
th_id
<
RX_NB_TH_MAX
;
th_id
++
)
{
common_vars
->
common_vars_rx_data_per_thread
[
th_id
].
rxdataF
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
(
fp
->
ofdm_symbol_size
*
14
)
);
}
...
...
openair1/PHY/MODULATION/slot_fep_nr.c
View file @
65c427b1
...
...
@@ -25,7 +25,7 @@
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
//#define DEBUG_FEP
#define DEBUG_FEP(a...)
#define SOFFSET 0
...
...
@@ -35,16 +35,15 @@
#endif*/
int
nr_slot_fep
(
PHY_VARS_NR_UE
*
ue
,
unsigned
char
l
,
unsigned
char
symbo
l
,
unsigned
char
Ns
,
int
sample_offset
,
int
no_prefix
,
NR_CHANNEL_EST_t
channel
)
{
NR_CHANNEL_EST_t
channel
)
{
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
NR_UE_COMMON
*
common_vars
=
&
ue
->
common_vars
;
uint8_t
eNB_id
=
0
;
unsigned
char
aa
;
unsigned
char
symbol
=
l
;
//+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame
unsigned
int
nb_prefix_samples
;
unsigned
int
nb_prefix_samples0
;
if
(
ue
->
is_synchronized
)
{
...
...
@@ -68,52 +67,23 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
uint8_t
p
=
0
;
uint8_t
l0
=
pdcch_vars
->
coreset
[
0
].
duration
;
uint64_t
coreset_freq_dom
=
pdcch_vars
->
coreset
[
0
].
frequencyDomainResources
;
for
(
int
i
=
0
;
i
<
45
;
i
++
)
{
if
(((
coreset_freq_dom
&
0x1FFFFFFFFFFF
)
>>
i
)
&
0x1
)
nb_rb_coreset
++
;
}
nb_rb_coreset
=
6
*
nb_rb_coreset
;
//printf("corset duration %d nb_rb_coreset %d\n", l0, nb_rb_coreset);
void
(
*
dft
)(
int16_t
*
,
int16_t
*
,
int
);
int
tmp_dft_in
[
8192
]
__attribute__
((
aligned
(
32
)));
// This is for misalignment issues for 6 and 15 PRBs
switch
(
frame_parms
->
ofdm_symbol_size
)
{
case
128
:
dft
=
dft128
;
break
;
case
256
:
dft
=
dft256
;
break
;
case
512
:
dft
=
dft512
;
break
;
case
1024
:
dft
=
dft1024
;
break
;
case
1536
:
dft
=
dft1536
;
break
;
case
2048
:
dft
=
dft2048
;
break
;
case
4096
:
dft
=
dft4096
;
break
;
case
8192
:
dft
=
dft8192
;
break
;
default:
dft
=
dft512
;
break
;
struct
l_s
{
int
key
;
void
(
*
val
)(
int16_t
*
,
int16_t
*
,
int
);
}
listFunc
[]
=
{
{
128
,
dft128
},{
256
,
dft256
},{
512
,
dft512
},{
1024
,
dft1024
},
{
1536
,
dft1536
},{
2048
,
dft2048
},{
4096
,
dft4096
},{
8192
,
dft8192
}
};
findInList
(
frame_parms
->
ofdm_symbol_size
,
dft
,
listFunc
,
struct
l_s
);
if
(
no_prefix
)
{
slot_offset
=
frame_parms
->
ofdm_symbol_size
*
(
frame_parms
->
symbols_per_slot
)
*
(
Ns
);
...
...
@@ -121,139 +91,75 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
slot_offset
=
(
frame_parms
->
samples_per_slot
)
*
(
Ns
);
}
/*if (l<0 || l>=7-frame_parms->Ncp) {
printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
return(-1);
}*/
if
(
Ns
<
0
||
Ns
>=
20
)
{
printf
(
"slot_fep: Ns must be between 0 and 19
\n
"
);
return
(
-
1
);
}
int32_t
**
rxdf
=
common_vars
->
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
rxdataF
;
AssertFatal
(
Ns
>=
0
&&
Ns
<
20
,
"slot_fep: Ns must be between 0 and 19
\n
"
);
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_rx
;
aa
++
)
{
memset
(
&
common_vars
->
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
0
,
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
memset
(
&
rxdf
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
0
,
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
rx_offset
=
sample_offset
+
slot_offset
+
nb_prefix_samples0
-
SOFFSET
;
rx_offset
=
sample_offset
+
slot_offset
+
nb_prefix_samples0
-
SOFFSET
+
(
frame_parms
->
ofdm_symbol_size
+
nb_prefix_samples
)
*
symbol
;
rx_offset
%=
frame_length_samples
;
// Align with 256 bit
// rx_offset = rx_offset&0xfffffff8;
#ifdef DEBUG_FEP
// if (ue->frame <100)
/*LOG_I(PHY,*/
printf
(
"slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d
\n
"
,
ue
->
proc
.
proc_rxtx
[(
Ns
)
&
1
].
frame_rx
,
Ns
,
symbol
,
nb_prefix_samples
,
nb_prefix_samples0
,
slot_offset
,
sample_offset
,
rx_offset
,
frame_length_samples
);
#endif
if
(
l
==
0
)
{
if
(
rx_offset
>
(
frame_length_samples
-
frame_parms
->
ofdm_symbol_size
))
memcpy
((
short
*
)
&
common_vars
->
rxdata
[
aa
][
frame_length_samples
],
(
short
*
)
&
common_vars
->
rxdata
[
aa
][
0
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
if
((
rx_offset
&
7
)
!=
0
)
{
// if input to dft is not 256-bit aligned, issue for size 6,15 and 25 PRBs
memcpy
((
void
*
)
tmp_dft_in
,
(
void
*
)
&
common_vars
->
rxdata
[
aa
][
rx_offset
%
frame_length_samples
],
LOG_D
(
PHY
,
"slot_fep: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d
\n
"
,
Ns
,
symbol
,
nb_prefix_samples
,
nb_prefix_samples0
,
slot_offset
,
sample_offset
,
rx_offset
,
frame_length_samples
);
if
(
rx_offset
>
(
frame_length_samples
-
frame_parms
->
ofdm_symbol_size
))
{
if
(
rx_offset
+
frame_parms
->
ofdm_symbol_size
>
frame_parms
->
samples_per_subframe
*
10
+
2048
)
LOG_E
(
PHY
,
"rx_offset get out of buffer
\n
"
);
else
LOG_W
(
PHY
,
"DFT on a buffer outside regular space, code looks wrong
\n
"
);
memcpy
((
short
*
)
&
common_vars
->
rxdataTime
[
aa
][
frame_length_samples
],
(
short
*
)
&
common_vars
->
rxdataTime
[
aa
][
0
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
dft
((
int16_t
*
)
tmp_dft_in
,
(
int16_t
*
)
&
common_vars
->
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
}
else
{
// use dft input from RX buffer directly
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
rx_dft_stats
);
#endif
dft
((
int16_t
*
)
&
common_vars
->
rxdata
[
aa
][(
rx_offset
)
%
frame_length_samples
],
(
int16_t
*
)
&
common_vars
->
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
rx_dft_stats
);
#endif
}
}
else
{
rx_offset
+=
(
frame_parms
->
ofdm_symbol_size
+
nb_prefix_samples
)
*
l
;
// +
// (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1);
if
(
rx_offset
>
(
frame_length_samples
-
frame_parms
->
ofdm_symbol_size
))
memcpy
((
void
*
)
&
common_vars
->
rxdata
[
aa
][
frame_length_samples
],
(
void
*
)
&
common_vars
->
rxdata
[
aa
][
0
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
rx_dft_stats
);
#endif
if
((
rx_offset
&
7
)
!=
0
)
{
// if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
if
((
rx_offset
&
7
)
!=
0
)
{
// if input to dft is not 256-bit aligned, issue for size 6,15 and 25 PRBs
LOG_D
(
PHY
,
"dft on unaligned buffer: %d offset
\n
"
,
rx_offset
);
int
tmp_dft_in
[
8192
]
__attribute__
((
aligned
(
32
)));
memcpy
((
void
*
)
tmp_dft_in
,
(
void
*
)
&
common_vars
->
rxdata
[
aa
][(
rx_offset
)
%
frame_length_samples
],
(
void
*
)
&
common_vars
->
rxdataTime
[
aa
][
rx_offset
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
UE_meas
(
ue
->
rx_dft_stats
,
dft
((
int16_t
*
)
tmp_dft_in
,
(
int16_t
*
)
&
common_vars
->
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
(
int16_t
*
)
&
rxdf
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
)
);
}
else
{
// use dft input from RX buffer directly
dft
((
int16_t
*
)
&
common_vars
->
rxdata
[
aa
][(
rx_offset
)
%
frame_length_samples
],
(
int16_t
*
)
&
common_vars
->
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
}
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
rx_dft_stats
);
#endif
UE_meas
(
ue
->
rx_dft_stats
,
dft
((
int16_t
*
)
&
common_vars
->
rxdataTime
[
aa
][
rx_offset
],
(
int16_t
*
)
&
rxdf
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
));
}
#ifdef DEBUG_FEP
// if (ue->frame <100)
printf
(
"slot_fep: frame %d: symbol %d rx_offset %d
\n
"
,
ue
->
proc
.
proc_rxtx
[(
Ns
)
&
1
].
frame_rx
,
symbol
,
rx_offset
);
#endif
DEBUG_FEP
(
"slot_fep: frame %d: symbol %d rx_offset %d
\n
"
,
ue
->
proc
.
proc_rxtx
[(
Ns
)
&
1
].
frame_rx
,
symbol
,
rx_offset
);
}
if
(
ue
->
perfect_ce
==
0
)
{
switch
(
channel
){
switch
(
channel
)
{
case
NR_PBCH_EST
:
break
;
case
NR_PDCCH_EST
:
#ifdef DEBUG_FEP
printf
(
"PDCCH Channel estimation aatx %d, slot %d, symbol %d start_sc %d
\n
"
,
aa
,
Ns
,
l
,
coreset_start_subcarrier
);
#endif
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
#endif
nr_pdcch_channel_estimation
(
ue
,
0
,
DEBUG_FEP
(
"PDCCH Channel estimation eNB %d, aatx %d, slot %d, symbol %d start_sc %d
\n
"
,
eNB_id
,
aa
,
Ns
,
l
,
coreset_start_subcarrier
);
UE_meas
(
ue
->
dlsch_channel_estimation_stats
,
nr_pdcch_channel_estimation
(
ue
,
eNB_id
,
Ns
,
l
,
symbol
,
coreset_start_subcarrier
,
nb_rb_coreset
);
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
#endif
nb_rb_coreset
));
break
;
case
NR_PDSCH_EST
:
#ifdef DEBUG_FEP
printf
(
"Channel estimation aatx %d, slot %d, symbol %d
\n
"
,
aa
,
Ns
,
l
);
#endif
#if UE_TIMING_TRACE
start_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
#endif
ue
->
frame_parms
.
nushift
=
(
p
>>
1
)
&
1
;;
DEBUG_FEP
(
"Channel estimation eNB %d, aatx %d, slot %d, symbol %d
\n
"
,
eNB_id
,
aa
,
Ns
,
l
);
ue
->
frame_parms
.
nushift
=
(
p
>>
1
)
&
1
;
if
(
symbol
==
l0
)
nr_pdsch_channel_estimation
(
ue
,
0
,
UE_meas
(
ue
->
dlsch_channel_estimation_stats
,
nr_pdsch_channel_estimation
(
ue
,
eNB_id
,
Ns
,
p
,
l
,
symbol
,
bwp_start_subcarrier
,
nb_rb_pdsch
);
#if UE_TIMING_TRACE
stop_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
#endif
nb_rb_pdsch
));
break
;
...
...
@@ -265,12 +171,9 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
return
(
-
1
);
break
;
}
}
#ifdef DEBUG_FEP
printf
(
"slot_fep: done
\n
"
);
#endif
DEBUG_FEP
(
"slot_fep: done
\n
"
);
return
(
0
);
}
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
View file @
65c427b1
...
...
@@ -413,7 +413,6 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
int
nr_pdcch_channel_estimation
(
PHY_VARS_NR_UE
*
ue
,
uint8_t
eNB_offset
,
unsigned
char
Ns
,
unsigned
char
l
,
unsigned
char
symbol
,
unsigned
short
coreset_start_subcarrier
,
unsigned
short
nb_rb_coreset
)
...
...
@@ -616,14 +615,14 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
break
;
}
if
(
(
Ns
==
1
)
&&
(
l
==
0
))
if
(
(
Ns
==
1
)
&&
(
symbo
l
==
0
))
{
// do ifft of channel estimate
for
(
aarx
=
0
;
aarx
<
ue
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
for
(
p
=
0
;
p
<
ue
->
frame_parms
.
nb_antenna_ports_eNB
;
p
++
)
{
if
(
ue
->
common_vars
.
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
dl_ch_estimates
[
eNB_offset
][(
p
<<
1
)
+
aarx
])
{
LOG_D
(
PHY
,
"Channel Impulse Computation Slot %d ThreadId %d Symbol %d
\n
"
,
Ns
,
ue
->
current_thread_id
[
Ns
],
l
);
LOG_D
(
PHY
,
"Channel Impulse Computation Slot %d ThreadId %d Symbol %d
\n
"
,
Ns
,
ue
->
current_thread_id
[
Ns
],
symbo
l
);
idft
((
int16_t
*
)
&
ue
->
common_vars
.
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
dl_ch_estimates
[
eNB_offset
][(
p
<<
1
)
+
aarx
][
0
],
(
int16_t
*
)
ue
->
common_vars
.
common_vars_rx_data_per_thread
[
ue
->
current_thread_id
[
Ns
]].
dl_ch_estimates_time
[
eNB_offset
][(
p
<<
1
)
+
aarx
],
1
);
}
...
...
@@ -637,7 +636,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t
eNB_offset
,
unsigned
char
Ns
,
unsigned
short
p
,
unsigned
char
l
,
unsigned
char
symbol
,
unsigned
short
bwp_start_subcarrier
,
unsigned
short
nb_rb_pdsch
)
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
View file @
65c427b1
...
...
@@ -45,7 +45,6 @@
int
nr_pdcch_channel_estimation
(
PHY_VARS_NR_UE
*
ue
,
uint8_t
eNB_offset
,
unsigned
char
Ns
,
unsigned
char
l
,
unsigned
char
symbol
,
unsigned
short
coreset_start_subcarrier
,
unsigned
short
nb_rb_coreset
);
...
...
@@ -69,7 +68,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t
eNB_offset
,
unsigned
char
Ns
,
unsigned
short
p
,
unsigned
char
l
,
unsigned
char
symbol
,
unsigned
short
bwp_start_subcarrier
,
unsigned
short
nb_rb_pdsch
);
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
View file @
65c427b1
...
...
@@ -253,7 +253,7 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
ue
->
ssb_offset
=
sync_pos
+
(
fp
->
samples_per_subframe
*
10
)
-
fp
->
nb_prefix_samples
;
//write_output("rxdata1.m","rxd1",ue->common_vars.rxdata[0],10*fp->samples_per_subframe,1,1);
//write_output("rxdata1.m","rxd1",ue->common_vars.rxdata
Time
[0],10*fp->samples_per_subframe,1,1);
#ifdef DEBUG_INITIAL_SYNCH
LOG_I
(
PHY
,
"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d
\n
"
,
ue
->
Mod_id
,
sync_pos
,
ue
->
common_vars
.
eNb_id
);
...
...
@@ -270,10 +270,10 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
for
(
int
n
=
start
;
n
<
end
;
n
++
){
for
(
int
ar
=
0
;
ar
<
fp
->
nb_antennas_rx
;
ar
++
)
{
re
=
((
double
)(((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
]))[
2
*
n
]);
im
=
((
double
)(((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
]))[
2
*
n
+
1
]);
((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
])[
2
*
n
]
=
(
short
)(
round
(
re
*
cos
(
n
*
off_angle
)
-
im
*
sin
(
n
*
off_angle
)));
((
short
*
)
ue
->
common_vars
.
rxdata
[
ar
])[
2
*
n
+
1
]
=
(
short
)(
round
(
re
*
sin
(
n
*
off_angle
)
+
im
*
cos
(
n
*
off_angle
)));
re
=
((
double
)(((
short
*
)
ue
->
common_vars
.
rxdata
Time
[
ar
]))[
2
*
n
]);
im
=
((
double
)(((
short
*
)
ue
->
common_vars
.
rxdata
Time
[
ar
]))[
2
*
n
+
1
]);
((
short
*
)
ue
->
common_vars
.
rxdata
Time
[
ar
])[
2
*
n
]
=
(
short
)(
round
(
re
*
cos
(
n
*
off_angle
)
-
im
*
sin
(
n
*
off_angle
)));
((
short
*
)
ue
->
common_vars
.
rxdata
Time
[
ar
])[
2
*
n
+
1
]
=
(
short
)(
round
(
re
*
sin
(
n
*
off_angle
)
+
im
*
cos
(
n
*
off_angle
)));
}
}
}
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
View file @
65c427b1
...
...
@@ -421,7 +421,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
int
max_h
=
0
;
int
symbol
;
//uint8_t pbch_a[64];
uint8_t
*
pbch_a
=
malloc
(
sizeof
(
uint8_t
)
*
32
);
uint8_t
*
pbch_a
=
calloc
(
NR_POLAR_PBCH_PAYLOAD_BITS
,
sizeof
(
*
pbch_a
)
);
//uint32_t pbch_a_prime;
int16_t
*
pbch_e_rx
;
uint8_t
*
decoded_output
=
nr_ue_pbch_vars
->
decoded_output
;
...
...
@@ -434,12 +434,11 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
//uint8_t decoderListSize = 8, pathMetricAppr = 0;
//time_stats_t polar_decoder_init,polar_rate_matching,decoding,bit_extraction,deinterleaving;
//time_stats_t path_metric,sorting,update_LLR;
memset
(
&
pbch_a
[
0
],
0
,
sizeof
(
uint8_t
)
*
NR_POLAR_PBCH_PAYLOAD_BITS
);
//printf("nr_pbch_ue nid_cell %d\n",frame_parms->Nid_cell);
pbch_e_rx
=
&
nr_ue_pbch_vars
->
llr
[
0
]
;
pbch_e_rx
=
nr_ue_pbch_vars
->
llr
;
// clear LLR buffer
memset
(
nr_ue_pbch_vars
->
llr
,
0
,
NR_POLAR_PBCH_E
);
memset
(
nr_ue_pbch_vars
->
llr
,
0
,
NR_POLAR_PBCH_E
*
sizeof
(
*
nr_ue_pbch_vars
->
llr
)
);
int
symbol_offset
=
1
;
if
(
ue
->
is_synchronized
>
0
)
...
...
@@ -500,12 +499,12 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
*/
if
(
symbol
==
1
)
{
nr_pbch_quantize
(
pbch_e_rx
,
(
short
*
)
&
(
nr_ue_pbch_vars
->
rxdataF_
comp
[
0
][
symbol
*
240
]),
(
short
*
)
&
(
nr_ue_pbch_vars
->
rxdataF_
ext
[
0
][
symbol
*
240
]),
144
);
pbch_e_rx
+=
144
;
}
else
{
nr_pbch_quantize
(
pbch_e_rx
,
(
short
*
)
&
(
nr_ue_pbch_vars
->
rxdataF_
comp
[
0
][
symbol
*
240
]),
(
short
*
)
&
(
nr_ue_pbch_vars
->
rxdataF_
ext
[
0
][
symbol
*
240
]),
360
);
pbch_e_rx
+=
360
;
}
...
...
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
View file @
65c427b1
...
...
@@ -626,11 +626,11 @@ void decimation_synchro_nr(PHY_VARS_NR_UE *PHY_vars_UE, int rate_change, int **r
/* build with cic filter does not work properly. Performances are significantly deteriorated */
#ifdef CIC_DECIMATOR
cic_decimator
((
int16_t
*
)
&
(
PHY_vars_UE
->
common_vars
.
rxdata
[
0
][
0
]),
(
int16_t
*
)
&
(
rxdata
[
0
][
0
]),
cic_decimator
((
int16_t
*
)
&
(
PHY_vars_UE
->
common_vars
.
rxdata
Time
[
0
][
0
]),
(
int16_t
*
)
&
(
rxdata
[
0
][
0
]),
samples_for_frame
,
rate_change
,
CIC_FILTER_STAGE_NUMBER
,
0
,
FIR_RATE_CHANGE
);
#else
fir_decimator
((
int16_t
*
)
&
(
PHY_vars_UE
->
common_vars
.
rxdata
[
0
][
0
]),
(
int16_t
*
)
&
(
rxdata
[
0
][
0
]),
fir_decimator
((
int16_t
*
)
&
(
PHY_vars_UE
->
common_vars
.
rxdata
Time
[
0
][
0
]),
(
int16_t
*
)
&
(
rxdata
[
0
][
0
]),
samples_for_frame
,
rate_change
,
0
);
#endif
...
...
@@ -669,7 +669,7 @@ int pss_synchro_nr(PHY_VARS_NR_UE *PHY_vars_UE, int rate_change)
int
samples_for_frame
=
frame_parms
->
samples_per_subframe
*
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
LOG_M
(
"rxdata0_rand.m"
,
"rxd0_rand"
,
&
PHY_vars_UE
->
common_vars
.
rxdata
[
0
][
0
],
samples_for_frame
,
1
,
1
);
LOG_M
(
"rxdata0_rand.m"
,
"rxd0_rand"
,
&
PHY_vars_UE
->
common_vars
.
rxdata
Time
[
0
][
0
],
samples_for_frame
,
1
,
1
);
#endif
...
...
@@ -688,7 +688,7 @@ int pss_synchro_nr(PHY_VARS_NR_UE *PHY_vars_UE, int rate_change)
}
else
{
rxdata
=
PHY_vars_UE
->
common_vars
.
rxdata
;
rxdata
=
PHY_vars_UE
->
common_vars
.
rxdata
Time
;
}
#ifdef DBG_PSS_NR
...
...
openair1/PHY/TOOLS/nr_phy_scope.c
View file @
65c427b1
...
...
@@ -582,7 +582,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
llr_pdcch
=
(
float
*
)
calloc
(
12
*
frame_parms
->
N_RB_DL
*
num_pdcch_symbols
*
2
,
sizeof
(
float
));
// init to zero
bit_pdcch
=
(
float
*
)
calloc
(
12
*
frame_parms
->
N_RB_DL
*
num_pdcch_symbols
*
2
,
sizeof
(
float
));
rxsig_t
=
(
int16_t
**
)
phy_vars_ue
->
common_vars
.
rxdata
;
rxsig_t
=
(
int16_t
**
)
phy_vars_ue
->
common_vars
.
rxdata
Time
;
rxsig_t_dB
=
calloc
(
nb_antennas_rx
,
sizeof
(
float
*
));
for
(
arx
=
0
;
arx
<
nb_antennas_rx
;
arx
++
)
{
rxsig_t_dB
[
arx
]
=
(
float
*
)
calloc
(
samples_per_frame
,
sizeof
(
float
));
...
...
openair1/PHY/TOOLS/time_meas.h
View file @
65c427b1
...
...
@@ -147,4 +147,15 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts)
dst_ts
->
max
=
src_ts
->
max
;
}
}
#if UE_TIMING_TRACE
#define UE_meas(meaS, funC) \
start_meas(&meaS);\
funC;\
stop_meas(&meaS);
#else
#define UE_meas(meaS, funC) \
funC;
#endif
#endif
openair1/PHY/defs_nr_UE.h
View file @
65c427b1
...
...
@@ -407,7 +407,7 @@ typedef struct {
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
/// - first index: rx antenna [0..nb_antennas_rx[
/// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES+2048[
int32_t
**
rxdata
;
int32_t
**
rxdata
Time
;
NR_UE_COMMON_PER_THREAD
common_vars_rx_data_per_thread
[
RX_NB_TH_MAX
];
...
...
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