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
Michael Black
OpenXG-RAN
Commits
87d95177
Commit
87d95177
authored
Apr 17, 2023
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid duplicated function in nr_common for supported bandwidth
parent
56367dd0
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
272 additions
and
364 deletions
+272
-364
common/utils/nr/nr_common.c
common/utils/nr/nr_common.c
+20
-132
common/utils/nr/nr_common.h
common/utils/nr/nr_common.h
+1
-1
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+2
-1
openair1/SIMULATION/NR_PHY/pbchsim.c
openair1/SIMULATION/NR_PHY/pbchsim.c
+2
-1
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+181
-174
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+66
-55
No files found.
common/utils/nr/nr_common.c
View file @
87d95177
...
@@ -49,8 +49,8 @@ int get_supported_band_index(int scs, int band, int n_rbs)
...
@@ -49,8 +49,8 @@ int get_supported_band_index(int scs, int band, int n_rbs)
int
scs_index
=
scs
;
int
scs_index
=
scs
;
if
(
band
>
256
)
if
(
band
>
256
)
scs_index
++
;
scs_index
++
;
for
(
int
i
=
0
;
i
<
1
1
;
i
++
)
{
for
(
int
i
=
0
;
i
<
1
2
;
i
++
)
{
if
(
n_rbs
==
tables_5_3_2
[
scs
][
i
])
if
(
n_rbs
==
tables_5_3_2
[
scs
_index
][
i
])
return
i
;
return
i
;
}
}
return
(
-
1
);
// not found
return
(
-
1
);
// not found
...
@@ -130,34 +130,34 @@ const nr_bandentry_t nr_bandtable[] = {
...
@@ -130,34 +130,34 @@ const nr_bandentry_t nr_bandtable[] = {
{
261
,
27500040
,
28350000
,
27500040
,
28350000
,
2
,
2070833
,
120
}
{
261
,
27500040
,
28350000
,
27500040
,
28350000
,
2
,
2070833
,
120
}
};
};
int
get_supported_bw_
k
hz
(
frequency_range_t
frequency_range
,
int
bw_index
)
int
get_supported_bw_
m
hz
(
frequency_range_t
frequency_range
,
int
bw_index
)
{
{
if
(
frequency_range
==
FR1
)
{
if
(
frequency_range
==
FR1
)
{
switch
(
bw_index
)
{
switch
(
bw_index
)
{
case
0
:
case
0
:
return
5
000
;
// 5MHz
return
5
;
// 5MHz
case
1
:
case
1
:
return
10
000
;
return
10
;
case
2
:
case
2
:
return
15
000
;
return
15
;
case
3
:
case
3
:
return
20
000
;
return
20
;
case
4
:
case
4
:
return
25
000
;
return
25
;
case
5
:
case
5
:
return
30
000
;
return
30
;
case
6
:
case
6
:
return
40
000
;
return
40
;
case
7
:
case
7
:
return
50
000
;
return
50
;
case
8
:
case
8
:
return
60
000
;
return
60
;
case
9
:
case
9
:
return
80
000
;
return
80
;
case
10
:
case
10
:
return
90
000
;
return
90
;
case
11
:
case
11
:
return
100
000
;
return
100
;
default
:
default
:
AssertFatal
(
false
,
"Invalid band index for FR1 %d
\n
"
,
bw_index
);
AssertFatal
(
false
,
"Invalid band index for FR1 %d
\n
"
,
bw_index
);
}
}
...
@@ -165,13 +165,13 @@ int get_supported_bw_khz(frequency_range_t frequency_range, int bw_index)
...
@@ -165,13 +165,13 @@ int get_supported_bw_khz(frequency_range_t frequency_range, int bw_index)
else
{
else
{
switch
(
bw_index
)
{
switch
(
bw_index
)
{
case
0
:
case
0
:
return
50
000
;
// 50MHz
return
50
;
// 50MHz
case
1
:
case
1
:
return
100
000
;
return
100
;
case
2
:
case
2
:
return
200
000
;
return
200
;
case
3
:
case
3
:
return
400
000
;
return
400
;
default
:
default
:
AssertFatal
(
false
,
"Invalid band index for FR2 %d
\n
"
,
bw_index
);
AssertFatal
(
false
,
"Invalid band index for FR2 %d
\n
"
,
bw_index
);
}
}
...
@@ -184,7 +184,7 @@ bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_
...
@@ -184,7 +184,7 @@ bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_
// Relative channel bandwidth <= 4% for TDD bands and <= 3% for FDD bands
// Relative channel bandwidth <= 4% for TDD bands and <= 3% for FDD bands
int
index
=
get_nr_table_idx
(
nr_band
,
scs
);
int
index
=
get_nr_table_idx
(
nr_band
,
scs
);
int
bw_index
=
get_supported_band_index
(
scs
,
nr_band
,
nb_ul
);
int
bw_index
=
get_supported_band_index
(
scs
,
nr_band
,
nb_ul
);
int
band_size_khz
=
get_supported_bw_
khz
(
nr_band
>
256
?
FR2
:
FR1
,
bw_index
)
;
int
band_size_khz
=
get_supported_bw_
mhz
(
nr_band
>
256
?
FR2
:
FR1
,
bw_index
)
*
1000
;
float
limit
=
frame_type
==
TDD
?
0
.
04
:
0
.
03
;
float
limit
=
frame_type
==
TDD
?
0
.
04
:
0
.
03
;
float
rel_bw
=
(
float
)
(
2
*
band_size_khz
)
/
(
float
)
(
nr_bandtable
[
index
].
ul_max
+
nr_bandtable
[
index
].
ul_min
);
float
rel_bw
=
(
float
)
(
2
*
band_size_khz
)
/
(
float
)
(
nr_bandtable
[
index
].
ul_max
+
nr_bandtable
[
index
].
ul_min
);
return
rel_bw
<=
limit
;
return
rel_bw
<=
limit
;
...
@@ -382,118 +382,6 @@ int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index)
...
@@ -382,118 +382,6 @@ int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index)
return
delta_duplex
;
return
delta_duplex
;
}
}
uint16_t
config_bandwidth
(
int
mu
,
int
nb_rb
,
int
nr_band
)
{
if
(
nr_band
<
100
)
{
//FR1
switch
(
mu
)
{
case
0
:
if
(
nb_rb
<=
25
)
return
5
;
if
(
nb_rb
<=
52
)
return
10
;
if
(
nb_rb
<=
79
)
return
15
;
if
(
nb_rb
<=
106
)
return
20
;
if
(
nb_rb
<=
133
)
return
25
;
if
(
nb_rb
<=
160
)
return
30
;
if
(
nb_rb
<=
216
)
return
40
;
if
(
nb_rb
<=
270
)
return
50
;
AssertFatal
(
1
==
0
,
"Number of DL resource blocks %d undefined for mu %d and band %d
\n
"
,
nb_rb
,
mu
,
nr_band
);
break
;
case
1
:
if
(
nb_rb
<=
11
)
return
5
;
if
(
nb_rb
<=
24
)
return
10
;
if
(
nb_rb
<=
38
)
return
15
;
if
(
nb_rb
<=
51
)
return
20
;
if
(
nb_rb
<=
65
)
return
25
;
if
(
nb_rb
<=
78
)
return
30
;
if
(
nb_rb
<=
106
)
return
40
;
if
(
nb_rb
<=
133
)
return
50
;
if
(
nb_rb
<=
162
)
return
60
;
if
(
nb_rb
<=
189
)
return
70
;
if
(
nb_rb
<=
217
)
return
80
;
if
(
nb_rb
<=
245
)
return
90
;
if
(
nb_rb
<=
273
)
return
100
;
AssertFatal
(
1
==
0
,
"Number of DL resource blocks %d undefined for mu %d and band %d
\n
"
,
nb_rb
,
mu
,
nr_band
);
break
;
case
2
:
if
(
nb_rb
<=
11
)
return
10
;
if
(
nb_rb
<=
18
)
return
15
;
if
(
nb_rb
<=
24
)
return
20
;
if
(
nb_rb
<=
31
)
return
25
;
if
(
nb_rb
<=
38
)
return
30
;
if
(
nb_rb
<=
51
)
return
40
;
if
(
nb_rb
<=
65
)
return
50
;
if
(
nb_rb
<=
79
)
return
60
;
if
(
nb_rb
<=
93
)
return
70
;
if
(
nb_rb
<=
107
)
return
80
;
if
(
nb_rb
<=
121
)
return
90
;
if
(
nb_rb
<=
135
)
return
100
;
AssertFatal
(
1
==
0
,
"Number of DL resource blocks %d undefined for mu %d and band %d
\n
"
,
nb_rb
,
mu
,
nr_band
);
break
;
default:
AssertFatal
(
1
==
0
,
"Numerology %d undefined for band %d in FR1
\n
"
,
mu
,
nr_band
);
}
}
else
{
switch
(
mu
)
{
case
2
:
if
(
nb_rb
<=
66
)
return
50
;
if
(
nb_rb
<=
132
)
return
100
;
if
(
nb_rb
<=
264
)
return
200
;
AssertFatal
(
1
==
0
,
"Number of DL resource blocks %d undefined for mu %d and band %d
\n
"
,
nb_rb
,
mu
,
nr_band
);
break
;
case
3
:
if
(
nb_rb
<=
32
)
return
50
;
if
(
nb_rb
<=
66
)
return
100
;
if
(
nb_rb
<=
132
)
return
200
;
if
(
nb_rb
<=
264
)
return
400
;
AssertFatal
(
1
==
0
,
"Number of DL resource blocks %d undefined for mu %d and band %d
\n
"
,
nb_rb
,
mu
,
nr_band
);
break
;
default:
AssertFatal
(
1
==
0
,
"Numerology %d undefined for band %d in FR1
\n
"
,
mu
,
nr_band
);
}
}
}
// Returns the corresponding row index of the NR table
// Returns the corresponding row index of the NR table
int
get_nr_table_idx
(
int
nr_bandP
,
uint8_t
scs_index
)
{
int
get_nr_table_idx
(
int
nr_bandP
,
uint8_t
scs_index
)
{
int
scs_khz
=
15
<<
scs_index
;
int
scs_khz
=
15
<<
scs_index
;
...
...
common/utils/nr/nr_common.h
View file @
87d95177
...
@@ -76,7 +76,6 @@ int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUp
...
@@ -76,7 +76,6 @@ int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUp
int
cce_to_reg_interleaving
(
const
int
R
,
int
k
,
int
n_shift
,
const
int
C
,
int
L
,
const
int
N_regs
);
int
cce_to_reg_interleaving
(
const
int
R
,
int
k
,
int
n_shift
,
const
int
C
,
int
L
,
const
int
N_regs
);
int
get_SLIV
(
uint8_t
S
,
uint8_t
L
);
int
get_SLIV
(
uint8_t
S
,
uint8_t
L
);
void
get_coreset_rballoc
(
uint8_t
*
FreqDomainResource
,
int
*
n_rb
,
int
*
rb_offset
);
void
get_coreset_rballoc
(
uint8_t
*
FreqDomainResource
,
int
*
n_rb
,
int
*
rb_offset
);
uint16_t
config_bandwidth
(
int
mu
,
int
nb_rb
,
int
nr_band
);
int
get_nr_table_idx
(
int
nr_bandP
,
uint8_t
scs_index
);
int
get_nr_table_idx
(
int
nr_bandP
,
uint8_t
scs_index
);
int32_t
get_delta_duplex
(
int
nr_bandP
,
uint8_t
scs_index
);
int32_t
get_delta_duplex
(
int
nr_bandP
,
uint8_t
scs_index
);
frame_type_t
get_frame_type
(
uint16_t
nr_bandP
,
uint8_t
scs_index
);
frame_type_t
get_frame_type
(
uint16_t
nr_bandP
,
uint8_t
scs_index
);
...
@@ -94,6 +93,7 @@ int get_supported_band_index(int scs, int band, int n_rbs);
...
@@ -94,6 +93,7 @@ int get_supported_band_index(int scs, int band, int n_rbs);
long
rrc_get_max_nr_csrs
(
const
int
max_rbs
,
long
b_SRS
);
long
rrc_get_max_nr_csrs
(
const
int
max_rbs
,
long
b_SRS
);
void
get_K1_K2
(
int
N1
,
int
N2
,
int
*
K1
,
int
*
K2
);
void
get_K1_K2
(
int
N1
,
int
N2
,
int
*
K1
,
int
*
K2
);
bool
compare_relative_ul_channel_bw
(
int
nr_band
,
int
scs
,
int
nb_ul
,
frame_type_t
frame_type
);
bool
compare_relative_ul_channel_bw
(
int
nr_band
,
int
scs
,
int
nb_ul
,
frame_type_t
frame_type
);
int
get_supported_bw_mhz
(
frequency_range_t
frequency_range
,
int
bw_index
);
void
get_samplerate_and_bw
(
int
mu
,
void
get_samplerate_and_bw
(
int
mu
,
int
n_rb
,
int
n_rb
,
int8_t
threequarter_fs
,
int8_t
threequarter_fs
,
...
...
openair1/PHY/INIT/nr_init.c
View file @
87d95177
...
@@ -954,7 +954,8 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
...
@@ -954,7 +954,8 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
}
}
fp
->
threequarter_fs
=
0
;
fp
->
threequarter_fs
=
0
;
gNB_config
->
carrier_config
.
dl_bandwidth
.
value
=
config_bandwidth
(
mu
,
N_RB_DL
,
fp
->
nr_band
);
int
bw_index
=
get_supported_band_index
(
mu
,
fp
->
nr_band
,
N_RB_DL
);
gNB_config
->
carrier_config
.
dl_bandwidth
.
value
=
get_supported_bw_mhz
(
fp
->
nr_band
>
256
?
FR2
:
FR1
,
bw_index
);
nr_init_frame_parms
(
gNB_config
,
fp
);
nr_init_frame_parms
(
gNB_config
,
fp
);
...
...
openair1/SIMULATION/NR_PHY/pbchsim.c
View file @
87d95177
...
@@ -172,7 +172,8 @@ void nr_phy_config_request_sim_pbchsim(PHY_VARS_gNB *gNB,
...
@@ -172,7 +172,8 @@ void nr_phy_config_request_sim_pbchsim(PHY_VARS_gNB *gNB,
else
fp
->
nr_band
=
78
;
else
fp
->
nr_band
=
78
;
fp
->
threequarter_fs
=
0
;
fp
->
threequarter_fs
=
0
;
gNB_config
->
carrier_config
.
dl_bandwidth
.
value
=
config_bandwidth
(
mu
,
N_RB_DL
,
fp
->
nr_band
);
int
bw_index
=
get_supported_band_index
(
mu
,
fp
->
nr_band
,
N_RB_DL
);
gNB_config
->
carrier_config
.
dl_bandwidth
.
value
=
get_supported_bw_mhz
(
fp
->
nr_band
>
256
?
FR2
:
FR1
,
bw_index
);
fp
->
ofdm_offset_divisor
=
UINT_MAX
;
fp
->
ofdm_offset_divisor
=
UINT_MAX
;
nr_init_frame_parms
(
gNB_config
,
fp
);
nr_init_frame_parms
(
gNB_config
,
fp
);
...
...
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
87d95177
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
87d95177
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