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
cc8a8ef9
Commit
cc8a8ef9
authored
Dec 29, 2023
by
Thomas Schlichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NR_UE: fix timestamps for initial writes for rfsim
parent
bd13f79e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
executables/nr-ue.c
executables/nr-ue.c
+13
-8
No files found.
executables/nr-ue.c
View file @
cc8a8ef9
...
...
@@ -722,8 +722,13 @@ void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, bool toTrash)
UE
->
frame_parms
.
get_samples_per_slot
(
slot
,
&
UE
->
frame_parms
),
UE
->
frame_parms
.
nb_antennas_rx
);
if
(
IS_SOFTMODEM_RFSIM
)
dummyWrite
(
UE
,
*
timestamp
,
UE
->
frame_parms
.
get_samples_per_slot
(
slot
,
&
UE
->
frame_parms
));
if
(
IS_SOFTMODEM_RFSIM
)
{
openair0_timestamp
writeTimestamp
=
*
timestamp
+
UE
->
frame_parms
.
get_samples_slot_timestamp
(
slot
,
&
UE
->
frame_parms
,
DURATION_RX_TO_TX
)
-
openair0_cfg
[
0
].
tx_sample_advance
-
UE
->
N_TA_offset
-
UE
->
timing_advance
;
int
writeSlot
=
(
slot
+
DURATION_RX_TO_TX
)
%
UE
->
frame_parms
.
slots_per_frame
;
dummyWrite
(
UE
,
writeTimestamp
,
UE
->
frame_parms
.
get_samples_per_slot
(
writeSlot
,
&
UE
->
frame_parms
));
}
if
(
toTrash
)
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
free
(
rxp
[
i
]);
...
...
@@ -748,19 +753,20 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
}
}
else
{
*
timestamp
+=
UE
->
frame_parms
.
get_samples_per_slot
(
1
,
&
UE
->
frame_parms
);
for
(
int
size
=
UE
->
rx_offset
;
size
>
0
;
size
-=
UE
->
frame_parms
.
samples_per_subframe
)
{
int
unitTransfer
=
size
>
UE
->
frame_parms
.
samples_per_subframe
?
UE
->
frame_parms
.
samples_per_subframe
:
size
;
// we write before read because gNB waits for UE to write and both executions halt
// this happens here as the read size is samples_per_subframe which is very much larger than samp_per_slot
if
(
IS_SOFTMODEM_RFSIM
)
dummyWrite
(
UE
,
*
timestamp
,
unitTransfer
);
AssertFatal
(
unitTransfer
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
timestamp
,
(
void
**
)
UE
->
common_vars
.
rxdata
,
unitTransfer
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
*
timestamp
+=
unitTransfer
;
// this does not affect the read but needed for RFSIM write
if
(
IS_SOFTMODEM_RFSIM
)
{
openair0_timestamp
writeTimestamp
=
*
timestamp
+
UE
->
frame_parms
.
get_samples_slot_timestamp
(
0
,
&
UE
->
frame_parms
,
DURATION_RX_TO_TX
)
-
openair0_cfg
[
0
].
tx_sample_advance
-
UE
->
N_TA_offset
-
UE
->
timing_advance
;
dummyWrite
(
UE
,
writeTimestamp
,
unitTransfer
);
}
}
}
}
...
...
@@ -842,7 +848,6 @@ void *UE_thread(void *arg)
int
ta_shift
=
(
UE
->
init_sync_frame
+
trashed_frames
)
*
2
*
TO_init_rate
;
UE
->
rx_offset_comp
=
0
;
UE
->
timing_advance
+=
ta_shift
;
timing_advance
=
UE
->
timing_advance
;
}
decoded_frame_rx
=
mac
->
mib_frame
;
LOG_I
(
PHY
,
"UE synchronized decoded_frame_rx=%d UE->init_sync_frame=%d trashed_frames=%d
\n
"
,
...
...
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