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
bc04d720
Commit
bc04d720
authored
Dec 20, 2021
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some improvements from review
parent
842a4bbf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
35 deletions
+43
-35
nfapi/oai_integration/nfapi_pnf.c
nfapi/oai_integration/nfapi_pnf.c
+2
-3
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+8
-6
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+7
-5
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+2
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+24
-19
No files found.
nfapi/oai_integration/nfapi_pnf.c
View file @
bc04d720
...
@@ -1159,7 +1159,7 @@ int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
...
@@ -1159,7 +1159,7 @@ int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
if
(
req
->
numPdus
>
0
)
{
if
(
req
->
numPdus
>
0
)
{
for
(
int
i
=
0
;
i
<
req
->
numPdus
;
i
++
)
{
for
(
int
i
=
0
;
i
<
req
->
numPdus
;
i
++
)
{
if
(
req
->
ul_dci_pdu_list
[
i
].
PDUType
==
0
)
// only possible value 0: PDCCH PDU
if
(
req
->
ul_dci_pdu_list
[
i
].
PDUType
==
NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE
)
// only possible value 0: PDCCH PDU
msgTx
->
ul_pdcch_pdu
[
i
]
=
req
->
ul_dci_pdu_list
[
i
];
msgTx
->
ul_pdcch_pdu
[
i
]
=
req
->
ul_dci_pdu_list
[
i
];
else
else
LOG_E
(
PHY
,
"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d
\n
"
,
NFAPI_SFNSLOT2DEC
(
req
->
SFN
,
req
->
Slot
),
req
->
numPdus
-
1
,
req
->
ul_dci_pdu_list
[
req
->
numPdus
-
1
].
PDUType
);
LOG_E
(
PHY
,
"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d
\n
"
,
NFAPI_SFNSLOT2DEC
(
req
->
SFN
,
req
->
Slot
),
req
->
numPdus
-
1
,
req
->
ul_dci_pdu_list
[
req
->
numPdus
-
1
].
PDUType
);
...
@@ -1243,8 +1243,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
...
@@ -1243,8 +1243,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
processingData_L1tx_t
*
msgTx
=
(
processingData_L1tx_t
*
)
NotifiedFifoData
(
res
);
processingData_L1tx_t
*
msgTx
=
(
processingData_L1tx_t
*
)
NotifiedFifoData
(
res
);
if
(
dl_tti_pdu_list
[
i
].
PDUType
==
NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE
)
{
if
(
dl_tti_pdu_list
[
i
].
PDUType
==
NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE
)
{
// we trust the scheduler sends only one PDCCH PDU per slot
msgTx
->
pdcch_pdu
[
i
]
=
dl_tti_pdu_list
[
i
].
pdcch_pdu
;
// copies all the received PDCCH PDUs
msgTx
->
pdcch_pdu
[
i
]
=
dl_tti_pdu_list
[
i
].
pdcch_pdu
;
// fills the last received PDCCH PDU
}
}
else
if
(
dl_tti_pdu_list
[
i
].
PDUType
==
NFAPI_NR_DL_TTI_SSB_PDU_TYPE
)
{
else
if
(
dl_tti_pdu_list
[
i
].
PDUType
==
NFAPI_NR_DL_TTI_SSB_PDU_TYPE
)
{
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]);
...
...
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
bc04d720
...
@@ -641,9 +641,11 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
...
@@ -641,9 +641,11 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
bwpd
=
(
void
*
)
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
initialDownlinkBWP
;
bwpd
=
(
void
*
)
CellGroup
->
spCellConfig
->
spCellConfigDedicated
->
initialDownlinkBWP
;
genericParameters
=
&
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
;
genericParameters
=
&
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
;
}
}
else
AssertFatal
(
1
==
0
,
"Either initial BWP or active BWP should always be present
\n
"
);
sched_ctrl
->
search_space
=
get_searchspace
(
scc
,
bwpd
,
target_ss
);
sched_ctrl
->
search_space
=
get_searchspace
(
scc
,
bwpd
,
target_ss
);
sched_ctrl
->
coreset
=
get_coreset
(
Mod_idP
,
scc
,
bwpd
,
sched_ctrl
->
search_space
,
target_ss
);
sched_ctrl
->
coreset
=
get_coreset
(
Mod_idP
,
scc
,
bwpd
,
sched_ctrl
->
search_space
,
target_ss
);
UE_info
->
UE_sched_ctrl
[
UE_id
].
sched_pdcch
=
set_pdcch_structure
(
RC
.
nrmac
[
Mod_idP
],
sched_ctrl
->
sched_pdcch
=
set_pdcch_structure
(
RC
.
nrmac
[
Mod_idP
],
sched_ctrl
->
search_space
,
sched_ctrl
->
search_space
,
sched_ctrl
->
coreset
,
sched_ctrl
->
coreset
,
scc
,
scc
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
bc04d720
...
@@ -830,14 +830,15 @@ void pf_dl(module_id_t module_id,
...
@@ -830,14 +830,15 @@ void pf_dl(module_id_t module_id,
if
(
ps
->
time_domain_allocation
!=
tda
)
if
(
ps
->
time_domain_allocation
!=
tda
)
nr_set_pdsch_semi_static
(
scc
,
UE_info
->
CellGroup
[
UE_id
],
sched_ctrl
->
active_bwp
,
bwpd
,
tda
,
f
,
ps
);
nr_set_pdsch_semi_static
(
scc
,
UE_info
->
CellGroup
[
UE_id
],
sched_ctrl
->
active_bwp
,
bwpd
,
tda
,
f
,
ps
);
const
uint16_t
slbitmap
=
SL_to_bitmap
(
ps
->
startSymbolIndex
,
ps
->
nrOfSymbols
);
// Freq-demain allocation
// Freq-demain allocation
while
(
rbStart
<
bwpSize
&&
while
(
rbStart
<
bwpSize
&&
!
(
rballoc_mask
[
rbStart
]
&
SL_to_bitmap
(
ps
->
startSymbolIndex
,
ps
->
nrOfSymbols
)
))
!
(
rballoc_mask
[
rbStart
]
&
slbitmap
))
rbStart
++
;
rbStart
++
;
uint16_t
max_rbSize
=
1
;
uint16_t
max_rbSize
=
1
;
while
(
rbStart
+
max_rbSize
<
bwpSize
&&
while
(
rbStart
+
max_rbSize
<
bwpSize
&&
(
rballoc_mask
[
rbStart
+
max_rbSize
]
&
SL_to_bitmap
(
ps
->
startSymbolIndex
,
ps
->
nrOfSymbols
)
))
(
rballoc_mask
[
rbStart
+
max_rbSize
]
&
slbitmap
))
max_rbSize
++
;
max_rbSize
++
;
sched_pdsch
->
Qm
=
nr_get_Qm_dl
(
sched_pdsch
->
mcs
,
ps
->
mcsTableIdx
);
sched_pdsch
->
Qm
=
nr_get_Qm_dl
(
sched_pdsch
->
mcs
,
ps
->
mcsTableIdx
);
...
@@ -861,7 +862,7 @@ void pf_dl(module_id_t module_id,
...
@@ -861,7 +862,7 @@ void pf_dl(module_id_t module_id,
/* transmissions: directly allocate */
/* transmissions: directly allocate */
n_rb_sched
-=
sched_pdsch
->
rbSize
;
n_rb_sched
-=
sched_pdsch
->
rbSize
;
for
(
int
rb
=
0
;
rb
<
sched_pdsch
->
rbSize
;
rb
++
)
for
(
int
rb
=
0
;
rb
<
sched_pdsch
->
rbSize
;
rb
++
)
rballoc_mask
[
rb
+
sched_pdsch
->
rbStart
]
-=
SL_to_bitmap
(
ps
->
startSymbolIndex
,
ps
->
nrOfSymbols
)
;
rballoc_mask
[
rb
+
sched_pdsch
->
rbStart
]
-=
slbitmap
;
}
}
}
}
...
@@ -896,6 +897,7 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
...
@@ -896,6 +897,7 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
.
locationAndBandwidth
,
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
MAX_BWP_SIZE
);
const
uint16_t
slbitmap
=
SL_to_bitmap
(
startSymbolIndex
,
nrOfSymbols
);
uint16_t
*
vrb_map
=
RC
.
nrmac
[
module_id
]
->
common_channels
[
CC_id
].
vrb_map
;
uint16_t
*
vrb_map
=
RC
.
nrmac
[
module_id
]
->
common_channels
[
CC_id
].
vrb_map
;
uint16_t
rballoc_mask
[
bwpSize
];
uint16_t
rballoc_mask
[
bwpSize
];
int
n_rb_sched
=
0
;
int
n_rb_sched
=
0
;
...
@@ -904,8 +906,8 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
...
@@ -904,8 +906,8 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
// if any RB in vrb_map is blocked (1), the current RBG will be 0
// if any RB in vrb_map is blocked (1), the current RBG will be 0
rballoc_mask
[
i
]
=
(
~
vrb_map
[
i
+
BWPStart
])
&
0x3fff
;
//bitwise not and 14 symbols
rballoc_mask
[
i
]
=
(
~
vrb_map
[
i
+
BWPStart
])
&
0x3fff
;
//bitwise not and 14 symbols
// if all the pdsch symbols are free
// if all the pdsch symbols are free
if
((
rballoc_mask
[
i
]
&
SL_to_bitmap
(
startSymbolIndex
,
nrOfSymbols
)
)
==
if
((
rballoc_mask
[
i
]
&
slbitmap
)
==
SL_to_bitmap
(
startSymbolIndex
,
nrOfSymbols
)
)
slbitmap
)
n_rb_sched
++
;
n_rb_sched
++
;
}
}
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
View file @
bc04d720
...
@@ -298,12 +298,12 @@ void nr_preprocessor_phytest(module_id_t module_id,
...
@@ -298,12 +298,12 @@ void nr_preprocessor_phytest(module_id_t module_id,
while
(
true
)
{
while
(
true
)
{
/* advance to first free RB */
/* advance to first free RB */
while
(
rbStart
<
bwpSize
&&
while
(
rbStart
<
bwpSize
&&
(
vrb_map
[
rbStart
+
BWPStart
]
&
(((
1
<<
ps
->
nrOfSymbols
)
-
1
)
<<
ps
->
startSymbolIndex
)))
(
vrb_map
[
rbStart
+
BWPStart
]
&
SL_to_bitmap
(
ps
->
startSymbolIndex
,
ps
->
nrOfSymbols
)))
rbStart
++
;
rbStart
++
;
rbSize
=
1
;
rbSize
=
1
;
/* iterate until we are at target_dl_bw or no available RBs */
/* iterate until we are at target_dl_bw or no available RBs */
while
(
rbStart
+
rbSize
<
bwpSize
&&
while
(
rbStart
+
rbSize
<
bwpSize
&&
!
(
vrb_map
[
rbStart
+
rbSize
+
BWPStart
]
&
(((
1
<<
ps
->
nrOfSymbols
)
-
1
)
<<
ps
->
startSymbolIndex
))
&&
!
(
vrb_map
[
rbStart
+
rbSize
+
BWPStart
]
&
SL_to_bitmap
(
ps
->
startSymbolIndex
,
ps
->
nrOfSymbols
))
&&
rbSize
<
target_dl_bw
)
rbSize
<
target_dl_bw
)
rbSize
++
;
rbSize
++
;
/* found target_dl_bw? */
/* found target_dl_bw? */
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
bc04d720
...
@@ -293,6 +293,19 @@ NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac,
...
@@ -293,6 +293,19 @@ NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac,
}
}
int
cce_to_reg_interleaving
(
const
int
R
,
int
k
,
int
n_shift
,
const
int
C
,
int
L
,
const
int
N_regs
)
{
int
f
;
// interleaving function
if
(
R
==
0
)
f
=
k
;
else
{
int
c
=
k
/
R
;
int
r
=
k
%
R
;
f
=
(
r
*
C
+
c
+
n_shift
)
%
(
N_regs
/
L
);
}
return
f
;
}
uint8_t
find_pdcch_candidate
(
gNB_MAC_INST
*
mac
,
uint8_t
find_pdcch_candidate
(
gNB_MAC_INST
*
mac
,
int
cc_id
,
int
cc_id
,
int
aggregation
,
int
aggregation
,
...
@@ -310,34 +323,26 @@ uint8_t find_pdcch_candidate(gNB_MAC_INST *mac,
...
@@ -310,34 +323,26 @@ uint8_t find_pdcch_candidate(gNB_MAC_INST *mac,
return
-
1
;
return
-
1
;
}
}
int
N_rb
=
pdcch
->
n_rb
;
// nb of rbs of coreset per symbol
const
int
N_rb
=
pdcch
->
n_rb
;
// nb of rbs of coreset per symbol
int
N_symb
=
coreset
->
duration
;
// nb of coreset symbols
const
int
N_symb
=
coreset
->
duration
;
// nb of coreset symbols
int
N_regs
=
N_rb
*
N_symb
;
// nb of REGs per coreset
const
int
N_regs
=
N_rb
*
N_symb
;
// nb of REGs per coreset
int
N_cces
=
N_regs
/
NR_NB_REG_PER_CCE
;
// nb of cces in coreset
const
int
N_cces
=
N_regs
/
NR_NB_REG_PER_CCE
;
// nb of cces in coreset
const
int
R
=
pdcch
->
InterleaverSize
;
int
L
=
pdcch
->
RegBundleSize
;
const
int
L
=
pdcch
->
RegBundleSize
;
int
R
=
pdcch
->
InterleaverSize
;
const
int
C
=
R
>
0
?
N_regs
/
(
L
*
R
)
:
0
;
int
n_shift
=
pdcch
->
ShiftIndex
;
const
int
B_rb
=
L
/
N_symb
;
// nb of RBs occupied by each REG bundle
int
C
=
R
>
0
?
N_regs
/
(
L
*
R
)
:
0
;
int
B_rb
=
L
/
N_symb
;
// nb of RBs occupied by each REG bundle
int
first_cce
;
int
first_cce
;
bool
taken
=
false
;
// flag if the resource for a given candidate are taken
bool
taken
=
false
;
// flag if the resource for a given candidate are taken
// loop over all the available candidates
// loop over all the available candidates
// this implements TS 38.211 Sec. 7.3.2.2
for
(
int
m
=
next_cand
;
m
<
nr_of_candidates
;
m
++
)
{
// loop over candidates
for
(
int
m
=
next_cand
;
m
<
nr_of_candidates
;
m
++
)
{
// loop over candidates
first_cce
=
aggregation
*
((
Y
+
CEILIDIV
((
m
*
N_cces
),(
aggregation
*
nr_of_candidates
))
+
N_ci
)
%
CEILIDIV
(
N_cces
,
aggregation
));
first_cce
=
aggregation
*
((
Y
+
CEILIDIV
((
m
*
N_cces
),(
aggregation
*
nr_of_candidates
))
+
N_ci
)
%
CEILIDIV
(
N_cces
,
aggregation
));
for
(
int
j
=
first_cce
;
(
j
<
first_cce
+
aggregation
)
&&
!
taken
;
j
++
)
{
// loop over CCEs
for
(
int
j
=
first_cce
;
(
j
<
first_cce
+
aggregation
)
&&
!
taken
;
j
++
)
{
// loop over CCEs
for
(
int
k
=
6
*
j
/
L
;
(
k
<
(
6
*
j
/
L
+
6
/
L
))
&&
!
taken
;
k
++
)
{
// loop over REG bundles
for
(
int
k
=
6
*
j
/
L
;
(
k
<
(
6
*
j
/
L
+
6
/
L
))
&&
!
taken
;
k
++
)
{
// loop over REG bundles
int
f
;
// interleaving function
int
f
=
cce_to_reg_interleaving
(
R
,
k
,
pdcch
->
ShiftIndex
,
C
,
L
,
N_regs
);
if
(
R
==
0
)
f
=
k
;
else
{
int
c
=
k
/
R
;
int
r
=
k
%
R
;
f
=
(
r
*
C
+
c
+
n_shift
)
%
(
N_regs
/
L
);
}
for
(
int
rb
=
0
;
rb
<
B_rb
;
rb
++
)
{
// loop over the RBs of the bundle
for
(
int
rb
=
0
;
rb
<
B_rb
;
rb
++
)
{
// loop over the RBs of the bundle
if
(
vrb_map
[
pdcch
->
BWPStart
+
f
*
B_rb
+
rb
]
&
(((
1
<<
N_symb
)
-
1
)
<<
pdcch
->
StartSymbolIndex
))
{
if
(
vrb_map
[
pdcch
->
BWPStart
+
f
*
B_rb
+
rb
]
&
SL_to_bitmap
(
pdcch
->
StartSymbolIndex
,
N_symb
))
{
taken
=
true
;
taken
=
true
;
break
;
break
;
}
}
...
...
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