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
zzha zzha
OpenXG-RAN
Commits
81873616
Commit
81873616
authored
Feb 09, 2021
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schedule UE periodically every 10 frames in UL
parent
800330e4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
4 deletions
+42
-4
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+39
-4
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+3
-0
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
81873616
...
@@ -745,6 +745,34 @@ long get_K2(const NR_BWP_Uplink_t *ubwp, int time_domain_assignment, int mu) {
...
@@ -745,6 +745,34 @@ long get_K2(const NR_BWP_Uplink_t *ubwp, int time_domain_assignment, int mu) {
return
3
;
return
3
;
}
}
bool
nr_UE_is_to_be_scheduled
(
module_id_t
mod_id
,
int
CC_id
,
int
UE_id
,
frame_t
frame
,
sub_frame_t
slot
)
{
const
NR_ServingCellConfigCommon_t
*
scc
=
RC
.
nrmac
[
mod_id
]
->
common_channels
->
ServingCellConfigCommon
;
const
uint8_t
slots_per_frame
[
5
]
=
{
10
,
20
,
40
,
80
,
160
};
const
int
n
=
slots_per_frame
[
*
scc
->
ssbSubcarrierSpacing
];
const
int
now
=
frame
*
n
+
slot
;
const
struct
gNB_MAC_INST_s
*
nrmac
=
RC
.
nrmac
[
mod_id
];
const
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
nrmac
->
UE_info
.
UE_sched_ctrl
[
UE_id
];
const
int
last_ul_sched
=
sched_ctrl
->
last_ul_frame
*
n
+
sched_ctrl
->
last_ul_slot
;
const
int
diff
=
(
now
-
last_ul_sched
+
1024
*
n
)
%
(
1024
*
n
);
/* UE is to be scheduled if
* (1) we think the UE has more bytes awaiting than what we scheduled
* (2) there is a scheduling request
* (3) or we did not schedule it in more than 10 frames */
const
bool
has_data
=
sched_ctrl
->
estimated_ul_buffer
>
sched_ctrl
->
sched_ul_bytes
;
const
bool
high_inactivity
=
diff
>=
10
*
n
;
LOG_D
(
MAC
,
"%4d.%2d UL inactivity %d slots has_data %d SR %d
\n
"
,
frame
,
slot
,
diff
,
has_data
,
sched_ctrl
->
SR
);
return
has_data
||
sched_ctrl
->
SR
||
high_inactivity
;
}
int
next_list_entry_looped
(
NR_list_t
*
list
,
int
UE_id
)
int
next_list_entry_looped
(
NR_list_t
*
list
,
int
UE_id
)
{
{
if
(
UE_id
<
0
)
if
(
UE_id
<
0
)
...
@@ -924,12 +952,16 @@ void pf_ul(module_id_t module_id,
...
@@ -924,12 +952,16 @@ void pf_ul(module_id_t module_id,
continue
;
continue
;
}
}
if
(
sched_ctrl
->
estimated_ul_buffer
-
sched_ctrl
->
sched_ul_bytes
<=
0
&&
!
sched_ctrl
->
SR
)
const
int
B
=
max
(
0
,
sched_ctrl
->
estimated_ul_buffer
-
sched_ctrl
->
sched_ul_bytes
);
/* preprocessor computed sched_frame/sched_slot */
const
bool
do_sched
=
nr_UE_is_to_be_scheduled
(
module_id
,
0
,
UE_id
,
sched_pusch
->
frame
,
sched_pusch
->
slot
);
if
(
B
==
0
&&
!
do_sched
)
continue
;
continue
;
/* Schedule UE
if there is a SR
and no data (otherwise, will be scheduled
/* Schedule UE
on SR or UL inactivity
and no data (otherwise, will be scheduled
* ba
d
ed on data to transmit) */
* ba
s
ed on data to transmit) */
if
(
sched_ctrl
->
estimated_ul_buffer
-
sched_ctrl
->
sched_ul_bytes
<=
0
&&
sched_ctrl
->
SR
)
{
if
(
B
==
0
&&
do_sched
)
{
/* if no data, pre-allocate 5RB */
/* if no data, pre-allocate 5RB */
bool
freeCCE
=
find_free_CCE
(
module_id
,
slot
,
UE_id
);
bool
freeCCE
=
find_free_CCE
(
module_id
,
slot
,
UE_id
);
if
(
!
freeCCE
)
{
if
(
!
freeCCE
)
{
...
@@ -1212,6 +1244,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
...
@@ -1212,6 +1244,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
for
(
int
UE_id
=
UE_list
->
head
;
UE_id
>=
0
;
UE_id
=
UE_list
->
next
[
UE_id
])
{
for
(
int
UE_id
=
UE_list
->
head
;
UE_id
>=
0
;
UE_id
=
UE_list
->
next
[
UE_id
])
{
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
UE_info
->
mac_stats
[
UE_id
].
ulsch_current_bytes
=
0
;
UE_info
->
mac_stats
[
UE_id
].
ulsch_current_bytes
=
0
;
/* dynamic PUSCH values (RB alloc, MCS, hence R, Qm, TBS) that change in
/* dynamic PUSCH values (RB alloc, MCS, hence R, Qm, TBS) that change in
* every TTI are pre-populated by the preprocessor and used below */
* every TTI are pre-populated by the preprocessor and used below */
NR_sched_pusch_t
*
sched_pusch
=
&
sched_ctrl
->
sched_pusch
;
NR_sched_pusch_t
*
sched_pusch
=
&
sched_ctrl
->
sched_pusch
;
...
@@ -1276,6 +1309,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
...
@@ -1276,6 +1309,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
cur_harq
->
ndi
);
cur_harq
->
ndi
);
}
}
UE_info
->
mac_stats
[
UE_id
].
ulsch_current_bytes
=
sched_pusch
->
tb_size
;
UE_info
->
mac_stats
[
UE_id
].
ulsch_current_bytes
=
sched_pusch
->
tb_size
;
sched_ctrl
->
last_ul_frame
=
sched_pusch
->
frame
;
sched_ctrl
->
last_ul_slot
=
sched_pusch
->
slot
;
LOG_D
(
MAC
,
LOG_D
(
MAC
,
"%4d.%2d RNTI %04x UL sched %4d.%2d start %2d RBS %3d startSymbol %2d nb_symbol %2d MCS %2d TBS %4d HARQ PID %2d round %d NDI %d est %6d sched %6d est BSR %6d
\n
"
,
"%4d.%2d RNTI %04x UL sched %4d.%2d start %2d RBS %3d startSymbol %2d nb_symbol %2d MCS %2d TBS %4d HARQ PID %2d round %d NDI %d est %6d sched %6d est BSR %6d
\n
"
,
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
81873616
...
@@ -545,6 +545,9 @@ typedef struct {
...
@@ -545,6 +545,9 @@ typedef struct {
NR_pdsch_semi_static_t
pdsch_semi_static
;
NR_pdsch_semi_static_t
pdsch_semi_static
;
/// Sched PDSCH: scheduling decisions, copied into HARQ and cleared every TTI
/// Sched PDSCH: scheduling decisions, copied into HARQ and cleared every TTI
NR_sched_pdsch_t
sched_pdsch
;
NR_sched_pdsch_t
sched_pdsch
;
/// For UL synchronization: store last UL scheduling grant
frame_t
last_ul_frame
;
sub_frame_t
last_ul_slot
;
/// total amount of data awaiting for this UE
/// total amount of data awaiting for this UE
uint32_t
num_total_bytes
;
uint32_t
num_total_bytes
;
...
...
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