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
spbro
OpenXG-RAN
Commits
9a2e080f
Commit
9a2e080f
authored
Apr 13, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply clang-format
parent
94b23d1e
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
1111 additions
and
1165 deletions
+1111
-1165
openair1/PHY/CODING/nrPolar_tools/nr_polar_psbch_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_psbch_defs.h
+3
-3
openair1/PHY/CODING/nr_polar_init.c
openair1/PHY/CODING/nr_polar_init.c
+6
-3
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+5
-8
openair1/PHY/INIT/nr_parms.c
openair1/PHY/INIT/nr_parms.c
+3
-4
openair1/PHY/MODULATION/modulation_UE.h
openair1/PHY/MODULATION/modulation_UE.h
+5
-5
openair1/PHY/MODULATION/slot_fep_nr.c
openair1/PHY/MODULATION/slot_fep_nr.c
+49
-53
openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
+11
-16
openair1/PHY/NR_REFSIG/nr_gold_ue.c
openair1/PHY/NR_REFSIG/nr_gold_ue.c
+16
-18
openair1/PHY/NR_REFSIG/refsig_defs_ue.h
openair1/PHY/NR_REFSIG/refsig_defs_ue.h
+2
-7
openair1/PHY/NR_REFSIG/sss_nr.h
openair1/PHY/NR_REFSIG/sss_nr.h
+16
-5
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+67
-79
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+1
-1
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+21
-27
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c
+212
-189
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+11
-12
openair1/PHY/NR_UE_TRANSPORT/nr_psbch_rx.c
openair1/PHY/NR_UE_TRANSPORT/nr_psbch_rx.c
+94
-90
openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c
openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c
+144
-134
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+8
-10
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
+23
-33
openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
+11
-14
openair1/PHY/TOOLS/tools_defs.h
openair1/PHY/TOOLS/tools_defs.h
+3
-5
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+3
-3
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+1
-1
openair1/PHY/defs_nr_sl_UE.h
openair1/PHY/defs_nr_sl_UE.h
+15
-29
openair1/SCHED_NR_UE/defs.h
openair1/SCHED_NR_UE/defs.h
+2
-7
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+7
-22
openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c
+112
-131
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+32
-25
openair1/SIMULATION/NR_PHY/psbchsim.c
openair1/SIMULATION/NR_PHY/psbchsim.c
+228
-231
No files found.
openair1/PHY/CODING/nrPolar_tools/nr_polar_psbch_defs.h
View file @
9a2e080f
...
...
@@ -33,11 +33,11 @@
#ifndef __NR_POLAR_PSBCH_DEFS__H__
#define __NR_POLAR_PSBCH_DEFS__H__
//PSBCH related polar parameters.
//
PSBCH related polar parameters.
//PSBCH symbols sent in 11RBS, 9 symbols. 11*9*(12-3(for DMRS))*2bits = 1782 bits
//
PSBCH symbols sent in 11RBS, 9 symbols. 11*9*(12-3(for DMRS))*2bits = 1782 bits
#define SL_NR_POLAR_PSBCH_E_NORMAL_CP 1782
//PSBCH symbols sent in 11RBS, 7 symbols. 11*7*(12-3(for DMRS))*2bits = 1386 bits
//
PSBCH symbols sent in 11RBS, 7 symbols. 11*7*(12-3(for DMRS))*2bits = 1386 bits
#define SL_NR_POLAR_PSBCH_E_EXT_CP 1386
// SL_NR_POLAR_PSBCH_E_NORMAL_CP/32
#define SL_NR_POLAR_PSBCH_E_DWORD 56
...
...
openair1/PHY/CODING/nr_polar_init.c
View file @
9a2e080f
...
...
@@ -192,7 +192,7 @@ t_nrPolar_params *nr_polar_params(int8_t messageType, uint16_t messageLength, ui
newPolarInitNode
->
payloadBits
=
messageLength
;
newPolarInitNode
->
crcCorrectionBits
=
NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS
;
//LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level);
}
else
if
(
messageType
==
SL_NR_POLAR_PSBCH_MESSAGE_TYPE
)
{
//PSBCH
}
else
if
(
messageType
==
SL_NR_POLAR_PSBCH_MESSAGE_TYPE
)
{
//
PSBCH
newPolarInitNode
->
n_max
=
SL_NR_POLAR_PSBCH_N_MAX
;
newPolarInitNode
->
i_il
=
SL_NR_POLAR_PSBCH_I_IL
;
newPolarInitNode
->
i_seg
=
SL_NR_POLAR_PSBCH_I_SEG
;
...
...
@@ -203,8 +203,11 @@ t_nrPolar_params *nr_polar_params(int8_t messageType, uint16_t messageLength, ui
newPolarInitNode
->
payloadBits
=
SL_NR_POLAR_PSBCH_PAYLOAD_BITS
;
newPolarInitNode
->
encoderLength
=
SL_NR_POLAR_PSBCH_E_NORMAL_CP
+
2
;
newPolarInitNode
->
crcCorrectionBits
=
SL_NR_POLAR_PSBCH_CRC_ERROR_CORRECTION_BITS
;
newPolarInitNode
->
crc_generator_matrix
=
crc24c_generator_matrix
(
newPolarInitNode
->
payloadBits
);
//G_P
LOG_D
(
PHY
,
"SIDELINK: Initializing polar parameters for PSBCH (K %d, E %d)
\n
"
,
newPolarInitNode
->
payloadBits
,
newPolarInitNode
->
encoderLength
);
newPolarInitNode
->
crc_generator_matrix
=
crc24c_generator_matrix
(
newPolarInitNode
->
payloadBits
);
// G_P
LOG_D
(
PHY
,
"SIDELINK: Initializing polar parameters for PSBCH (K %d, E %d)
\n
"
,
newPolarInitNode
->
payloadBits
,
newPolarInitNode
->
encoderLength
);
}
else
{
AssertFatal
(
1
==
0
,
"[nr_polar_init] Incorrect Message Type(%d)"
,
messageType
);
}
...
...
openair1/PHY/INIT/nr_init_ue.c
View file @
9a2e080f
...
...
@@ -385,7 +385,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
static
void
sl_ue_free
(
PHY_VARS_NR_UE
*
UE
)
{
if
(
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
)
{
free_and_zero
(
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
[
0
]);
free_and_zero
(
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
[
1
]);
...
...
@@ -716,21 +715,20 @@ void phy_term_nr_top(void)
void
sl_ue_phy_init
(
PHY_VARS_NR_UE
*
UE
)
{
uint16_t
scaling_value
=
ONE_OVER_SQRT2_Q15
;
NR_DL_FRAME_PARMS
*
sl_fp
=
&
UE
->
SL_UE_PHY_PARAMS
.
sl_frame_params
;
if
(
!
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
)
{
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
=
(
int32_t
**
)
malloc16_clear
(
SL_NR_NUM_IDs_IN_PSS
*
sizeof
(
int32_t
*
)
);
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
[
0
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
sl_fp
->
ofdm_symbol_size
);
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
[
1
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
sl_fp
->
ofdm_symbol_size
);
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
=
malloc16_clear
(
SL_NR_NUM_IDs_IN_PSS
*
sizeof
(
int32_t
*
)
);
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
[
0
]
=
malloc16_clear
(
sizeof
(
int32_t
)
*
sl_fp
->
ofdm_symbol_size
);
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
sl_pss_for_correlation
[
1
]
=
malloc16_clear
(
sizeof
(
int32_t
)
*
sl_fp
->
ofdm_symbol_size
);
}
LOG_I
(
PHY
,
"SIDELINK INIT: GENERATE PSS, SSS, GOLD SEQUENCES AND PSBCH DMRS SEQUENCES FOR ALL possible SLSS IDs 0- 671
\n
"
);
// Generate PSS sequences for IDs 0,1 used in PSS
sl_generate_pss
(
&
UE
->
SL_UE_PHY_PARAMS
.
init_params
,
0
,
scaling_value
);
sl_generate_pss
(
&
UE
->
SL_UE_PHY_PARAMS
.
init_params
,
1
,
scaling_value
);
sl_generate_pss
(
&
UE
->
SL_UE_PHY_PARAMS
.
init_params
,
0
,
scaling_value
);
sl_generate_pss
(
&
UE
->
SL_UE_PHY_PARAMS
.
init_params
,
1
,
scaling_value
);
// Generate psbch dmrs Gold Sequences and modulated dmrs symbols
sl_init_psbch_dmrs_gold_sequences
(
UE
);
...
...
@@ -745,4 +743,3 @@ void sl_ue_phy_init(PHY_VARS_NR_UE *UE)
init_symbol_rotation
(
sl_fp
);
init_timeshift_rotation
(
sl_fp
);
}
openair1/PHY/INIT/nr_parms.c
View file @
9a2e080f
...
...
@@ -425,8 +425,7 @@ void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp)
LOG_I
(
PHY
,
"fp->samples_per_frame=%d
\n
"
,
fp
->
samples_per_frame
);
LOG_I
(
PHY
,
"fp->dl_CarrierFreq=%lu
\n
"
,
fp
->
dl_CarrierFreq
);
LOG_I
(
PHY
,
"fp->ul_CarrierFreq=%lu
\n
"
,
fp
->
ul_CarrierFreq
);
LOG_I
(
PHY
,
"fp->Nid_cell=%d
\n
"
,
fp
->
Nid_cell
);
LOG_I
(
PHY
,
"fp->first_carrier_offset=%d
\n
"
,
fp
->
first_carrier_offset
);
LOG_I
(
PHY
,
"fp->ssb_start_subcarrier=%d
\n
"
,
fp
->
ssb_start_subcarrier
);
LOG_I
(
PHY
,
"fp->Nid_cell=%d
\n
"
,
fp
->
Nid_cell
);
LOG_I
(
PHY
,
"fp->first_carrier_offset=%d
\n
"
,
fp
->
first_carrier_offset
);
LOG_I
(
PHY
,
"fp->ssb_start_subcarrier=%d
\n
"
,
fp
->
ssb_start_subcarrier
);
}
openair1/PHY/MODULATION/modulation_UE.h
View file @
9a2e080f
...
...
@@ -55,11 +55,11 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
c16_t
rxdataF
[][
frame_parms
->
samples_per_slot_wCP
],
uint32_t
linktype
);
int
sl_nr_slot_fep
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
unsigned
char
symbol
,
unsigned
char
Ns
,
uint32_t
sample_offset
,
c16_t
rxdataF
[][
ue
->
SL_UE_PHY_PARAMS
.
sl_frame_params
.
samples_per_slot_wCP
]);
UE_nr_rxtx_proc_t
*
proc
,
unsigned
char
symbol
,
unsigned
char
Ns
,
uint32_t
sample_offset
,
c16_t
rxdataF
[][
ue
->
SL_UE_PHY_PARAMS
.
sl_frame_params
.
samples_per_slot_wCP
]);
int
nr_slot_fep_init_sync
(
PHY_VARS_NR_UE
*
ue
,
const
UE_nr_rxtx_proc_t
*
proc
,
...
...
openair1/PHY/MODULATION/slot_fep_nr.c
View file @
9a2e080f
...
...
@@ -35,33 +35,34 @@
#endif*/
int
sl_nr_slot_fep
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
unsigned
char
symbol
,
unsigned
char
Ns
,
uint32_t
sample_offset
,
c16_t
rxdataF
[][
ue
->
SL_UE_PHY_PARAMS
.
sl_frame_params
.
samples_per_slot_wCP
])
UE_nr_rxtx_proc_t
*
proc
,
unsigned
char
symbol
,
unsigned
char
Ns
,
uint32_t
sample_offset
,
c16_t
rxdataF
[][
ue
->
SL_UE_PHY_PARAMS
.
sl_frame_params
.
samples_per_slot_wCP
])
{
NR_DL_FRAME_PARMS
*
frame_params
=
&
ue
->
SL_UE_PHY_PARAMS
.
sl_frame_params
;
NR_UE_COMMON
*
common_vars
=
&
ue
->
common_vars
;
NR_UE_COMMON
*
common_vars
=
&
ue
->
common_vars
;
AssertFatal
(
symbol
<
frame_params
->
symbols_per_slot
,
"slot_fep: symbol must be between 0 and %d
\n
"
,
frame_params
->
symbols_per_slot
-
1
);
AssertFatal
(
Ns
<
frame_params
->
slots_per_frame
,
"slot_fep: Ns must be between 0 and %d
\n
"
,
frame_params
->
slots_per_frame
-
1
);
AssertFatal
(
symbol
<
frame_params
->
symbols_per_slot
,
"slot_fep: symbol must be between 0 and %d
\n
"
,
frame_params
->
symbols_per_slot
-
1
);
AssertFatal
(
Ns
<
frame_params
->
slots_per_frame
,
"slot_fep: Ns must be between 0 and %d
\n
"
,
frame_params
->
slots_per_frame
-
1
);
unsigned
int
nb_prefix_samples
=
frame_params
->
nb_prefix_samples
;
unsigned
int
nb_prefix_samples
=
frame_params
->
nb_prefix_samples
;
unsigned
int
nb_prefix_samples0
=
frame_params
->
nb_prefix_samples0
;
dft_size_idx_t
dftsize
=
get_dft
(
frame_params
->
ofdm_symbol_size
);
// This is for misalignment issues
int32_t
tmp_dft_in
[
8192
]
__attribute__
((
aligned
(
32
)));
int32_t
tmp_dft_in
[
8192
]
__attribute__
((
aligned
(
32
)));
unsigned
int
rx_offset
=
frame_params
->
get_samples_slot_timestamp
(
Ns
,
frame_params
,
0
);
unsigned
int
rx_offset
=
frame_params
->
get_samples_slot_timestamp
(
Ns
,
frame_params
,
0
);
unsigned
int
abs_symbol
=
Ns
*
frame_params
->
symbols_per_slot
+
symbol
;
rx_offset
+=
sample_offset
;
for
(
int
idx_symb
=
Ns
*
frame_params
->
symbols_per_slot
;
idx_symb
<=
abs_symbol
;
idx_symb
++
)
rx_offset
+=
(
idx_symb
%
(
0x7
<<
frame_params
->
numerology_index
))
?
nb_prefix_samples
:
nb_prefix_samples0
;
for
(
int
idx_symb
=
Ns
*
frame_params
->
symbols_per_slot
;
idx_symb
<=
abs_symbol
;
idx_symb
++
)
rx_offset
+=
(
idx_symb
%
(
0x7
<<
frame_params
->
numerology_index
))
?
nb_prefix_samples
:
nb_prefix_samples0
;
rx_offset
+=
frame_params
->
ofdm_symbol_size
*
symbol
;
// use OFDM symbol from within 1/8th of the CP to avoid ISI
...
...
@@ -69,58 +70,61 @@ int sl_nr_slot_fep(PHY_VARS_NR_UE *ue,
#ifdef SL_DEBUG_SLOT_FEP
// if (ue->frame <100)
LOG_I
(
PHY
,
"slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u
\n
"
,
Ns
,
symbol
,
nb_prefix_samples
,
nb_prefix_samples0
,
rx_offset
);
LOG_I
(
PHY
,
"slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u
\n
"
,
Ns
,
symbol
,
nb_prefix_samples
,
nb_prefix_samples0
,
rx_offset
);
#endif
for
(
unsigned
char
aa
=
0
;
aa
<
frame_params
->
nb_antennas_rx
;
aa
++
)
{
memset
(
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
0
,
frame_params
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
for
(
unsigned
char
aa
=
0
;
aa
<
frame_params
->
nb_antennas_rx
;
aa
++
)
{
memset
(
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
0
,
frame_params
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
int16_t
*
rxdata_ptr
=
(
int16_t
*
)
&
common_vars
->
rxdata
[
aa
][
rx_offset
];
// if input to dft is not 256-bit aligned
if
((
rx_offset
&
7
)
!=
0
)
{
memcpy
((
void
*
)
&
tmp_dft_in
[
0
],
(
void
*
)
&
common_vars
->
rxdata
[
aa
][
rx_offset
],
frame_params
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
memcpy
((
void
*
)
&
tmp_dft_in
[
0
],
(
void
*
)
&
common_vars
->
rxdata
[
aa
][
rx_offset
],
frame_params
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
rxdata_ptr
=
(
int16_t
*
)
tmp_dft_in
;
}
dft
(
dftsize
,
rxdata_ptr
,
(
int16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
1
);
dft
(
dftsize
,
rxdata_ptr
,
(
int16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
1
);
int
symb_offset
=
(
Ns
%
frame_params
->
slots_per_subframe
)
*
frame_params
->
symbols_per_slot
;
int32_t
rot2
=
((
uint32_t
*
)
frame_params
->
symbol_rotation
[
1
])[
symbol
+
symb_offset
];
((
int16_t
*
)
&
rot2
)[
1
]
=-
((
int16_t
*
)
&
rot2
)[
1
];
int
symb_offset
=
(
Ns
%
frame_params
->
slots_per_subframe
)
*
frame_params
->
symbols_per_slot
;
int32_t
rot2
=
((
uint32_t
*
)
frame_params
->
symbol_rotation
[
1
])[
symbol
+
symb_offset
];
((
int16_t
*
)
&
rot2
)[
1
]
=
-
((
int16_t
*
)
&
rot2
)[
1
];
#ifdef SL_DEBUG_SLOT_FEP
// if (ue->frame <100)
LOG_I
(
PHY
,
"slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d
\n
"
,
Ns
,
symbol
,
rx_offset
,
symbol
+
symb_offset
,((
int16_t
*
)
&
rot2
)[
0
],((
int16_t
*
)
&
rot2
)[
1
]);
LOG_I
(
PHY
,
"slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d
\n
"
,
Ns
,
symbol
,
rx_offset
,
symbol
+
symb_offset
,
((
int16_t
*
)
&
rot2
)[
0
],
((
int16_t
*
)
&
rot2
)[
1
]);
#endif
rotate_cpx_vector
((
c16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
(
c16_t
*
)
&
rot2
,
(
c16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
frame_params
->
ofdm_symbol_size
,
15
);
rotate_cpx_vector
((
c16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
(
c16_t
*
)
&
rot2
,
(
c16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
frame_params
->
ofdm_symbol_size
,
15
);
int16_t
*
shift_rot
=
(
int16_t
*
)
frame_params
->
timeshift_symbol_rotation
;
multadd_cpx_vector
((
int16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
shift_rot
,
(
int16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
1
,
frame_params
->
ofdm_symbol_size
,
15
);
multadd_cpx_vector
((
int16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
shift_rot
,
(
int16_t
*
)
&
rxdataF
[
aa
][
frame_params
->
ofdm_symbol_size
*
symbol
],
1
,
frame_params
->
ofdm_symbol_size
,
15
);
}
LOG_D
(
PHY
,
"SIDELINK RX: Slot FEP: done for symbol:%d
\n
"
,
symbol
);
return
0
;
...
...
@@ -133,7 +137,6 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
c16_t
rxdataF
[][
frame_parms
->
samples_per_slot_wCP
],
uint32_t
linktype
)
{
NR_UE_COMMON
*
common_vars
=
&
ue
->
common_vars
;
int
Ns
=
proc
->
nr_slot_rx
;
...
...
@@ -190,14 +193,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
stop_meas
(
&
ue
->
rx_dft_stats
);
apply_nr_rotation_RX
(
frame_parms
,
rxdataF
[
aa
],
frame_parms
->
symbol_rotation
[
linktype
],
Ns
,
frame_parms
->
N_RB_DL
,
0
,
symbol
,
1
);
apply_nr_rotation_RX
(
frame_parms
,
rxdataF
[
aa
],
frame_parms
->
symbol_rotation
[
linktype
],
Ns
,
frame_parms
->
N_RB_DL
,
0
,
symbol
,
1
);
}
#ifdef DEBUG_FEP
...
...
openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
View file @
9a2e080f
...
...
@@ -202,31 +202,26 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
return
(
0
);
}
void
nr_pbch_dmrs_rx
(
int
symbol
,
unsigned
int
*
nr_gold_pbch
,
c16_t
*
output
,
bool
sidelink
)
void
nr_pbch_dmrs_rx
(
int
symbol
,
unsigned
int
*
nr_gold_pbch
,
c16_t
*
output
,
bool
sidelink
)
{
int
m
,
m0
,
m1
;
uint8_t
idx
=
0
;
if
(
sidelink
)
{
AssertFatal
(
symbol
==
0
||
(
symbol
>=
5
&&
symbol
<=
12
),
"illegal symbol %d
\n
"
,
symbol
);
AssertFatal
(
symbol
==
0
||
(
symbol
>=
5
&&
symbol
<=
12
),
"illegal symbol %d
\n
"
,
symbol
);
m0
=
(
symbol
)
?
(
symbol
-
4
)
*
33
:
0
;
m1
=
(
symbol
)
?
(
symbol
-
3
)
*
33
:
33
;
}
else
{
AssertFatal
(
symbol
>=
0
&&
symbol
<
3
,
"illegal symbol %d
\n
"
,
symbol
);
AssertFatal
(
symbol
>=
0
&&
symbol
<
3
,
"illegal symbol %d
\n
"
,
symbol
);
if
(
symbol
==
0
)
{
m0
=
0
;
m1
=
60
;
}
else
if
(
symbol
==
1
)
{
m0
=
60
;
m1
=
84
;
}
else
{
m0
=
84
;
m1
=
144
;
m0
=
0
;
m1
=
60
;
}
else
if
(
symbol
==
1
)
{
m0
=
60
;
m1
=
84
;
}
else
{
m0
=
84
;
m1
=
144
;
}
}
// printf("Generating pilots symbol %d, m0 %d, m1 %d\n",symbol,m0,m1);
...
...
openair1/PHY/NR_REFSIG/nr_gold_ue.c
View file @
9a2e080f
...
...
@@ -157,31 +157,26 @@ void sl_init_psbch_dmrs_gold_sequences(PHY_VARS_NR_UE *UE)
uint8_t
reset
;
for
(
slss_id
=
0
;
slss_id
<
SL_NR_NUM_SLSS_IDs
;
slss_id
++
)
{
reset
=
1
;
x2
=
slss_id
;
#ifdef SL_DEBUG_INIT
printf
(
"
\n
PSBCH DMRS GOLD SEQ for SLSSID :%d :
\n
"
,
slss_id
);
printf
(
"
\n
PSBCH DMRS GOLD SEQ for SLSSID :%d :
\n
"
,
slss_id
);
#endif
for
(
uint8_t
n
=
0
;
n
<
SL_NR_NUM_PSBCH_DMRS_RE_DWORD
;
n
++
)
{
for
(
uint8_t
n
=
0
;
n
<
SL_NR_NUM_PSBCH_DMRS_RE_DWORD
;
n
++
)
{
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
psbch_dmrs_gold_sequences
[
slss_id
][
n
]
=
lte_gold_generic
(
&
x1
,
&
x2
,
reset
);
reset
=
0
;
#ifdef SL_DEBUG_INIT_DATA
printf
(
"%x
\n
"
,
SL_UE_INIT_PARAMS
.
sl_psbch_dmrs_gold_sequences
[
slss_id
][
n
]);
printf
(
"%x
\n
"
,
SL_UE_INIT_PARAMS
.
sl_psbch_dmrs_gold_sequences
[
slss_id
][
n
]);
#endif
}
}
}
void
sl_generate_psbch_dmrs_qpsk_sequences
(
PHY_VARS_NR_UE
*
UE
,
struct
complex16
*
modulated_dmrs_sym
,
uint16_t
slss_id
)
void
sl_generate_psbch_dmrs_qpsk_sequences
(
PHY_VARS_NR_UE
*
UE
,
struct
complex16
*
modulated_dmrs_sym
,
uint16_t
slss_id
)
{
uint8_t
idx
=
0
;
uint32_t
*
sl_dmrs_sequence
=
UE
->
SL_UE_PHY_PARAMS
.
init_params
.
psbch_dmrs_gold_sequences
[
slss_id
];
c16_t
*
mod_table
=
(
c16_t
*
)
nr_qpsk_mod_table
;
...
...
@@ -191,24 +186,27 @@ void sl_generate_psbch_dmrs_qpsk_sequences(PHY_VARS_NR_UE *UE,
#endif
/// QPSK modulation
for
(
int
m
=
0
;
m
<
SL_NR_NUM_PSBCH_DMRS_RE
;
m
++
)
{
idx
=
(((
sl_dmrs_sequence
[(
m
<<
1
)
>>
5
])
>>
((
m
<<
1
)
&
0x1f
))
&
3
);
for
(
int
m
=
0
;
m
<
SL_NR_NUM_PSBCH_DMRS_RE
;
m
++
)
{
idx
=
(((
sl_dmrs_sequence
[(
m
<<
1
)
>>
5
])
>>
((
m
<<
1
)
&
0x1f
))
&
3
);
modulated_dmrs_sym
[
m
].
r
=
mod_table
[
idx
].
r
;
modulated_dmrs_sym
[
m
].
i
=
mod_table
[
idx
].
i
;
#ifdef SL_DEBUG_INIT_DATA
printf
(
"m:%d gold seq: %d b0-b1: %d-%d DMRS Symbols: %d %d
\n
"
,
m
,
sl_dmrs_sequence
[(
m
<<
1
)
>>
5
],
(((
sl_dmrs_sequence
[(
m
<<
1
)
>>
5
])
>>
((
m
<<
1
)
&
0x1f
))
&
1
),
(((
sl_dmrs_sequence
[((
m
<<
1
)
+
1
)
>>
5
])
>>
(((
m
<<
1
)
+
1
)
&
0x1f
))
&
1
),
modulated_dmrs_sym
[
m
].
r
,
modulated_dmrs_sym
[
m
].
i
);
printf
(
"m:%d gold seq: %d b0-b1: %d-%d DMRS Symbols: %d %d
\n
"
,
m
,
sl_dmrs_sequence
[(
m
<<
1
)
>>
5
],
(((
sl_dmrs_sequence
[(
m
<<
1
)
>>
5
])
>>
((
m
<<
1
)
&
0x1f
))
&
1
),
(((
sl_dmrs_sequence
[((
m
<<
1
)
+
1
)
>>
5
])
>>
(((
m
<<
1
)
+
1
)
&
0x1f
))
&
1
),
modulated_dmrs_sym
[
m
].
r
,
modulated_dmrs_sym
[
m
].
i
);
printf
(
"idx:%d, qpsk_table.r:%d, qpsk_table.i:%d
\n
"
,
idx
,
mod_table
[
idx
].
r
,
mod_table
[
idx
].
i
);
#endif
}
#ifdef SL_DUMP_INIT_SAMPLES
char
filename
[
40
],
varname
[
25
];
sprintf
(
filename
,
"sl_psbch_dmrs_slssid_%d.m"
,
slss_id
);
sprintf
(
varname
,
"sl_dmrs_id_%d.m"
,
slss_id
);
LOG_M
(
filename
,
varname
,
(
void
*
)
modulated_dmrs_sym
,
SL_NR_NUM_PSBCH_DMRS_RE
,
1
,
1
);
sprintf
(
filename
,
"sl_psbch_dmrs_slssid_%d.m"
,
slss_id
);
sprintf
(
varname
,
"sl_dmrs_id_%d.m"
,
slss_id
);
LOG_M
(
filename
,
varname
,
(
void
*
)
modulated_dmrs_sym
,
SL_NR_NUM_PSBCH_DMRS_RE
,
1
,
1
);
#endif
}
openair1/PHY/NR_REFSIG/refsig_defs_ue.h
View file @
9a2e080f
...
...
@@ -30,10 +30,7 @@
/*!\brief This function generates the NR Gold sequence (38-211, Sec 5.2.1) for the PBCH DMRS.
@param PHY_VARS_NR_UE* ue structure provides configuration, frame parameters and the pointers to the 32 bits sequence storage tables
*/
void
nr_pbch_dmrs_rx
(
int
dmrss
,
unsigned
int
*
nr_gold_pbch
,
c16_t
*
output
,
bool
sidelink
);
void
nr_pbch_dmrs_rx
(
int
dmrss
,
unsigned
int
*
nr_gold_pbch
,
c16_t
*
output
,
bool
sidelink
);
/*!\brief This function generates the NR Gold sequence (38-211, Sec 5.2.1) for the PDCCH DMRS.
@param PHY_VARS_NR_UE* ue structure provides configuration, frame parameters and the pointers to the 32 bits sequence storage tables
...
...
@@ -73,7 +70,5 @@ void sl_generate_pss(SL_NR_UE_INIT_PARAMS_t *sl_init_params, uint8_t n_sl_id2, u
void
sl_generate_pss_ifft_samples
(
sl_nr_ue_phy_params_t
*
sl_ue_params
,
SL_NR_UE_INIT_PARAMS_t
*
sl_init_params
);
void
sl_generate_sss
(
SL_NR_UE_INIT_PARAMS_t
*
sl_init_params
,
uint16_t
slss_id
,
uint16_t
scaling
);
void
sl_init_psbch_dmrs_gold_sequences
(
PHY_VARS_NR_UE
*
UE
);
void
sl_generate_psbch_dmrs_qpsk_sequences
(
PHY_VARS_NR_UE
*
UE
,
struct
complex16
*
modulated_dmrs_sym
,
uint16_t
slss_id
);
void
sl_generate_psbch_dmrs_qpsk_sequences
(
PHY_VARS_NR_UE
*
UE
,
struct
complex16
*
modulated_dmrs_sym
,
uint16_t
slss_id
);
#endif
openair1/PHY/NR_REFSIG/sss_nr.h
View file @
9a2e080f
...
...
@@ -72,11 +72,22 @@
static
const
c16_t
phase_nr
[
PHASE_HYPOTHESIS_NUMBER
]
=
{
// {pi/3 ---- pi/3, -pi/3 ---- pi/3}
{
16384
,
-
28377
},
{
20173
,
-
25821
},
{
23571
,
-
22762
},
{
26509
,
-
19260
},
{
28932
,
-
15383
},
{
30791
,
-
11207
},
{
32051
,
-
6813
},
{
32687
,
-
2286
},
{
32687
,
2286
},
{
32051
,
6813
},
{
30791
,
11207
},
{
28932
,
15383
},
{
26509
,
19260
},
{
23571
,
22762
},
{
20173
,
25821
},
{
16384
,
28377
}
};
{
16384
,
-
28377
},
{
20173
,
-
25821
},
{
23571
,
-
22762
},
{
26509
,
-
19260
},
{
28932
,
-
15383
},
{
30791
,
-
11207
},
{
32051
,
-
6813
},
{
32687
,
-
2286
},
{
32687
,
2286
},
{
32051
,
6813
},
{
30791
,
11207
},
{
28932
,
15383
},
{
26509
,
19260
},
{
23571
,
22762
},
{
20173
,
25821
},
{
16384
,
28377
}};
void
init_context_sss_nr
(
int
amp
);
void
free_context_sss_nr
(
void
);
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
View file @
9a2e080f
...
...
@@ -717,7 +717,7 @@ c32_t nr_pbch_dmrs_correlation(const PHY_VARS_NR_UE *ue,
}
int
nr_pbch_channel_estimation
(
PHY_VARS_NR_UE
*
ue
,
NR_DL_FRAME_PARMS
*
fp
,
NR_DL_FRAME_PARMS
*
fp
,
int
estimateSz
,
struct
complex16
dl_ch_estimates
[][
estimateSz
],
struct
complex16
dl_ch_estimates_time
[][
fp
->
ofdm_symbol_size
],
...
...
@@ -738,47 +738,42 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
uint32_t
*
gold_seq
=
NULL
;
if
(
sidelink
)
{
AssertFatal
(
dmrss
==
0
||
(
dmrss
>=
5
&&
dmrss
<=
12
),
"symbol %d is illegal for PSBCH DM-RS
\n
"
,
dmrss
);
AssertFatal
(
dmrss
==
0
||
(
dmrss
>=
5
&&
dmrss
<=
12
),
"symbol %d is illegal for PSBCH DM-RS
\n
"
,
dmrss
);
sl_nr_ue_phy_params_t
*
sl_phy_params
=
&
ue
->
SL_UE_PHY_PARAMS
;
LOG_D
(
PHY
,
"PSBCH Channel Estimation SLSSID:%d
\n
"
,
Nid
);
LOG_D
(
PHY
,
"PSBCH Channel Estimation SLSSID:%d
\n
"
,
Nid
);
gold_seq
=
sl_phy_params
->
init_params
.
psbch_dmrs_gold_sequences
[
Nid
];
lastsymbol
=
12
;
num_rbs
=
SL_NR_NUM_PSBCH_RBS_IN_ONE_SYMBOL
;
}
else
{
nushift
=
fp
->
Nid_cell
%
4
;
nushift
=
fp
->
Nid_cell
%
4
;
AssertFatal
(
dmrss
>=
0
&&
dmrss
<
3
,
"symbol %d is illegal for PBCH DM-RS
\n
"
,
dmrss
);
AssertFatal
(
dmrss
>=
0
&&
dmrss
<
3
,
"symbol %d is illegal for PBCH DM-RS
\n
"
,
dmrss
);
gold_seq
=
ue
->
nr_gold_pbch
[
n_hf
][
ssb_index
];
lastsymbol
=
2
;
num_rbs
=
20
;
}
unsigned
int
ssb_offset
=
fp
->
first_carrier_offset
+
fp
->
ssb_start_subcarrier
;
if
(
ssb_offset
>=
fp
->
ofdm_symbol_size
)
ssb_offset
-=
fp
->
ofdm_symbol_size
;
unsigned
int
ssb_offset
=
fp
->
first_carrier_offset
+
fp
->
ssb_start_subcarrier
;
if
(
ssb_offset
>=
fp
->
ofdm_symbol_size
)
ssb_offset
-=
fp
->
ofdm_symbol_size
;
const
int
ch_offset
=
fp
->
ofdm_symbol_size
*
symbol
;
const
int
symbol_offset
=
fp
->
ofdm_symbol_size
*
symbol
;
const
int
ch_offset
=
fp
->
ofdm_symbol_size
*
symbol
;
const
int
symbol_offset
=
fp
->
ofdm_symbol_size
*
symbol
;
const
int
k
=
nushift
;
DEBUG_PBCH
(
"PBCH Channel Estimation : gNB_id %d ch_offset %d, OFDM size %d, Ncp=%d, Ns=%d, k=%d symbol %d
\n
"
,
proc
->
gNB_id
,
ch_offset
,
fp
->
ofdm_symbol_size
,
fp
->
Ncp
,
Ns
,
k
,
symbol
);
proc
->
gNB_id
,
ch_offset
,
fp
->
ofdm_symbol_size
,
fp
->
Ncp
,
Ns
,
k
,
symbol
);
const
c16_t
*
fl
,
*
fm
,
*
fr
;
...
...
@@ -814,59 +809,58 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
}
idft_size_idx_t
idftsizeidx
;
switch
(
fp
->
ofdm_symbol_size
)
{
case
128
:
idftsizeidx
=
IDFT_128
;
break
;
case
256
:
idftsizeidx
=
IDFT_256
;
break
;
case
512
:
idftsizeidx
=
IDFT_512
;
break
;
case
768
:
idftsizeidx
=
IDFT_768
;
break
;
case
128
:
idftsizeidx
=
IDFT_128
;
break
;
case
1024
:
idftsizeidx
=
IDFT_1024
;
break
;
case
1536
:
idftsizeidx
=
IDFT_1536
;
break
;
case
2048
:
idftsizeidx
=
IDFT_2048
;
break
;
case
3072
:
idftsizeidx
=
IDFT_3072
;
break
;
case
4096
:
idftsizeidx
=
IDFT_4096
;
break
;
case
6144
:
idftsizeidx
=
IDFT_6144
;
break
;
default:
printf
(
"unsupported ofdm symbol size
\n
"
);
assert
(
0
);
case
256
:
idftsizeidx
=
IDFT_256
;
break
;
case
512
:
idftsizeidx
=
IDFT_512
;
break
;
case
768
:
idftsizeidx
=
IDFT_768
;
break
;
case
1024
:
idftsizeidx
=
IDFT_1024
;
break
;
case
1536
:
idftsizeidx
=
IDFT_1536
;
break
;
case
2048
:
idftsizeidx
=
IDFT_2048
;
break
;
case
3072
:
idftsizeidx
=
IDFT_3072
;
break
;
case
4096
:
idftsizeidx
=
IDFT_4096
;
break
;
case
6144
:
idftsizeidx
=
IDFT_6144
;
break
;
default:
printf
(
"unsupported ofdm symbol size
\n
"
);
assert
(
0
);
}
// generate pilot
// Note: pilot returned by the following function is already the complex conjugate of the transmitted DMRS
nr_pbch_dmrs_rx
(
dmrss
,
gold_seq
,
&
pilot
[
0
],
sidelink
);
for
(
int
aarx
=
0
;
aarx
<
fp
->
nb_antennas_rx
;
aarx
++
)
{
nr_pbch_dmrs_rx
(
dmrss
,
gold_seq
,
&
pilot
[
0
],
sidelink
);
for
(
int
aarx
=
0
;
aarx
<
fp
->
nb_antennas_rx
;
aarx
++
)
{
int
re_offset
=
ssb_offset
;
c16_t
*
pil
=
pilot
;
c16_t
*
rxF
=
&
rxdataF
[
aarx
][
symbol_offset
+
k
];
...
...
@@ -922,7 +916,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
multaddRealVectorComplexScalar
(
fl
,
ch
,
dl_ch
,
16
);
pil
++
;
re_offset
=
(
re_offset
+
4
)
%
fp
->
ofdm_symbol_size
;
re_offset
=
(
re_offset
+
4
)
%
fp
->
ofdm_symbol_size
;
ch
=
c16mulShift
(
*
pil
,
rxF
[
re_offset
],
15
);
DEBUG_PBCH
(
"pilot %u: rxF= (%d,%d), ch= (%d,%d), pil=(%d,%d)
\n
"
,
pilot_cnt
+
1
,
...
...
@@ -934,7 +928,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
pil
->
i
);
multaddRealVectorComplexScalar
(
fm
,
ch
,
dl_ch
,
16
);
pil
++
;
re_offset
=
(
re_offset
+
4
)
%
fp
->
ofdm_symbol_size
;
re_offset
=
(
re_offset
+
4
)
%
fp
->
ofdm_symbol_size
;
ch
=
c16mulShift
(
*
pil
,
rxF
[
re_offset
],
15
);
DEBUG_PBCH
(
"pilot %u: rxF= (%d,%d), ch= (%d,%d), pil=(%d,%d)
\n
"
,
pilot_cnt
+
2
,
...
...
@@ -950,7 +944,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch
+=
12
;
}
if
(
dmrss
==
lastsymbol
)
// update time statistics for last PBCH symbol
if
(
dmrss
==
lastsymbol
)
// update time statistics for last PBCH symbol
{
// do ifft of channel estimate
LOG_D
(
PHY
,
"Channel Impulse Computation Slot %d Symbol %d ch_offset %d
\n
"
,
Ns
,
symbol
,
ch_offset
);
...
...
@@ -962,13 +956,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
}
if
(
!
sidelink
&&
dmrss
==
lastsymbol
)
UEscopeCopy
(
ue
,
pbchDlChEstimateTime
,
(
void
*
)
dl_ch_estimates_time
,
sizeof
(
c16_t
),
fp
->
nb_antennas_rx
,
fp
->
ofdm_symbol_size
,
0
);
UEscopeCopy
(
ue
,
pbchDlChEstimateTime
,
(
void
*
)
dl_ch_estimates_time
,
sizeof
(
c16_t
),
fp
->
nb_antennas_rx
,
fp
->
ofdm_symbol_size
,
0
);
return
(
0
);
}
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
View file @
9a2e080f
...
...
@@ -65,7 +65,7 @@ c32_t nr_pbch_dmrs_correlation(const PHY_VARS_NR_UE *ue,
const
c16_t
rxdataF
[][
ue
->
frame_parms
.
samples_per_slot_wCP
]);
int
nr_pbch_channel_estimation
(
PHY_VARS_NR_UE
*
ue
,
NR_DL_FRAME_PARMS
*
fp
,
NR_DL_FRAME_PARMS
*
fp
,
int
estimateSz
,
struct
complex16
dl_ch_estimates
[][
estimateSz
],
struct
complex16
dl_ch_estimates_time
[][
fp
->
ofdm_symbol_size
],
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
View file @
9a2e080f
...
...
@@ -310,56 +310,50 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
-
((
int
)
rx_gain
-
(
int
)
rx_gain_offset
));
}
//PSBCH RSRP calculations according to 38.215 section 5.1.22
//
PSBCH RSRP calculations according to 38.215 section 5.1.22
void
nr_sl_psbch_rsrp_measurements
(
sl_nr_ue_phy_params_t
*
sl_phy_params
,
NR_DL_FRAME_PARMS
*
fp
,
c16_t
rxdataF
[][
fp
->
samples_per_slot_wCP
],
bool
use_SSS
)
{
SL_NR_UE_PSBCH_t
*
psbch_rx
=
&
sl_phy_params
->
psbch
;
uint8_t
numsym
=
(
fp
->
Ncp
)
?
SL_NR_NUM_SYMBOLS_SSB_EXT_CP
:
SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP
;
uint8_t
numsym
=
(
fp
->
Ncp
)
?
SL_NR_NUM_SYMBOLS_SSB_EXT_CP
:
SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP
;
uint32_t
re_offset
=
fp
->
first_carrier_offset
+
fp
->
ssb_start_subcarrier
;
uint32_t
rsrp
=
0
,
num_re
=
0
;
LOG_D
(
PHY
,
"PSBCH RSRP MEAS: numsym:%d, re_offset:%d
\n
"
,
numsym
,
re_offset
);
LOG_D
(
PHY
,
"PSBCH RSRP MEAS: numsym:%d, re_offset:%d
\n
"
,
numsym
,
re_offset
);
for
(
int
aarx
=
0
;
aarx
<
fp
->
nb_antennas_rx
;
aarx
++
)
{
// Calculate PSBCH RSRP based from DMRS REs
for
(
uint8_t
symbol
=
0
;
symbol
<
numsym
;)
{
struct
complex16
*
rxF
=
&
rxdataF
[
aarx
][
symbol
*
fp
->
ofdm_symbol_size
];
//Calculate PSBCH RSRP based from DMRS REs
for
(
uint8_t
symbol
=
0
;
symbol
<
numsym
;)
{
struct
complex16
*
rxF
=
&
rxdataF
[
aarx
][
symbol
*
fp
->
ofdm_symbol_size
];
for
(
int
re
=
0
;
re
<
SL_NR_NUM_PSBCH_RE_IN_ONE_SYMBOL
;
re
++
)
{
if
(
re
%
4
==
0
)
{
//DMRS RE
for
(
int
re
=
0
;
re
<
SL_NR_NUM_PSBCH_RE_IN_ONE_SYMBOL
;
re
++
)
{
if
(
re
%
4
==
0
)
{
// DMRS RE
uint16_t
offset
=
(
re_offset
+
re
)
%
fp
->
ofdm_symbol_size
;
rsrp
+=
c16amp2
(
rxF
[
offset
]);
num_re
++
;
}
}
symbol
=
(
symbol
==
0
)
?
5
:
symbol
+
1
;
symbol
=
(
symbol
==
0
)
?
5
:
symbol
+
1
;
}
}
if
(
use_SSS
)
{
//TBD...
//UE can decide between using only PSBCH DMRS or PSBCH DMRS and SSS for PSBCH RSRP computation.
//If needed this can be implemented. Reference Spec 38.215
//
TBD...
//
UE can decide between using only PSBCH DMRS or PSBCH DMRS and SSS for PSBCH RSRP computation.
//
If needed this can be implemented. Reference Spec 38.215
}
psbch_rx
->
rsrp_dB_per_RE
=
10
*
log10
(
rsrp
/
num_re
);
psbch_rx
->
rsrp_dBm_per_RE
=
psbch_rx
->
rsrp_dB_per_RE
+
30
-
10
*
log10
(
pow
(
2
,
30
))
-
((
int
)
openair0_cfg
[
0
].
rx_gain
[
0
]
-
(
int
)
openair0_cfg
[
0
].
rx_gain_offset
[
0
])
-
dB_fixed
(
fp
->
ofdm_symbol_size
);
LOG_I
(
PHY
,
"PSBCH RSRP (DMRS REs): numREs:%d RSRP :%d dB/RE ,RSRP:%d dBm/RE
\n
"
,
num_re
,
psbch_rx
->
rsrp_dB_per_RE
,
psbch_rx
->
rsrp_dBm_per_RE
);
psbch_rx
->
rsrp_dB_per_RE
=
10
*
log10
(
rsrp
/
num_re
);
psbch_rx
->
rsrp_dBm_per_RE
=
psbch_rx
->
rsrp_dB_per_RE
+
30
-
10
*
log10
(
pow
(
2
,
30
))
-
((
int
)
openair0_cfg
[
0
].
rx_gain
[
0
]
-
(
int
)
openair0_cfg
[
0
].
rx_gain_offset
[
0
])
-
dB_fixed
(
fp
->
ofdm_symbol_size
);
LOG_I
(
PHY
,
"PSBCH RSRP (DMRS REs): numREs:%d RSRP :%d dB/RE ,RSRP:%d dBm/RE
\n
"
,
num_re
,
psbch_rx
->
rsrp_dB_per_RE
,
psbch_rx
->
rsrp_dBm_per_RE
);
}
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync_sl.c
View file @
9a2e080f
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
View file @
9a2e080f
...
...
@@ -241,7 +241,7 @@ void nr_pbch_channel_compensation(struct complex16 rxdataF_ext[][PBCH_MAX_RE_PER
simde__m128i
*
rxdataF128
=
(
simde__m128i
*
)
rxdataF_ext
[
aarx
];
simde__m128i
*
rxdataF_comp128
=
(
simde__m128i
*
)
rxdataF_comp
[
aarx
];
for
(
int
re
=
0
;
re
<
nb_re
;
re
+=
4
)
{
for
(
int
re
=
0
;
re
<
nb_re
;
re
+=
4
)
{
*
rxdataF_comp128
++
=
mulByConjugate128
(
rxdataF128
++
,
dl_ch128
++
,
output_shift
);
}
}
...
...
@@ -271,14 +271,14 @@ void nr_pbch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
}
void
nr_pbch_unscrambling
(
int16_t
*
demod_pbch_e
,
uint16_t
Nid
,
uint8_t
nushift
,
uint16_t
M
,
uint16_t
length
,
uint8_t
bitwise
,
uint32_t
unscrambling_mask
,
uint32_t
pbch_a_prime
,
uint32_t
*
pbch_a_interleaved
)
uint16_t
Nid
,
uint8_t
nushift
,
uint16_t
M
,
uint16_t
length
,
uint8_t
bitwise
,
uint32_t
unscrambling_mask
,
uint32_t
pbch_a_prime
,
uint32_t
*
pbch_a_interleaved
)
{
uint8_t
reset
,
offset
;
uint32_t
x1
=
0
,
x2
=
0
,
s
=
0
;
...
...
@@ -332,9 +332,8 @@ void nr_pbch_unscrambling(int16_t *demod_pbch_e,
}
}
void
nr_pbch_quantize
(
int16_t
*
pbch_llr8
,
int16_t
*
pbch_llr
,
uint16_t
len
)
{
void
nr_pbch_quantize
(
int16_t
*
pbch_llr8
,
int16_t
*
pbch_llr
,
uint16_t
len
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
if
(
pbch_llr
[
i
]
>
31
)
pbch_llr8
[
i
]
=
32
;
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_psbch_rx.c
View file @
9a2e080f
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_UE_TRANSPORT/nr_psbch_tx.c
View file @
9a2e080f
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
View file @
9a2e080f
...
...
@@ -428,22 +428,20 @@ int nr_rx_psbch(PHY_VARS_NR_UE *ue,
c16_t
rxdataF
[][
frame_parms
->
samples_per_slot_wCP
],
uint16_t
slss_id
);
void
nr_tx_psbch
(
PHY_VARS_NR_UE
*
UE
,
uint32_t
frame_tx
,
uint32_t
slot_tx
,
sl_nr_tx_config_psbch_pdu_t
*
psbch_vars
,
c16_t
**
txdataF
);
void
nr_tx_psbch
(
PHY_VARS_NR_UE
*
UE
,
uint32_t
frame_tx
,
uint32_t
slot_tx
,
sl_nr_tx_config_psbch_pdu_t
*
psbch_vars
,
c16_t
**
txdataF
);
nr_initial_sync_t
sl_nr_slss_search
(
PHY_VARS_NR_UE
*
UE
,
UE_nr_rxtx_proc_t
*
proc
,
int
num_frames
);
//Reuse already existing PBCH functions
//
Reuse already existing PBCH functions
int
nr_pbch_channel_level
(
struct
complex16
dl_ch_estimates_ext
[][
PBCH_MAX_RE_PER_SYMBOL
],
NR_DL_FRAME_PARMS
*
frame_parms
,
int
nb_re
);
int
nb_re
);
void
nr_pbch_channel_compensation
(
struct
complex16
rxdataF_ext
[][
PBCH_MAX_RE_PER_SYMBOL
],
struct
complex16
dl_ch_estimates_ext
[][
PBCH_MAX_RE_PER_SYMBOL
],
int
nb_re
,
struct
complex16
rxdataF_comp
[][
PBCH_MAX_RE_PER_SYMBOL
],
NR_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
output_shift
);
struct
complex16
dl_ch_estimates_ext
[][
PBCH_MAX_RE_PER_SYMBOL
],
int
nb_re
,
struct
complex16
rxdataF_comp
[][
PBCH_MAX_RE_PER_SYMBOL
],
NR_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
output_shift
);
void
nr_pbch_unscrambling
(
int16_t
*
demod_pbch_e
,
uint16_t
Nid
,
uint8_t
nushift
,
...
...
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
View file @
9a2e080f
...
...
@@ -706,10 +706,9 @@ static int pss_search_time_nr(c16_t **rxdata, PHY_VARS_NR_UE *ue, int fo_flag, i
void
sl_generate_pss
(
SL_NR_UE_INIT_PARAMS_t
*
sl_init_params
,
uint8_t
n_sl_id2
,
uint16_t
scaling
)
{
int
i
=
0
,
m
=
0
;
int16_t
x
[
SL_NR_PSS_SEQUENCE_LENGTH
];
const
int
x_initial
[
7
]
=
{
0
,
1
,
1
,
0
,
1
,
1
,
1
};
const
int
x_initial
[
7
]
=
{
0
,
1
,
1
,
0
,
1
,
1
,
1
};
int16_t
*
sl_pss
=
sl_init_params
->
sl_pss
[
n_sl_id2
];
int16_t
*
sl_pss_for_sync
=
sl_init_params
->
sl_pss_for_sync
[
n_sl_id2
];
...
...
@@ -720,37 +719,32 @@ void sl_generate_pss(SL_NR_UE_INIT_PARAMS_t *sl_init_params, uint8_t n_sl_id2, u
#endif
/// Sequence generation
for
(
i
=
0
;
i
<
7
;
i
++
)
for
(
i
=
0
;
i
<
7
;
i
++
)
x
[
i
]
=
x_initial
[
i
];
for
(
i
=
0
;
i
<
(
SL_NR_PSS_SEQUENCE_LENGTH
-
7
);
i
++
)
{
x
[
i
+
7
]
=
(
x
[
i
+
4
]
+
x
[
i
])
%
2
;
for
(
i
=
0
;
i
<
(
SL_NR_PSS_SEQUENCE_LENGTH
-
7
);
i
++
)
{
x
[
i
+
7
]
=
(
x
[
i
+
4
]
+
x
[
i
])
%
2
;
}
for
(
i
=
0
;
i
<
SL_NR_PSS_SEQUENCE_LENGTH
;
i
++
)
{
m
=
(
i
+
22
+
43
*
n_sl_id2
)
%
SL_NR_PSS_SEQUENCE_LENGTH
;
sl_pss_for_sync
[
i
]
=
(
1
-
2
*
x
[
m
]);
for
(
i
=
0
;
i
<
SL_NR_PSS_SEQUENCE_LENGTH
;
i
++
)
{
m
=
(
i
+
22
+
43
*
n_sl_id2
)
%
SL_NR_PSS_SEQUENCE_LENGTH
;
sl_pss_for_sync
[
i
]
=
(
1
-
2
*
x
[
m
]);
sl_pss
[
i
]
=
sl_pss_for_sync
[
i
]
*
scaling
;
#ifdef SL_DEBUG_INIT_DATA
printf
(
"m:%d, sl_pss[%d]:%d
\n
"
,
m
,
i
,
sl_pss
[
i
]);
printf
(
"m:%d, sl_pss[%d]:%d
\n
"
,
m
,
i
,
sl_pss
[
i
]);
#endif
}
#ifdef SL_DUMP_INIT_SAMPLES
LOG_M
(
"sl_pss_seq.m"
,
"sl_pss"
,
(
void
*
)
sl_pss
,
SL_NR_PSS_SEQUENCE_LENGTH
,
1
,
0
);
LOG_M
(
"sl_pss_seq.m"
,
"sl_pss"
,
(
void
*
)
sl_pss
,
SL_NR_PSS_SEQUENCE_LENGTH
,
1
,
0
);
#endif
}
// This cannot be done at init time as ofdm symbol size, ssb start subcarrier depends on configuration
// done at SLSS read time.
void
sl_generate_pss_ifft_samples
(
sl_nr_ue_phy_params_t
*
sl_ue_params
,
SL_NR_UE_INIT_PARAMS_t
*
sl_init_params
)
{
uint8_t
id2
=
0
;
int16_t
*
sl_pss
=
NULL
;
NR_DL_FRAME_PARMS
*
sl_fp
=
&
sl_ue_params
->
sl_frame_params
;
...
...
@@ -765,9 +759,9 @@ void sl_generate_pss_ifft_samples(sl_nr_ue_phy_params_t *sl_ue_params, SL_NR_UE_
LOG_I
(
PHY
,
"SIDELINK INIT: Generation of PSS time domain samples. scaling_factor:%d
\n
"
,
scaling_factor
);
for
(
id2
=
0
;
id2
<
SL_NR_NUM_IDs_IN_PSS
;
id2
++
)
{
k
=
sl_fp
->
first_carrier_offset
+
sl_fp
->
ssb_start_subcarrier
+
2
;
// PSS in from REs 2-129
if
(
k
>=
sl_fp
->
ofdm_symbol_size
)
k
-=
sl_fp
->
ofdm_symbol_size
;
if
(
k
>=
sl_fp
->
ofdm_symbol_size
)
k
-=
sl_fp
->
ofdm_symbol_size
;
pss_T
=
&
sl_init_params
->
sl_pss_for_correlation
[
id2
][
0
];
sl_pss
=
sl_init_params
->
sl_pss
[
id2
];
...
...
@@ -775,32 +769,28 @@ void sl_generate_pss_ifft_samples(sl_nr_ue_phy_params_t *sl_ue_params, SL_NR_UE_
memset
(
pss_T
,
0
,
sl_fp
->
ofdm_symbol_size
*
sizeof
(
pss_T
[
0
]));
memset
(
pss_F
,
0
,
sl_fp
->
ofdm_symbol_size
*
sizeof
(
c16_t
));
for
(
int
i
=
0
;
i
<
SL_NR_PSS_SEQUENCE_LENGTH
;
i
++
)
{
for
(
int
i
=
0
;
i
<
SL_NR_PSS_SEQUENCE_LENGTH
;
i
++
)
{
pss_F
[
k
].
r
=
(
sl_pss
[
i
]
*
scaling_factor
)
>>
15
;
//pss_F[2*k] = (sl_pss[i]/23170) * 4192;
//pss_F[2*k+1] = 0;
//
pss_F[2*k] = (sl_pss[i]/23170) * 4192;
//
pss_F[2*k+1] = 0;
#ifdef SL_DEBUG_INIT_DATA
printf
(
"id:%d, k:%d, pss_F[%d]:%d, sl_pss[%d]:%d
\n
"
,
id2
,
k
,
2
*
k
,
pss_F
[
2
*
k
],
i
,
sl_pss
[
i
]);
printf
(
"id:%d, k:%d, pss_F[%d]:%d, sl_pss[%d]:%d
\n
"
,
id2
,
k
,
2
*
k
,
pss_F
[
2
*
k
],
i
,
sl_pss
[
i
]);
#endif
k
++
;
if
(
k
==
sl_fp
->
ofdm_symbol_size
)
k
=
0
;
if
(
k
==
sl_fp
->
ofdm_symbol_size
)
k
=
0
;
}
idft
((
int16_t
)
get_idft
(
sl_fp
->
ofdm_symbol_size
),
(
int16_t
*
)
&
pss_F
[
0
],
/* complex input */
(
int16_t
*
)
&
pss_T
[
0
],
/* complex output */
1
);
/* scaling factor */
idft
((
int16_t
)
get_idft
(
sl_fp
->
ofdm_symbol_size
),
(
int16_t
*
)
&
pss_F
[
0
],
/* complex input */
(
int16_t
*
)
&
pss_T
[
0
],
/* complex output */
1
);
/* scaling factor */
}
#ifdef SL_DUMP_PSBCH_TX_SAMPLES
LOG_M
(
"sl_pss_TD_id0.m"
,
"pss_TD_0"
,
(
void
*
)
sl_init_params
->
sl_pss_for_correlation
[
0
],
sl_fp
->
ofdm_symbol_size
,
1
,
1
);
LOG_M
(
"sl_pss_TD_id1.m"
,
"pss_TD_1"
,
(
void
*
)
sl_init_params
->
sl_pss_for_correlation
[
1
],
sl_fp
->
ofdm_symbol_size
,
1
,
1
);
LOG_M
(
"sl_pss_TD_id0.m"
,
"pss_TD_0"
,
(
void
*
)
sl_init_params
->
sl_pss_for_correlation
[
0
],
sl_fp
->
ofdm_symbol_size
,
1
,
1
);
LOG_M
(
"sl_pss_TD_id1.m"
,
"pss_TD_1"
,
(
void
*
)
sl_init_params
->
sl_pss_for_correlation
[
1
],
sl_fp
->
ofdm_symbol_size
,
1
,
1
);
#endif
}
openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
View file @
9a2e080f
...
...
@@ -533,7 +533,6 @@ bool rx_sss_nr(PHY_VARS_NR_UE *ue,
void
sl_generate_sss
(
SL_NR_UE_INIT_PARAMS_t
*
sl_init_params
,
uint16_t
slss_id
,
uint16_t
scaling
)
{
int
i
=
0
;
int
m0
,
m1
;
int
n_sl_id1
,
n_sl_id2
;
...
...
@@ -541,7 +540,7 @@ void sl_generate_sss(SL_NR_UE_INIT_PARAMS_t *sl_init_params, uint16_t slss_id, u
int16_t
*
sl_sss_for_sync
=
sl_init_params
->
sl_sss_for_sync
[
slss_id
];
int16_t
x0
[
SL_NR_SSS_SEQUENCE_LENGTH
],
x1
[
SL_NR_SSS_SEQUENCE_LENGTH
];
const
int
x_initial
[
7
]
=
{
1
,
0
,
0
,
0
,
0
,
0
,
0
};
const
int
x_initial
[
7
]
=
{
1
,
0
,
0
,
0
,
0
,
0
,
0
};
n_sl_id1
=
slss_id
%
336
;
n_sl_id2
=
slss_id
/
336
;
...
...
@@ -552,32 +551,30 @@ void sl_generate_sss(SL_NR_UE_INIT_PARAMS_t *sl_init_params, uint16_t slss_id, u
printf
(
"SIDELINK: SSS Generation with slss_id:%d, N_SL_id1:%d, N_SL_id2:%d
\n
"
,
slss_id
,
n_sl_id1
,
n_sl_id2
);
#endif
for
(
i
=
0
;
i
<
7
;
i
++
)
{
for
(
i
=
0
;
i
<
7
;
i
++
)
{
x0
[
i
]
=
x_initial
[
i
];
x1
[
i
]
=
x_initial
[
i
];
}
for
(
i
=
0
;
i
<
SL_NR_SSS_SEQUENCE_LENGTH
-
7
;
i
++
)
{
x0
[
i
+
7
]
=
(
x0
[
i
+
4
]
+
x0
[
i
])
%
2
;
x1
[
i
+
7
]
=
(
x1
[
i
+
1
]
+
x1
[
i
])
%
2
;
for
(
i
=
0
;
i
<
SL_NR_SSS_SEQUENCE_LENGTH
-
7
;
i
++
)
{
x0
[
i
+
7
]
=
(
x0
[
i
+
4
]
+
x0
[
i
])
%
2
;
x1
[
i
+
7
]
=
(
x1
[
i
+
1
]
+
x1
[
i
])
%
2
;
}
m0
=
15
*
(
n_sl_id1
/
112
)
+
(
5
*
n_sl_id2
);
m0
=
15
*
(
n_sl_id1
/
112
)
+
(
5
*
n_sl_id2
);
m1
=
n_sl_id1
%
112
;
for
(
i
=
0
;
i
<
SL_NR_SSS_SEQUENCE_LENGTH
;
i
++
)
{
sl_sss_for_sync
[
i
]
=
(
1
-
2
*
x0
[(
i
+
m0
)
%
SL_NR_SSS_SEQUENCE_LENGTH
]
)
*
(
1
-
2
*
x1
[(
i
+
m1
)
%
SL_NR_SSS_SEQUENCE_LENGTH
]
);
for
(
i
=
0
;
i
<
SL_NR_SSS_SEQUENCE_LENGTH
;
i
++
)
{
sl_sss_for_sync
[
i
]
=
(
1
-
2
*
x0
[(
i
+
m0
)
%
SL_NR_SSS_SEQUENCE_LENGTH
])
*
(
1
-
2
*
x1
[(
i
+
m1
)
%
SL_NR_SSS_SEQUENCE_LENGTH
]
);
sl_sss
[
i
]
=
sl_sss_for_sync
[
i
]
*
scaling
;
#ifdef SL_DEBUG_INIT_DATA
printf
(
"m0:%d, m1:%d, sl_sss_for_sync[%d]:%d, sl_sss[%d]:%d
\n
"
,
m0
,
m1
,
i
,
sl_sss_for_sync
[
i
],
i
,
sl_sss
[
i
]);
printf
(
"m0:%d, m1:%d, sl_sss_for_sync[%d]:%d, sl_sss[%d]:%d
\n
"
,
m0
,
m1
,
i
,
sl_sss_for_sync
[
i
],
i
,
sl_sss
[
i
]);
#endif
}
#ifdef SL_DUMP_PSBCH_TX_SAMPLES
LOG_M
(
"sl_sss_seq.m"
,
"sl_sss"
,
(
void
*
)
sl_sss
,
SL_NR_SSS_SEQUENCE_LENGTH
,
1
,
0
);
LOG_M
(
"sl_sss_forsync_seq.m"
,
"sl_sss_for_sync"
,
(
void
*
)
sl_sss_for_sync
,
SL_NR_SSS_SEQUENCE_LENGTH
,
1
,
0
);
LOG_M
(
"sl_sss_seq.m"
,
"sl_sss"
,
(
void
*
)
sl_sss
,
SL_NR_SSS_SEQUENCE_LENGTH
,
1
,
0
);
LOG_M
(
"sl_sss_forsync_seq.m"
,
"sl_sss_for_sync"
,
(
void
*
)
sl_sss_for_sync
,
SL_NR_SSS_SEQUENCE_LENGTH
,
1
,
0
);
#endif
}
openair1/PHY/TOOLS/tools_defs.h
View file @
9a2e080f
...
...
@@ -242,11 +242,9 @@ extern "C" {
};
}
__attribute__
((
always_inline
))
inline
c16_t
c16xmulConstShift
(
const
c16_t
a
,
const
int
b
,
const
int
Shift
)
{
return
(
c16_t
)
{
.
r
=
(
int16_t
)((
a
.
r
*
b
)
>>
Shift
),
.
i
=
(
int16_t
)((
a
.
i
*
b
)
>>
Shift
)
};
__attribute__
((
always_inline
))
inline
c16_t
c16xmulConstShift
(
const
c16_t
a
,
const
int
b
,
const
int
Shift
)
{
return
(
c16_t
){.
r
=
(
int16_t
)((
a
.
r
*
b
)
>>
Shift
),
.
i
=
(
int16_t
)((
a
.
i
*
b
)
>>
Shift
)};
}
__attribute__
((
always_inline
))
inline
c32_t
c32x16maddShift
(
const
c16_t
a
,
const
c16_t
b
,
const
c32_t
c
,
const
int
Shift
)
{
...
...
openair1/PHY/defs_nr_UE.h
View file @
9a2e080f
...
...
@@ -593,7 +593,7 @@ typedef struct PHY_VARS_NR_UE_s {
notifiedFIFO_t
tx_resume_ind_fifo
[
NR_MAX_SLOTS_PER_FRAME
];
//Sidelink parameters
//
Sidelink parameters
sl_nr_sidelink_mode_t
sl_mode
;
sl_nr_ue_phy_params_t
SL_UE_PHY_PARAMS
;
}
PHY_VARS_NR_UE
;
...
...
@@ -618,7 +618,7 @@ typedef struct nr_phy_data_tx_s {
NR_UE_ULSCH_t
ulsch
;
NR_UE_PUCCH
pucch_vars
;
//
Sidelink Rx action decided by MAC
//
Sidelink Rx action decided by MAC
sl_nr_tx_config_type_enum_t
sl_tx_action
;
sl_nr_tx_config_psbch_pdu_t
psbch_vars
;
...
...
@@ -628,7 +628,7 @@ typedef struct nr_phy_data_s {
NR_UE_PDCCH_CONFIG
phy_pdcch_config
;
NR_UE_DLSCH_t
dlsch
[
2
];
//
Sidelink Rx action decided by MAC
//
Sidelink Rx action decided by MAC
sl_nr_rx_config_type_enum_t
sl_rx_action
;
}
nr_phy_data_t
;
...
...
openair1/PHY/defs_nr_common.h
View file @
9a2e080f
...
...
@@ -96,7 +96,7 @@
#define MAX_DELAY_COMP 20
#define PBCH_MAX_RE_PER_SYMBOL (20
*
12)
#define PBCH_MAX_RE_PER_SYMBOL (20
*
12)
typedef
enum
{
NR_MU_0
=
0
,
...
...
openair1/PHY/defs_nr_sl_UE.h
View file @
9a2e080f
...
...
@@ -30,27 +30,24 @@
\warning
*/
#ifndef _DEFS_NR_SL_UE_H_
#define _DEFS_NR_SL_UE_H_
#ifndef _DEFS_NR_SL_UE_H_
#define _DEFS_NR_SL_UE_H_
#include "PHY/types.h"
#include "PHY/defs_nr_common.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/sidelink_nr_ue_interface.h"
#include "common/utils/time_meas.h"
// (33*(13-4))
// Normal CP - NUM_SSB_Symbols = 13. 4 symbols for PSS, SSS
#define SL_NR_NUM_PSBCH_DMRS_RE
297
//ceil(2(QPSK)*SL_NR_NUM_PSBCH_DMRS_RE/32)
#define SL_NR_NUM_PSBCH_DMRS_RE 297
//
ceil(2(QPSK)*SL_NR_NUM_PSBCH_DMRS_RE/32)
#define SL_NR_NUM_PSBCH_DMRS_RE_DWORD 20
//11 RBs for PSBCH in one symbol * 12 REs
//
11 RBs for PSBCH in one symbol * 12 REs
#define SL_NR_NUM_PSBCH_RE_IN_ONE_SYMBOL 132
//3 DMRS REs per RB * 11 RBS in one symbol
//
3 DMRS REs per RB * 11 RBS in one symbol
#define SL_NR_NUM_PSBCH_DMRS_RE_IN_ONE_SYMBOL 33
//9 PSBCH DATA REs * 11 RBS in one symbol
//
9 PSBCH DATA REs * 11 RBS in one symbol
#define SL_NR_NUM_PSBCH_DATA_RE_IN_ONE_SYMBOL 99
#define SL_NR_NUM_PSBCH_RBS_IN_ONE_SYMBOL 11
// SL_NR_POLAR_PSBCH_E_NORMAL_CP/2 bits because QPSK used for PSBCH.
...
...
@@ -61,8 +58,6 @@
// 11 * (12-3 DMRS REs) * 9 symbols for PSBCH
#define SL_NR_NUM_PSBCH_DATA_RE_IN_ALL_SYMBOLS 891
#define SL_NR_NUM_SYMBOLS_SSB_NORMAL_CP 13
#define SL_NR_NUM_SYMBOLS_SSB_EXT_CP 11
#define SL_NR_NUM_PSS_SYMBOLS 2
...
...
@@ -76,21 +71,16 @@
#define SL_NR_NUM_IDs_IN_SSS 336
#define SL_NR_NUM_SLSS_IDs 672
typedef
enum
sl_nr_sidelink_mode
{
SL_NOT_SUPPORTED
=
0
,
SL_MODE1_SUPPORTED
,
SL_MODE2_SUPPORTED
}
sl_nr_sidelink_mode_t
;
typedef
enum
sl_nr_sidelink_mode
{
SL_NOT_SUPPORTED
=
0
,
SL_MODE1_SUPPORTED
,
SL_MODE2_SUPPORTED
}
sl_nr_sidelink_mode_t
;
//(11*(12-3 DMRS REs) * 2 (QPSK used)
#define SL_NR_NUM_PSBCH_DATA_BITS_IN_ONE_SYMBOL 198
typedef
struct
SL_NR_UE_INIT_PARAMS
{
//gold sequences for PSBCH DMRS
// gold sequences for PSBCH DMRS
uint32_t
psbch_dmrs_gold_sequences
[
SL_NR_NUM_SLSS_IDs
][
SL_NR_NUM_PSBCH_DMRS_RE_DWORD
];
// Gold sequences for PSBCH DMRS
//PSBCH DMRS QPSK modulated symbols for all possible SLSS Ids
//
PSBCH DMRS QPSK modulated symbols for all possible SLSS Ids
struct
complex16
psbch_dmrs_modsym
[
SL_NR_NUM_SLSS_IDs
][
SL_NR_NUM_PSBCH_DMRS_RE
];
// Scaled values
...
...
@@ -106,7 +96,6 @@ typedef struct SL_NR_UE_INIT_PARAMS {
}
SL_NR_UE_INIT_PARAMS_t
;
typedef
struct
SL_NR_SYNC_PARAMS
{
// Indicating start of SSB block in the initial set of samples
uint32_t
ssb_offset
;
// Freq Offset calculated
...
...
@@ -115,16 +104,15 @@ typedef struct SL_NR_SYNC_PARAMS {
uint32_t
remaining_frames
;
uint32_t
rx_offset
;
uint32_t
slot_offset
;
uint16_t
N_sl_id2
;
//id2 determined from PSS during sync ref UE selection
uint16_t
N_sl_id1
;
//id2 determined from SSS during sync ref UE selection
uint16_t
N_sl_id
;
//ID calculated from ID1 and ID2
int32_t
psbch_rsrp
;
//
rsrp of the decoded psbch during sync ref ue selection
uint16_t
N_sl_id2
;
//
id2 determined from PSS during sync ref UE selection
uint16_t
N_sl_id1
;
//
id2 determined from SSS during sync ref UE selection
uint16_t
N_sl_id
;
//
ID calculated from ID1 and ID2
int32_t
psbch_rsrp
;
//
rsrp of the decoded psbch during sync ref ue selection
uint32_t
DFN
;
// DFN calculated after sync ref UE search
}
SL_NR_SYNC_PARAMS_t
;
typedef
struct
SL_NR_UE_PSBCH
{
// AVG POWER OF PSBCH DMRS in dB/RE
int16_t
rsrp_dB_per_RE
;
// AVG POWER OF PSBCH DMRS in dBm/RE
...
...
@@ -142,7 +130,6 @@ typedef struct SL_NR_UE_PSBCH {
}
SL_NR_UE_PSBCH_t
;
typedef
struct
sl_nr_ue_phy_params
{
SL_NR_UE_INIT_PARAMS_t
init_params
;
SL_NR_SYNC_PARAMS_t
sync_params
;
...
...
@@ -150,7 +137,7 @@ typedef struct sl_nr_ue_phy_params {
// Sidelink PHY PARAMETERS USED FOR PSBCH reception/Txn
SL_NR_UE_PSBCH_t
psbch
;
//Configuration parameters from MAC
//
Configuration parameters from MAC
sl_nr_phy_config_request_t
sl_config
;
NR_DL_FRAME_PARMS
sl_frame_params
;
...
...
@@ -162,5 +149,4 @@ typedef struct sl_nr_ue_phy_params {
}
sl_nr_ue_phy_params_t
;
#endif
\ No newline at end of file
openair1/SCHED_NR_UE/defs.h
View file @
9a2e080f
...
...
@@ -165,13 +165,8 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
const
UE_nr_rxtx_proc_t
*
proc
,
c16_t
rxdataF
[][
ue
->
frame_parms
.
samples_per_slot_wCP
]);
int
psbch_pscch_processing
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
nr_phy_data_t
*
phy_data
);
int
phy_procedures_nrUE_SL_TX
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
nr_phy_data_tx_t
*
phy_data
);
int
psbch_pscch_processing
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
nr_phy_data_t
*
phy_data
);
int
phy_procedures_nrUE_SL_TX
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
nr_phy_data_tx_t
*
phy_data
);
/*! \brief This function prepares the sl indication to pass to the MAC
*/
void
nr_fill_sl_indication
(
nr_sidelink_indication_t
*
sl_ind
,
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
9a2e080f
...
...
@@ -865,12 +865,7 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_
__attribute__
((
aligned
(
32
)))
struct
complex16
dl_ch_estimates_time
[
fp
->
nb_antennas_rx
][
fp
->
ofdm_symbol_size
];
for
(
int
i
=
1
;
i
<
4
;
i
++
)
{
nr_slot_fep
(
ue
,
fp
,
proc
,
(
ssb_start_symbol
+
i
)
%
(
fp
->
symbols_per_slot
),
rxdataF
,
link_type_dl
);
nr_slot_fep
(
ue
,
fp
,
proc
,
(
ssb_start_symbol
+
i
)
%
(
fp
->
symbols_per_slot
),
rxdataF
,
link_type_dl
);
start_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
nr_pbch_channel_estimation
(
ue
,
...
...
@@ -879,9 +874,9 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_
dl_ch_estimates
,
dl_ch_estimates_time
,
proc
,
(
ssb_start_symbol
+
i
)
%
(
fp
->
symbols_per_slot
),
i
-
1
,
ssb_index
&
7
,
(
ssb_start_symbol
+
i
)
%
(
fp
->
symbols_per_slot
),
i
-
1
,
ssb_index
&
7
,
ssb_slot_2
==
nr_slot_rx
,
rxdataF
,
false
,
...
...
@@ -926,12 +921,7 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_
{
for
(
int
j
=
prs_config
->
SymbolStart
;
j
<
(
prs_config
->
SymbolStart
+
prs_config
->
NumPRSSymbols
);
j
++
)
{
nr_slot_fep
(
ue
,
fp
,
proc
,
(
j
%
fp
->
symbols_per_slot
),
rxdataF
,
link_type_dl
);
nr_slot_fep
(
ue
,
fp
,
proc
,
(
j
%
fp
->
symbols_per_slot
),
rxdataF
,
link_type_dl
);
}
nr_prs_channel_estimation
(
gNB_id
,
rsc_id
,
i
,
ue
,
proc
,
fp
,
rxdataF
);
}
...
...
@@ -962,12 +952,7 @@ int pbch_pdcch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_
for
(
uint16_t
l
=
0
;
l
<
nb_symb_pdcch
;
l
++
)
{
start_meas
(
&
ue
->
ofdm_demod_stats
);
nr_slot_fep
(
ue
,
fp
,
proc
,
l
,
rxdataF
,
link_type_dl
);
nr_slot_fep
(
ue
,
fp
,
proc
,
l
,
rxdataF
,
link_type_dl
);
}
// Hold the channel estimates in frequency domain.
...
...
@@ -1027,7 +1012,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
nr_slot_fep
(
ue
,
&
ue
->
frame_parms
,
proc
,
m
,
//
to be updated from higher layer
m
,
//
to be updated from higher layer
rxdataF
,
link_type_dl
);
}
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue_sl.c
View file @
9a2e080f
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
9a2e080f
...
...
@@ -786,38 +786,45 @@ int main(int argc, char **argv)
int
ssb_slot
=
(
UE
->
symbol_offset
/
14
)
+
(
n_hf
*
(
frame_parms
->
slots_per_frame
>>
1
));
proc
.
nr_slot_rx
=
ssb_slot
;
proc
.
gNB_id
=
0
;
for
(
int
i
=
UE
->
symbol_offset
+
1
;
i
<
UE
->
symbol_offset
+
4
;
i
++
)
{
nr_slot_fep
(
UE
,
frame_parms
,
&
proc
,
i
%
frame_parms
->
symbols_per_slot
,
rxdataF
,
link_type_dl
);
nr_pbch_channel_estimation
(
UE
,
&
UE
->
frame_parms
,
estimateSz
,
dl_ch_estimates
,
dl_ch_estimates_time
,
&
proc
,
i
%
frame_parms
->
symbols_per_slot
,
i
-
(
UE
->
symbol_offset
+
1
),
ssb_index
%
8
,
n_hf
,
rxdataF
,
false
,
frame_parms
->
Nid_cell
);
for
(
int
i
=
UE
->
symbol_offset
+
1
;
i
<
UE
->
symbol_offset
+
4
;
i
++
)
{
nr_slot_fep
(
UE
,
frame_parms
,
&
proc
,
i
%
frame_parms
->
symbols_per_slot
,
rxdataF
,
link_type_dl
);
nr_pbch_channel_estimation
(
UE
,
&
UE
->
frame_parms
,
estimateSz
,
dl_ch_estimates
,
dl_ch_estimates_time
,
&
proc
,
i
%
frame_parms
->
symbols_per_slot
,
i
-
(
UE
->
symbol_offset
+
1
),
ssb_index
%
8
,
n_hf
,
rxdataF
,
false
,
frame_parms
->
Nid_cell
);
}
fapiPbch_t
result
;
fapiPbch_t
result
;
ret
=
nr_rx_pbch
(
UE
,
&
proc
,
estimateSz
,
dl_ch_estimates
,
frame_parms
,
ssb_index
%
8
,
&
result
,
rxdataF
);
if
(
ret
==
0
)
{
//UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically
//UE->rx_ind.rx_indication_body->mib_pdu.ssb_length; //Lmax, not yet detected automatically
uint8_t
gNB_xtra_byte
=
0
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
gNB_xtra_byte
|=
((
gNB
->
pbch
.
pbch_a
>>
(
31
-
i
))
&
1
)
<<
(
7
-
i
);
if
(
ret
==
0
)
{
//
UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically
//
UE->rx_ind.rx_indication_body->mib_pdu.ssb_length; //Lmax, not yet detected automatically
uint8_t
gNB_xtra_byte
=
0
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
gNB_xtra_byte
|=
((
gNB
->
pbch
.
pbch_a
>>
(
31
-
i
))
&
1
)
<<
(
7
-
i
);
payload_ret
=
(
result
.
xtra_byte
==
gNB_xtra_byte
);
for
(
i
=
0
;
i
<
3
;
i
++
){
payload_ret
+=
(
result
.
decoded_output
[
i
]
==
((
msgDataTx
.
ssb
[
ssb_index
].
ssb_pdu
.
ssb_pdu_rel15
.
bchPayload
>>
(
8
*
i
))
&
0xff
));
}
//printf("ret %d\n", payload_ret);
if
(
payload_ret
!=
4
)
for
(
i
=
0
;
i
<
3
;
i
++
)
{
payload_ret
+=
(
result
.
decoded_output
[
i
]
==
((
msgDataTx
.
ssb
[
ssb_index
].
ssb_pdu
.
ssb_pdu_rel15
.
bchPayload
>>
(
8
*
i
))
&
0xff
));
}
// printf("ret %d\n", payload_ret);
if
(
payload_ret
!=
4
)
n_errors_payload
++
;
}
if
(
ret
!=
0
)
n_errors
++
;
if
(
ret
!=
0
)
n_errors
++
;
}
}
//noise trials
printf
(
"SNR %f: trials %d, n_errors_crc = %d, n_errors_payload %d
\n
"
,
SNR
,
n_trials
,
n_errors
,
n_errors_payload
);
...
...
openair1/SIMULATION/NR_PHY/psbchsim.c
View file @
9a2e080f
This diff is collapsed.
Click to expand it.
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