Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
oai
openairinterface5G
Commits
47df7e51
Commit
47df7e51
authored
Oct 26, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nr_pbchsim' of
https://gitlab.eurecom.fr/oai/openairinterface5g
into nr_pbchsim
parents
f841174f
6f38c94d
Changes
36
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
1339 additions
and
2110 deletions
+1339
-2110
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+2
-2
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
+12
-4
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
+1
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+6
-4
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+1
-1
openair1/PHY/CODING/nr_polar_init.c
openair1/PHY/CODING/nr_polar_init.c
+3
-3
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+8
-6
openair1/PHY/INIT/nr_init_ue.c
openair1/PHY/INIT/nr_init_ue.c
+12
-29
openair1/PHY/INIT/nr_parms.c
openair1/PHY/INIT/nr_parms.c
+100
-202
openair1/PHY/INIT/phy_init.h
openair1/PHY/INIT/phy_init.h
+2
-1
openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c
openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c
+1
-0
openair1/PHY/MODULATION/ofdm_mod.c
openair1/PHY/MODULATION/ofdm_mod.c
+2
-2
openair1/PHY/MODULATION/slot_fep_nr.c
openair1/PHY/MODULATION/slot_fep_nr.c
+46
-47
openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
+35
-23
openair1/PHY/NR_REFSIG/pss_nr.h
openair1/PHY/NR_REFSIG/pss_nr.h
+7
-2
openair1/PHY/NR_REFSIG/refsig_defs_ue.h
openair1/PHY/NR_REFSIG/refsig_defs_ue.h
+1
-1
openair1/PHY/NR_REFSIG/sss_nr.h
openair1/PHY/NR_REFSIG/sss_nr.h
+1
-1
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+17
-2
openair1/PHY/NR_TRANSPORT/nr_pss.c
openair1/PHY/NR_TRANSPORT/nr_pss.c
+8
-2
openair1/PHY/NR_TRANSPORT/nr_sss.c
openair1/PHY/NR_TRANSPORT/nr_sss.c
+1
-1
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+189
-161
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+0
-3
openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+9
-1010
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+84
-115
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+336
-341
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+1
-0
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
+106
-53
openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
+79
-51
openair1/PHY/TOOLS/cdot_prod.c
openair1/PHY/TOOLS/cdot_prod.c
+122
-0
openair1/PHY/TOOLS/dB_routines.c
openair1/PHY/TOOLS/dB_routines.c
+8
-0
openair1/PHY/TOOLS/lte_dfts.c
openair1/PHY/TOOLS/lte_dfts.c
+6
-4
openair1/PHY/TOOLS/tools_defs.h
openair1/PHY/TOOLS/tools_defs.h
+5
-0
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+4
-1
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+6
-2
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+5
-4
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+113
-31
No files found.
cmake_targets/CMakeLists.txt
View file @
47df7e51
...
...
@@ -1296,7 +1296,7 @@ set(PHY_SRC_UE
${
OPENAIR1_DIR
}
/PHY/NR_REFSIG/nr_gold.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/file_output.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cadd_vv.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/lte_dfts.c
#
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/log2_approx.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cmult_sv.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cmult_vv.c
...
...
@@ -1334,7 +1334,7 @@ set(PHY_SRC_UE
${
OPENAIR1_DIR
}
/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/file_output.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cadd_vv.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/lte_dfts.c
#
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/log2_approx.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cmult_sv.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cmult_vv.c
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
View file @
47df7e51
...
...
@@ -1069,9 +1069,17 @@ int8_t polar_decoder_int16(int16_t *input,
nr_polar_deinterleaver
(
polarParams
->
nr_polar_CPrime
,
polarParams
->
nr_polar_B
,
polarParams
->
interleaving_pattern
,
polarParams
->
K
);
//Remove the CRC (â)
for
(
int
j
=
0
;
j
<
polarParams
->
payloadBits
;
j
++
)
polarParams
->
nr_polar_A
[
j
]
=
polarParams
->
nr_polar_B
[
j
];
nr_byte2bit_uint8_32_t
(
polarParams
->
nr_polar_A
,
polarParams
->
payloadBits
,
out
);
//for (int j = 0; j < polarParams->payloadBits; j++) polarParams->nr_polar_A[j]=polarParams->nr_polar_B[j];
// Check the CRC
for
(
int
j
=
0
;
j
<
polarParams
->
crcParityBits
;
j
++
)
{
int
crcbit
=
0
;
for
(
int
i
=
0
;
i
<
polarParams
->
payloadBits
;
i
++
)
crcbit
=
crcbit
^
(
polarParams
->
crc_generator_matrix
[
i
][
j
]
&
polarParams
->
nr_polar_B
[
i
]);
if
(
crcbit
!=
polarParams
->
nr_polar_B
[
polarParams
->
payloadBits
+
j
])
return
(
-
1
);
}
// pack into ceil(payloadBits/32) 32 bit words, lowest index in MSB
// nr_byte2bit_uint8_32_t(polarParams->nr_polar_A, polarParams->payloadBits, out);
nr_byte2bit_uint8_32_t
(
polarParams
->
nr_polar_B
,
polarParams
->
payloadBits
,
out
);
return
(
0
);
}
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
View file @
47df7e51
...
...
@@ -443,7 +443,7 @@ void applyGtoright(t_nrPolar_params *pp,decoder_node_t *node) {
}
else
#endif
{
// equvalent scalar code to above, activated only on non x86/ARM architectures
{
// equvalent scalar code to above, activated only on non x86/ARM architectures
or Nv=1,2
for
(
int
i
=
0
;
i
<
node
->
Nv
/
2
;
i
++
)
{
alpha_r
[
i
]
=
alpha_v
[
i
+
(
node
->
Nv
/
2
)]
-
(
betal
[
i
]
*
alpha_v
[
i
]);
}
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
View file @
47df7e51
...
...
@@ -361,11 +361,13 @@ static inline void nr_polar_interleaver(uint8_t *input,
}
static
inline
void
nr_polar_deinterleaver
(
uint8_t
*
input
,
uint8_t
*
output
,
uint16_t
*
pattern
,
uint16_t
size
)
uint8_t
*
output
,
uint16_t
*
pattern
,
uint16_t
size
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
output
[
pattern
[
i
]]
=
input
[
i
];
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
output
[
pattern
[
i
]]
=
input
[
i
];
}
}
#endif
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
View file @
47df7e51
...
...
@@ -54,7 +54,7 @@ void polar_encoder(uint32_t *in,
polarParams
->
nr_polar_crc
,
polarParams
->
payloadBits
,
polarParams
->
crcParityBits
);
for
(
uint8_t
i
=
0
;
i
<
polarParams
->
crcParityBits
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
polarParams
->
crcParityBits
;
i
++
)
polarParams
->
nr_polar_crc
[
i
]
=
(
polarParams
->
nr_polar_crc
[
i
]
%
2
);
//Attach CRC to the Transport Block. (a to b)
...
...
openair1/PHY/CODING/nr_polar_init.c
View file @
47df7e51
...
...
@@ -185,9 +185,9 @@ void nr_polar_print_polarParams(t_nrPolar_paramsPtr polarParams)
}
t_nrPolar_paramsPtr
nr_polar_params
(
t_nrPolar_paramsPtr
polarParams
,
int8_t
messageType
,
uint16_t
messageLength
,
uint8_t
aggregation_level
)
int8_t
messageType
,
uint16_t
messageLength
,
uint8_t
aggregation_level
)
{
t_nrPolar_paramsPtr
currentPtr
=
NULL
;
...
...
openair1/PHY/INIT/nr_init.c
View file @
47df7e51
...
...
@@ -100,6 +100,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
gNB
->
check_for_MUMIMO_transmissions
=
0
;
while
(
gNB
->
configured
==
0
)
usleep
(
10000
);
init_dfts
();
/*
LOG_I(PHY,"[gNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d nb_antennas_tx:%u nb_antennas_rx:%u PRACH[rootSequenceIndex:%u prach_Config_enabled:%u configIndex:%u highSpeed:%u zeroCorrelationZoneConfig:%u freqOffset:%u]\n",
gNB->Mod_id,
...
...
@@ -367,7 +369,7 @@ void install_schedule_handlers(IF_Module_t *if_inst)
/// this function is a temporary addition for NR configuration
void
nr_phy_config_request_sim
(
PHY_VARS_gNB
*
gNB
)
void
nr_phy_config_request_sim
(
PHY_VARS_gNB
*
gNB
,
int
N_RB_DL
,
int
N_RB_UL
,
int
mu
)
{
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
nfapi_nr_config_request_t
*
gNB_config
=
&
gNB
->
gNB_config
;
...
...
@@ -375,14 +377,14 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB)
//overwrite for new NR parameters
gNB_config
->
nfapi_config
.
rf_bands
.
rf_band
[
0
]
=
22
;
gNB_config
->
nfapi_config
.
earfcn
.
value
=
6600
;
gNB_config
->
subframe_config
.
numerology_index_mu
.
value
=
1
;
gNB_config
->
subframe_config
.
duplex_mode
.
value
=
F
DD
;
gNB_config
->
subframe_config
.
numerology_index_mu
.
value
=
mu
;
gNB_config
->
subframe_config
.
duplex_mode
.
value
=
T
DD
;
gNB_config
->
rf_config
.
tx_antenna_ports
.
value
=
1
;
gNB_config
->
rf_config
.
dl_carrier_bandwidth
.
value
=
106
;
gNB_config
->
rf_config
.
ul_carrier_bandwidth
.
value
=
106
;
gNB_config
->
rf_config
.
dl_carrier_bandwidth
.
value
=
N_RB_DL
;
gNB_config
->
rf_config
.
ul_carrier_bandwidth
.
value
=
N_RB_UL
;
gNB_config
->
sch_config
.
half_frame_index
.
value
=
0
;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
0
;
gNB_config
->
sch_config
.
n_ssb_crb
.
value
=
86
;
gNB_config
->
sch_config
.
n_ssb_crb
.
value
=
(
N_RB_DL
-
20
)
>>
1
;
gNB_config
->
sch_config
.
ssb_subcarrier_offset
.
value
=
0
;
...
...
openair1/PHY/INIT/nr_init_ue.c
View file @
47df7e51
...
...
@@ -655,15 +655,16 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
int
i
,
j
,
k
,
l
;
int
eNB_id
;
int
th_id
;
int
n_ssb_crb
=
(
fp
->
N_RB_DL
-
20
)
>>
1
;
abstraction_flag
=
0
;
fp
->
nb_antennas_tx
=
1
;
fp
->
nb_antennas_rx
=
1
;
printf
(
"Initializing UE vars (abstraction %"
PRIu8
") for eNB TXant %"
PRIu8
", UE RXant %"
PRIu8
"
\n
"
,
abstraction_flag
,
fp
->
nb_antennas_tx
,
fp
->
nb_antennas_rx
);
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
nr_init_frame_parms_ue
(
&
ue
->
frame_parms
);
nr_init_frame_parms_ue
(
&
ue
->
frame_parms
,
NR_MU_1
,
NORMAL
,
n_ssb_crb
,
0
);
phy_init_nr_top
(
ue
);
// many memory allocation sizes are hard coded
...
...
@@ -941,43 +942,25 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag) {
void
phy_init_nr_top
(
PHY_VARS_NR_UE
*
ue
)
{
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
NR_UE_DLSCH_t
*
dlsch0
=
ue
->
dlsch
[
0
][
0
][
0
];
dlsch0
=
(
NR_UE_DLSCH_t
*
)
malloc16
(
sizeof
(
NR_UE_DLSCH_t
));
NR_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
NR_UE_DLSCH_t
*
dlsch0
=
ue
->
dlsch
[
0
][
0
][
0
];
dlsch0
=
(
NR_UE_DLSCH_t
*
)
malloc16
(
sizeof
(
NR_UE_DLSCH_t
));
crcTableInit
();
init_dfts
();
ccodedot11_init
();
ccodedot11_init_inv
();
ccodelte_init
();
ccodelte_init_inv
();
//treillis_table_init();
phy_generate_viterbi_tables
();
phy_generate_viterbi_tables_lte
();
//init_td8();
//init_td16();
#ifdef __AVX2__
//init_td16avx2();
#endif
init_context_synchro_nr
(
frame_parms
);
generate_ul_reference_signal_sequences
(
SHRT_MAX
);
// Polar encoder init for PBCH
//nr_polar_init(&frame_parms->pbch_polar_params, 1);
/*t_nrPolar_paramsPtr nrPolar_params = NULL, currentPtr = NULL;
nr_polar_init(&ue->nrPolar_params,
NR_POLAR_PBCH_MESSAGE_TYPE,
NR_POLAR_PBCH_PAYLOAD_BITS,
NR_POLAR_PBCH_AGGREGATION_LEVEL);*/
ue
->
nrPolar_params
=
NULL
;
nr_polar_init
(
&
ue
->
nrPolar_params
,
NR_POLAR_PBCH_MESSAGE_TYPE
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
NR_POLAR_PBCH_AGGREGATION_LEVEL
);
//lte_sync_time_init(frame_parms);
//generate_ul_ref_sigs();
...
...
openair1/PHY/INIT/nr_parms.c
View file @
47df7e51
...
...
@@ -26,18 +26,20 @@
uint32_t
nr_subcarrier_spacing
[
MAX_NUM_SUBCARRIER_SPACING
]
=
{
15e3
,
30e3
,
60e3
,
120e3
,
240e3
};
uint16_t
nr_slots_per_subframe
[
MAX_NUM_SUBCARRIER_SPACING
]
=
{
1
,
2
,
4
,
16
,
32
};
int
nr_init_frame_parms
(
nfapi_nr_config_request_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
int
nr_init_frame_parms0
(
NR_DL_FRAME_PARMS
*
fp
,
int
mu
,
int
Ncp
)
{
int
N_RB
=
config
->
rf_config
.
dl_carrier_bandwidth
.
value
;
int
Ncp
=
config
->
subframe_config
.
dl_cyclic_prefix_type
.
value
;
int
mu
=
config
->
subframe_config
.
numerology_index_mu
.
value
;
#if DISABLE_LOG_X
printf
(
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
N_RB
,
Ncp
);
printf
(
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
fp
->
N_RB
_DL
,
Ncp
);
#else
LOG_I
(
PHY
,
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
N_RB
,
Ncp
);
LOG_I
(
PHY
,
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
fp
->
N_RB
_DL
,
Ncp
);
#endif
if
(
Ncp
==
NFAPI_CP_EXTENDED
)
...
...
@@ -46,15 +48,15 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
switch
(
mu
)
{
case
NR_MU_0
:
//15kHz scs
f
rame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_0
];
f
rame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_0
];
f
p
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_0
];
f
p
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_0
];
break
;
case
NR_MU_1
:
//30kHz scs
f
rame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_1
];
f
rame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_1
];
f
p
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_1
];
f
p
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_1
];
switch
(
N_RB
){
switch
(
fp
->
N_RB
_DL
){
case
11
:
case
24
:
case
38
:
...
...
@@ -63,17 +65,17 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
case
65
:
case
106
:
//40 MHz
if
(
f
rame_parms
->
threequarter_fs
)
{
f
rame_parms
->
ofdm_symbol_size
=
1536
;
f
rame_parms
->
first_carrier_offset
=
900
;
//1536 - 636
f
rame_parms
->
nb_prefix_samples0
=
132
;
f
rame_parms
->
nb_prefix_samples
=
108
;
if
(
f
p
->
threequarter_fs
)
{
f
p
->
ofdm_symbol_size
=
1536
;
f
p
->
first_carrier_offset
=
900
;
//1536 - 636
f
p
->
nb_prefix_samples0
=
132
;
f
p
->
nb_prefix_samples
=
108
;
}
else
{
f
rame_parms
->
ofdm_symbol_size
=
2048
;
f
rame_parms
->
first_carrier_offset
=
1412
;
//2048 - 636
f
rame_parms
->
nb_prefix_samples0
=
176
;
f
rame_parms
->
nb_prefix_samples
=
144
;
f
p
->
ofdm_symbol_size
=
2048
;
f
p
->
first_carrier_offset
=
1412
;
//2048 - 636
f
p
->
nb_prefix_samples0
=
176
;
f
p
->
nb_prefix_samples
=
144
;
}
break
;
...
...
@@ -82,32 +84,44 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
case
189
:
case
217
:
//80 MHz
if
(
frame_parms
->
threequarter_fs
)
{
frame_parms
->
ofdm_symbol_size
=
3072
;
frame_parms
->
first_carrier_offset
=
1770
;
//3072 - 1302
frame_parms
->
nb_prefix_samples0
=
264
;
frame_parms
->
nb_prefix_samples
=
216
;
}
else
{
frame_parms
->
ofdm_symbol_size
=
4096
;
frame_parms
->
first_carrier_offset
=
2794
;
//4096 - 1302
frame_parms
->
nb_prefix_samples0
=
352
;
frame_parms
->
nb_prefix_samples
=
288
;
if
(
fp
->
threequarter_fs
)
{
fp
->
ofdm_symbol_size
=
3072
;
fp
->
first_carrier_offset
=
1770
;
//3072 - 1302
fp
->
nb_prefix_samples0
=
264
;
fp
->
nb_prefix_samples
=
216
;
}
else
{
fp
->
ofdm_symbol_size
=
4096
;
fp
->
first_carrier_offset
=
2794
;
//4096 - 1302
fp
->
nb_prefix_samples0
=
352
;
fp
->
nb_prefix_samples
=
288
;
}
break
;
case
245
:
AssertFatal
(
fp
->
threequarter_fs
==
0
,
"3/4 sampling impossible for N_RB %d and MU %d
\n
"
,
fp
->
N_RB_DL
,
mu
);
fp
->
ofdm_symbol_size
=
4096
;
fp
->
first_carrier_offset
=
2626
;
//4096 - 1478
fp
->
nb_prefix_samples0
=
352
;
fp
->
nb_prefix_samples
=
288
;
break
;
case
273
:
AssertFatal
(
fp
->
threequarter_fs
==
0
,
"3/4 sampling impossible for N_RB %d and MU %d
\n
"
,
fp
->
N_RB_DL
,
mu
);
fp
->
ofdm_symbol_size
=
4096
;
fp
->
first_carrier_offset
=
2458
;
//4096 - 1638
fp
->
nb_prefix_samples0
=
352
;
fp
->
nb_prefix_samples
=
288
;
break
;
default:
AssertFatal
(
1
==
0
,
"Number of resource blocks %d undefined for mu %d, frame parms = %p
\n
"
,
N_RB
,
mu
,
f
rame_parms
);
AssertFatal
(
1
==
0
,
"Number of resource blocks %d undefined for mu %d, frame parms = %p
\n
"
,
fp
->
N_RB
_DL
,
mu
,
f
p
);
}
break
;
case
NR_MU_2
:
//60kHz scs
f
rame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_2
];
f
rame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_2
];
f
p
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_2
];
f
p
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_2
];
switch
(
N_RB
){
//FR1 bands only
switch
(
fp
->
N_RB
_DL
){
//FR1 bands only
case
11
:
case
18
:
case
38
:
...
...
@@ -121,196 +135,80 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
case
121
:
case
135
:
default:
AssertFatal
(
1
==
0
,
"Number of resource blocks %d undefined for mu %d, frame parms = %p
\n
"
,
N_RB
,
mu
,
f
rame_parms
);
AssertFatal
(
1
==
0
,
"Number of resource blocks %d undefined for mu %d, frame parms = %p
\n
"
,
fp
->
N_RB
_DL
,
mu
,
f
p
);
}
break
;
case
NR_MU_3
:
f
rame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_3
];
f
rame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_3
];
f
p
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_3
];
f
p
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_3
];
break
;
case
NR_MU_4
:
f
rame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_4
];
f
rame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_4
];
f
p
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_4
];
f
p
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_4
];
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid numerology index %d"
,
mu
);
}
f
rame_parms
->
slots_per_frame
=
10
*
f
rame_parms
->
slots_per_subframe
;
f
rame_parms
->
symbols_per_slot
=
((
Ncp
==
NORMAL
)
?
14
:
12
);
// to redefine for different slot formats
f
rame_parms
->
samples_per_subframe_wCP
=
f
rame_parms
->
ofdm_symbol_size
*
f
rame_parms
->
symbols_per_slot
*
f
rame_parms
->
slots_per_subframe
;
f
rame_parms
->
samples_per_frame_wCP
=
10
*
f
rame_parms
->
samples_per_subframe_wCP
;
f
rame_parms
->
samples_per_subframe
=
(
f
rame_parms
->
samples_per_subframe_wCP
+
(
f
rame_parms
->
nb_prefix_samples0
*
f
rame_parms
->
slots_per_subframe
)
+
(
f
rame_parms
->
nb_prefix_samples
*
f
rame_parms
->
slots_per_subframe
*
(
f
rame_parms
->
symbols_per_slot
-
1
)));
f
rame_parms
->
samples_per_frame
=
10
*
f
rame_parms
->
samples_per_subframe
;
f
rame_parms
->
freq_range
=
(
f
rame_parms
->
dl_CarrierFreq
<
6e9
)
?
nr_FR1
:
nr_FR2
;
f
p
->
slots_per_frame
=
10
*
f
p
->
slots_per_subframe
;
f
p
->
symbols_per_slot
=
((
Ncp
==
NORMAL
)
?
14
:
12
);
// to redefine for different slot formats
f
p
->
samples_per_subframe_wCP
=
f
p
->
ofdm_symbol_size
*
f
p
->
symbols_per_slot
*
f
p
->
slots_per_subframe
;
f
p
->
samples_per_frame_wCP
=
10
*
f
p
->
samples_per_subframe_wCP
;
f
p
->
samples_per_subframe
=
(
f
p
->
samples_per_subframe_wCP
+
(
f
p
->
nb_prefix_samples0
*
f
p
->
slots_per_subframe
)
+
(
f
p
->
nb_prefix_samples
*
f
p
->
slots_per_subframe
*
(
f
p
->
symbols_per_slot
-
1
)));
f
p
->
samples_per_frame
=
10
*
f
p
->
samples_per_subframe
;
f
p
->
freq_range
=
(
f
p
->
dl_CarrierFreq
<
6e9
)
?
nr_FR1
:
nr_FR2
;
// Initial bandwidth part configuration -- full carrier bandwidth
f
rame_parms
->
initial_bwp_dl
.
bwp_id
=
0
;
f
rame_parms
->
initial_bwp_dl
.
scs
=
f
rame_parms
->
subcarrier_spacing
;
f
rame_parms
->
initial_bwp_dl
.
location
=
0
;
f
rame_parms
->
initial_bwp_dl
.
N_RB
=
N_RB
;
f
rame_parms
->
initial_bwp_dl
.
cyclic_prefix
=
Ncp
;
f
rame_parms
->
initial_bwp_dl
.
ofdm_symbol_size
=
f
rame_parms
->
ofdm_symbol_size
;
f
p
->
initial_bwp_dl
.
bwp_id
=
0
;
f
p
->
initial_bwp_dl
.
scs
=
f
p
->
subcarrier_spacing
;
f
p
->
initial_bwp_dl
.
location
=
0
;
f
p
->
initial_bwp_dl
.
N_RB
=
fp
->
N_RB
_DL
;
f
p
->
initial_bwp_dl
.
cyclic_prefix
=
Ncp
;
f
p
->
initial_bwp_dl
.
ofdm_symbol_size
=
f
p
->
ofdm_symbol_size
;
return
0
;
}
int
nr_init_frame_parms_ue
(
NR_DL_FRAME_PARMS
*
frame_parms
)
{
int
N_RB
=
106
;
int
Ncp
=
0
;
int
mu
=
1
;
#if DISABLE_LOG_X
printf
(
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
N_RB
,
Ncp
);
#else
LOG_I
(
PHY
,
"Initializing frame parms for mu %d, N_RB %d, Ncp %d
\n
"
,
mu
,
N_RB
,
Ncp
);
#endif
if
(
Ncp
==
EXTENDED
)
AssertFatal
(
mu
==
NR_MU_2
,
"Invalid cyclic prefix %d for numerology index %d
\n
"
,
Ncp
,
mu
);
switch
(
mu
)
{
case
NR_MU_0
:
//15kHz scs
frame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_0
];
frame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_0
];
break
;
case
NR_MU_1
:
//30kHz scs
frame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_1
];
frame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_1
];
switch
(
N_RB
){
case
11
:
case
24
:
case
38
:
case
78
:
case
51
:
case
65
:
case
106
:
//40 MHz
if
(
frame_parms
->
threequarter_fs
)
{
frame_parms
->
ofdm_symbol_size
=
1536
;
frame_parms
->
first_carrier_offset
=
900
;
//1536 - 636
frame_parms
->
nb_prefix_samples0
=
132
;
frame_parms
->
nb_prefix_samples
=
108
;
}
else
{
frame_parms
->
ofdm_symbol_size
=
2048
;
frame_parms
->
first_carrier_offset
=
1412
;
//2048 - 636
frame_parms
->
nb_prefix_samples0
=
176
;
frame_parms
->
nb_prefix_samples
=
144
;
}
break
;
case
133
:
case
162
:
case
189
:
case
217
:
//80 MHz
if
(
frame_parms
->
threequarter_fs
)
{
frame_parms
->
ofdm_symbol_size
=
3072
;
frame_parms
->
first_carrier_offset
=
1770
;
//3072 - 1302
frame_parms
->
nb_prefix_samples0
=
264
;
frame_parms
->
nb_prefix_samples
=
216
;
}
else
{
frame_parms
->
ofdm_symbol_size
=
4096
;
frame_parms
->
first_carrier_offset
=
2794
;
//4096 - 1302
frame_parms
->
nb_prefix_samples0
=
352
;
frame_parms
->
nb_prefix_samples
=
288
;
}
break
;
case
245
:
case
273
:
default:
AssertFatal
(
1
==
0
,
"Number of resource blocks %d undefined for mu %d, frame parms = %p
\n
"
,
N_RB
,
mu
,
frame_parms
);
}
break
;
case
NR_MU_2
:
//60kHz scs
frame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_2
];
frame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_2
];
switch
(
N_RB
){
//FR1 bands only
case
11
:
case
18
:
case
38
:
case
24
:
case
31
:
case
51
:
case
65
:
case
79
:
case
93
:
case
107
:
case
121
:
case
135
:
default:
AssertFatal
(
1
==
0
,
"Number of resource blocks %d undefined for mu %d, frame parms = %p
\n
"
,
N_RB
,
mu
,
frame_parms
);
}
break
;
case
NR_MU_3
:
frame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_3
];
frame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_3
];
break
;
case
NR_MU_4
:
frame_parms
->
subcarrier_spacing
=
nr_subcarrier_spacing
[
NR_MU_4
];
frame_parms
->
slots_per_subframe
=
nr_slots_per_subframe
[
NR_MU_4
];
break
;
default:
AssertFatal
(
1
==
0
,
"Invalid numerology index %d"
,
mu
);
}
frame_parms
->
nb_prefix_samples0
=
160
;
frame_parms
->
nb_prefix_samples
=
144
;
frame_parms
->
symbols_per_tti
=
14
;
frame_parms
->
numerology_index
=
0
;
frame_parms
->
ttis_per_subframe
=
1
;
frame_parms
->
slots_per_tti
=
2
;
//only slot config 1 is supported
int
nr_init_frame_parms
(
nfapi_nr_config_request_t
*
config
,
NR_DL_FRAME_PARMS
*
fp
)
{
frame_parms
->
ofdm_symbol_size
=
2048
;
frame_parms
->
samples_per_tti
=
30720
;
frame_parms
->
samples_per_subframe
=
30720
*
frame_parms
->
ttis_per_subframe
;
//frame_parms->first_carrier_offset = 2048-600;
nr_init_
frame_parms
0
(
fp
,
config
->
subframe_config
.
numerology_index_mu
.
value
,
config
->
subframe_config
.
dl_cyclic_prefix_type
.
value
)
;
}
frame_parms
->
slots_per_frame
=
10
*
frame_parms
->
slots_per_subframe
;
frame_parms
->
symbols_per_slot
=
((
Ncp
==
NORMAL
)
?
14
:
12
);
// to redefine for different slot formats
frame_parms
->
samples_per_subframe_wCP
=
frame_parms
->
ofdm_symbol_size
*
frame_parms
->
symbols_per_slot
*
frame_parms
->
slots_per_subframe
;
frame_parms
->
samples_per_frame_wCP
=
10
*
frame_parms
->
samples_per_subframe_wCP
;
//frame_parms->samples_per_subframe = (frame_parms->samples_per_subframe_wCP + (frame_parms->nb_prefix_samples0 * frame_parms->slots_per_subframe) +
// (frame_parms->nb_prefix_samples * frame_parms->slots_per_subframe * (frame_parms->symbols_per_slot - 1)));
frame_parms
->
samples_per_frame
=
10
*
frame_parms
->
samples_per_subframe
;
frame_parms
->
freq_range
=
(
frame_parms
->
dl_CarrierFreq
<
6e9
)
?
nr_FR1
:
nr_FR2
;
int
nr_init_frame_parms_ue
(
NR_DL_FRAME_PARMS
*
fp
,
int
mu
,
int
Ncp
,
int
n_ssb_crb
,
int
ssb_subcarrier_offset
)
{
nr_init_frame_parms0
(
fp
,
mu
,
Ncp
);
int
start_rb
=
n_ssb_crb
/
(
1
<<
mu
);
fp
->
ssb_start_subcarrier
=
12
*
start_rb
+
ssb_subcarrier_offset
;
return
0
;
}
void
nr_dump_frame_parms
(
NR_DL_FRAME_PARMS
*
f
rame_parms
)
void
nr_dump_frame_parms
(
NR_DL_FRAME_PARMS
*
f
p
)
{
LOG_I
(
PHY
,
"f
rame_parms
->scs=%d
\n
"
,
f
rame_parms
->
subcarrier_spacing
);
LOG_I
(
PHY
,
"f
rame_parms
->ofdm_symbol_size=%d
\n
"
,
f
rame_parms
->
ofdm_symbol_size
);
LOG_I
(
PHY
,
"f
rame_parms
->nb_prefix_samples0=%d
\n
"
,
f
rame_parms
->
nb_prefix_samples0
);
LOG_I
(
PHY
,
"f
rame_parms
->nb_prefix_samples=%d
\n
"
,
f
rame_parms
->
nb_prefix_samples
);
LOG_I
(
PHY
,
"f
rame_parms
->slots_per_subframe=%d
\n
"
,
f
rame_parms
->
slots_per_subframe
);
LOG_I
(
PHY
,
"f
rame_parms
->samples_per_subframe_wCP=%d
\n
"
,
f
rame_parms
->
samples_per_subframe_wCP
);
LOG_I
(
PHY
,
"f
rame_parms
->samples_per_frame_wCP=%d
\n
"
,
f
rame_parms
->
samples_per_frame_wCP
);
LOG_I
(
PHY
,
"f
rame_parms
->samples_per_subframe=%d
\n
"
,
f
rame_parms
->
samples_per_subframe
);
LOG_I
(
PHY
,
"f
rame_parms
->samples_per_frame=%d
\n
"
,
f
rame_parms
->
samples_per_frame
);
LOG_I
(
PHY
,
"f
rame_parms
->initial_bwp_dl.bwp_id=%d
\n
"
,
f
rame_parms
->
initial_bwp_dl
.
bwp_id
);
LOG_I
(
PHY
,
"f
rame_parms
->initial_bwp_dl.scs=%d
\n
"
,
f
rame_parms
->
initial_bwp_dl
.
scs
);
LOG_I
(
PHY
,
"f
rame_parms
->initial_bwp_dl.N_RB=%d
\n
"
,
f
rame_parms
->
initial_bwp_dl
.
N_RB
);
LOG_I
(
PHY
,
"f
rame_parms
->initial_bwp_dl.cyclic_prefix=%d
\n
"
,
f
rame_parms
->
initial_bwp_dl
.
cyclic_prefix
);
LOG_I
(
PHY
,
"f
rame_parms
->initial_bwp_dl.location=%d
\n
"
,
f
rame_parms
->
initial_bwp_dl
.
location
);
LOG_I
(
PHY
,
"f
rame_parms
->initial_bwp_dl.ofdm_symbol_size=%d
\n
"
,
f
rame_parms
->
initial_bwp_dl
.
ofdm_symbol_size
);
LOG_I
(
PHY
,
"f
p
->scs=%d
\n
"
,
f
p
->
subcarrier_spacing
);
LOG_I
(
PHY
,
"f
p
->ofdm_symbol_size=%d
\n
"
,
f
p
->
ofdm_symbol_size
);
LOG_I
(
PHY
,
"f
p
->nb_prefix_samples0=%d
\n
"
,
f
p
->
nb_prefix_samples0
);
LOG_I
(
PHY
,
"f
p
->nb_prefix_samples=%d
\n
"
,
f
p
->
nb_prefix_samples
);
LOG_I
(
PHY
,
"f
p
->slots_per_subframe=%d
\n
"
,
f
p
->
slots_per_subframe
);
LOG_I
(
PHY
,
"f
p
->samples_per_subframe_wCP=%d
\n
"
,
f
p
->
samples_per_subframe_wCP
);
LOG_I
(
PHY
,
"f
p
->samples_per_frame_wCP=%d
\n
"
,
f
p
->
samples_per_frame_wCP
);
LOG_I
(
PHY
,
"f
p
->samples_per_subframe=%d
\n
"
,
f
p
->
samples_per_subframe
);
LOG_I
(
PHY
,
"f
p
->samples_per_frame=%d
\n
"
,
f
p
->
samples_per_frame
);
LOG_I
(
PHY
,
"f
p
->initial_bwp_dl.bwp_id=%d
\n
"
,
f
p
->
initial_bwp_dl
.
bwp_id
);
LOG_I
(
PHY
,
"f
p
->initial_bwp_dl.scs=%d
\n
"
,
f
p
->
initial_bwp_dl
.
scs
);
LOG_I
(
PHY
,
"f
p
->initial_bwp_dl.N_RB=%d
\n
"
,
f
p
->
initial_bwp_dl
.
N_RB
);
LOG_I
(
PHY
,
"f
p
->initial_bwp_dl.cyclic_prefix=%d
\n
"
,
f
p
->
initial_bwp_dl
.
cyclic_prefix
);
LOG_I
(
PHY
,
"f
p
->initial_bwp_dl.location=%d
\n
"
,
f
p
->
initial_bwp_dl
.
location
);
LOG_I
(
PHY
,
"f
p
->initial_bwp_dl.ofdm_symbol_size=%d
\n
"
,
f
p
->
initial_bwp_dl
.
ofdm_symbol_size
);
}
openair1/PHY/INIT/phy_init.h