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
50d4d489
Commit
50d4d489
authored
Feb 13, 2024
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix timing advance from msg2/rar
parent
c92cbe67
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
36 deletions
+40
-36
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
+1
-0
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+13
-7
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+4
-4
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+2
-0
openair2/LAYER2/NR_MAC_UE/mac_defs.h
openair2/LAYER2/NR_MAC_UE/mac_defs.h
+7
-2
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+0
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+8
-19
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+5
-3
No files found.
nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
View file @
50d4d489
...
...
@@ -547,6 +547,7 @@ typedef struct {
int
ta_frame
;
int
ta_slot
;
int
ta_command
;
bool
is_rar
;
}
fapi_nr_ta_command_pdu
;
typedef
struct
{
...
...
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
View file @
50d4d489
...
...
@@ -320,7 +320,7 @@ static void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
}
}
void
configure_ta_command
(
PHY_VARS_NR_UE
*
ue
,
fapi_nr_ta_command_pdu
*
ta_command_pdu
)
static
void
configure_ta_command
(
PHY_VARS_NR_UE
*
ue
,
fapi_nr_ta_command_pdu
*
ta_command_pdu
)
{
/* Time Alignment procedure
...
...
@@ -365,13 +365,19 @@ void configure_ta_command(PHY_VARS_NR_UE *ue, fapi_nr_ta_command_pdu *ta_command
const
double
t_subframe
=
1
.
0
;
// subframe duration of 1 msec
const
int
ul_tx_timing_adjustment
=
1
+
(
int
)
ceil
(
slots_per_subframe
*
(
N_t_1
+
N_t_2
+
N_TA_max
+
0
.
5
)
/
t_subframe
);
ue
->
ta_slot
=
(
ta_command_pdu
->
ta_slot
+
ul_tx_timing_adjustment
)
%
slots_per_frame
;
if
(
ta_command_pdu
->
ta_slot
+
ul_tx_timing_adjustment
>
slots_per_frame
)
ue
->
ta_frame
=
(
ta_command_pdu
->
ta_frame
+
1
)
%
1024
;
else
if
(
ta_command_pdu
->
is_rar
)
{
ue
->
ta_slot
=
ta_command_pdu
->
ta_slot
;
ue
->
ta_frame
=
ta_command_pdu
->
ta_frame
;
ue
->
ta_command
=
ta_command_pdu
->
ta_command
;
ue
->
timing_advance
=
0
;
ue
->
ta_command
=
ta_command_pdu
->
ta_command
+
31
;
// To use TA adjustment algo in ue_ta_procedures()
}
else
{
ue
->
ta_slot
=
(
ta_command_pdu
->
ta_slot
+
ul_tx_timing_adjustment
)
%
slots_per_frame
;
if
(
ta_command_pdu
->
ta_slot
+
ul_tx_timing_adjustment
>
slots_per_frame
)
ue
->
ta_frame
=
(
ta_command_pdu
->
ta_frame
+
1
)
%
1024
;
else
ue
->
ta_frame
=
ta_command_pdu
->
ta_frame
;
ue
->
ta_command
=
ta_command_pdu
->
ta_command
;
}
LOG_D
(
PHY
,
"TA command received in Frame.Slot %d.%d -- Starting UL time alignment procedures. TA update will be applied at frame %d slot %d
\n
"
,
ta_command_pdu
->
ta_frame
,
ta_command_pdu
->
ta_slot
,
ue
->
ta_frame
,
ue
->
ta_slot
);
}
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
50d4d489
...
...
@@ -232,15 +232,14 @@ int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL){
// - If the current tx frame and slot match the TA configuration
// then timing advance is processed and set to be applied in the next UL transmission
// - Application of timing adjustment according to TS 38.213 p4.2
// todo:
// - handle RAR TA application as per ch 4.2 TS 38.213
void
ue_ta_procedures
(
PHY_VARS_NR_UE
*
ue
,
int
slot_tx
,
int
frame_tx
)
{
if
(
frame_tx
==
ue
->
ta_frame
&&
slot_tx
==
ue
->
ta_slot
)
{
uint16_t
ofdm_symbol_size
=
ue
->
frame_parms
.
ofdm_symbol_size
;
// convert time factor "16 * 64 * T_c / (2^mu)" in N_TA calculation in TS38.213 section 4.2 to samples by multiplying with samples per second
// convert time factor "16 * 64 * T_c / (2^mu)" in N_TA calculation in TS38.213 section 4.2 to samples by multiplying with
// samples per second
// 16 * 64 * T_c / (2^mu) * samples_per_second
// = 16 * T_s / (2^mu) * samples_per_second
// = 16 * 1 / (15 kHz * 2048) / (2^mu) * (15 kHz * 2^mu * ofdm_symbol_size)
...
...
@@ -250,7 +249,8 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx)
ue
->
timing_advance
+=
(
ue
->
ta_command
-
31
)
*
bw_scaling
;
LOG_D
(
PHY
,
"[UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d
\n
"
,
LOG_D
(
PHY
,
"[UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d
\n
"
,
ue
->
Mod_id
,
frame_tx
,
slot_tx
,
...
...
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
50d4d489
...
...
@@ -552,6 +552,8 @@ int main(int argc, char *argv[])
gNB
=
RC
.
gNB
[
0
];
gNB
->
ofdm_offset_divisor
=
UINT_MAX
;
gNB
->
num_pusch_symbols_per_thread
=
1
;
gNB
->
RU_list
[
0
]
=
calloc
(
1
,
sizeof
(
**
gNB
->
RU_list
));
gNB
->
RU_list
[
0
]
->
rfdevice
.
openair0_cfg
=
openair0_cfg
;
initFloatingCoresTpool
(
threadCnt
,
&
gNB
->
threadPool
,
false
,
"gNB-tpool"
);
initNotifiedFIFO
(
&
gNB
->
respDecode
);
...
...
openair2/LAYER2/NR_MAC_UE/mac_defs.h
View file @
50d4d489
...
...
@@ -384,11 +384,16 @@ typedef struct {
short
ssb_rsrp_dBm
;
}
NR_SSB_meas_t
;
typedef
enum
ta_type
{
no_ta
=
0
,
adjustment_ta
,
rar_ta
,
}
ta_type_t
;
typedef
struct
NR_UL_TIME_ALIGNMENT
{
/// TA command and TAGID received from the gNB
bool
ta_apply
;
ta_type_t
ta_apply
;
int
ta_command
;
int
ta_total
;
uint32_t
tag_id
;
int
frame
;
int
slot
;
...
...
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
50d4d489
...
...
@@ -401,7 +401,6 @@ and fills the PRACH PDU per each FD occasion.
void
nr_ue_pucch_scheduler
(
NR_UE_MAC_INST_t
*
mac
,
frame_t
frameP
,
int
slotP
,
void
*
phy_data
);
void
nr_schedule_csirs_reception
(
NR_UE_MAC_INST_t
*
mac
,
int
frame
,
int
slot
);
void
nr_schedule_csi_for_im
(
NR_UE_MAC_INST_t
*
mac
,
int
frame
,
int
slot
);
void
schedule_ta_command
(
fapi_nr_dl_config_request_t
*
dl_config
,
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
);
/* \brief This function schedules the Msg3 transmission
@param
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
50d4d489
...
...
@@ -3722,12 +3722,11 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
const
int
tag
=
((
NR_MAC_CE_TA
*
)
pduP
)[
1
].
TAGID
;
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
=
&
mac
->
ul_time_alignment
;
ul_time_alignment
->
ta_total
+=
ta
-
31
;
ul_time_alignment
->
tag_id
=
tag
;
ul_time_alignment
->
ta_command
=
ta
;
ul_time_alignment
->
frame
=
frameP
;
ul_time_alignment
->
slot
=
slot
;
ul_time_alignment
->
ta_apply
=
true
;
ul_time_alignment
->
ta_apply
=
adjustment_ta
;
/*
#ifdef DEBUG_HEADER_PARSING
LOG_D(MAC, "[UE] CE %d : UE Timing Advance : %d\n", i, pduP[1]);
...
...
@@ -3735,21 +3734,9 @@ void nr_ue_process_mac_pdu(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_i
*/
if
(
ta
==
31
)
LOG_D
(
NR_MAC
,
"[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d TA total %d
\n
"
,
frameP
,
slot
,
ta
,
tag
,
CC_id
,
ul_time_alignment
->
ta_total
);
LOG_D
(
NR_MAC
,
"[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d
\n
"
,
frameP
,
slot
,
ta
,
tag
,
CC_id
);
else
LOG_I
(
NR_MAC
,
"[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d TA total %d
\n
"
,
frameP
,
slot
,
ta
,
tag
,
CC_id
,
ul_time_alignment
->
ta_total
);
LOG_I
(
NR_MAC
,
"[%d.%d] Received TA_COMMAND %u TAGID %u CC_id %d
\n
"
,
frameP
,
slot
,
ta
,
tag
,
CC_id
);
break
;
case
DL_SCH_LCID_CON_RES_ID
:
...
...
@@ -4129,9 +4116,9 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d
// TA command
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
=
&
mac
->
ul_time_alignment
;
const
int
ta
=
rar
->
TA2
+
(
rar
->
TA1
<<
5
);
ul_time_alignment
->
ta_command
=
31
+
ta
;
ul_time_alignment
->
ta_
total
=
ta
;
ul_time_alignment
->
ta_apply
=
true
;
ul_time_alignment
->
ta_command
=
ta
;
ul_time_alignment
->
ta_
apply
=
rar_
ta
;
LOG_W
(
MAC
,
"received TA command %d
\n
"
,
31
+
ta
);
#ifdef DEBUG_RAR
// CSI
...
...
@@ -4221,6 +4208,8 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d
return
;
}
ret
=
nr_ue_pusch_scheduler
(
mac
,
is_Msg3
,
frame
,
slot
,
&
frame_tx
,
&
slot_tx
,
tda_info
.
k2
);
ul_time_alignment
->
frame
=
frame_tx
;
ul_time_alignment
->
slot
=
slot_tx
;
if
(
ret
!=
-
1
)
{
uint16_t
rnti
=
mac
->
crnti
;
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
50d4d489
...
...
@@ -58,6 +58,7 @@
//#define SRS_DEBUG
static
void
nr_ue_prach_scheduler
(
NR_UE_MAC_INST_t
*
mac
,
frame_t
frameP
,
sub_frame_t
slotP
);
static
void
schedule_ta_command
(
fapi_nr_dl_config_request_t
*
dl_config
,
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
);
fapi_nr_ul_config_request_pdu_t
*
lockGet_ul_config
(
NR_UE_MAC_INST_t
*
mac
,
frame_t
frame_tx
,
int
slot_tx
,
uint8_t
pdu_type
)
{
...
...
@@ -1018,7 +1019,7 @@ void nr_ue_dl_scheduler(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info
ue_dci_configuration
(
mac
,
dl_config
,
rx_frame
,
rx_slot
);
if
(
mac
->
ul_time_alignment
.
ta_apply
)
if
(
mac
->
ul_time_alignment
.
ta_apply
!=
no_ta
)
schedule_ta_command
(
dl_config
,
&
mac
->
ul_time_alignment
);
if
(
mac
->
state
==
UE_CONNECTED
)
{
nr_schedule_csirs_reception
(
mac
,
rx_frame
,
rx_slot
);
...
...
@@ -3354,15 +3355,16 @@ uint8_t nr_ue_get_sdu(NR_UE_MAC_INST_t *mac,
return
num_sdus
>
0
?
1
:
0
;
}
void
schedule_ta_command
(
fapi_nr_dl_config_request_t
*
dl_config
,
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
)
static
void
schedule_ta_command
(
fapi_nr_dl_config_request_t
*
dl_config
,
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
)
{
fapi_nr_ta_command_pdu
*
ta
=
&
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
ta_command_pdu
;
ta
->
ta_frame
=
ul_time_alignment
->
frame
;
ta
->
ta_slot
=
ul_time_alignment
->
slot
;
ta
->
is_rar
=
ul_time_alignment
->
ta_apply
==
rar_ta
;
ta
->
ta_command
=
ul_time_alignment
->
ta_command
;
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
pdu_type
=
FAPI_NR_CONFIG_TA_COMMAND
;
dl_config
->
number_pdus
+=
1
;
ul_time_alignment
->
ta_apply
=
false
;
ul_time_alignment
->
ta_apply
=
no_ta
;
}
uint32_t
nr_get_pbr
(
long
prioritizedbitrate
)
...
...
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