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
wangjie
OpenXG-RAN
Commits
98ef48ae
Commit
98ef48ae
authored
Nov 24, 2020
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calculate TBS in pre-processor and use the results in post-proc
parent
4124edff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
29 deletions
+58
-29
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+23
-3
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+30
-26
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+5
-0
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
View file @
98ef48ae
...
@@ -452,9 +452,29 @@ void nr_ul_preprocessor_phytest(module_id_t module_id,
...
@@ -452,9 +452,29 @@ void nr_ul_preprocessor_phytest(module_id_t module_id,
num_dmrs_cdm_grps_no_data
,
num_dmrs_cdm_grps_no_data
,
ps
);
ps
);
sched_ctrl
->
sched_pusch
.
mcs
=
9
;
const
int
mcs
=
9
;
sched_ctrl
->
sched_pusch
.
rbStart
=
rbStart
;
NR_sched_pusch_t
*
sched_pusch
=
&
sched_ctrl
->
sched_pusch
;
sched_ctrl
->
sched_pusch
.
rbSize
=
rbSize
;
sched_pusch
->
mcs
=
mcs
;
sched_pusch
->
rbStart
=
rbStart
;
sched_pusch
->
rbSize
=
rbSize
;
/* Calculate TBS from MCS */
sched_pusch
->
R
=
nr_get_code_rate_ul
(
mcs
,
ps
->
mcs_table
);
sched_pusch
->
Qm
=
nr_get_Qm_ul
(
mcs
,
ps
->
mcs_table
);
if
(
ps
->
pusch_Config
->
tp_pi2BPSK
&&
((
ps
->
mcs_table
==
3
&&
mcs
<
2
)
||
(
ps
->
mcs_table
==
4
&&
mcs
<
6
)))
{
sched_pusch
->
R
>>=
1
;
sched_pusch
->
Qm
<<=
1
;
}
sched_pusch
->
tb_size
=
nr_compute_tbs
(
sched_pusch
->
Qm
,
sched_pusch
->
R
,
sched_pusch
->
rbSize
,
ps
->
nrOfSymbols
,
ps
->
N_PRB_DMRS
*
ps
->
num_dmrs_symb
,
0
,
// nb_rb_oh
0
,
1
/* NrOfLayers */
)
>>
3
;
/* mark the corresponding RBs as used */
/* mark the corresponding RBs as used */
for
(
int
rb
=
rbStart
;
rb
<
rbStart
+
rbSize
;
rb
++
)
for
(
int
rb
=
rbStart
;
rb
<
rbStart
+
rbSize
;
rb
++
)
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
98ef48ae
...
@@ -551,9 +551,29 @@ void nr_simple_ulsch_preprocessor(module_id_t module_id,
...
@@ -551,9 +551,29 @@ void nr_simple_ulsch_preprocessor(module_id_t module_id,
num_dmrs_cdm_grps_no_data
,
num_dmrs_cdm_grps_no_data
,
ps
);
ps
);
sched_ctrl
->
sched_pusch
.
mcs
=
9
;
const
int
mcs
=
9
;
sched_ctrl
->
sched_pusch
.
rbStart
=
rbStart
;
NR_sched_pusch_t
*
sched_pusch
=
&
sched_ctrl
->
sched_pusch
;
sched_ctrl
->
sched_pusch
.
rbSize
=
rbSize
;
sched_pusch
->
mcs
=
mcs
;
sched_pusch
->
rbStart
=
rbStart
;
sched_pusch
->
rbSize
=
rbSize
;
/* Calculate TBS from MCS */
sched_pusch
->
R
=
nr_get_code_rate_ul
(
mcs
,
ps
->
mcs_table
);
sched_pusch
->
Qm
=
nr_get_Qm_ul
(
mcs
,
ps
->
mcs_table
);
if
(
ps
->
pusch_Config
->
tp_pi2BPSK
&&
((
ps
->
mcs_table
==
3
&&
mcs
<
2
)
||
(
ps
->
mcs_table
==
4
&&
mcs
<
6
)))
{
sched_pusch
->
R
>>=
1
;
sched_pusch
->
Qm
<<=
1
;
}
sched_pusch
->
tb_size
=
nr_compute_tbs
(
sched_pusch
->
Qm
,
sched_pusch
->
R
,
sched_pusch
->
rbSize
,
ps
->
nrOfSymbols
,
ps
->
N_PRB_DMRS
*
ps
->
num_dmrs_symb
,
0
,
// nb_rb_oh
0
,
1
/* NrOfLayers */
)
>>
3
;
/* mark the corresponding RBs as used */
/* mark the corresponding RBs as used */
for
(
int
rb
=
0
;
rb
<
sched_ctrl
->
sched_pusch
.
rbSize
;
rb
++
)
for
(
int
rb
=
0
;
rb
<
sched_ctrl
->
sched_pusch
.
rbSize
;
rb
++
)
...
@@ -574,6 +594,8 @@ void nr_schedule_ulsch(module_id_t module_id,
...
@@ -574,6 +594,8 @@ void nr_schedule_ulsch(module_id_t module_id,
const
NR_UE_list_t
*
UE_list
=
&
UE_info
->
list
;
const
NR_UE_list_t
*
UE_list
=
&
UE_info
->
list
;
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
];
/* dynamic PUSCH values (RB alloc, MCS, hence R, Qm, TBS) that change in
* 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
;
if
(
sched_pusch
->
rbSize
<=
0
)
if
(
sched_pusch
->
rbSize
<=
0
)
continue
;
continue
;
...
@@ -593,28 +615,10 @@ void nr_schedule_ulsch(module_id_t module_id,
...
@@ -593,28 +615,10 @@ void nr_schedule_ulsch(module_id_t module_id,
* through nr_save_pusch_fields() */
* through nr_save_pusch_fields() */
NR_sched_pusch_save_t
*
ps
=
&
sched_ctrl
->
pusch_save
;
NR_sched_pusch_save_t
*
ps
=
&
sched_ctrl
->
pusch_save
;
/* Calculate TBS from MCS */
const
uint8_t
mcs
=
sched_pusch
->
mcs
;
uint16_t
R
=
nr_get_code_rate_ul
(
mcs
,
ps
->
mcs_table
);
uint8_t
Qm
=
nr_get_Qm_ul
(
mcs
,
ps
->
mcs_table
);
if
(
ps
->
pusch_Config
->
tp_pi2BPSK
&&
((
ps
->
mcs_table
==
3
&&
mcs
<
2
)
||
(
ps
->
mcs_table
==
4
&&
mcs
<
6
)))
{
R
>>=
1
;
Qm
<<=
1
;
}
const
uint32_t
tb_size
=
nr_compute_tbs
(
Qm
,
R
,
sched_pusch
->
rbSize
,
ps
->
nrOfSymbols
,
ps
->
N_PRB_DMRS
*
ps
->
num_dmrs_symb
,
0
,
// nb_rb_oh
0
,
1
/* NrOfLayers */
)
>>
3
;
/* Statistics */
/* Statistics */
UE_info
->
mac_stats
[
UE_id
].
ulsch_rounds
[
cur_harq
->
round
]
++
;
UE_info
->
mac_stats
[
UE_id
].
ulsch_rounds
[
cur_harq
->
round
]
++
;
if
(
cur_harq
->
round
==
0
)
if
(
cur_harq
->
round
==
0
)
UE_info
->
mac_stats
[
UE_id
].
ulsch_total_bytes_scheduled
+=
tb_size
;
UE_info
->
mac_stats
[
UE_id
].
ulsch_total_bytes_scheduled
+=
sched_pusch
->
tb_size
;
/* PUSCH in a later slot, but corresponding DCI now! */
/* PUSCH in a later slot, but corresponding DCI now! */
...
@@ -646,9 +650,9 @@ void nr_schedule_ulsch(module_id_t module_id,
...
@@ -646,9 +650,9 @@ void nr_schedule_ulsch(module_id_t module_id,
pusch_pdu
->
cyclic_prefix
=
0
;
pusch_pdu
->
cyclic_prefix
=
0
;
/* FAPI: PUSCH information always included */
/* FAPI: PUSCH information always included */
pusch_pdu
->
target_code_rate
=
R
;
pusch_pdu
->
target_code_rate
=
sched_pusch
->
R
;
pusch_pdu
->
qam_mod_order
=
Qm
;
pusch_pdu
->
qam_mod_order
=
sched_pusch
->
Qm
;
pusch_pdu
->
mcs_index
=
mcs
;
pusch_pdu
->
mcs_index
=
sched_pusch
->
mcs
;
pusch_pdu
->
mcs_table
=
ps
->
mcs_table
;
pusch_pdu
->
mcs_table
=
ps
->
mcs_table
;
pusch_pdu
->
transform_precoding
=
ps
->
transform_precoding
;
pusch_pdu
->
transform_precoding
=
ps
->
transform_precoding
;
if
(
ps
->
pusch_Config
->
dataScramblingIdentityPUSCH
)
if
(
ps
->
pusch_Config
->
dataScramblingIdentityPUSCH
)
...
@@ -702,7 +706,7 @@ void nr_schedule_ulsch(module_id_t module_id,
...
@@ -702,7 +706,7 @@ void nr_schedule_ulsch(module_id_t module_id,
pusch_pdu
->
pusch_data
.
rv_index
=
nr_rv_round_map
[
cur_harq
->
round
];
pusch_pdu
->
pusch_data
.
rv_index
=
nr_rv_round_map
[
cur_harq
->
round
];
pusch_pdu
->
pusch_data
.
harq_process_id
=
harq_id
;
pusch_pdu
->
pusch_data
.
harq_process_id
=
harq_id
;
pusch_pdu
->
pusch_data
.
new_data_indicator
=
cur_harq
->
ndi
;
pusch_pdu
->
pusch_data
.
new_data_indicator
=
cur_harq
->
ndi
;
pusch_pdu
->
pusch_data
.
tb_size
=
tb_size
;
pusch_pdu
->
pusch_data
.
tb_size
=
sched_pusch
->
tb_size
;
pusch_pdu
->
pusch_data
.
num_cb
=
0
;
//CBG not supported
pusch_pdu
->
pusch_data
.
num_cb
=
0
;
//CBG not supported
/* PUSCH PTRS */
/* PUSCH PTRS */
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
98ef48ae
...
@@ -321,6 +321,11 @@ typedef struct NR_sched_pusch {
...
@@ -321,6 +321,11 @@ typedef struct NR_sched_pusch {
/// MCS
/// MCS
uint8_t
mcs
;
uint8_t
mcs
;
/// TBS-related info
uint16_t
R
;
uint8_t
Qm
;
uint32_t
tb_size
;
}
NR_sched_pusch_t
;
}
NR_sched_pusch_t
;
typedef
struct
NR_UE_harq
{
typedef
struct
NR_UE_harq
{
...
...
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