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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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-RAN
Commits
98b3f4d4
Commit
98b3f4d4
authored
May 29, 2024
by
hsum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor nr_slot_select function to improve readability and maintainability
parent
a0eaf8ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
44 deletions
+27
-44
openair1/SCHED_NR/phy_frame_config_nr.c
openair1/SCHED_NR/phy_frame_config_nr.c
+27
-44
No files found.
openair1/SCHED_NR/phy_frame_config_nr.c
View file @
98b3f4d4
...
...
@@ -295,62 +295,45 @@ int get_next_downlink_slot(PHY_VARS_gNB *gNB, nfapi_nr_config_request_scf_t *cfg
}
}
int
nr_slot_select
(
nfapi_nr_config_request_scf_t
*
cfg
,
int
nr_frame
,
int
nr_slot
)
{
int
nr_slot_select
(
nfapi_nr_config_request_scf_t
*
cfg
,
int
nr_frame
,
int
nr_slot
)
{
/* for FFD all slot can be considered as an uplink */
int
mu
=
cfg
->
ssb_config
.
scs_common
.
value
,
check_slot
=
0
;
int
mu
=
cfg
->
ssb_config
.
scs_common
.
value
;
int
check_slot
=
0
;
int
nb_max_tdd_periodicity
=
get_nb_max_tdd_periodicity
(
mu
,
cfg
->
tdd_table
.
tdd_period
.
value
);
if
(
cfg
->
cell_config
.
frame_duplex_type
.
value
==
FDD
)
{
return
(
NR_UPLINK_SLOT
|
NR_DOWNLINK_SLOT
);
return
(
NR_UPLINK_SLOT
|
NR_DOWNLINK_SLOT
);
}
if
(
nr_frame
%
2
==
0
)
{
for
(
int
symbol_count
=
0
;
symbol_count
<
NR_NUMBER_OF_SYMBOLS_PER_SLOT
;
symbol_count
++
)
{
if
(
cfg
->
tdd_table
.
max_tdd_periodicity_list
[
nr_slot
].
max_num_of_symbol_per_slot_list
[
symbol_count
].
slot_config
.
value
==
1
)
{
check_slot
++
;
}
for
(
int
symbol_count
=
0
;
symbol_count
<
NR_NUMBER_OF_SYMBOLS_PER_SLOT
;
symbol_count
++
)
{
if
(
cfg
->
tdd_table
.
max_tdd_periodicity_list
[
nr_slot
%
nb_max_tdd_periodicity
]
.
max_num_of_symbol_per_slot_list
[
symbol_count
]
.
slot_config
.
value
==
1
)
{
check_slot
++
;
}
}
if
(
check_slot
==
NR_NUMBER_OF_SYMBOLS_PER_SLOT
)
{
return
(
NR_UPLINK_SLOT
);
}
if
(
check_slot
==
NR_NUMBER_OF_SYMBOLS_PER_SLOT
)
{
return
(
NR_UPLINK_SLOT
);
}
check_slot
=
0
;
check_slot
=
0
;
for
(
int
symbol_count
=
0
;
symbol_count
<
NR_NUMBER_OF_SYMBOLS_PER_SLOT
;
symbol_count
++
)
{
if
(
cfg
->
tdd_table
.
max_tdd_periodicity_list
[
nr_slot
].
max_num_of_symbol_per_slot_list
[
symbol_count
].
slot_config
.
value
==
0
)
{
check_slot
++
;
}
for
(
int
symbol_count
=
0
;
symbol_count
<
NR_NUMBER_OF_SYMBOLS_PER_SLOT
;
symbol_count
++
)
{
if
(
cfg
->
tdd_table
.
max_tdd_periodicity_list
[
nr_slot
%
nb_max_tdd_periodicity
]
.
max_num_of_symbol_per_slot_list
[
symbol_count
]
.
slot_config
.
value
==
0
)
{
check_slot
++
;
}
}
if
(
check_slot
==
NR_NUMBER_OF_SYMBOLS_PER_SLOT
)
{
return
(
NR_DOWNLINK_SLOT
);
}
else
{
return
(
NR_MIXED_SLOT
);
}
if
(
check_slot
==
NR_NUMBER_OF_SYMBOLS_PER_SLOT
)
{
return
(
NR_DOWNLINK_SLOT
);
}
else
{
for
(
int
symbol_count
=
0
;
symbol_count
<
NR_NUMBER_OF_SYMBOLS_PER_SLOT
;
symbol_count
++
)
{
if
(
cfg
->
tdd_table
.
max_tdd_periodicity_list
[((
1
<<
mu
)
*
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
)
+
nr_slot
].
max_num_of_symbol_per_slot_list
[
symbol_count
].
slot_config
.
value
==
1
)
{
check_slot
++
;
}
}
if
(
check_slot
==
NR_NUMBER_OF_SYMBOLS_PER_SLOT
)
{
return
(
NR_UPLINK_SLOT
);
}
check_slot
=
0
;
for
(
int
symbol_count
=
0
;
symbol_count
<
NR_NUMBER_OF_SYMBOLS_PER_SLOT
;
symbol_count
++
)
{
if
(
cfg
->
tdd_table
.
max_tdd_periodicity_list
[((
1
<<
mu
)
*
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
)
+
nr_slot
].
max_num_of_symbol_per_slot_list
[
symbol_count
].
slot_config
.
value
==
0
)
{
check_slot
++
;
}
}
if
(
check_slot
==
NR_NUMBER_OF_SYMBOLS_PER_SLOT
)
{
return
(
NR_DOWNLINK_SLOT
);
}
else
{
return
(
NR_MIXED_SLOT
);
}
return
(
NR_MIXED_SLOT
);
}
}
...
...
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