Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
458b4a62
Commit
458b4a62
authored
Dec 27, 2023
by
francescomani
Committed by
Laurent THOMAS
Jan 10, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for computing ssb subcarrier offset
parent
6df54457
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
22 deletions
+41
-22
common/utils/nr/nr_common.c
common/utils/nr/nr_common.c
+19
-12
common/utils/nr/nr_common.h
common/utils/nr/nr_common.h
+7
-1
openair1/PHY/INIT/nr_parms.c
openair1/PHY/INIT/nr_parms.c
+5
-3
openair1/PHY/NR_TRANSPORT/nr_pbch.c
openair1/PHY/NR_TRANSPORT/nr_pbch.c
+2
-1
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+4
-3
openair2/RRC/NR/nr_rrc_config.c
openair2/RRC/NR/nr_rrc_config.c
+4
-2
No files found.
common/utils/nr/nr_common.c
View file @
458b4a62
...
@@ -755,11 +755,20 @@ void SLIV2SL(int SLIV,int *S,int *L) {
...
@@ -755,11 +755,20 @@ void SLIV2SL(int SLIV,int *S,int *L) {
}
}
}
}
int
get_ssb_subcarrier_offset
(
uint32_t
absoluteFrequencySSB
,
uint32_t
absoluteFrequencyPointA
)
nr_sco_info_t
get_ssb_subcarrier_offset
(
int
scs
,
uint32_t
absoluteFrequencySSB
,
uint32_t
absoluteFrequencyPointA
)
{
{
uint32_t
absolute_diff
=
(
absoluteFrequencySSB
-
absoluteFrequencyPointA
);
nr_sco_info_t
sco
;
const
int
scaling_5khz
=
absoluteFrequencyPointA
<
600000
?
3
:
1
;
// for FR1 k_SSB expressed in terms of 15kHz SCS
return
((
absolute_diff
/
scaling_5khz
)
%
24
);
// for FR2 k_SSB expressed in terms of the subcarrier spacing provided by the higher-layer parameter subCarrierSpacingCommon
sco
.
absolute_diff
=
(
absoluteFrequencySSB
-
absoluteFrequencyPointA
);
sco
.
scaling
=
1
;
if
(
absoluteFrequencyPointA
<
600000
)
sco
.
scaling
=
3
;
if
(
scs
>
2
)
sco
.
scaling
<<=
(
scs
-
2
);
int
sco_limit
=
scs
==
1
?
24
:
12
;
sco
.
subcarrier_offset
=
((
sco
.
absolute_diff
/
sco
.
scaling
)
%
sco_limit
);
return
sco
;
}
}
uint32_t
get_ssb_offset_to_pointA
(
uint32_t
absoluteFrequencySSB
,
uint32_t
get_ssb_offset_to_pointA
(
uint32_t
absoluteFrequencySSB
,
...
@@ -767,16 +776,14 @@ uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
...
@@ -767,16 +776,14 @@ uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
int
ssbSubcarrierSpacing
,
int
ssbSubcarrierSpacing
,
int
frequency_range
)
int
frequency_range
)
{
{
uint32_t
absolute_diff
=
(
absoluteFrequencySSB
-
absoluteFrequencyPointA
);
nr_sco_info_t
sco
=
get_ssb_subcarrier_offset
(
ssbSubcarrierSpacing
,
absoluteFrequencySSB
,
absoluteFrequencyPointA
);
const
int
scaling_5khz
=
absoluteFrequencyPointA
<
600000
?
3
:
1
;
int
sco
=
get_ssb_subcarrier_offset
(
absoluteFrequencySSB
,
absoluteFrequencyPointA
);
const
int
scs_scaling
=
frequency_range
==
FR2
?
1
<<
(
ssbSubcarrierSpacing
-
2
)
:
1
<<
ssbSubcarrierSpacing
;
const
int
scs_scaling
=
frequency_range
==
FR2
?
1
<<
(
ssbSubcarrierSpacing
-
2
)
:
1
<<
ssbSubcarrierSpacing
;
const
int
scaled_abs_diff
=
absolute_diff
/
scaling_5khz
;
const
int
scaled_abs_diff
=
sco
.
absolute_diff
/
sco
.
scaling
;
const
int
ssb_offset_point_a
=
// absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total
(
scaled_abs_diff
-
sco
)
/
1
2
const
int
cent_freq_comp
=
frequency_range
==
FR2
?
10
:
10
*
scs_scaling
;
// scaling taken into account in sco.scaling for FR
2
-
10
*
scs_scaling
;
// absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total
const
int
ssb_offset_point_a
=
(
scaled_abs_diff
-
sco
.
subcarrier_offset
)
/
12
-
cent_freq_comp
;
AssertFatal
(
ssb_offset_point_a
%
scs_scaling
==
0
,
"PRB offset %d can create frequency offset
\n
"
,
ssb_offset_point_a
);
AssertFatal
(
ssb_offset_point_a
%
scs_scaling
==
0
,
"PRB offset %d can create frequency offset
\n
"
,
ssb_offset_point_a
);
AssertFatal
(
sco
%
scs_scaling
==
0
,
"ssb offset %d can create frequency offset
\n
"
,
sco
);
AssertFatal
(
sco
.
subcarrier_offset
%
scs_scaling
==
0
,
"ssb offset %d can create frequency offset
\n
"
,
sco
.
subcarrier_offset
);
return
ssb_offset_point_a
;
return
ssb_offset_point_a
;
}
}
...
...
common/utils/nr/nr_common.h
View file @
458b4a62
...
@@ -81,6 +81,12 @@ typedef enum {
...
@@ -81,6 +81,12 @@ typedef enum {
nr_FR2
nr_FR2
}
nr_frequency_range_e
;
}
nr_frequency_range_e
;
typedef
struct
{
int
subcarrier_offset
;
uint32_t
absolute_diff
;
int
scaling
;
}
nr_sco_info_t
;
typedef
struct
nr_bandentry_s
{
typedef
struct
nr_bandentry_s
{
int16_t
band
;
int16_t
band
;
uint64_t
ul_min
;
uint64_t
ul_min
;
...
@@ -157,7 +163,7 @@ uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
...
@@ -157,7 +163,7 @@ uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
uint32_t
absoluteFrequencyPointA
,
uint32_t
absoluteFrequencyPointA
,
int
ssbSubcarrierSpacing
,
int
ssbSubcarrierSpacing
,
int
frequency_range
);
int
frequency_range
);
int
get_ssb_subcarrier_offset
(
uint32_t
absoluteFrequencySSB
,
uint32_t
absoluteFrequencyPointA
);
nr_sco_info_t
get_ssb_subcarrier_offset
(
int
scs
,
uint32_t
absoluteFrequencySSB
,
uint32_t
absoluteFrequencyPointA
);
int
get_delay_idx
(
int
delay
,
int
max_delay_comp
);
int
get_delay_idx
(
int
delay
,
int
max_delay_comp
);
void
freq2time
(
uint16_t
ofdm_symbol_size
,
void
freq2time
(
uint16_t
ofdm_symbol_size
,
...
...
openair1/PHY/INIT/nr_parms.c
View file @
458b4a62
...
@@ -347,10 +347,12 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
...
@@ -347,10 +347,12 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
fp
->
freq_range
=
(
fp
->
dl_CarrierFreq
<
6e9
)
?
nr_FR1
:
nr_FR2
;
fp
->
freq_range
=
(
fp
->
dl_CarrierFreq
<
6e9
)
?
nr_FR1
:
nr_FR2
;
uint8_t
sco
=
0
;
uint8_t
sco
=
0
;
if
(((
fp
->
freq_range
==
nr_FR1
)
&&
(
config
->
ssb_table
.
ssb_subcarrier_offset
<
24
))
||
if
(((
fp
->
freq_range
==
nr_FR1
)
&&
(
config
->
ssb_table
.
ssb_subcarrier_offset
<
24
))
||
((
fp
->
freq_range
==
nr_FR2
)
&&
(
config
->
ssb_table
.
ssb_subcarrier_offset
<
12
))
)
{
((
fp
->
freq_range
==
nr_FR2
)
&&
(
config
->
ssb_table
.
ssb_subcarrier_offset
<
12
))
)
{
if
(
fp
->
freq_range
==
nr_FR1
)
if
(
fp
->
freq_range
==
nr_FR1
)
sco
=
config
->
ssb_table
.
ssb_subcarrier_offset
>>
config
->
ssb_config
.
scs_common
;
sco
=
config
->
ssb_table
.
ssb_subcarrier_offset
>>
config
->
ssb_config
.
scs_common
;
else
sco
=
config
->
ssb_table
.
ssb_subcarrier_offset
;
}
}
fp
->
ssb_start_subcarrier
=
(
12
*
config
->
ssb_table
.
ssb_offset_point_a
+
sco
);
fp
->
ssb_start_subcarrier
=
(
12
*
config
->
ssb_table
.
ssb_offset_point_a
+
sco
);
...
...
openair1/PHY/NR_TRANSPORT/nr_pbch.c
View file @
458b4a62
...
@@ -228,7 +228,8 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
...
@@ -228,7 +228,8 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
uint8_t
n_hf
,
uint8_t
n_hf
,
int
sfn
,
int
sfn
,
nfapi_nr_config_request_scf_t
*
config
,
nfapi_nr_config_request_scf_t
*
config
,
NR_DL_FRAME_PARMS
*
frame_parms
)
{
NR_DL_FRAME_PARMS
*
frame_parms
)
{
int
k
,
l
,
m
;
int
k
,
l
,
m
;
//int16_t a;
//int16_t a;
int16_t
mod_pbch_e
[
NR_POLAR_PBCH_E
];
int16_t
mod_pbch_e
[
NR_POLAR_PBCH_E
];
...
...
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
458b4a62
...
@@ -329,9 +329,10 @@ static void config_common(gNB_MAC_INST *nrmac, int pdsch_AntennaPorts, int pusch
...
@@ -329,9 +329,10 @@ static void config_common(gNB_MAC_INST *nrmac, int pdsch_AntennaPorts, int pusch
cfg
->
ssb_table
.
ssb_period
.
value
=
*
scc
->
ssb_periodicityServingCell
;
cfg
->
ssb_table
.
ssb_period
.
value
=
*
scc
->
ssb_periodicityServingCell
;
cfg
->
ssb_table
.
ssb_period
.
tl
.
tag
=
NFAPI_NR_CONFIG_SSB_PERIOD_TAG
;
cfg
->
ssb_table
.
ssb_period
.
tl
.
tag
=
NFAPI_NR_CONFIG_SSB_PERIOD_TAG
;
cfg
->
num_tlv
++
;
cfg
->
num_tlv
++
;
cfg
->
ssb_table
.
ssb_subcarrier_offset
.
value
=
nr_sco_info_t
sco
=
get_ssb_subcarrier_offset
(
*
scc
->
ssbSubcarrierSpacing
,
get_ssb_subcarrier_offset
(
*
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencySSB
,
*
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencySSB
,
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencyPointA
);
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencyPointA
);
cfg
->
ssb_table
.
ssb_subcarrier_offset
.
value
=
sco
.
subcarrier_offset
;
AssertFatal
(
cfg
->
ssb_table
.
ssb_subcarrier_offset
.
value
<
16
,
AssertFatal
(
cfg
->
ssb_table
.
ssb_subcarrier_offset
.
value
<
16
,
"cannot handle ssb_subcarrier_offset %d resulting from Point A %ld SSB %ld: please increase dl_absoluteFrequencyPointA "
"cannot handle ssb_subcarrier_offset %d resulting from Point A %ld SSB %ld: please increase dl_absoluteFrequencyPointA "
"in the config by 16
\n
"
,
"in the config by 16
\n
"
,
...
...
openair2/RRC/NR/nr_rrc_config.c
View file @
458b4a62
...
@@ -1767,8 +1767,10 @@ NR_BCCH_BCH_Message_t *get_new_MIB_NR(const NR_ServingCellConfigCommon_t *scc)
...
@@ -1767,8 +1767,10 @@ NR_BCCH_BCH_Message_t *get_new_MIB_NR(const NR_ServingCellConfigCommon_t *scc)
AssertFatal
(
scc
->
ssbSubcarrierSpacing
!=
NULL
,
"scc->ssbSubcarrierSpacing is null
\n
"
);
AssertFatal
(
scc
->
ssbSubcarrierSpacing
!=
NULL
,
"scc->ssbSubcarrierSpacing is null
\n
"
);
int
ssb_subcarrier_offset
=
31
;
// default value for NSA
int
ssb_subcarrier_offset
=
31
;
// default value for NSA
if
(
get_softmodem_params
()
->
sa
)
{
if
(
get_softmodem_params
()
->
sa
)
{
ssb_subcarrier_offset
=
get_ssb_subcarrier_offset
(
*
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencySSB
,
nr_sco_info_t
sco
=
get_ssb_subcarrier_offset
(
*
scc
->
ssbSubcarrierSpacing
,
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencyPointA
);
*
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencySSB
,
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencyPointA
);
ssb_subcarrier_offset
=
sco
.
subcarrier_offset
;
}
}
mib
->
message
.
choice
.
mib
->
ssb_SubcarrierOffset
=
ssb_subcarrier_offset
&
15
;
mib
->
message
.
choice
.
mib
->
ssb_SubcarrierOffset
=
ssb_subcarrier_offset
&
15
;
...
...
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