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
d81cd6da
Commit
d81cd6da
authored
Oct 30, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replacing nr_tti with nr_subframe
parent
915d69ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
27 deletions
+26
-27
targets/RT/USER/nr-ue.c
targets/RT/USER/nr-ue.c
+26
-27
No files found.
targets/RT/USER/nr-ue.c
View file @
d81cd6da
...
...
@@ -796,7 +796,7 @@ void *UE_thread(void *arg) {
PHY_VARS_NR_UE
*
UE
=
(
PHY_VARS_NR_UE
*
)
arg
;
// int tx_enabled = 0;
int
dummy_rx
[
UE
->
frame_parms
.
nb_antennas_rx
][
UE
->
frame_parms
.
samples_per_
tti
]
__attribute__
((
aligned
(
32
)));
int
dummy_rx
[
UE
->
frame_parms
.
nb_antennas_rx
][
UE
->
frame_parms
.
samples_per_
subframe
]
__attribute__
((
aligned
(
32
)));
openair0_timestamp
timestamp
;
void
*
rxp
[
NB_ANTENNAS_RX
],
*
txp
[
NB_ANTENNAS_TX
];
int
start_rx_stream
=
0
;
...
...
@@ -828,7 +828,7 @@ void *UE_thread(void *arg) {
//itti_send_msg_to_task (TASK_NAS_UE, UE->Mod_id + NB_eNB_INST, message_p);
#endif
int
tti
_nr
=-
1
;
int
subframe
_nr
=-
1
;
//int cumulated_shift=0;
if
((
oaisim_flag
==
0
)
&&
(
UE
->
mode
!=
loop_through_memory
))
AssertFatal
(
UE
->
rfdevice
.
trx_start_func
(
&
UE
->
rfdevice
)
==
0
,
"Could not start the device
\n
"
);
...
...
@@ -926,12 +926,11 @@ void *UE_thread(void *arg) {
rt_sleep_ns
(
1000
*
1000
);
}
else
{
tti_nr
++
;
int
ttis_per_frame
=
LTE_NUMBER_OF_SUBFRAMES_PER_FRAME
*
UE
->
frame_parms
.
ttis_per_subframe
;
tti_nr
%=
ttis_per_frame
;
subframe_nr
++
;
subframe_nr
%=
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
UE_nr_rxtx_proc_t
*
proc
=
&
UE
->
proc
.
proc_rxtx
[
thread_idx
];
// update thread index for received subframe
UE
->
current_thread_id
[
tti
_nr
]
=
thread_idx
;
UE
->
current_thread_id
[
subframe
_nr
]
=
thread_idx
;
#if BASIC_SIMULATOR
{
...
...
@@ -944,7 +943,7 @@ void *UE_thread(void *arg) {
}
}
#endif
LOG_D
(
PHY
,
"Process
TTI %d thread Idx %d
\n
"
,
tti_nr
,
UE
->
current_thread_id
[
tti
_nr
]);
LOG_D
(
PHY
,
"Process
subframe %d thread Idx %d
\n
"
,
subframe_nr
,
UE
->
current_thread_id
[
subframe
_nr
]);
thread_idx
++
;
if
(
thread_idx
>=
RX_NB_TH
)
...
...
@@ -955,14 +954,14 @@ void *UE_thread(void *arg) {
for
(
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
rxp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
UE
->
frame_parms
.
ofdm_symbol_size
+
UE
->
frame_parms
.
nb_prefix_samples0
+
tti_nr
*
UE
->
frame_parms
.
samples_per_tti
];
subframe_nr
*
UE
->
frame_parms
.
samples_per_subframe
];
for
(
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
txp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
txdata
[
i
][((
tti_nr
+
2
)
%
10
*
UE
->
frame_parms
.
ttis_per_subframe
)
*
UE
->
frame_parms
.
samples_per_tti
];
txp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
txdata
[
i
][((
subframe_nr
+
2
)
%
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
)
*
UE
->
frame_parms
.
samples_per_subframe
];
int
readBlockSize
,
writeBlockSize
;
if
(
tti_nr
<
(
ttis_per_frame
-
1
))
{
readBlockSize
=
UE
->
frame_parms
.
samples_per_
tti
;
writeBlockSize
=
UE
->
frame_parms
.
samples_per_
tti
;
if
(
subframe_nr
<
(
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
-
1
))
{
readBlockSize
=
UE
->
frame_parms
.
samples_per_
subframe
;
writeBlockSize
=
UE
->
frame_parms
.
samples_per_
subframe
;
}
else
{
// set TO compensation to zero
UE
->
rx_offset_diff
=
0
;
...
...
@@ -971,15 +970,15 @@ void *UE_thread(void *arg) {
UE
->
rx_offset
>
0
)
UE
->
rx_offset_diff
=
-
1
;
if
(
UE
->
rx_offset
>
5
*
UE
->
frame_parms
.
samples_per_subframe
&&
UE
->
rx_offset
<
10
*
UE
->
frame_parms
.
samples_per_
tti
)
UE
->
rx_offset
<
10
*
UE
->
frame_parms
.
samples_per_
subframe
)
UE
->
rx_offset_diff
=
1
;
LOG_D
(
PHY
,
"AbsSubframe %d.%d TTI SET rx_off_diff to %d rx_offset %d
\n
"
,
proc
->
frame_rx
,
tti
_nr
,
UE
->
rx_offset_diff
,
UE
->
rx_offset
);
readBlockSize
=
UE
->
frame_parms
.
samples_per_
tti
-
LOG_D
(
PHY
,
"AbsSubframe %d.%d TTI SET rx_off_diff to %d rx_offset %d
\n
"
,
proc
->
frame_rx
,
subframe
_nr
,
UE
->
rx_offset_diff
,
UE
->
rx_offset
);
readBlockSize
=
UE
->
frame_parms
.
samples_per_
subframe
-
UE
->
frame_parms
.
ofdm_symbol_size
-
UE
->
frame_parms
.
nb_prefix_samples0
-
UE
->
rx_offset_diff
;
writeBlockSize
=
UE
->
frame_parms
.
samples_per_
tti
-
writeBlockSize
=
UE
->
frame_parms
.
samples_per_
subframe
-
UE
->
rx_offset_diff
;
}
...
...
@@ -992,7 +991,7 @@ void *UE_thread(void *arg) {
AssertFatal
(
writeBlockSize
==
UE
->
rfdevice
.
trx_write_func
(
&
UE
->
rfdevice
,
timestamp
+
(
2
*
UE
->
frame_parms
.
samples_per_
tti
)
-
(
2
*
UE
->
frame_parms
.
samples_per_
subframe
)
-
UE
->
frame_parms
.
ofdm_symbol_size
-
UE
->
frame_parms
.
nb_prefix_samples0
-
openair0_cfg
[
0
].
tx_sample_advance
,
txp
,
...
...
@@ -1000,7 +999,7 @@ void *UE_thread(void *arg) {
UE
->
frame_parms
.
nb_antennas_tx
,
1
),
""
);
if
(
tti_nr
==
(
ttis_per_frame
-
1
))
{
if
(
subframe_nr
==
(
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
-
1
))
{
// read in first symbol of next frame and adjust for timing drift
int
first_symbols
=
writeBlockSize
-
readBlockSize
;
if
(
first_symbols
>
0
)
...
...
@@ -1016,7 +1015,7 @@ void *UE_thread(void *arg) {
pickTime
(
gotIQs
);
// operate on thread sf mod 2
AssertFatal
(
pthread_mutex_lock
(
&
proc
->
mutex_rxtx
)
==
0
,
""
);
if
(
tti
_nr
==
0
)
{
if
(
subframe
_nr
==
0
)
{
//UE->proc.proc_rxtx[0].frame_rx++;
//UE->proc.proc_rxtx[1].frame_rx++;
for
(
th_id
=
0
;
th_id
<
RX_NB_TH
;
th_id
++
)
{
...
...
@@ -1038,18 +1037,18 @@ void *UE_thread(void *arg) {
UE
->
proc
.
proc_rxtx
[
th_id
].
gotIQs
=
readTime
(
gotIQs
);
}
proc
->
nr_tti_rx
=
tti
_nr
;
proc
->
subframe_rx
=
tti_nr
>>
((
uint8_t
)(
log2
(
UE
->
frame_parms
.
ttis_per_subframe
)))
;
proc
->
nr_tti_rx
=
subframe
_nr
;
proc
->
subframe_rx
=
subframe_nr
;
proc
->
frame_tx
=
proc
->
frame_rx
;
proc
->
nr_tti_tx
=
tti
_nr
+
DURATION_RX_TO_TX
;
if
(
proc
->
nr_tti_tx
>
ttis_per_frame
)
{
proc
->
nr_tti_tx
=
subframe
_nr
+
DURATION_RX_TO_TX
;
if
(
proc
->
nr_tti_tx
>
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
)
{
proc
->
frame_tx
=
(
proc
->
frame_tx
+
1
)
%
MAX_FRAME_NUMBER
;
proc
->
nr_tti_tx
%=
ttis_per_frame
;
proc
->
nr_tti_tx
%=
NR_NUMBER_OF_SUBFRAMES_PER_FRAME
;
}
proc
->
subframe_tx
=
(
proc
->
nr_tti_tx
)
>>
((
uint8_t
)(
log2
(
UE
->
frame_parms
.
ttis_per_subframe
)))
;
proc
->
subframe_tx
=
subframe_nr
+
DURATION_RX_TO_TX
;
proc
->
timestamp_tx
=
timestamp
+
(
DURATION_RX_TO_TX
*
UE
->
frame_parms
.
samples_per_
tti
)
-
(
DURATION_RX_TO_TX
*
UE
->
frame_parms
.
samples_per_
subframe
)
-
UE
->
frame_parms
.
ofdm_symbol_size
-
UE
->
frame_parms
.
nb_prefix_samples0
;
proc
->
instance_cnt_rxtx
++
;
...
...
@@ -1069,7 +1068,7 @@ void *UE_thread(void *arg) {
char
exit_fun_string
[
256
];
sprintf
(
exit_fun_string
,
"[SCHED][UE %d] !!! UE instance_cnt_rxtx > 2 (IC %d) (Proc %d)!!"
,
UE
->
Mod_id
,
proc
->
instance_cnt_rxtx
,
UE
->
current_thread_id
[
tti
_nr
]);
UE
->
current_thread_id
[
subframe
_nr
]);
printf
(
"%s
\n
"
,
exit_fun_string
);
fflush
(
stdout
);
sleep
(
1
);
...
...
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