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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
daf30bd6
Commit
daf30bd6
authored
2 years ago
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/NR_UE_mthread_rework' into integration_2022_wk48
parents
c99a0557
f47acc49
Branches unavailable
2025.w14
2025.w13
2025.w12
2025.w11
2025.w10
2025.w09
2025.w08
2025.w07
2025.w06
2025.w05
2025.w04
2025.w03
2025.w02
2024.w51
2024.w50
2024.w49
2024.w48
2024.w47
2024.w46
2024.w45
2024.w44
2024.w43
2024.w42
2024.w41
2024.w40
2024.w39
2024.w38
2024.w36
2024.w35
2024.w34
2024.w33
2024.w32
2024.w31
2024.w30
2024.w29
2024.w28
2024.w27
2024.w26
2024.w25
2024.w24
2024.w23
2024.w22
2024.w21
2024.w18
2024.w17
2024.w16
2024.w15
2024.w14
2024.w13
2024.w12
2024.w11
2024.w10
2024.w09
2024.w08
2024.w06
2024.w05
2024.w04
2024.w03
2024.w02
2024.w01
2023.w51
2023.w50
2023.w49
2023.w48
2023.w47
2023.w45
2023.w43
2023.w42
2023.w41
2023.w40
2023.w39
2023.w38
2023.w37
2023.w36
2023.w34
2023.w33
2023.w32
2023.w31
2023.w30
2023.w29
2023.w28
2023.w27
2023.w26
2023.w25
2023.w24
2023.w23
2023.w22
2023.w21
2023.w20
2023.w19
2023.w18
2023.w18b
2023.w16
2023.w15
2023.w14
2023.w13
2023.w12
2023.w11
2023.w11b
2023.w10
2023.w10b
2023.w09
2023.w08
2023.w08b
2023.w07
2023.w06
2023.w05
2023.w03
2023.w02
2022.w51
2022.w50
2022.w49
2022.w48
v2.2.0
v2.1.0
v2.0.0
flexran-eol
ARC_1.3
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
150 additions
and
137 deletions
+150
-137
executables/docs/nr-ue-design.md
executables/docs/nr-ue-design.md
+22
-0
executables/nr-ue.c
executables/nr-ue.c
+92
-104
openair1/PHY/defs_nr_UE.h
openair1/PHY/defs_nr_UE.h
+2
-2
openair1/PHY/impl_defs_top.h
openair1/PHY/impl_defs_top.h
+1
-3
openair1/SCHED_NR_UE/defs.h
openair1/SCHED_NR_UE/defs.h
+1
-2
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+19
-9
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+1
-2
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+0
-4
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
+4
-11
radio/COMMON/common_lib.h
radio/COMMON/common_lib.h
+8
-0
No files found.
executables/docs/nr-ue-design.md
0 → 100644
View file @
daf30bd6
# Multi-threading Design
The
`UE_thread`
function in
`nr-ue.c`
is the main top level thread that interacts with the radio unit. Once the thread spawns, it starts the 'Initial Syncronization'. Once its complete, the regular processing of slots commences.
## Initial Syncronization Block
```
mermaid
graph TD
A(Start) -->|UE_thread| B["readFrame<br/>--Reads samples worth 2 frames"]
B --> |Tpool thread| C["UE_synch<br/>--PSS & SSS detection<br/>--PBCH decode"]
B --> |UE_thread| D["readFrame<br/>--trash samples to unblock radio"]
C --> |Tpool thread| E[syncInFrame<br/>--shift first sample to start of frame]
D --> |UE_thread| E
```
## Regular Slot Processing
```
mermaid
graph TD
E[syncInFrame<br/>--shift first sample to start of frame] -->|UE_thread| F["trx_read_func (slot n)"]
F --> |Tpool thread| G["processSlotTX (slot n+4)<br/>--PUSCH encode<br/>--PUCCH encode<br/>--trx_write_func"]
F --> |UE_thread| H["UE_processing (slot n)<br/>--PDCCH decode<br/>--PDSCH decode"]
G --> |Tpool thread| I(Merge)
H --> |UE_thread| I(Merge)
I --> |Go to next slot<br/>UE_thread| F
```
This diff is collapsed.
Click to expand it.
executables/nr-ue.c
View file @
daf30bd6
...
@@ -32,9 +32,9 @@
...
@@ -32,9 +32,9 @@
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "executables/softmodem-common.h"
#include "executables/softmodem-common.h"
#include "LAYER2/nr_pdcp/nr_pdcp_entity.h"
#include "LAYER2/nr_pdcp/nr_pdcp_entity.h"
#include "SCHED_NR_UE/pucch_uci_ue_nr.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "radio/COMMON/common_lib.h"
/*
/*
* NR SLOT PROCESSING SEQUENCE
* NR SLOT PROCESSING SEQUENCE
...
@@ -603,6 +603,61 @@ static void UE_synch(void *arg) {
...
@@ -603,6 +603,61 @@ static void UE_synch(void *arg) {
}
}
}
}
static
void
RU_write
(
nr_rxtx_thread_data_t
*
rxtxD
)
{
PHY_VARS_NR_UE
*
UE
=
rxtxD
->
UE
;
UE_nr_rxtx_proc_t
*
proc
=
&
rxtxD
->
proc
;
void
*
txp
[
NB_ANTENNAS_TX
];
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
txp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
txdata
[
i
][
UE
->
frame_parms
.
get_samples_slot_timestamp
(
proc
->
nr_slot_tx
,
&
UE
->
frame_parms
,
0
)];
radio_tx_flag_t
flags
=
Invalid
;
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
0
);
if
(
openair0_cfg
[
0
].
duplex_mode
==
duplex_mode_TDD
&&
!
get_softmodem_params
()
->
continuous_tx
)
{
uint8_t
tdd_period
=
mac
->
phy_config
.
config_req
.
tdd_table
.
tdd_period_in_slots
;
int
nrofUplinkSlots
,
nrofUplinkSymbols
;
if
(
mac
->
scc
)
{
nrofUplinkSlots
=
mac
->
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSlots
;
nrofUplinkSymbols
=
mac
->
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSymbols
;
}
else
{
nrofUplinkSlots
=
mac
->
scc_SIB
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSlots
;
nrofUplinkSymbols
=
mac
->
scc_SIB
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSymbols
;
}
int
slot_tx_usrp
=
proc
->
nr_slot_tx
;
uint8_t
num_UL_slots
=
nrofUplinkSlots
+
(
nrofUplinkSymbols
!=
0
);
uint8_t
first_tx_slot
=
tdd_period
-
num_UL_slots
;
if
(
slot_tx_usrp
%
tdd_period
==
first_tx_slot
)
flags
=
StartOfBurst
;
else
if
(
slot_tx_usrp
%
tdd_period
==
first_tx_slot
+
num_UL_slots
-
1
)
flags
=
EndOfBurst
;
else
if
(
slot_tx_usrp
%
tdd_period
>
first_tx_slot
)
flags
=
MiddleOfBurst
;
}
else
{
flags
=
MiddleOfBurst
;
}
if
(
flags
||
IS_SOFTMODEM_RFSIM
)
AssertFatal
(
rxtxD
->
writeBlockSize
==
UE
->
rfdevice
.
trx_write_func
(
&
UE
->
rfdevice
,
proc
->
timestamp_tx
,
txp
,
rxtxD
->
writeBlockSize
,
UE
->
frame_parms
.
nb_antennas_tx
,
flags
),
""
);
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
memset
(
txp
[
i
],
0
,
rxtxD
->
writeBlockSize
);
}
void
processSlotTX
(
void
*
arg
)
{
void
processSlotTX
(
void
*
arg
)
{
nr_rxtx_thread_data_t
*
rxtxD
=
(
nr_rxtx_thread_data_t
*
)
arg
;
nr_rxtx_thread_data_t
*
rxtxD
=
(
nr_rxtx_thread_data_t
*
)
arg
;
...
@@ -636,6 +691,8 @@ void processSlotTX(void *arg) {
...
@@ -636,6 +691,8 @@ void processSlotTX(void *arg) {
phy_procedures_nrUE_TX
(
UE
,
proc
,
proc
->
gNB_id
,
&
phy_data
);
phy_procedures_nrUE_TX
(
UE
,
proc
,
proc
->
gNB_id
,
&
phy_data
);
}
}
RU_write
(
rxtxD
);
}
}
void
UE_processing
(
nr_rxtx_thread_data_t
*
rxtxD
)
{
void
UE_processing
(
nr_rxtx_thread_data_t
*
rxtxD
)
{
...
@@ -668,7 +725,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) {
...
@@ -668,7 +725,7 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) {
phy_procedures_slot_parallelization_nrUE_RX
(
UE
,
proc
,
0
,
0
,
1
,
no_relay
,
NULL
);
phy_procedures_slot_parallelization_nrUE_RX
(
UE
,
proc
,
0
,
0
,
1
,
no_relay
,
NULL
);
#else
#else
uint64_t
a
=
rdtsc_oai
();
uint64_t
a
=
rdtsc_oai
();
phy_procedures_nrUE_RX
(
UE
,
proc
,
gNB_id
,
&
phy_data
,
&
rxtxD
->
txFifo
);
phy_procedures_nrUE_RX
(
UE
,
proc
,
gNB_id
,
&
phy_data
);
LOG_D
(
PHY
,
"In %s: slot %d, time %llu
\n
"
,
__FUNCTION__
,
proc
->
nr_slot_rx
,
(
rdtsc_oai
()
-
a
)
/
3500
);
LOG_D
(
PHY
,
"In %s: slot %d, time %llu
\n
"
,
__FUNCTION__
,
proc
->
nr_slot_rx
,
(
rdtsc_oai
()
-
a
)
/
3500
);
#endif
#endif
...
@@ -678,46 +735,6 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) {
...
@@ -678,46 +735,6 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) {
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
UE
->
Mod_id
,
ENB_FLAG_NO
,
mac
->
crnti
,
proc
->
frame_rx
,
proc
->
nr_slot_rx
,
0
);
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
UE
->
Mod_id
,
ENB_FLAG_NO
,
mac
->
crnti
,
proc
->
frame_rx
,
proc
->
nr_slot_rx
,
0
);
pdcp_run
(
&
ctxt
);
pdcp_run
(
&
ctxt
);
}
}
// Wait for PUSCH processing to finish
notifiedFIFO_elt_t
*
res
;
res
=
pullTpool
(
&
rxtxD
->
txFifo
,
&
(
get_nrUE_params
()
->
Tpool
));
if
(
res
==
NULL
)
return
;
// Tpool has been stopped
delNotifiedFIFO_elt
(
res
);
}
if
(
proc
->
tx_slot_type
==
NR_UPLINK_SLOT
||
proc
->
tx_slot_type
==
NR_MIXED_SLOT
)
{
nr_phy_data_tx_t
phy_data
=
{
0
};
if
(
UE
->
if_inst
!=
NULL
&&
UE
->
if_inst
->
ul_indication
!=
NULL
)
{
nr_uplink_indication_t
ul_indication
;
memset
((
void
*
)
&
ul_indication
,
0
,
sizeof
(
ul_indication
));
ul_indication
.
module_id
=
UE
->
Mod_id
;
ul_indication
.
gNB_index
=
gNB_id
;
ul_indication
.
cc_id
=
UE
->
CC_id
;
ul_indication
.
frame_rx
=
proc
->
frame_rx
;
ul_indication
.
slot_rx
=
proc
->
nr_slot_rx
;
ul_indication
.
frame_tx
=
proc
->
frame_tx
;
ul_indication
.
slot_tx
=
proc
->
nr_slot_tx
;
ul_indication
.
ue_sched_mode
=
SCHED_PUCCH
;
ul_indication
.
phy_data
=
&
phy_data
;
UE
->
if_inst
->
ul_indication
(
&
ul_indication
);
}
if
(
UE
->
UE_mode
[
gNB_id
]
<=
PUSCH
)
{
pucch_procedures_ue_nr
(
UE
,
gNB_id
,
proc
,
&
phy_data
);
}
LOG_D
(
PHY
,
"Sending Uplink data
\n
"
);
nr_ue_pusch_common_procedures
(
UE
,
proc
->
nr_slot_tx
,
&
UE
->
frame_parms
,
UE
->
frame_parms
.
nb_antennas_tx
);
if
(
UE
->
UE_mode
[
gNB_id
]
>
NOT_SYNCHED
&&
UE
->
UE_mode
[
gNB_id
]
<
PUSCH
)
nr_ue_prach_procedures
(
UE
,
proc
,
proc
->
gNB_id
);
}
}
ue_ta_procedures
(
UE
,
proc
->
nr_slot_tx
,
proc
->
frame_tx
);
ue_ta_procedures
(
UE
,
proc
->
nr_slot_tx
,
proc
->
frame_tx
);
...
@@ -824,7 +841,7 @@ void *UE_thread(void *arg) {
...
@@ -824,7 +841,7 @@ void *UE_thread(void *arg) {
PHY_VARS_NR_UE
*
UE
=
(
PHY_VARS_NR_UE
*
)
arg
;
PHY_VARS_NR_UE
*
UE
=
(
PHY_VARS_NR_UE
*
)
arg
;
// int tx_enabled = 0;
// int tx_enabled = 0;
openair0_timestamp
timestamp
,
writeTimestamp
;
openair0_timestamp
timestamp
,
writeTimestamp
;
void
*
rxp
[
NB_ANTENNAS_RX
]
,
*
txp
[
NB_ANTENNAS_TX
]
;
void
*
rxp
[
NB_ANTENNAS_RX
];
int
start_rx_stream
=
0
;
int
start_rx_stream
=
0
;
fapi_nr_config_request_t
*
cfg
=
&
UE
->
nrUE_config
;
fapi_nr_config_request_t
*
cfg
=
&
UE
->
nrUE_config
;
AssertFatal
(
0
==
openair0_device_load
(
&
(
UE
->
rfdevice
),
&
openair0_cfg
[
0
]),
""
);
AssertFatal
(
0
==
openair0_device_load
(
&
(
UE
->
rfdevice
),
&
openair0_cfg
[
0
]),
""
);
...
@@ -836,11 +853,14 @@ void *UE_thread(void *arg) {
...
@@ -836,11 +853,14 @@ void *UE_thread(void *arg) {
notifiedFIFO_t
nf
;
notifiedFIFO_t
nf
;
initNotifiedFIFO
(
&
nf
);
initNotifiedFIFO
(
&
nf
);
notifiedFIFO_t
txFifo
;
initNotifiedFIFO
(
&
txFifo
);
notifiedFIFO_t
freeBlocks
;
notifiedFIFO_t
freeBlocks
;
initNotifiedFIFO_nothreadSafe
(
&
freeBlocks
);
initNotifiedFIFO_nothreadSafe
(
&
freeBlocks
);
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
0
);
int
timing_advance
=
UE
->
timing_advance
;
int
timing_advance
=
UE
->
timing_advance
;
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
0
);
bool
syncRunning
=
false
;
bool
syncRunning
=
false
;
const
int
nb_slot_frame
=
UE
->
frame_parms
.
slots_per_frame
;
const
int
nb_slot_frame
=
UE
->
frame_parms
.
slots_per_frame
;
...
@@ -937,20 +957,16 @@ void *UE_thread(void *arg) {
...
@@ -937,20 +957,16 @@ void *UE_thread(void *arg) {
rxp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
firstSymSamp
+
rxp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
firstSymSamp
+
UE
->
frame_parms
.
get_samples_slot_timestamp
(
slot_nr
,
&
UE
->
frame_parms
,
0
)];
UE
->
frame_parms
.
get_samples_slot_timestamp
(
slot_nr
,
&
UE
->
frame_parms
,
0
)];
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
txp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
txdata
[
i
][
UE
->
frame_parms
.
get_samples_slot_timestamp
(
((
slot_nr
+
DURATION_RX_TO_TX
-
NR_RX_NB_TH
)
%
nb_slot_frame
),
&
UE
->
frame_parms
,
0
)];
int
readBlockSize
,
writeBlockSize
;
int
readBlockSize
,
writeBlockSize
;
if
(
slot_nr
<
(
nb_slot_frame
-
1
))
{
if
(
slot_nr
<
(
nb_slot_frame
-
1
))
{
readBlockSize
=
get_readBlockSize
(
slot_nr
,
&
UE
->
frame_parms
);
readBlockSize
=
get_readBlockSize
(
slot_nr
,
&
UE
->
frame_parms
);
writeBlockSize
=
UE
->
frame_parms
.
get_samples_per_slot
((
slot_nr
+
DURATION_RX_TO_TX
-
NR_RX_NB_TH
)
%
nb_slot_frame
,
&
UE
->
frame_parms
);
writeBlockSize
=
UE
->
frame_parms
.
get_samples_per_slot
((
slot_nr
+
DURATION_RX_TO_TX
)
%
nb_slot_frame
,
&
UE
->
frame_parms
);
}
else
{
}
else
{
UE
->
rx_offset_diff
=
computeSamplesShift
(
UE
);
UE
->
rx_offset_diff
=
computeSamplesShift
(
UE
);
readBlockSize
=
get_readBlockSize
(
slot_nr
,
&
UE
->
frame_parms
)
-
readBlockSize
=
get_readBlockSize
(
slot_nr
,
&
UE
->
frame_parms
)
-
UE
->
rx_offset_diff
;
UE
->
rx_offset_diff
;
writeBlockSize
=
UE
->
frame_parms
.
get_samples_per_slot
((
slot_nr
+
DURATION_RX_TO_TX
-
NR_RX_NB_TH
)
%
nb_slot_frame
,
&
UE
->
frame_parms
)
-
UE
->
rx_offset_diff
;
writeBlockSize
=
UE
->
frame_parms
.
get_samples_per_slot
((
slot_nr
+
DURATION_RX_TO_TX
)
%
nb_slot_frame
,
&
UE
->
frame_parms
)
-
UE
->
rx_offset_diff
;
}
}
AssertFatal
(
readBlockSize
==
AssertFatal
(
readBlockSize
==
...
@@ -976,25 +992,10 @@ void *UE_thread(void *arg) {
...
@@ -976,25 +992,10 @@ void *UE_thread(void *arg) {
LOG_E
(
PHY
,
"can't compensate: diff =%d
\n
"
,
first_symbols
);
LOG_E
(
PHY
,
"can't compensate: diff =%d
\n
"
,
first_symbols
);
}
}
curMsg
.
proc
.
timestamp_tx
=
timestamp
+
UE
->
frame_parms
.
get_samples_slot_timestamp
(
slot_nr
,
&
UE
->
frame_parms
,
DURATION_RX_TO_TX
)
-
firstSymSamp
;
UE_processing
(
&
curMsg
);
if
(
curMsg
.
proc
.
decoded_frame_rx
!=
-
1
)
decoded_frame_rx
=
(((
mac
->
mib
->
systemFrameNumber
.
buf
[
0
]
>>
mac
->
mib
->
systemFrameNumber
.
bits_unused
)
<<
4
)
|
curMsg
.
proc
.
decoded_frame_rx
);
else
decoded_frame_rx
=-
1
;
if
(
decoded_frame_rx
>
0
&&
decoded_frame_rx
!=
curMsg
.
proc
.
frame_rx
)
LOG_E
(
PHY
,
"Decoded frame index (%d) is not compatible with current context (%d), UE should go back to synch mode
\n
"
,
decoded_frame_rx
,
curMsg
.
proc
.
frame_rx
);
// use previous timing_advance value to compute writeTimestamp
// use previous timing_advance value to compute writeTimestamp
writeTimestamp
=
timestamp
+
writeTimestamp
=
timestamp
+
UE
->
frame_parms
.
get_samples_slot_timestamp
(
slot_nr
,
&
UE
->
frame_parms
,
DURATION_RX_TO_TX
UE
->
frame_parms
.
get_samples_slot_timestamp
(
slot_nr
,
&
UE
->
frame_parms
,
DURATION_RX_TO_TX
)
-
NR_RX_NB_TH
)
-
firstSymSamp
-
openair0_cfg
[
0
].
tx_sample_advance
-
-
firstSymSamp
-
openair0_cfg
[
0
].
tx_sample_advance
-
UE
->
N_TA_offset
-
timing_advance
;
UE
->
N_TA_offset
-
timing_advance
;
// but use current UE->timing_advance value to compute writeBlockSize
// but use current UE->timing_advance value to compute writeBlockSize
...
@@ -1003,47 +1004,34 @@ void *UE_thread(void *arg) {
...
@@ -1003,47 +1004,34 @@ void *UE_thread(void *arg) {
timing_advance
=
UE
->
timing_advance
;
timing_advance
=
UE
->
timing_advance
;
}
}
int
flags
=
0
;
// Start TX slot processing here. It runs in parallel with RX slot processing
notifiedFIFO_elt_t
*
newElt
=
newNotifiedFIFO_elt
(
sizeof
(
nr_rxtx_thread_data_t
),
curMsg
.
proc
.
nr_slot_tx
,
&
txFifo
,
processSlotTX
);
if
(
openair0_cfg
[
0
].
duplex_mode
==
duplex_mode_TDD
&&
!
get_softmodem_params
()
->
continuous_tx
)
{
nr_rxtx_thread_data_t
*
curMsgTx
=
(
nr_rxtx_thread_data_t
*
)
NotifiedFifoData
(
newElt
);
curMsgTx
->
proc
=
curMsg
.
proc
;
uint8_t
tdd_period
=
mac
->
phy_config
.
config_req
.
tdd_table
.
tdd_period_in_slots
;
curMsgTx
->
writeBlockSize
=
writeBlockSize
;
int
nrofUplinkSlots
,
nrofUplinkSymbols
;
curMsgTx
->
proc
.
timestamp_tx
=
writeTimestamp
;
if
(
mac
->
scc
)
{
curMsgTx
->
UE
=
UE
;
nrofUplinkSlots
=
mac
->
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSlots
;
pushTpool
(
&
(
get_nrUE_params
()
->
Tpool
),
newElt
);
nrofUplinkSymbols
=
mac
->
scc
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSymbols
;
}
else
{
nrofUplinkSlots
=
mac
->
scc_SIB
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSlots
;
nrofUplinkSymbols
=
mac
->
scc_SIB
->
tdd_UL_DL_ConfigurationCommon
->
pattern1
.
nrofUplinkSymbols
;
}
int
slot_tx_usrp
=
slot_nr
+
DURATION_RX_TO_TX
-
NR_RX_NB_TH
;
uint8_t
num_UL_slots
=
nrofUplinkSlots
+
(
nrofUplinkSymbols
!=
0
);
uint8_t
first_tx_slot
=
tdd_period
-
num_UL_slots
;
if
(
slot_tx_usrp
%
tdd_period
==
first_tx_slot
)
// RX slot processing
flags
=
2
;
UE_processing
(
&
curMsg
);
else
if
(
slot_tx_usrp
%
tdd_period
==
first_tx_slot
+
num_UL_slots
-
1
)
flags
=
3
;
else
if
(
slot_tx_usrp
%
tdd_period
>
first_tx_slot
)
flags
=
1
;
}
else
{
flags
=
1
;
}
if
(
flags
||
IS_SOFTMODEM_RFSIM
)
if
(
curMsg
.
proc
.
decoded_frame_rx
!=
-
1
)
AssertFatal
(
writeBlockSize
==
decoded_frame_rx
=
(((
mac
->
mib
->
systemFrameNumber
.
buf
[
0
]
>>
mac
->
mib
->
systemFrameNumber
.
bits_unused
)
<<
4
)
|
curMsg
.
proc
.
decoded_frame_rx
);
UE
->
rfdevice
.
trx_write_func
(
&
UE
->
rfdevice
,
else
writeTimestamp
,
decoded_frame_rx
=-
1
;
txp
,
writeBlockSize
,
UE
->
frame_parms
.
nb_antennas_tx
,
flags
),
""
);
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_tx
;
i
++
)
if
(
decoded_frame_rx
>
0
&&
decoded_frame_rx
!=
curMsg
.
proc
.
frame_rx
)
memset
(
txp
[
i
],
0
,
writeBlockSize
);
LOG_E
(
PHY
,
"Decoded frame index (%d) is not compatible with current context (%d), UE should go back to synch mode
\n
"
,
decoded_frame_rx
,
curMsg
.
proc
.
frame_rx
);
// Wait for TX slot processing to finish
notifiedFIFO_elt_t
*
res
;
res
=
pullTpool
(
&
txFifo
,
&
(
get_nrUE_params
()
->
Tpool
));
if
(
res
==
NULL
)
LOG_E
(
PHY
,
"Tpool has been aborted
\n
"
);
else
delNotifiedFIFO_elt
(
res
);
}
// while !oai_exit
}
// while !oai_exit
return
NULL
;
return
NULL
;
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/defs_nr_UE.h
View file @
daf30bd6
...
@@ -768,7 +768,7 @@ typedef struct nr_rxtx_thread_data_s {
...
@@ -768,7 +768,7 @@ typedef struct nr_rxtx_thread_data_s {
UE_nr_rxtx_proc_t
proc
;
UE_nr_rxtx_proc_t
proc
;
PHY_VARS_NR_UE
*
UE
;
PHY_VARS_NR_UE
*
UE
;
NR_UE_SCHED_MODE_t
ue_sched_mode
;
NR_UE_SCHED_MODE_t
ue_sched_mode
;
notifiedFIFO_t
txFifo
;
int
writeBlockSize
;
}
nr_rxtx_thread_data_t
;
}
nr_rxtx_thread_data_t
;
typedef
struct
LDPCDecode_ue_s
{
typedef
struct
LDPCDecode_ue_s
{
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/impl_defs_top.h
View file @
daf30bd6
...
@@ -269,9 +269,7 @@
...
@@ -269,9 +269,7 @@
/* FFS_NR_TODO it defines ue capability which is the number of slots */
/* FFS_NR_TODO it defines ue capability which is the number of slots */
/* - between reception of pdsch and tarnsmission of its acknowlegment */
/* - between reception of pdsch and tarnsmission of its acknowlegment */
/* - between reception of un uplink grant and its related transmission */
/* - between reception of un uplink grant and its related transmission */
/* - FIXME temprarily set to 5 to avoid timing issues at OAI UE in rfsimulator */
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (4)
/* - issues caused by no rendez-vous point between TX and RX in the OAI UE */
#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (5)
#ifndef NO_RAT_NR
#ifndef NO_RAT_NR
#define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX)
/* for NR this will certainly depends to such UE capability which is not yet defined */
#define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX)
/* for NR this will certainly depends to such UE capability which is not yet defined */
...
...
This diff is collapsed.
Click to expand it.
openair1/SCHED_NR_UE/defs.h
View file @
daf30bd6
...
@@ -109,8 +109,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
...
@@ -109,8 +109,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
int
phy_procedures_nrUE_RX
(
PHY_VARS_NR_UE
*
ue
,
int
phy_procedures_nrUE_RX
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
gNB_id
,
uint8_t
gNB_id
,
nr_phy_data_t
*
phy_data
,
nr_phy_data_t
*
phy_data
);
notifiedFIFO_t
*
txFifo
);
int
phy_procedures_slot_parallelization_nrUE_RX
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
gNB_id
,
uint8_t
abstraction_flag
,
uint8_t
do_pdcch_flag
,
relaying_type_t
r_type
);
int
phy_procedures_slot_parallelization_nrUE_RX
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
gNB_id
,
uint8_t
abstraction_flag
,
uint8_t
do_pdcch_flag
,
relaying_type_t
r_type
);
...
...
This diff is collapsed.
Click to expand it.
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
daf30bd6
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
#include "executables/softmodem-common.h"
#include "executables/softmodem-common.h"
#include "executables/nr-uesoftmodem.h"
#include "executables/nr-uesoftmodem.h"
#include "LAYER2/NR_MAC_UE/mac_proto.h"
#include "LAYER2/NR_MAC_UE/mac_proto.h"
#include "openair1/SCHED_NR_UE/pucch_uci_ue_nr.h"
//#define DEBUG_PHY_PROC
//#define DEBUG_PHY_PROC
#define NR_PDCCH_SCHED
#define NR_PDCCH_SCHED
...
@@ -297,6 +298,23 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
...
@@ -297,6 +298,23 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
if
(
ue
->
UE_mode
[
gNB_id
]
==
PUSCH
)
{
if
(
ue
->
UE_mode
[
gNB_id
]
==
PUSCH
)
{
ue_srs_procedures_nr
(
ue
,
proc
,
gNB_id
);
ue_srs_procedures_nr
(
ue
,
proc
,
gNB_id
);
}
}
if
(
ue
->
UE_mode
[
gNB_id
]
<=
PUSCH
)
{
pucch_procedures_ue_nr
(
ue
,
gNB_id
,
proc
,
phy_data
);
}
LOG_D
(
PHY
,
"Sending Uplink data
\n
"
);
nr_ue_pusch_common_procedures
(
ue
,
proc
->
nr_slot_tx
,
&
ue
->
frame_parms
,
ue
->
frame_parms
.
nb_antennas_tx
);
if
(
ue
->
UE_mode
[
gNB_id
]
>
NOT_SYNCHED
&&
ue
->
UE_mode
[
gNB_id
]
<
PUSCH
)
nr_ue_prach_procedures
(
ue
,
proc
,
proc
->
gNB_id
);
LOG_D
(
PHY
,
"****** end TX-Chain for AbsSubframe %d.%d ******
\n
"
,
proc
->
frame_tx
,
proc
->
nr_slot_tx
);
LOG_D
(
PHY
,
"****** end TX-Chain for AbsSubframe %d.%d ******
\n
"
,
proc
->
frame_tx
,
proc
->
nr_slot_tx
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX
,
VCD_FUNCTION_OUT
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX
,
VCD_FUNCTION_OUT
);
...
@@ -981,8 +999,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
...
@@ -981,8 +999,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
int
phy_procedures_nrUE_RX
(
PHY_VARS_NR_UE
*
ue
,
int
phy_procedures_nrUE_RX
(
PHY_VARS_NR_UE
*
ue
,
UE_nr_rxtx_proc_t
*
proc
,
UE_nr_rxtx_proc_t
*
proc
,
uint8_t
gNB_id
,
uint8_t
gNB_id
,
nr_phy_data_t
*
phy_data
,
nr_phy_data_t
*
phy_data
)
{
notifiedFIFO_t
*
txFifo
)
{
int
frame_rx
=
proc
->
frame_rx
;
int
frame_rx
=
proc
->
frame_rx
;
int
nr_slot_rx
=
proc
->
nr_slot_rx
;
int
nr_slot_rx
=
proc
->
nr_slot_rx
;
...
@@ -1176,13 +1193,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
...
@@ -1176,13 +1193,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
#endif //NR_PDCCH_SCHED
#endif //NR_PDCCH_SCHED
// Start PUSCH processing here. It runs in parallel with PDSCH processing
notifiedFIFO_elt_t
*
newElt
=
newNotifiedFIFO_elt
(
sizeof
(
nr_rxtx_thread_data_t
),
proc
->
nr_slot_tx
,
txFifo
,
processSlotTX
);
nr_rxtx_thread_data_t
*
curMsg
=
(
nr_rxtx_thread_data_t
*
)
NotifiedFifoData
(
newElt
);
curMsg
->
proc
=
*
proc
;
curMsg
->
UE
=
ue
;
curMsg
->
ue_sched_mode
=
SCHED_PUSCH
;
pushTpool
(
&
(
get_nrUE_params
()
->
Tpool
),
newElt
);
start_meas
(
&
ue
->
generic_stat
);
start_meas
(
&
ue
->
generic_stat
);
// do procedures for C-RNTI
// do procedures for C-RNTI
int
ret_pdsch
=
0
;
int
ret_pdsch
=
0
;
...
...
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
daf30bd6
...
@@ -1266,8 +1266,7 @@ int main(int argc, char **argv)
...
@@ -1266,8 +1266,7 @@ int main(int argc, char **argv)
phy_procedures_nrUE_RX
(
UE
,
phy_procedures_nrUE_RX
(
UE
,
&
UE_proc
,
&
UE_proc
,
0
,
0
,
&
phy_data
,
&
phy_data
);
NULL
);
//----------------------------------------------------------
//----------------------------------------------------------
//---------------------- count errors ----------------------
//---------------------- count errors ----------------------
...
...
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
daf30bd6
...
@@ -1243,10 +1243,6 @@ int main(int argc, char **argv)
...
@@ -1243,10 +1243,6 @@ int main(int argc, char **argv)
phy_procedures_nrUE_TX
(
UE
,
&
UE_proc
,
gNB_id
,
&
phy_data
);
phy_procedures_nrUE_TX
(
UE
,
&
UE_proc
,
gNB_id
,
&
phy_data
);
/* We need to call common sending function to send signal */
LOG_D
(
PHY
,
"Sending Uplink data
\n
"
);
nr_ue_pusch_common_procedures
(
UE
,
slot
,
&
UE
->
frame_parms
,
UE
->
frame_parms
.
nb_antennas_tx
);
if
(
n_trials
==
1
)
{
if
(
n_trials
==
1
)
{
LOG_M
(
"txsig0.m"
,
"txs0"
,
&
UE
->
common_vars
.
txdata
[
0
][
slot_offset
],
slot_length
,
1
,
1
);
LOG_M
(
"txsig0.m"
,
"txs0"
,
&
UE
->
common_vars
.
txdata
[
0
][
slot_offset
],
slot_length
,
1
,
1
);
LOG_M
(
"txsig0F.m"
,
"txs0F"
,
UE
->
common_vars
.
txdataF
[
0
],
frame_parms
->
ofdm_symbol_size
*
14
,
1
,
1
);
LOG_M
(
"txsig0F.m"
,
"txs0F"
,
UE
->
common_vars
.
txdataF
[
0
],
frame_parms
->
ofdm_symbol_size
*
14
,
1
,
1
);
...
...
This diff is collapsed.
Click to expand it.
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
View file @
daf30bd6
...
@@ -1140,17 +1140,10 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
...
@@ -1140,17 +1140,10 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
LOG_T
(
NR_MAC
,
"In %s():%d not calling scheduler. sched mode = %d and mac->ra.ra_state = %d
\n
"
,
LOG_T
(
NR_MAC
,
"In %s():%d not calling scheduler. sched mode = %d and mac->ra.ra_state = %d
\n
"
,
__FUNCTION__
,
__LINE__
,
ul_info
->
ue_sched_mode
,
mac
->
ra
.
ra_state
);
__FUNCTION__
,
__LINE__
,
ul_info
->
ue_sched_mode
,
mac
->
ra
.
ra_state
);
switch
(
ul_info
->
ue_sched_mode
)
{
case
SCHED_PUSCH
:
ret
=
nr_ue_scheduler
(
NULL
,
ul_info
);
ret
=
nr_ue_scheduler
(
NULL
,
ul_info
);
if
(
is_nr_UL_slot
(
tdd_UL_DL_ConfigurationCommon
,
ul_info
->
slot_tx
,
mac
->
frame_type
)
&&
!
get_softmodem_params
()
->
phy_test
)
if
(
is_nr_UL_slot
(
tdd_UL_DL_ConfigurationCommon
,
ul_info
->
slot_tx
,
mac
->
frame_type
)
&&
!
get_softmodem_params
()
->
phy_test
)
{
nr_ue_prach_scheduler
(
module_id
,
ul_info
->
frame_tx
,
ul_info
->
slot_tx
);
break
;
case
SCHED_PUCCH
:
if
(
is_nr_UL_slot
(
tdd_UL_DL_ConfigurationCommon
,
ul_info
->
slot_tx
,
mac
->
frame_type
))
nr_ue_pucch_scheduler
(
module_id
,
ul_info
->
frame_tx
,
ul_info
->
slot_tx
,
ul_info
->
phy_data
);
nr_ue_pucch_scheduler
(
module_id
,
ul_info
->
frame_tx
,
ul_info
->
slot_tx
,
ul_info
->
phy_data
);
break
;
nr_ue_prach_scheduler
(
module_id
,
ul_info
->
frame_tx
,
ul_info
->
slot_tx
)
;
}
}
switch
(
ret
){
switch
(
ret
){
...
...
This diff is collapsed.
Click to expand it.
radio/COMMON/common_lib.h
View file @
daf30bd6
...
@@ -150,6 +150,14 @@ typedef enum {
...
@@ -150,6 +150,14 @@ typedef enum {
gpsdo
=
2
gpsdo
=
2
}
clock_source_t
;
}
clock_source_t
;
/*! \brief Radio Tx burst flags */
typedef
enum
{
Invalid
=
0
,
MiddleOfBurst
,
StartOfBurst
,
EndOfBurst
}
radio_tx_flag_t
;
/*! \brief Structure used for initializing UDP read threads */
/*! \brief Structure used for initializing UDP read threads */
typedef
struct
{
typedef
struct
{
openair0_device
*
device
;
openair0_device
*
device
;
...
...
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