Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
OpenXG
OpenXG UE
Commits
de49abd6
Commit
de49abd6
authored
Dec 04, 2019
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapting config_request to scf nfapi (compiling ok but still not running)
parent
699c18ef
Changes
32
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
631 additions
and
431 deletions
+631
-431
executables/nr-ru.c
executables/nr-ru.c
+7
-7
executables/nr-softmodem.c
executables/nr-softmodem.c
+10
-10
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+116
-131
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+68
-58
openair1/PHY/INIT/nr_parms.c
openair1/PHY/INIT/nr_parms.c
+15
-15
openair1/PHY/INIT/phy_init.h
openair1/PHY/INIT/phy_init.h
+3
-3
openair1/PHY/NR_REFSIG/nr_gold.c
openair1/PHY/NR_REFSIG/nr_gold.c
+3
-3
openair1/PHY/NR_TRANSPORT/nr_dci.c
openair1/PHY/NR_TRANSPORT/nr_dci.c
+4
-5
openair1/PHY/NR_TRANSPORT/nr_dci.h
openair1/PHY/NR_TRANSPORT/nr_dci.h
+2
-4
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+0
-1
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
+0
-1
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+6
-7
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+7
-7
openair1/PHY/NR_TRANSPORT/nr_pss.c
openair1/PHY/NR_TRANSPORT/nr_pss.c
+2
-2
openair1/PHY/NR_TRANSPORT/nr_sss.c
openair1/PHY/NR_TRANSPORT/nr_sss.c
+2
-2
openair1/PHY/NR_TRANSPORT/nr_transport.h
openair1/PHY/NR_TRANSPORT/nr_transport.h
+7
-7
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+1
-1
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+4
-2
openair1/SCHED_NR/nr_ru_procedures.c
openair1/SCHED_NR/nr_ru_procedures.c
+2
-3
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+16
-16
openair1/SCHED_NR/sched_nr.h
openair1/SCHED_NR/sched_nr.h
+1
-1
openair1/SIMULATION/NR_PHY/dlschsim.c
openair1/SIMULATION/NR_PHY/dlschsim.c
+0
-1
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+2
-4
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+4
-5
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+327
-88
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+4
-22
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+4
-9
openair2/LAYER2/NR_MAC_gNB/nr_mac_common.c
openair2/LAYER2/NR_MAC_gNB/nr_mac_common.c
+9
-11
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+2
-2
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
+1
-1
openair2/NR_PHY_INTERFACE/NR_IF_Module.h
openair2/NR_PHY_INTERFACE/NR_IF_Module.h
+1
-1
No files found.
executables/nr-ru.c
View file @
de49abd6
...
...
@@ -1039,10 +1039,10 @@ int wakeup_prach_ru(RU_t *ru) {
void
fill_rf_config
(
RU_t
*
ru
,
char
*
rf_config_file
)
{
int
i
;
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
nfapi_nr_config_request_t
*
gNB_config
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
//tmp index
nfapi_nr_config_request_
scf_
t
*
gNB_config
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
//tmp index
openair0_config_t
*
cfg
=
&
ru
->
openair0_cfg
;
int
N_RB
=
gNB_config
->
rf_config
.
dl_carrier_bandwidth
.
value
;
int
mu
=
gNB_config
->
subframe_config
.
numerology_index_mu
.
value
;
int
mu
=
gNB_config
->
ssb_config
.
scs_common
.
value
;
int
N_RB
=
gNB_config
->
carrier_config
.
dl_grid_size
[
gNB_config
->
ssb_config
.
scs_common
.
value
]
.
value
;
if
(
mu
==
NR_MU_0
)
{
//or if LTE
if
(
N_RB
==
100
)
{
...
...
@@ -1115,7 +1115,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
AssertFatal
(
0
==
1
,
"Numerology %d not supported for the moment
\n
"
,
mu
);
}
if
(
gNB_config
->
subframe_config
.
duplex_mod
e
.
value
==
TDD
)
if
(
gNB_config
->
cell_config
.
frame_duplex_typ
e
.
value
==
TDD
)
cfg
->
duplex_mode
=
duplex_mode_TDD
;
else
//FDD
cfg
->
duplex_mode
=
duplex_mode_FDD
;
...
...
@@ -1862,7 +1862,7 @@ void configure_ru(int idx,
RU_t
*
ru
=
RC
.
ru
[
idx
];
RRU_config_t
*
config
=
(
RRU_config_t
*
)
arg
;
RRU_capabilities_t
*
capabilities
=
(
RRU_capabilities_t
*
)
arg
;
nfapi_nr_config_request_t
*
gNB_config
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
nfapi_nr_config_request_
scf_
t
*
gNB_config
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
int
ret
;
LOG_I
(
PHY
,
"Received capabilities from RRU %d
\n
"
,
idx
);
...
...
@@ -1885,8 +1885,8 @@ void configure_ru(int idx,
//config->tdd_config_S[0] = ru->nr_frame_parms->tdd_config_S;
config
->
att_tx
[
0
]
=
ru
->
att_tx
;
config
->
att_rx
[
0
]
=
ru
->
att_rx
;
config
->
N_RB_DL
[
0
]
=
gNB_config
->
rf_config
.
dl_carrier_bandwidth
.
value
;
config
->
N_RB_UL
[
0
]
=
gNB_config
->
rf_config
.
ul_carrier_bandwidth
.
value
;
config
->
N_RB_DL
[
0
]
=
gNB_config
->
carrier_config
.
dl_grid_size
[
gNB_config
->
ssb_config
.
scs_common
.
value
]
.
value
;
config
->
N_RB_UL
[
0
]
=
gNB_config
->
carrier_config
.
dl_grid_size
[
gNB_config
->
ssb_config
.
scs_common
.
value
]
.
value
;
config
->
threequarter_fs
[
0
]
=
ru
->
nr_frame_parms
->
threequarter_fs
;
/* if (ru->if_south==REMOTE_IF4p5) {
config->prach_FreqOffset[0] = ru->nr_frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset;
...
...
executables/nr-softmodem.c
View file @
de49abd6
...
...
@@ -211,7 +211,7 @@ char uecap_xer_in=0;
uint8_t
abstraction_flag
=
0
;
/* forward declarations */
void
set_default_frame_parms
(
nfapi_nr_config_request_t
*
config
[
MAX_NUM_CCs
],
NR_DL_FRAME_PARMS
*
frame_parms
[
MAX_NUM_CCs
]);
void
set_default_frame_parms
(
nfapi_nr_config_request_
scf_
t
*
config
[
MAX_NUM_CCs
],
NR_DL_FRAME_PARMS
*
frame_parms
[
MAX_NUM_CCs
]);
/*---------------------BMC: timespec helpers -----------------------------*/
...
...
@@ -525,18 +525,18 @@ static void get_options(void) {
void
set_default_frame_parms
(
nfapi_nr_config_request_t
*
config
[
MAX_NUM_CCs
],
void
set_default_frame_parms
(
nfapi_nr_config_request_
scf_
t
*
config
[
MAX_NUM_CCs
],
NR_DL_FRAME_PARMS
*
frame_parms
[
MAX_NUM_CCs
])
{
for
(
int
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
frame_parms
[
CC_id
]
=
(
NR_DL_FRAME_PARMS
*
)
malloc
(
sizeof
(
NR_DL_FRAME_PARMS
));
config
[
CC_id
]
=
(
nfapi_nr_config_request_
t
*
)
malloc
(
sizeof
(
nfapi_nr_config_request
_t
));
config
[
CC_id
]
->
s
ubframe_config
.
numerology_index_mu
.
value
=
1
;
config
[
CC_id
]
->
subframe_config
.
duplex_mod
e
.
value
=
1
;
//FDD
config
[
CC_id
]
->
subframe_config
.
dl_cyclic_prefix_type
.
value
=
0
;
//NORMAL
config
[
CC_id
]
->
rf_config
.
dl_carrier_bandwidth
.
value
=
106
;
config
[
CC_id
]
->
rf_config
.
ul_carrier_bandwidth
.
value
=
106
;
config
[
CC_id
]
->
sch_config
.
physical
_cell_id
.
value
=
0
;
config
[
CC_id
]
=
(
nfapi_nr_config_request_
scf_t
*
)
malloc
(
sizeof
(
nfapi_nr_config_request_scf
_t
));
config
[
CC_id
]
->
s
sb_config
.
scs_common
.
value
=
1
;
config
[
CC_id
]
->
cell_config
.
frame_duplex_typ
e
.
value
=
1
;
//FDD
//
config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
config
[
CC_id
]
->
carrier_config
.
dl_grid_size
[
1
]
.
value
=
106
;
config
[
CC_id
]
->
carrier_config
.
ul_grid_size
[
1
]
.
value
=
106
;
config
[
CC_id
]
->
cell_config
.
phy
_cell_id
.
value
=
0
;
///dl frequency to be filled in
/* //Set some default values that may be overwritten while reading options
frame_parms[CC_id]->frame_type = FDD;
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
View file @
de49abd6
This diff is collapsed.
Click to expand it.
openair1/PHY/INIT/nr_init.c
View file @
de49abd6
This diff is collapsed.
Click to expand it.
openair1/PHY/INIT/nr_parms.c
View file @
de49abd6
...
...
@@ -27,10 +27,11 @@ uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3,
uint16_t
nr_slots_per_subframe
[
MAX_NUM_SUBCARRIER_SPACING
]
=
{
1
,
2
,
4
,
16
,
32
};
int
nr_get_ssb_start_symbol
(
NR_DL_FRAME_PARMS
*
fp
,
uint8_t
i_ssb
,
uint8_t
half_frame_index
)
int
nr_get_ssb_start_symbol
(
NR_DL_FRAME_PARMS
*
fp
,
uint8_t
i_ssb
)
{
int
mu
=
fp
->
numerology_index
;
uint8_t
half_frame_index
=
fp
->
half_frame_bit
;
int
symbol
=
0
;
uint8_t
n
,
n_temp
;
nr_ssb_type_e
type
=
fp
->
ssb_type
;
...
...
@@ -79,16 +80,14 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp, uint8_t i_ssb, uint8_t half_f
return
symbol
;
}
int
nr_is_ssb_slot
(
nfapi_nr_config_request_t
*
cfg
,
int
slot
)
int
nr_is_ssb_slot
(
uint8_t
n_hf
,
uint8_t
period
,
int
slot
)
{
uint8_t
n_hf
;
int
rel_slot
;
n_hf
=
cfg
->
sch_config
.
half_frame_index
.
value
;
int
rel_slot
;
// if SSB periodicity is 5ms, they are transmitted in both half frames
if
(
cfg
->
sch_config
.
ssb_periodicity
.
value
==
5
)
{
if
(
period
==
0
)
{
if
(
slot
<
10
)
n_hf
=
0
;
else
...
...
@@ -122,6 +121,7 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
if
(
Ncp
==
NFAPI_CP_EXTENDED
)
AssertFatal
(
mu
==
NR_MU_2
,
"Invalid cyclic prefix %d for numerology index %d
\n
"
,
Ncp
,
mu
);
fp
->
half_frame_bit
=
0
;
// half frame bit initialized to 0 here
fp
->
numerology_index
=
mu
;
fp
->
Ncp
=
Ncp
;
fp
->
N_RB_DL
=
N_RB_DL
;
...
...
@@ -277,17 +277,17 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
return
0
;
}
int
nr_init_frame_parms
(
nfapi_nr_config_request_t
*
config
,
int
nr_init_frame_parms
(
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
fp
)
{
fp
->
eutra_band
=
config
->
nfapi_config
.
rf_bands
.
rf_band
[
0
]
;
fp
->
frame_type
=
config
->
subframe_config
.
duplex_mode
.
value
;
fp
->
L_ssb
=
config
->
sch_config
.
ssb_scg_position_in_burst
.
value
;
fp
->
frame_type
=
config
->
cell_config
.
frame_duplex_type
.
value
;
fp
->
L_ssb
=
(((
uint64_t
)
config
->
ssb_table
.
ssb_mask_list
[
1
].
ssb_mask
.
value
)
<<
32
)
|
config
->
ssb_table
.
ssb_mask_list
[
0
].
ssb_mask
.
value
;
int
N_RB_DL
=
config
->
carrier_config
.
dl_grid_size
[
config
->
ssb_config
.
scs_common
.
value
]
.
value
;
return
nr_init_frame_parms0
(
fp
,
config
->
s
ubframe_config
.
numerology_index_mu
.
value
,
config
->
subframe_config
.
dl_cyclic_prefix_type
.
value
,
config
->
rf_config
.
dl_carrier_bandwidth
.
value
);
config
->
s
sb_config
.
scs_common
.
value
,
NFAPI_CP_NORMAL
,
N_RB_DL
);
}
int
nr_init_frame_parms_ue
(
NR_DL_FRAME_PARMS
*
fp
,
...
...
@@ -314,8 +314,8 @@ void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp)
LOG_I
(
PHY
,
"fp->samples_per_frame_wCP=%d
\n
"
,
fp
->
samples_per_frame_wCP
);
LOG_I
(
PHY
,
"fp->samples_per_subframe=%d
\n
"
,
fp
->
samples_per_subframe
);
LOG_I
(
PHY
,
"fp->samples_per_frame=%d
\n
"
,
fp
->
samples_per_frame
);
LOG_I
(
PHY
,
"fp->dl_CarrierFreq=%u
\n
"
,
fp
->
dl_CarrierFreq
);
LOG_I
(
PHY
,
"fp->ul_CarrierFreq=%u
\n
"
,
fp
->
ul_CarrierFreq
);
LOG_I
(
PHY
,
"fp->dl_CarrierFreq=%
l
u
\n
"
,
fp
->
dl_CarrierFreq
);
LOG_I
(
PHY
,
"fp->ul_CarrierFreq=%
l
u
\n
"
,
fp
->
ul_CarrierFreq
);
}
...
...
openair1/PHY/INIT/phy_init.h
View file @
de49abd6
...
...
@@ -377,9 +377,9 @@ void phy_config_request(PHY_Config_t *phy_config);
int
init_frame_parms
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
osf
);
void
dump_frame_parms
(
LTE_DL_FRAME_PARMS
*
frame_parms
);
int
nr_get_ssb_start_symbol
(
NR_DL_FRAME_PARMS
*
fp
,
uint8_t
i_ssb
,
uint8_t
half_frame_index
);
int
nr_is_ssb_slot
(
nfapi_nr_config_request_t
*
cfg
,
int
slot
);
int
nr_init_frame_parms
(
nfapi_nr_config_request_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
);
int
nr_get_ssb_start_symbol
(
NR_DL_FRAME_PARMS
*
fp
,
uint8_t
i_ssb
);
int
nr_is_ssb_slot
(
uint8_t
n_hf
,
uint8_t
period
,
int
slot
);
int
nr_init_frame_parms
(
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
);
int
nr_init_frame_parms_ue
(
NR_DL_FRAME_PARMS
*
frame_parms
,
int
mu
,
int
Ncp
,
int
N_RB_DL
,
int
n_ssb_crb
,
int
ssb_subcarrier_offset
);
int
init_nr_ue_signal
(
PHY_VARS_NR_UE
*
ue
,
int
nb_connected_eNB
,
uint8_t
abstraction_flag
);
void
init_nr_ue_transport
(
PHY_VARS_NR_UE
*
ue
,
int
abstraction_flag
);
...
...
openair1/PHY/NR_REFSIG/nr_gold.c
View file @
de49abd6
...
...
@@ -26,11 +26,11 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB)
unsigned
int
x1
,
x2
;
uint16_t
Nid
,
i_ssb
,
i_ssb2
;
unsigned
char
Lmax
,
l
,
n_hf
,
N_hf
;
nfapi_nr_config_request_t
*
cfg
=
&
gNB
->
gNB_config
;
nfapi_nr_config_request_
scf_
t
*
cfg
=
&
gNB
->
gNB_config
;
NR_DL_FRAME_PARMS
*
fp
=
&
gNB
->
frame_parms
;
uint8_t
reset
;
Nid
=
cfg
->
sch_config
.
physical
_cell_id
.
value
;
Nid
=
cfg
->
cell_config
.
phy
_cell_id
.
value
;
Lmax
=
fp
->
Lmax
;
N_hf
=
(
Lmax
==
4
)
?
2
:
1
;
...
...
openair1/PHY/NR_TRANSPORT/nr_dci.c
View file @
de49abd6
...
...
@@ -42,8 +42,7 @@
uint16_t
nr_get_dci_size
(
nfapi_nr_dci_format_e
format
,
nfapi_nr_rnti_type_e
rnti_type
,
uint16_t
N_RB
,
nfapi_nr_config_request_t
*
config
)
{
uint16_t
N_RB
)
{
uint16_t
size
=
0
;
switch
(
format
)
{
...
...
@@ -52,7 +51,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
/// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 Time Domain assgnmt 4 --20
size
+=
20
;
size
+=
(
uint8_t
)
ceil
(
log2
(
(
N_RB
*
(
N_RB
+
1
))
>>
1
)
);
// Freq domain assignment -- hopping scenario to be updated
size
+=
nr_get_dci_size
(
NFAPI_NR_DL_DCI_FORMAT_1_0
,
rnti_type
,
N_RB
,
config
)
-
size
;
// Padding to match 1_0 size
size
+=
nr_get_dci_size
(
NFAPI_NR_DL_DCI_FORMAT_1_0
,
rnti_type
,
N_RB
)
-
size
;
// Padding to match 1_0 size
// UL/SUL indicator assumed to be 0
break
;
...
...
@@ -159,8 +158,8 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_config_pdcch_pdu *pdcch_pdu,
uint32_t
**
gold_pdcch_dmrs
,
int32_t
*
txdataF
,
int16_t
amp
,
NR_DL_FRAME_PARMS
frame_parms
,
nfapi_nr_config_request_t
config
)
{
NR_DL_FRAME_PARMS
frame_parms
)
{
int16_t
mod_dmrs
[
NR_MAX_CSET_DURATION
][
NR_MAX_PDCCH_DMRS_LENGTH
>>
1
];
// 3 for the max coreset duration
uint16_t
cset_start_sc
;
uint8_t
cset_start_symb
,
cset_nsymb
;
...
...
openair1/PHY/NR_TRANSPORT/nr_dci.h
View file @
de49abd6
...
...
@@ -27,15 +27,13 @@
uint16_t
nr_get_dci_size
(
nfapi_nr_dci_format_e
format
,
nfapi_nr_rnti_type_e
rnti_type
,
uint16_t
N_RB
,
nfapi_nr_config_request_t
*
config
);
uint16_t
N_RB
);
uint8_t
nr_generate_dci_top
(
nfapi_nr_dl_config_pdcch_pdu
*
pdcch_vars
,
uint32_t
**
gold_pdcch_dmrs
,
int32_t
*
txdataF
,
int16_t
amp
,
NR_DL_FRAME_PARMS
frame_parms
,
nfapi_nr_config_request_t
config
);
NR_DL_FRAME_PARMS
frame_parms
);
void
nr_pdcch_scrambling
(
uint32_t
*
in
,
uint32_t
size
,
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
de49abd6
...
...
@@ -74,7 +74,6 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
uint8_t
slot
,
NR_DL_FRAME_PARMS
*
frame_parms
,
int
xOverhead
,
nfapi_nr_config_request_t
*
config
,
time_stats_t
*
dlsch_encoding_stats
,
time_stats_t
*
dlsch_scrambling_stats
,
time_stats_t
*
dlsch_modulation_stats
)
{
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.h
View file @
de49abd6
...
...
@@ -77,7 +77,6 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
uint8_t
slot
,
NR_DL_FRAME_PARMS
*
frame_parms
,
int
xOverhead
,
nfapi_nr_config_request_t
*
config
,
time_stats_t
*
dlsch_encoding_stats
,
time_stats_t
*
dlsch_scrambling_stats
,
time_stats_t
*
dlsch_modulation_stats
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
de49abd6
...
...
@@ -107,19 +107,18 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch)
}
NR_gNB_DLSCH_t
*
new_gNB_dlsch
(
unsigned
char
Kmimo
,
NR_gNB_DLSCH_t
*
new_gNB_dlsch
(
NR_DL_FRAME_PARMS
*
frame_parms
,
unsigned
char
Kmimo
,
unsigned
char
Mdlharq
,
uint32_t
Nsoft
,
uint8_t
abstraction_flag
,
NR_DL_FRAME_PARMS
*
frame_parms
,
nfapi_nr_config_request_t
*
config
)
uint16_t
N_RB
)
{
NR_gNB_DLSCH_t
*
dlsch
;
unsigned
char
exit_flag
=
0
,
i
,
r
,
aa
,
layer
;
int
re
;
unsigned
char
bw_scaling
=
1
;
uint16_t
N_RB
=
config
->
rf_config
.
dl_carrier_bandwidth
.
value
;
switch
(
N_RB
)
{
...
...
openair1/PHY/NR_TRANSPORT/nr_pbch.c
View file @
de49abd6
...
...
@@ -50,13 +50,13 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs,
int32_t
*
txdataF
,
int16_t
amp
,
uint8_t
ssb_start_symbol
,
nfapi_nr_config_request_t
*
config
,
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
{
int
k
,
l
;
//int16_t a;
int16_t
mod_dmrs
[
NR_PBCH_DMRS_LENGTH
<<
1
];
uint8_t
idx
=
0
;
uint8_t
nushift
=
config
->
sch_config
.
physical
_cell_id
.
value
&
3
;
uint8_t
nushift
=
config
->
cell_config
.
phy
_cell_id
.
value
&
3
;
LOG_D
(
PHY
,
"PBCH DMRS mapping started at symbol %d shift %d
\n
"
,
ssb_start_symbol
+
1
,
nushift
);
/// QPSK modulation
...
...
@@ -229,7 +229,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
uint8_t
Lmax
,
uint8_t
ssb_index
,
int
sfn
,
nfapi_nr_config_request_t
*
config
,
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
{
int
k
,
l
,
m
;
//int16_t a;
...
...
@@ -265,7 +265,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
for
(
int
i
=
0
;
i
<
3
;
i
++
)
pbch
->
pbch_a
|=
((
ssb_index
>>
(
5
-
i
))
&
1
)
<<
(
29
+
i
);
// resp. 6th, 5th and 4th bits of ssb_index
else
pbch
->
pbch_a
|=
((
config
->
s
ch_config
.
ssb_subcarrier_offset
.
value
>>
4
)
&
1
)
<<
29
;
//MSB of k_SSB (bit index 4)
pbch
->
pbch_a
|=
((
config
->
s
sb_table
.
ssb_subcarrier_offset
.
value
>>
4
)
&
1
)
<<
29
;
//MSB of k_SSB (bit index 4)
LOG_D
(
PHY
,
"After extra byte: pbch_a = 0x%08x
\n
"
,
pbch
->
pbch_a
);
...
...
@@ -287,7 +287,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
M
=
(
Lmax
==
64
)
?
(
NR_POLAR_PBCH_PAYLOAD_BITS
-
6
)
:
(
NR_POLAR_PBCH_PAYLOAD_BITS
-
3
);
nushift
=
(((
sfn
>>
2
)
&
1
)
<<
1
)
^
((
sfn
>>
1
)
&
1
);
pbch
->
pbch_a_prime
=
0
;
nr_pbch_scrambling
(
pbch
,
(
uint32_t
)
config
->
sch_config
.
physical
_cell_id
.
value
,
nushift
,
M
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
0
,
unscrambling_mask
);
nr_pbch_scrambling
(
pbch
,
(
uint32_t
)
config
->
cell_config
.
phy
_cell_id
.
value
,
nushift
,
M
,
NR_POLAR_PBCH_PAYLOAD_BITS
,
0
,
unscrambling_mask
);
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Payload scrambling: nushift %d M %d sfn3 %d sfn2 %d
\n
"
,
nushift
,
M
,
(
sfn
>>
2
)
&
1
,
(
sfn
>>
1
)
&
1
);
printf
(
"pbch_a_prime: 0x%08x
\n
"
,
pbch
->
pbch_a_prime
);
...
...
@@ -312,7 +312,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
/// Scrambling
M
=
NR_POLAR_PBCH_E
;
nushift
=
(
Lmax
==
4
)
?
ssb_index
&
3
:
ssb_index
&
7
;
nr_pbch_scrambling
(
pbch
,
(
uint32_t
)
config
->
sch_config
.
physical
_cell_id
.
value
,
nushift
,
M
,
NR_POLAR_PBCH_E
,
1
,
0
);
nr_pbch_scrambling
(
pbch
,
(
uint32_t
)
config
->
cell_config
.
phy
_cell_id
.
value
,
nushift
,
M
,
NR_POLAR_PBCH_E
,
1
,
0
);
#ifdef DEBUG_PBCH_ENCODING
printf
(
"Scrambling:
\n
"
);
...
...
@@ -333,7 +333,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
}
/// Resource mapping
nushift
=
config
->
sch_config
.
physical
_cell_id
.
value
&
3
;
nushift
=
config
->
cell_config
.
phy
_cell_id
.
value
&
3
;
// PBCH modulated symbols are mapped within the SSB block on symbols 1, 2, 3 excluding the subcarriers used for the PBCH DMRS
///symbol 1 [0:239] -- 180 mod symbols
k
=
frame_parms
->
first_carrier_offset
+
frame_parms
->
ssb_start_subcarrier
;
...
...
openair1/PHY/NR_TRANSPORT/nr_pss.c
View file @
de49abd6
...
...
@@ -28,7 +28,7 @@ int nr_generate_pss( int16_t *d_pss,
int32_t
*
txdataF
,
int16_t
amp
,
uint8_t
ssb_start_symbol
,
nfapi_nr_config_request_t
*
config
,
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
{
int
i
,
k
,
l
,
m
;
...
...
@@ -36,7 +36,7 @@ int nr_generate_pss( int16_t *d_pss,
int16_t
x
[
NR_PSS_LENGTH
];
const
int
x_initial
[
7
]
=
{
0
,
1
,
1
,
0
,
1
,
1
,
1
};
uint8_t
Nid2
=
config
->
sch_config
.
physical
_cell_id
.
value
%
3
;
uint8_t
Nid2
=
config
->
cell_config
.
phy
_cell_id
.
value
%
3
;
/// Sequence generation
for
(
i
=
0
;
i
<
7
;
i
++
)
...
...
openair1/PHY/NR_TRANSPORT/nr_sss.c
View file @
de49abd6
...
...
@@ -27,7 +27,7 @@ int nr_generate_sss( int16_t *d_sss,
int32_t
*
txdataF
,
int16_t
amp
,
uint8_t
ssb_start_symbol
,
nfapi_nr_config_request_t
*
config
,
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
{
int
i
,
k
,
l
;
...
...
@@ -39,7 +39,7 @@ int nr_generate_sss( int16_t *d_sss,
const
int
x1_initial
[
7
]
=
{
1
,
0
,
0
,
0
,
0
,
0
,
0
};
/// Sequence generation
Nid
=
config
->
sch_config
.
physical
_cell_id
.
value
;
Nid
=
config
->
cell_config
.
phy
_cell_id
.
value
;
Nid2
=
Nid
%
3
;
Nid1
=
(
Nid
-
Nid2
)
/
3
;
...
...
openair1/PHY/NR_TRANSPORT/nr_transport.h
View file @
de49abd6
...
...
@@ -36,7 +36,7 @@ int nr_generate_pss( int16_t *d_pss,
int32_t
*
txdataF
,
int16_t
amp
,
uint8_t
ssb_start_symbol
,
nfapi_nr_config_request_t
*
config
,
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
);
/*!
...
...
@@ -49,7 +49,7 @@ int nr_generate_sss( int16_t *d_sss,
int32_t
*
txdataF
,
int16_t
amp
,
uint8_t
ssb_start_symbol
,
nfapi_nr_config_request_t
*
config
,
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
);
/*!
...
...
@@ -62,7 +62,7 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs,
int32_t
*
txdataF
,
int16_t
amp
,
uint8_t
ssb_start_symbol
,
nfapi_nr_config_request_t
*
config
,
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
);
/*!
...
...
@@ -94,7 +94,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
uint8_t
Lmax
,
uint8_t
ssb_index
,
int
sfn
,
nfapi_nr_config_request_t
*
config
,
nfapi_nr_config_request_
scf_
t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
);
/*!
...
...
@@ -105,12 +105,12 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
*/
void
nr_init_pbch_interleaver
(
uint8_t
*
interleaver
);
NR_gNB_DLSCH_t
*
new_gNB_dlsch
(
unsigned
char
Kmimo
,
NR_gNB_DLSCH_t
*
new_gNB_dlsch
(
NR_DL_FRAME_PARMS
*
frame_parms
,
unsigned
char
Kmimo
,
unsigned
char
Mdlharq
,
uint32_t
Nsoft
,
uint8_t
abstraction_flag
,
NR_DL_FRAME_PARMS
*
frame_parms
,
nfapi_nr_config_request_t
*
config
);
uint16_t
N_RB
);
void
rx_nr_prach
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
...
...
openair1/PHY/defs_gNB.h
View file @
de49abd6
...
...
@@ -598,7 +598,7 @@ typedef struct PHY_VARS_gNB_s {
int
rx_total_gain_dB
;
int
(
*
nr_start_if
)(
struct
RU_t_s
*
ru
,
struct
PHY_VARS_gNB_s
*
gNB
);
uint8_t
local_flag
;
nfapi_nr_config_request_t
gNB_config
;
nfapi_nr_config_request_
scf_
t
gNB_config
;
NR_DL_FRAME_PARMS
frame_parms
;
PHY_MEASUREMENTS_gNB
measurements
;
NR_IF_Module_t
*
if_inst
;
...
...
openair1/PHY/defs_nr_common.h
View file @
de49abd6
...
...
@@ -241,9 +241,9 @@ typedef struct NR_DL_FRAME_PARMS {
/// EUTRA Band
uint16_t
eutra_band
;
/// DL carrier frequency
uint
32
_t
dl_CarrierFreq
;
uint
64
_t
dl_CarrierFreq
;
/// UL carrier frequency
uint
32
_t
ul_CarrierFreq
;
uint
64
_t
ul_CarrierFreq
;
/// TX attenuation
uint32_t
att_tx
;
/// RX attenuation
...
...
@@ -321,6 +321,8 @@ typedef struct NR_DL_FRAME_PARMS {
/// TDD configuration
uint16_t
tdd_uplink_nr
[
2
*
NR_MAX_SLOTS_PER_FRAME
];
/* this is a bitmap of symbol of each slot given for 2 frames */
uint8_t
half_frame_bit
;
//SSB related params
/// Start in Subcarrier index of the SSB block
uint16_t
ssb_start_subcarrier
;
...
...
openair1/SCHED_NR/nr_ru_procedures.c
View file @
de49abd6
...
...
@@ -113,7 +113,6 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols) {
void
nr_feptx_ofdm_2thread
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
nfapi_nr_config_request_t
*
cfg
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
RU_proc_t
*
proc
=
&
ru
->
proc
;
struct
timespec
wait
;
int
slot
=
tti_tx
;
...
...
@@ -215,11 +214,11 @@ void nr_init_feptx_thread(RU_t *ru) {
void
nr_feptx_ofdm
(
RU_t
*
ru
,
int
frame_tx
,
int
tti_tx
)
{
NR_DL_FRAME_PARMS
*
fp
=
ru
->
nr_frame_parms
;
nfapi_nr_config_request_t
*
cfg
=
&
ru
->
gNB_list
[
0
]
->
gNB_config
;
int
cyclic_prefix_type
=
NFAPI_CP_NORMAL
;
unsigned
int
aa
=
0
;
int
slot_sizeF
=
(
fp
->
ofdm_symbol_size
)
*
((
c
fg
->
subframe_config
.
dl_cyclic_prefix_type
.
valu
e
==
1
)
?
12
:
14
);
((
c
yclic_prefix_typ
e
==
1
)
?
12
:
14
);
int
slot
=
tti_tx
;
int
*
txdata
=
&
ru
->
common
.
txdata
[
aa
][
slot
*
fp
->
samples_per_slot
];
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
de49abd6
...
...
@@ -84,23 +84,23 @@ int return_ssb_type(nfapi_config_request_t *cfg)
void
nr_set_ssb_first_subcarrier
(
nfapi_nr_config_request_t
*
cfg
,
NR_DL_FRAME_PARMS
*
fp
)
{
fp
->
ssb_start_subcarrier
=
(
12
*
cfg
->
s
ch_config
.
n_ssb_crb
.
value
+
cfg
->
sch_config
.
ssb_subcarrier_offset
.
value
)
/
(
1
<<
cfg
->
subframe_config
.
numerology_index_mu
.
value
);
LOG_D
(
PHY
,
"SSB first subcarrier %d (%d,%d)
\n
"
,
fp
->
ssb_start_subcarrier
,
cfg
->
s
ch_config
.
n_ssb_crb
.
value
,
cfg
->
sch_config
.
ssb_subcarrier_offset
.
value
);
void
nr_set_ssb_first_subcarrier
(
nfapi_nr_config_request_
scf_
t
*
cfg
,
NR_DL_FRAME_PARMS
*
fp
)
{
fp
->
ssb_start_subcarrier
=
(
12
*
cfg
->
s
sb_table
.
ssb_offset_point_a
.
value
+
cfg
->
ssb_table
.
ssb_subcarrier_offset
.
value
)
/
(
1
<<
cfg
->
ssb_config
.
scs_common
.
value
);
LOG_D
(
PHY
,
"SSB first subcarrier %d (%d,%d)
\n
"
,
fp
->
ssb_start_subcarrier
,
cfg
->
s
sb_table
.
ssb_offset_point_a
.
value
,
cfg
->
ssb_table
.
ssb_subcarrier_offset
.
value
);
}
void
nr_common_signal_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
slot
)
{
NR_DL_FRAME_PARMS
*
fp
=&
gNB
->
frame_parms
;
nfapi_nr_config_request_t
*
cfg
=
&
gNB
->
gNB_config
;
nfapi_nr_config_request_
scf_
t
*
cfg
=
&
gNB
->
gNB_config
;
int
**
txdataF
=
gNB
->
common_vars
.
txdataF
;
uint8_t
*
pbch_pdu
=&
gNB
->
pbch_pdu
[
0
];
uint8_t
ssb_index
,
n_hf
;
int
ssb_start_symbol
,
rel_slot
;
n_hf
=
cfg
->
sch_config
.
half_frame_index
.
value
;
n_hf
=
fp
->
half_frame_bit
;
// if SSB periodicity is 5ms, they are transmitted in both half frames
if
(
cfg
->
s
ch_config
.
ssb_periodicity
.
value
==
5
)
{
if
(
cfg
->
s
sb_table
.
ssb_period
.
value
==
0
)
{
if
(
slot
<
10
)
n_hf
=
0
;
else
...
...
@@ -118,7 +118,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
ssb_index
=
i
+
2
*
rel_slot
;
// computing the ssb_index
if
((
fp
->
L_ssb
>>
ssb_index
)
&
0x01
)
{
// generating the ssb only if the bit of L_ssb at current ssb index is 1
int
ssb_start_symbol_abs
=
nr_get_ssb_start_symbol
(
fp
,
ssb_index
,
n_hf
);
// computing the starting symbol for current ssb
int
ssb_start_symbol_abs
=
nr_get_ssb_start_symbol
(
fp
,
ssb_index
);
// computing the starting symbol for current ssb
ssb_start_symbol
=
ssb_start_symbol_abs
%
14
;
// start symbol wrt slot
nr_set_ssb_first_subcarrier
(
cfg
,
fp
);
// setting the first subcarrier
...
...
@@ -150,16 +150,16 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
int
do_meas
)
{
int
aa
;
NR_DL_FRAME_PARMS
*
fp
=&
gNB
->
frame_parms
;
nfapi_nr_config_request_t
*
cfg
=
&
gNB
->
gNB_config
;
nfapi_nr_config_request_
scf_
t
*
cfg
=
&
gNB
->
gNB_config
;
int
offset
=
gNB
->
CC_id
;
uint8_t
ssb_frame_periodicity
;
// every how many frames SSB are generated
uint8_t
ssb_frame_periodicity
=
1
;
// every how many frames SSB are generated
if
(
cfg
->
sch_config
.
ssb_periodicity
.
value
<
20
)
ssb_frame_periodicity
=
1
;
else
ssb_frame_periodicity
=
(
cfg
->
sch_config
.
ssb_periodicity
.
value
)
/
10
;
// 10ms is the frame length
if
((
cfg
->
subframe_config
.
duplex_mode
.
value
==
TDD
)
&&
if
(
cfg
->
ssb_table
.
ssb_period
.
value
>
1
)
ssb_frame_periodicity
=
1
<<
(
cfg
->
ssb_table
.
ssb_period
.
value
-
1
)
;
// 10ms is the frame length
if
((
cfg
->
cell_config
.
frame_duplex_type
.
value
==
TDD
)
&&
((
nr_slot_select
(
fp
,
frame
,
slot
)
&
NR_UPLINK_SLOT
)
>
0
))
return
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX
+
offset
,
1
);
...
...
@@ -187,7 +187,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
if
(
gNB
->
pdcch_pdu
)
nr_generate_dci_top
(
gNB
->
pdcch_pdu
,
gNB
->
nr_gold_pdcch_dmrs
[
slot
],
gNB
->
common_vars
.
txdataF
[
0
],
AMP
,
*
fp
,
*
cfg
);
AMP
,
*
fp
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX
,
0
);
LOG_D
(
PHY
,
"PDSCH generation started (%d)
\n
"
,
gNB
->
num_pdsch_rnti
);
...
...
@@ -196,7 +196,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
nr_generate_pdsch
(
gNB
->
dlsch
[
i
][
0
],
gNB
->
nr_gold_pdsch_dmrs
[
slot
],
gNB
->
common_vars
.
txdataF
,
AMP
,
frame
,
slot
,
fp
,
0
,
cfg
,
AMP
,
frame
,
slot
,
fp
,
0
,
&
gNB
->
dlsch_encoding_stats
,
&
gNB
->
dlsch_scrambling_stats
,
&
gNB
->
dlsch_modulation_stats
);
...
...
openair1/SCHED_NR/sched_nr.h
View file @
de49abd6
...
...
@@ -35,7 +35,7 @@
#include "phy_frame_config_nr.h"
void
nr_set_ssb_first_subcarrier
(
nfapi_nr_config_request_t
*
cfg
,
NR_DL_FRAME_PARMS
*
fp
);
void
nr_set_ssb_first_subcarrier
(
nfapi_nr_config_request_
scf_
t
*
cfg
,
NR_DL_FRAME_PARMS
*
fp
);
void
phy_procedures_gNB_TX
(
PHY_VARS_gNB
*
gNB
,
int
frame_tx
,
int
slot_tx
,
int
do_meas
);
void
phy_procedures_gNB_common_RX
(
PHY_VARS_gNB
*
gNB
,
int
frame_rx
,
int
slot_rx
);
void
phy_procedures_gNB_uespec_RX
(
PHY_VARS_gNB
*
gNB
,
int
frame_rx
,
int
slot_rx
);
...
...
openair1/SIMULATION/NR_PHY/dlschsim.c
View file @
de49abd6
...
...
@@ -136,7 +136,6 @@ int main(int argc, char **argv)
int
frame_length_complex_samples
;
//int frame_length_complex_samples_no_prefix;
NR_DL_FRAME_PARMS
*
frame_parms
;
//nfapi_nr_config_request_t *gNB_config;
uint8_t
Kmimo
=
0
;
uint32_t
Nsoft
=
0
;
double
sigma
;
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
de49abd6
...
...
@@ -207,12 +207,11 @@ int main(int argc, char **argv)
int
frame_length_complex_samples_no_prefix
;
int
slot_length_complex_samples_no_prefix
;
NR_DL_FRAME_PARMS
*
frame_parms
;
nfapi_nr_config_request_t
*
gNB_config
;
UE_nr_rxtx_proc_t
UE_proc
;
NR_Sched_Rsp_t
Sched_INFO
;
gNB_MAC_INST
*
gNB_mac
;
NR_UE_MAC_INST_t
*
UE_mac
;
int
cyclic_prefix_type
=
NFAPI_CP_NORMAL
;
int
ret
;
int
run_initial_sync
=
0
;
int
do_pdcch_flag
=
1
;
...
...
@@ -478,7 +477,6 @@ int main(int argc, char **argv)
memset
(
RC
.
gNB
[
0
],
0
,
sizeof
(
PHY_VARS_gNB
));
gNB
=
RC
.
gNB
[
0
];
gNB_config
=
&
gNB
->
gNB_config
;
frame_parms
=
&
gNB
->
frame_parms
;
//to be initialized I suppose (maybe not necessary for PBCH)
frame_parms
->
nb_antennas_tx
=
n_tx
;
frame_parms
->
nb_antennas_rx
=
n_rx
;
...
...
@@ -692,7 +690,7 @@ int main(int argc, char **argv)
//TODO: loop over slots
for
(
aa
=
0
;
aa
<
gNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
if
(
gNB_config
->
subframe_config
.
dl_cyclic_prefix_type
.
valu
e
==
1
)
{
if
(
cyclic_prefix_typ
e
==
1
)
{
PHY_ofdm_mod
(
gNB
->
common_vars
.
txdataF
[
aa
],
&
txdata
[
aa
][
tx_offset
],
frame_parms
->
ofdm_symbol_size
,
...
...
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
de49abd6
...
...
@@ -113,7 +113,6 @@ int main(int argc, char **argv)
int
frame_length_complex_samples
;
int
frame_length_complex_samples_no_prefix
;
NR_DL_FRAME_PARMS
*
frame_parms
;
nfapi_nr_config_request_t
*
gNB_config
;
int
ret
,
payload_ret
=
0
;
int
run_initial_sync
=
0
;
...
...
@@ -348,7 +347,6 @@ int main(int argc, char **argv)
RC
.
gNB
=
(
PHY_VARS_gNB
**
)
malloc
(
sizeof
(
PHY_VARS_gNB
*
));
RC
.
gNB
[
0
]
=
malloc
(
sizeof
(
PHY_VARS_gNB
));
gNB
=
RC
.
gNB
[
0
];
gNB_config
=
&
gNB
->
gNB_config
;
frame_parms
=
&
gNB
->
frame_parms
;
//to be initialized I suppose (maybe not necessary for PBCH)
frame_parms
->
nb_antennas_tx
=
n_tx
;
frame_parms
->
nb_antennas_rx
=
n_rx
;
...
...
@@ -361,7 +359,8 @@ int main(int argc, char **argv)
nr_phy_config_request_sim
(
gNB
,
N_RB_DL
,
N_RB_DL
,
mu
,
Nid_cell
,
SSB_positions
);
phy_init_nr_gNB
(
gNB
,
0
,
0
);
uint8_t
n_hf
=
gNB_config
->
sch_config
.
half_frame_index
.
value
;
uint8_t
n_hf
=
0
;
int
cyclic_prefix_type
=
NFAPI_CP_NORMAL
;
double
fs
,
bw
,
scs
,
eps
;
...
...
@@ -479,7 +478,7 @@ int main(int argc, char **argv)
nr_common_signal_procedures
(
gNB
,
frame
,
slot
);
for
(
aa
=
0
;
aa
<
gNB
->
frame_parms
.
nb_antennas_tx
;
aa
++
)
{
if
(
gNB_config
->
subframe_config
.
dl_cyclic_prefix_type
.
valu
e
==
1
)
{
if
(
cyclic_prefix_typ
e
==
1
)
{
PHY_ofdm_mod
(
gNB
->
common_vars
.
txdataF
[
aa
],
&
txdata
[
aa
][
slot
*
frame_parms
->
samples_per_slot
],
frame_parms
->
ofdm_symbol_size
,
...
...
@@ -589,7 +588,7 @@ int main(int argc, char **argv)
UE
->
rx_offset
=
0
;
uint8_t
ssb_index
=
0
;
while
(
!
((
SSB_positions
>>
ssb_index
)
&
0x01
))
ssb_index
++
;
// to select the first transmitted ssb
UE
->
symbol_offset
=
nr_get_ssb_start_symbol
(
frame_parms
,
ssb_index
,
n_hf
);
UE
->
symbol_offset
=
nr_get_ssb_start_symbol
(
frame_parms
,
ssb_index
);
int
ssb_slot
=
(
ssb_index
/
2
)
+
(
n_hf
*
frame_parms
->
slots_per_frame
);
for
(
int
i
=
UE
->
symbol_offset
+
1
;
i
<
UE
->
symbol_offset
+
4
;
i
++
)
{
nr_slot_fep
(
UE
,
...
...
openair2/GNB_APP/gnb_config.c
View file @
de49abd6
...
...
@@ -639,7 +639,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
// Parse optional physical parameters
sprintf
(
gnbpath
,
"%s.[%i]"
,
GNB_CONFIG_STRING_GNB_LIST
,
k
),
printf
(
"SSB SCO %d
\n
"
,
ssb_SubcarrierOffset
);
NRRRC_CONFIGURATION_REQ
(
msg_p
).
ssb_SubcarrierOffset
=
ssb_SubcarrierOffset
;
NRRRC_CONFIGURATION_REQ
(
msg_p
).
scc
=
scc
;
...
...
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
de49abd6
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
de49abd6
...
...
@@ -853,7 +853,7 @@ void fill_dci_pdu_rel15(nfapi_nr_dl_config_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
nfapi_nr_coreset_t coreset,
uint16_t frame,
uint16_t slot,
nfapi_nr_config_request_t cfg) {
nfapi_nr_config_request_
scf_
t cfg) {
AssertFatal(search_space.coreset_id==coreset.coreset_id, "Invalid association of coreset(%d) and search space(%d)\n",
search_space.search_space_id, coreset.coreset_id);
...
...
@@ -870,38 +870,20 @@ void fill_dci_pdu_rel15(nfapi_nr_dl_config_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
}
*/
int
get_
dlscs
(
nfapi_nr_config_request
_t
*
cfg
)
{
int
get_
spf
(
nfapi_nr_config_request_scf
_t
*
cfg
)
{
return
(
cfg
->
rf_config
.
dl_subcarrierspacing
.
value
);
}
int
get_ulscs
(
nfapi_nr_config_request_t
*
cfg
)
{
return
(
cfg
->
rf_config
.
ul_subcarrierspacing
.
value
);
}
int
get_spf
(
nfapi_nr_config_request_t
*
cfg
)
{
int
mu
=
cfg
->
rf_config
.
dl_subcarrierspacing
.
value
;
int
mu
=
cfg
->
ssb_config
.
scs_common
.
value
;
AssertFatal
(
mu
>=
0
&&
mu
<
4
,
"Illegal scs %d
\n
"
,
mu
);
return
(
10
*
(
1
<<
mu
));
}
int
to_absslot
(
nfapi_nr_config_request_t
*
cfg
,
int
frame
,
int
slot
)
{
int
to_absslot
(
nfapi_nr_config_request_
scf_
t
*
cfg
,
int
frame
,
int
slot
)
{
return
(
get_spf
(
cfg
)
*
frame
)
+
slot
;
}
int
get_symbolsperslot
(
nfapi_nr_config_request_t
*
cfg
)
{
return
((
cfg
->
subframe_config
.
dl_cyclic_prefix_type
.
value
==
NFAPI_CP_EXTENDED
)
?
12
:
14
);
}
int
extract_startSymbol
(
int
startSymbolAndLength
)
{
int
tmp
=
startSymbolAndLength
/
14
;
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
de49abd6
...
...
@@ -100,7 +100,7 @@ int nr_is_dci_opportunity(nfapi_nr_search_space_t search_space,
nfapi_nr_coreset_t coreset,
uint16_t frame,
uint16_t slot,
nfapi_nr_config_request_t cfg);
nfapi_nr_config_request_
scf_
t cfg);
*/
void
nr_configure_pdcch
(
nfapi_nr_dl_config_pdcch_pdu_rel15_t
*
pdcch_pdu
,
int
ss_type
,
...
...
@@ -111,17 +111,12 @@ void fill_dci_pdu_rel15(nfapi_nr_dl_config_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
int
*
dci_formats
,
int
*
rnti_types
);
int
get_dlscs
(
nfapi_nr_config_request_t
*
cfg
);
int
get_
ulscs
(
nfapi_nr_config_request
_t
*
cfg
);
int
get_
spf
(
nfapi_nr_config_request_scf
_t
*
cfg
);
int
get_spf
(
nfapi_nr_config_request_t
*
cfg
);
int
to_absslot
(
nfapi_nr_config_request_scf_t
*
cfg
,
int
frame
,
int
slot
);
int
to_absslot
(
nfapi_nr_config_request_t
*
cfg
,
int
frame
,
int
slot
);
int
get_symbolsperslot
(
nfapi_nr_config_request_t
*
cfg
);
void
get_band
(
uint32_t
downlink_frequency
,
uint16_t
*
current_band
,
int32_t
*
current_offset
,
lte_frame_type_t
*
current_type
);
void
get_band
(
uint64_t
downlink_frequency
,
uint16_t
*
current_band
,
int32_t
*
current_offset
,
lte_frame_type_t
*
current_type
);
uint64_t
from_nrarfcn
(
int
nr_bandP
,
uint32_t
dl_nrarfcn
);
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_common.c
View file @
de49abd6
...
...
@@ -69,7 +69,7 @@ nr_bandentry_t nr_bandtable[] = {
#define NR_BANDTABLE_SIZE (sizeof(nr_bandtable)/sizeof(nr_bandentry_t))
void
get_band
(
uint
32
_t
downlink_frequency
,
void
get_band
(
uint
64
_t
downlink_frequency
,
uint16_t
*
current_band
,
int32_t
*
current_offset
,
lte_frame_type_t
*
current_type
)
...
...
@@ -91,9 +91,7 @@ void get_band(uint32_t downlink_frequency,
if
(
nr_bandtable
[
ind
].
dl_min
<=
dl_freq_khz
&&
nr_bandtable
[
ind
].
dl_max
>=
dl_freq_khz
)
{
center_frequency_khz
=
(
nr_bandtable
[
ind
].
dl_max
+
nr_bandtable
[
ind
].
dl_min
)
/
2
;
if
(
abs
(
dl_freq_khz
-
center_frequency_khz
)
<
center_freq_diff_khz
){
*
current_band
=
nr_bandtable
[
ind
].
band
;
*
current_offset
=
(
nr_bandtable
[
ind
].
ul_min
-
nr_bandtable
[
ind
].
dl_min
)
*
1000
;
center_freq_diff_khz
=
abs
(
dl_freq_khz
-
center_frequency_khz
);
...
...
@@ -106,11 +104,11 @@ void get_band(uint32_t downlink_frequency,
}
}
LOG_I
(
PHY
,
"DL frequency %"
PRIu
32
": band %d, frame_type %d, UL frequency %"
PRIu32
"
\n
"
,
LOG_I
(
PHY
,
"DL frequency %"
PRIu
64
": band %d, frame_type %d, UL frequency %"
PRIu64
"
\n
"
,
downlink_frequency
,
*
current_band
,
*
current_type
,
downlink_frequency
+*
current_offset
);
AssertFatal
(
*
current_band
!=
0
,
"Can't find EUTRA band for frequency %u
\n
"
,
downlink_frequency
);
"Can't find EUTRA band for frequency %
l
u
\n
"
,
downlink_frequency
);
}
uint32_t
to_nrarfcn
(
int
nr_bandP
,
...
...
@@ -362,7 +360,7 @@ static inline uint8_t get_table_idx(uint8_t mcs_table, uint8_t dci_format, uint8
int
get_num_dmrs
(
uint16_t
dmrs_mask
)
{
int
num_dmrs
;
int
num_dmrs
=
0
;
for
(
int
i
=
0
;
i
<
16
;
i
++
)
num_dmrs
+=
((
dmrs_mask
>>
i
)
&
1
);
return
(
num_dmrs
);
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
de49abd6
...
...
@@ -67,7 +67,7 @@ typedef struct {
int
p_gNB
;
int
Ncp
;
int
nr_band
;
uint
32
_t
dl_CarrierFreq
;
uint
64
_t
dl_CarrierFreq
;
NR_BCCH_BCH_Message_t
*
mib
;
NR_ServingCellConfigCommon_t
*
ServingCellConfigCommon
;
NR_TDD_UL_DL_ConfigCommon_t
*
tdd_Config
;
...
...
@@ -139,7 +139,7 @@ typedef struct gNB_MAC_INST_s {
uint16_t
pdu_index
[
NFAPI_CC_MAX
];
/// NFAPI Config Request Structure
nfapi_nr_config_request_
t
config
[
NFAPI_CC_MAX
];
nfapi_nr_config_request_
scf_t
config
[
NFAPI_CC_MAX
];
/// NFAPI DL Config Request Structure
nfapi_nr_dl_config_request_t
DL_req
[
NFAPI_CC_MAX
];
/// NFAPI UL TTI Request Structure (this is from the new SCF specs)
...
...
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
View file @
de49abd6
...
...
@@ -283,7 +283,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
(UL_info->frame+((UL_info->slot>(9-sf_ahead))?1:0)) % 1024,
(UL_info->slot+sf_ahead)%10);
*/
nfapi_nr_config_request_t
*
cfg
=
&
mac
->
config
[
CC_id
];
nfapi_nr_config_request_
scf_
t
*
cfg
=
&
mac
->
config
[
CC_id
];
int
spf
=
get_spf
(
cfg
);
gNB_dlsch_ulsch_scheduler
(
module_id
,
UL_info
->
frame
,
...
...
openair2/NR_PHY_INTERFACE/NR_IF_Module.h
View file @
de49abd6
...
...
@@ -112,7 +112,7 @@ typedef struct {
typedef
struct
{
uint8_t
Mod_id
;
int
CC_id
;
nfapi_nr_config_request_t
*
cfg
;
nfapi_nr_config_request_
scf_
t
*
cfg
;
}
NR_PHY_Config_t
;
typedef
struct
NR_IF_Module_s
{
...
...
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