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
littleBu
OpenXG-RAN
Commits
4204699b
Commit
4204699b
authored
Nov 29, 2023
by
Marwan Hammouda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE: fixes on timing advance tracking and compensation
parent
e511cb25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
executables/nr-ue.c
executables/nr-ue.c
+11
-7
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
+1
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+5
-3
No files found.
executables/nr-ue.c
View file @
4204699b
...
@@ -834,12 +834,13 @@ void *UE_thread(void *arg)
...
@@ -834,12 +834,13 @@ void *UE_thread(void *arg)
if
(
UE
->
is_synchronized
)
{
if
(
UE
->
is_synchronized
)
{
if
(
tshift
)
if
(
tshift
)
{
{
int
diff
=
TO_init_rate
;
// shift in two frames
int
diff
=
0
;
// drift in one frame
UE
->
TO_I_Ctrl
+=
diff
;
UE
->
TO_I_Ctrl
=
round
(
TO_init_rate
/
TO_IScaling
)
;
UE
->
rx_offset_TO
=
(
TO_PScaling
*
diff
)
+
(
UE
->
TO_I_Ctrl
*
TO_IScaling
);
//PI controller
UE
->
rx_offset_TO
=
(
TO_PScaling
*
diff
)
+
(
UE
->
TO_I_Ctrl
*
TO_IScaling
);
//PI controller
UE
->
rx_offset_slot
=
1
;
UE
->
rx_offset_slot
=
1
;
UE
->
rx_offset
+=
(
UE
->
init_sync_frame
+
trashed_frames
)
*
TO_init_rate
;
int
ta_shift
=
(
UE
->
init_sync_frame
+
trashed_frames
)
*
2
*
TO_init_rate
;
UE
->
rx_offset_comp
=
0
;
UE
->
rx_offset_comp
=
0
;
int
ta_shift
=
(
UE
->
init_sync_frame
+
trashed_frames
)
*
2
*
diff
;
UE
->
timing_advance
+=
ta_shift
;
UE
->
timing_advance
+=
ta_shift
;
timing_advance
=
UE
->
timing_advance
;
timing_advance
=
UE
->
timing_advance
;
}
}
...
@@ -934,11 +935,14 @@ void *UE_thread(void *arg)
...
@@ -934,11 +935,14 @@ void *UE_thread(void *arg)
{
{
rx_offset_slot
=
UE
->
rx_offset_TO
*
UE
->
rx_offset_slot
/
nb_slot_frame
-
UE
->
rx_offset_comp
;
rx_offset_slot
=
UE
->
rx_offset_TO
*
UE
->
rx_offset_slot
/
nb_slot_frame
-
UE
->
rx_offset_comp
;
UE
->
rx_offset_comp
+=
rx_offset_slot
;
UE
->
rx_offset_comp
+=
rx_offset_slot
;
LOG_D
(
PHY
,
"UE->rx_offset_slot: %d, rx_offset_slot: %d, UE->rx_offset_TO: %d
\n
"
,
UE
->
rx_offset_slot
,
rx_offset_slot
,
UE
->
rx_offset_TO
);
UE
->
rx_offset_slot
++
;
UE
->
rx_offset_slot
++
;
UL_TO_Tx_ofs
=
2
*
rx_offset_slot
;
//to adapt the UE's transmission time in order to get aligned at gNB
UL_TO_Tx_ofs
=
1
*
rx_offset_slot
;
//to adapt the UE's transmission time in order to get aligned at gNB
acc_UL_To_TX
+=
UL_TO_Tx_ofs
;
acc_UL_To_TX
+=
UL_TO_Tx_ofs
;
if
(
UE
->
rx_offset_slot
>
((
2
*
nb_slot_frame
)
+
1
))
if
(
UE
->
rx_offset_slot
>
((
2
*
nb_slot_frame
)))
{
{
UE
->
rx_offset_slot
=
1
;
UE
->
rx_offset_slot
=
1
;
UE
->
rx_offset_comp
=
0
;
UE
->
rx_offset_comp
=
0
;
...
@@ -988,8 +992,8 @@ void *UE_thread(void *arg)
...
@@ -988,8 +992,8 @@ void *UE_thread(void *arg)
UE
->
timing_advance
+=
UL_TO_Tx_ofs
;
UE
->
timing_advance
+=
UL_TO_Tx_ofs
;
extern
uint64_t
RFsim_PropDelay
;
extern
uint64_t
RFsim_PropDelay
;
LOG_D
(
PHY
,
"RFsim_PropDelay: %lu, TA: %d, diff: %d, PI_Out: %d, offset_slot: %d, offset_UL: %d
\n
"
,
LOG_D
(
PHY
,
"RFsim_PropDelay: %lu, TA: %d, diff: %d, PI_Out: %d, offset_slot: %d, offset_UL: %d
, acc_UL_To_TX: %d
\n
"
,
RFsim_PropDelay
,
timing_advance
,
UE
->
rx_offset
,
UE
->
rx_offset_TO
,
rx_offset_slot
,
UL_TO_Tx_ofs
);
RFsim_PropDelay
,
timing_advance
,
UE
->
rx_offset
,
UE
->
rx_offset_TO
,
rx_offset_slot
,
UL_TO_Tx_ofs
,
acc_UL_To_TX
);
// use previous timing_advance value to compute writeTimestamp
// use previous timing_advance value to compute writeTimestamp
writeTimestamp
=
timestamp
+
writeTimestamp
=
timestamp
+
...
...
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
View file @
4204699b
...
@@ -120,7 +120,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
...
@@ -120,7 +120,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
ue
->
rx_offset_comp
=
0
;
ue
->
rx_offset_comp
=
0
;
}
}
LOG_D
(
PHY
,
"Frame: %u, diff: %d, rx_offset_TO: %d, PScaling: %f, IScaling: %f, TA: %d, TO_I_Ctrl: %
ld
\n
"
,
frame
,
ue
->
rx_offset
,
ue
->
rx_offset_TO
,
TO_PScaling
,
TO_IScaling
,
ue
->
timing_advance
,
TO_I_Ctrl
);
LOG_D
(
PHY
,
"Frame: %u, diff: %d, rx_offset_TO: %d, PScaling: %f, IScaling: %f, TA: %d, TO_I_Ctrl: %
d
\n
"
,
frame
,
ue
->
rx_offset
,
ue
->
rx_offset_TO
,
TO_PScaling
,
TO_IScaling
,
ue
->
timing_advance
,
ue
->
TO_I_Ctrl
);
if
(
abs
(
diff
)
<
5
)
if
(
abs
(
diff
)
<
5
)
count_max_pos_ok
++
;
count_max_pos_ok
++
;
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
4204699b
...
@@ -3829,10 +3829,10 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
...
@@ -3829,10 +3829,10 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
=
&
mac
->
ul_time_alignment
;
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
=
&
mac
->
ul_time_alignment
;
static
int
firstTime
=
0
;
//
static int firstTime = 0;
if
((
frameP
==
(
ul_time_alignment
->
frame
+
100
)
%
1024
)
||
firstTime
==
0
)
//
if ((frameP == (ul_time_alignment->frame + 100)%1024) || firstTime == 0 )
{
{
firstTime
=
1
;
//
firstTime = 1;
ul_time_alignment
->
ta_total
+=
ta
-
31
;
ul_time_alignment
->
ta_total
+=
ta
-
31
;
ul_time_alignment
->
tag_id
=
tag
;
ul_time_alignment
->
tag_id
=
tag
;
ul_time_alignment
->
ta_command
=
ta
;
ul_time_alignment
->
ta_command
=
ta
;
...
@@ -4214,6 +4214,8 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, int pdu_id)
...
@@ -4214,6 +4214,8 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, int pdu_id)
ul_time_alignment
->
ta_command
=
31
+
ta
;
ul_time_alignment
->
ta_command
=
31
+
ta
;
ul_time_alignment
->
ta_total
=
ta
;
ul_time_alignment
->
ta_total
=
ta
;
ul_time_alignment
->
ta_apply
=
true
;
ul_time_alignment
->
ta_apply
=
true
;
ul_time_alignment
->
frame
=
frame
;
ul_time_alignment
->
slot
=
slot
;
LOG_W
(
MAC
,
"received TA command %d
\n
"
,
31
+
ta
);
LOG_W
(
MAC
,
"received TA command %d
\n
"
,
31
+
ta
);
#ifdef DEBUG_RAR
#ifdef DEBUG_RAR
// CSI
// CSI
...
...
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