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
alex037yang
OpenXG-RAN
Commits
b93598c2
Commit
b93598c2
authored
5 years ago
by
Sakthivel Velumani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch by Laurent to fix RFsim for FR2
parent
cf51fff7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
44 deletions
+36
-44
executables/nr-ue.c
executables/nr-ue.c
+35
-43
targets/ARCH/rfsimulator/simulator.c
targets/ARCH/rfsimulator/simulator.c
+1
-1
No files found.
executables/nr-ue.c
View file @
b93598c2
...
...
@@ -509,57 +509,49 @@ void UE_processing(void *arg) {
}
void
readFrame
(
PHY_VARS_NR_UE
*
UE
,
openair0_timestamp
*
timestamp
)
{
void
*
rxp
[
NB_ANTENNAS_RX
];
void
dummyWrite
(
PHY_VARS_NR_UE
*
UE
,
openair0_timestamp
timestamp
,
int
writeBlockSize
)
{
void
*
dummy_tx
[
UE
->
frame_parms
.
nb_antennas_tx
];
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
dummy_tx
[
i
]
=
malloc16_clear
(
UE
->
frame_parms
.
samples_per_subframe
*
4
);
for
(
int
x
=
0
;
x
<
20
;
x
++
)
{
// two frames for initial sync
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
rxp
[
i
]
=
((
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
0
])
+
4
*
x
*
UE
->
frame_parms
.
samples_per_subframe
;
AssertFatal
(
UE
->
frame_parms
.
samples_per_subframe
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
timestamp
,
rxp
,
UE
->
frame_parms
.
samples_per_subframe
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
}
dummy_tx
[
i
]
=
malloc16_clear
(
writeBlockSize
*
4
);
AssertFatal
(
writeBlockSize
==
UE
->
rfdevice
.
trx_write_func
(
&
UE
->
rfdevice
,
timestamp
,
dummy_tx
,
writeBlockSize
,
UE
->
frame_parms
.
nb_antennas_tx
,
4
),
""
);
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
free
(
dummy_tx
[
i
]);
}
void
trashFrame
(
PHY_VARS_NR_UE
*
UE
,
openair0_timestamp
*
timestamp
)
{
void
*
dummy_tx
[
UE
->
frame_parms
.
nb_antennas_tx
];
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
dummy_tx
[
i
]
=
malloc16_clear
(
UE
->
frame_parms
.
samples_per_subframe
*
4
);
void
*
dummy_rx
[
UE
->
frame_parms
.
nb_antennas_rx
];
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
dummy_rx
[
i
]
=
malloc16
(
UE
->
frame_parms
.
samples_per_subframe
*
4
);
for
(
int
sf
=
0
;
sf
<
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
sf
++
)
{
// printf("Reading dummy sf %d\n",sf);
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
timestamp
,
dummy_rx
,
UE
->
frame_parms
.
samples_per_subframe
,
UE
->
frame_parms
.
nb_antennas_rx
);
if
(
IS_SOFTMODEM_RFSIM
)
{
usleep
(
1000
);
// slow down, as would do actuall rf to let cpu for the synchro thread
void
readFrame
(
PHY_VARS_NR_UE
*
UE
,
openair0_timestamp
*
timestamp
,
bool
toTrash
)
{
void
*
rxp
[
NB_ANTENNAS_RX
];
for
(
int
x
=
0
;
x
<
20
;
x
++
)
{
// two frames for initial sync
for
(
int
slot
=
0
;
slot
<
UE
->
frame_parms
.
slots_per_subframe
;
slot
++
)
{
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
{
if
(
toTrash
)
rxp
[
i
]
=
malloc16
(
UE
->
frame_parms
.
samples_per_slot
*
4
);
else
rxp
[
i
]
=
((
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
0
])
+
4
*
(
x
*
UE
->
frame_parms
.
slots_per_subframe
+
slot
)
*
UE
->
frame_parms
.
samples_per_slot
;
}
AssertFatal
(
UE
->
frame_parms
.
samples_per_slot
==
UE
->
rfdevice
.
trx_read_func
(
&
UE
->
rfdevice
,
timestamp
,
rxp
,
UE
->
frame_parms
.
samples_per_slot
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
if
(
IS_SOFTMODEM_RFSIM
)
dummyWrite
(
UE
,
*
timestamp
,
UE
->
frame_parms
.
samples_per_slot
);
if
(
toTrash
)
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
free
(
rxp
[
i
]);
}
}
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
free
(
dummy_tx
[
i
]);
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
free
(
dummy_rx
[
i
]);
}
void
syncInFrame
(
PHY_VARS_NR_UE
*
UE
,
openair0_timestamp
*
timestamp
)
{
...
...
@@ -644,7 +636,7 @@ void *UE_thread(void *arg) {
decoded_frame_rx
=
(
tmp
->
proc
.
decoded_frame_rx
+
trashed_frames
)
%
MAX_FRAME_NUMBER
;
delNotifiedFIFO_elt
(
res
);
}
else
{
trashFrame
(
UE
,
&
timestamp
);
readFrame
(
UE
,
&
timestamp
,
true
);
trashed_frames
++
;
continue
;
}
...
...
@@ -653,7 +645,7 @@ void *UE_thread(void *arg) {
AssertFatal
(
!
syncRunning
,
"At this point synchronisation can't be running
\n
"
);
if
(
!
UE
->
is_synchronized
)
{
readFrame
(
UE
,
&
timestamp
);
readFrame
(
UE
,
&
timestamp
,
false
);
notifiedFIFO_elt_t
*
Msg
=
newNotifiedFIFO_elt
(
sizeof
(
syncData_t
),
0
,
&
nf
,
UE_synch
);
syncData_t
*
syncMsg
=
(
syncData_t
*
)
NotifiedFifoData
(
Msg
);
syncMsg
->
UE
=
UE
;
...
...
@@ -747,7 +739,7 @@ void *UE_thread(void *arg) {
readBlockSize
,
UE
->
frame_parms
.
nb_antennas_rx
),
""
);
if
(
slot_nr
==
18
)
if
(
slot_nr
==
18
||
IS_SOFTMODEM_RFSIM
)
AssertFatal
(
writeBlockSize
==
UE
->
rfdevice
.
trx_write_func
(
&
UE
->
rfdevice
,
timestamp
+
...
...
This diff is collapsed.
Click to expand it.
targets/ARCH/rfsimulator/simulator.c
View file @
b93598c2
...
...
@@ -478,9 +478,9 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi
}
if
(
b
->
headerMode
==
false
)
{
LOG_D
(
HW
,
"UEsock: %d Set b->lastReceivedTS %ld
\n
"
,
fd
,
b
->
lastReceivedTS
);
if
(
!
b
->
trashingPacket
)
{
b
->
lastReceivedTS
=
b
->
th
.
timestamp
+
b
->
th
.
size
-
byteToSample
(
b
->
remainToTransfer
,
b
->
th
.
nbAnt
);
LOG_D
(
HW
,
"UEsock: %d Set b->lastReceivedTS %ld
\n
"
,
fd
,
b
->
lastReceivedTS
);
}
if
(
b
->
remainToTransfer
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
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