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
spbro
OpenXG-RAN
Commits
c48397f4
Commit
c48397f4
authored
May 28, 2024
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: reset beam only if it is a newly allocated one
parent
e93f056b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
63 deletions
+97
-63
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+54
-39
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
+12
-12
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+17
-7
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+5
-3
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+1
-1
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+8
-1
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
c48397f4
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
View file @
c48397f4
...
...
@@ -183,11 +183,11 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
ssb_start_symbol
=
get_ssb_start_symbol
(
band
,
scs
,
i_ssb
);
// if start symbol is in current slot, schedule current SSB, fill VRB map and call get_type0_PDCCH_CSS_config_parameters
if
((
ssb_start_symbol
/
14
)
==
rel_slot
){
in
t
beam
=
beam_allocation_procedure
(
&
gNB
->
beam_info
,
frameP
,
slotP
,
i_ssb
,
n_slots_frame
);
AssertFatal
(
beam
>=
0
,
"Cannot allocate SSB %d in any available beam
\n
"
,
i_ssb
);
NR_beam_alloc_stuct_
t
beam
=
beam_allocation_procedure
(
&
gNB
->
beam_info
,
frameP
,
slotP
,
i_ssb
,
n_slots_frame
);
AssertFatal
(
beam
.
idx
>=
0
,
"Cannot allocate SSB %d in any available beam
\n
"
,
i_ssb
);
const
int
prb_offset
=
offset_pointa
>>
scs
;
schedule_ssb
(
frameP
,
slotP
,
scc
,
dl_req
,
i_ssb
,
ssbSubcarrierOffset
,
offset_pointa
,
mib_pdu
);
fill_ssb_vrb_map
(
cc
,
prb_offset
,
ssbSubcarrierOffset
,
ssb_start_symbol
,
CC_id
,
beam
);
fill_ssb_vrb_map
(
cc
,
prb_offset
,
ssbSubcarrierOffset
,
ssb_start_symbol
,
CC_id
,
beam
.
idx
);
if
(
get_softmodem_params
()
->
sa
==
1
)
{
get_type0_PDCCH_CSS_config_parameters
(
&
gNB
->
type0_PDCCH_CSS_config
[
i_ssb
],
frameP
,
...
...
@@ -214,11 +214,11 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
ssb_start_symbol
=
get_ssb_start_symbol
(
band
,
scs
,
i_ssb
);
// if start symbol is in current slot, schedule current SSB, fill VRB map and call get_type0_PDCCH_CSS_config_parameters
if
((
ssb_start_symbol
/
14
)
==
rel_slot
){
in
t
beam
=
beam_allocation_procedure
(
&
gNB
->
beam_info
,
frameP
,
slotP
,
i_ssb
,
n_slots_frame
);
AssertFatal
(
beam
>=
0
,
"Cannot allocate SSB %d in any available beam
\n
"
,
i_ssb
);
NR_beam_alloc_stuct_
t
beam
=
beam_allocation_procedure
(
&
gNB
->
beam_info
,
frameP
,
slotP
,
i_ssb
,
n_slots_frame
);
AssertFatal
(
beam
.
idx
>=
0
,
"Cannot allocate SSB %d in any available beam
\n
"
,
i_ssb
);
const
int
prb_offset
=
offset_pointa
>>
scs
;
schedule_ssb
(
frameP
,
slotP
,
scc
,
dl_req
,
i_ssb
,
ssbSubcarrierOffset
,
offset_pointa
,
mib_pdu
);
fill_ssb_vrb_map
(
cc
,
prb_offset
,
ssbSubcarrierOffset
,
ssb_start_symbol
,
CC_id
,
beam
);
fill_ssb_vrb_map
(
cc
,
prb_offset
,
ssbSubcarrierOffset
,
ssb_start_symbol
,
CC_id
,
beam
.
idx
);
if
(
get_softmodem_params
()
->
sa
==
1
)
{
get_type0_PDCCH_CSS_config_parameters
(
&
gNB
->
type0_PDCCH_CSS_config
[
i_ssb
],
frameP
,
...
...
@@ -245,11 +245,11 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
ssb_start_symbol
=
get_ssb_start_symbol
(
band
,
scs
,
i_ssb
);
// if start symbol is in current slot, schedule current SSB, fill VRB map and call get_type0_PDCCH_CSS_config_parameters
if
((
ssb_start_symbol
/
14
)
==
rel_slot
){
in
t
beam
=
beam_allocation_procedure
(
&
gNB
->
beam_info
,
frameP
,
slotP
,
i_ssb
,
n_slots_frame
);
AssertFatal
(
beam
>=
0
,
"Cannot allocate SSB %d in any available beam
\n
"
,
i_ssb
);
NR_beam_alloc_stuct_
t
beam
=
beam_allocation_procedure
(
&
gNB
->
beam_info
,
frameP
,
slotP
,
i_ssb
,
n_slots_frame
);
AssertFatal
(
beam
.
idx
>=
0
,
"Cannot allocate SSB %d in any available beam
\n
"
,
i_ssb
);
const
int
prb_offset
=
offset_pointa
>>
(
scs
-
2
);
// reference 60kHz
schedule_ssb
(
frameP
,
slotP
,
scc
,
dl_req
,
i_ssb
,
ssbSubcarrierOffset
,
offset_pointa
,
mib_pdu
);
fill_ssb_vrb_map
(
cc
,
prb_offset
,
ssbSubcarrierOffset
>>
(
scs
-
2
),
ssb_start_symbol
,
CC_id
,
beam
);
fill_ssb_vrb_map
(
cc
,
prb_offset
,
ssbSubcarrierOffset
>>
(
scs
-
2
),
ssb_start_symbol
,
CC_id
,
beam
.
idx
);
if
(
get_softmodem_params
()
->
sa
==
1
)
{
get_type0_PDCCH_CSS_config_parameters
(
&
gNB
->
type0_PDCCH_CSS_config
[
i_ssb
],
frameP
,
...
...
@@ -586,8 +586,8 @@ void schedule_nr_sib1(module_id_t module_idP,
(
type0_PDCCH_CSS_config
->
active
==
true
))
{
const
int
n_slots_frame
=
nr_slots_per_frame
[
*
scc
->
ssbSubcarrierSpacing
];
in
t
beam
=
beam_allocation_procedure
(
&
gNB_mac
->
beam_info
,
frameP
,
slotP
,
i
,
n_slots_frame
);
AssertFatal
(
beam
>=
0
,
"Cannot allocate SIB1 corresponding to SSB %d in any available beam
\n
"
,
i
);
NR_beam_alloc_stuct_
t
beam
=
beam_allocation_procedure
(
&
gNB_mac
->
beam_info
,
frameP
,
slotP
,
i
,
n_slots_frame
);
AssertFatal
(
beam
.
idx
>=
0
,
"Cannot allocate SIB1 corresponding to SSB %d in any available beam
\n
"
,
i
);
LOG_D
(
NR_MAC
,
"(%d.%d) SIB1 transmission: ssb_index %d
\n
"
,
frameP
,
slotP
,
type0_PDCCH_CSS_config
->
ssb_index
);
default_table_type_t
table_type
=
get_default_table_type
(
type0_PDCCH_CSS_config
->
type0_pdcch_ss_mux_pattern
);
...
...
@@ -610,7 +610,7 @@ void schedule_nr_sib1(module_id_t module_idP,
&
dmrs_parms
,
&
tda_info
,
candidate_idx
,
beam
,
beam
.
idx
,
cc
->
sib1_bcch_length
);
nfapi_nr_dl_tti_request_body_t
*
dl_req
=
&
DL_req
->
dl_tti_request_body
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
c48397f4
...
...
@@ -3100,20 +3100,30 @@ void UL_tti_req_ahead_initialization(gNB_MAC_INST *gNB, int n, int CCid, frame_t
}
// return index of beam in period if valid or -1 if not valid
in
t
beam_allocation_procedure
(
NR_beam_info_t
*
beam_info
,
int
frame
,
int
slot
,
int
beam_index
,
int
slots_per_frame
)
NR_beam_alloc_stuct_
t
beam_allocation_procedure
(
NR_beam_info_t
*
beam_info
,
int
frame
,
int
slot
,
int
beam_index
,
int
slots_per_frame
)
{
NR_beam_alloc_stuct_t
beam_struct
;
beam_struct
.
new_beam
=
false
;
beam_struct
.
idx
=
-
1
;
// if no beam allocation for analog beamforming we always return beam index 0 (no multiple beams)
if
(
!
beam_info
->
beam_allocation
)
return
0
;
if
(
!
beam_info
->
beam_allocation
)
{
beam_struct
.
idx
=
0
;
return
beam_struct
;
}
const
int
index
=
((
frame
*
slots_per_frame
+
slot
)
/
beam_info
->
slots_in_beam_period
)
%
beam_info
->
beam_allocation_size
;
for
(
int
i
=
0
;
i
<
beam_info
->
beams_per_period
;
i
++
)
{
if
(
beam_info
->
beam_allocation
[
i
][
index
]
==
-
1
||
beam_info
->
beam_allocation
[
i
][
index
]
==
beam_index
)
{
if
(
beam_info
->
beam_allocation
[
i
][
index
]
==
beam_index
)
{
beam_struct
.
idx
=
i
;
return
beam_struct
;
}
if
(
beam_info
->
beam_allocation
[
i
][
index
]
==
-
1
)
{
beam_info
->
beam_allocation
[
i
][
index
]
=
beam_index
;
return
i
;
beam_struct
.
new_beam
=
true
;
beam_struct
.
idx
=
i
;
return
beam_struct
;
}
}
return
-
1
;
return
beam_struct
;
}
void
reset_beam_status
(
NR_beam_info_t
*
beam_info
,
int
frame
,
int
slot
,
int
beam_index
,
int
slots_per_frame
)
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
View file @
c48397f4
...
...
@@ -1326,15 +1326,15 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac,
else
{
// unoccupied occasion
// checking if in ul_slot the resources potentially to be assigned to this PUCCH are available
set_pucch_allocation
(
ul_bwp
,
r_pucch
,
bwp_size
,
curr_pucch
);
in
t
beam
=
beam_allocation_procedure
(
&
mac
->
beam_info
,
pucch_frame
,
pucch_slot
,
beam_index
,
n_slots_frame
);
if
(
beam
<
0
)
{
NR_beam_alloc_stuct_
t
beam
=
beam_allocation_procedure
(
&
mac
->
beam_info
,
pucch_frame
,
pucch_slot
,
beam_index
,
n_slots_frame
);
if
(
beam
.
idx
<
0
)
{
LOG_D
(
NR_MAC
,
"DL %4d.%2d, UL_ACK %4d.%2d beam resources for this occasion are already occupied, move to the following occasion
\n
"
,
frame
,
slot
,
pucch_frame
,
pucch_slot
);
continue
;
}
const
int
index
=
ul_buffer_index
(
pucch_frame
,
pucch_slot
,
ul_bwp
->
scs
,
mac
->
vrb_map_UL_size
);
uint16_t
*
vrb_map_UL
=
&
mac
->
common_channels
[
CC_id
].
vrb_map_UL
[
beam
][
index
*
MAX_BWP_SIZE
];
uint16_t
*
vrb_map_UL
=
&
mac
->
common_channels
[
CC_id
].
vrb_map_UL
[
beam
.
idx
][
index
*
MAX_BWP_SIZE
];
bool
ret
=
test_pucch0_vrb_occupation
(
curr_pucch
,
vrb_map_UL
,
bwp_start
,
...
...
@@ -1343,6 +1343,8 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac,
LOG_D
(
NR_MAC
,
"DL %4d.%2d, UL_ACK %4d.%2d PRB resources for this occasion are already occupied, move to the following occasion
\n
"
,
frame
,
slot
,
pucch_frame
,
pucch_slot
);
if
(
beam
.
new_beam
)
reset_beam_status
(
&
mac
->
beam_info
,
pucch_frame
,
pucch_slot
,
beam_index
,
n_slots_frame
);
continue
;
}
// allocating a new PUCCH structure for this occasion
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
c48397f4
...
...
@@ -425,7 +425,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options,
int
ul_buffer_index
(
int
frame
,
int
slot
,
int
scs
,
int
size
);
void
UL_tti_req_ahead_initialization
(
gNB_MAC_INST
*
gNB
,
int
n
,
int
CCid
,
frame_t
frameP
,
int
slotP
);
in
t
beam_allocation_procedure
(
NR_beam_info_t
*
beam_info
,
int
frame
,
int
slot
,
int
beam_index
,
int
slots_per_frame
);
NR_beam_alloc_stuct_
t
beam_allocation_procedure
(
NR_beam_info_t
*
beam_info
,
int
frame
,
int
slot
,
int
beam_index
,
int
slots_per_frame
);
void
reset_beam_status
(
NR_beam_info_t
*
beam_info
,
int
frame
,
int
slot
,
int
beam_index
,
int
slots_per_frame
);
void
nr_sr_reporting
(
gNB_MAC_INST
*
nrmac
,
frame_t
frameP
,
sub_frame_t
slotP
);
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
c48397f4
...
...
@@ -121,8 +121,15 @@ typedef enum {
nrRA_Msg4
=
4
,
nrRA_WAIT_Msg4_ACK
=
5
,
}
RA_gNB_state_t
;
static
const
char
*
const
nrra_text
[]
=
{
"IDLE"
,
"Msg2"
,
"WAIT_Msg3"
,
"Msg3_retransmission"
,
"Msg3_dcch_dtch"
,
"Msg4"
,
"WAIT_Msg4_ACK"
};
typedef
struct
{
int
idx
;
bool
new_beam
;
}
NR_beam_alloc_stuct_t
;
typedef
struct
nr_pdsch_AntennaPorts_t
{
int
N1
;
int
N2
;
...
...
@@ -202,7 +209,7 @@ typedef struct {
/// Msg3 time domain allocation index
int
Msg3_tda_id
;
/// Msg3 beam matrix index
int
Msg3_beam_idx
;
NR_beam_alloc_stuct_t
Msg3_beam
;
/// harq_pid used for Msg4 transmission
uint8_t
harq_pid
;
/// UE RNTI allocated during RAR
...
...
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