Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
OpenXG
OpenXG UE
Commits
00465bdd
Commit
00465bdd
authored
Jul 26, 2019
by
Hongzhi Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nr ue adding adjust gain
parent
465d5f4c
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
942 additions
and
21 deletions
+942
-21
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+2
-1
executables/nr-ue.c
executables/nr-ue.c
+10
-1
oaienv
oaienv
+1
-1
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c
+76
-0
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+8
-0
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+820
-0
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+24
-17
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
+1
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
00465bdd
...
...
@@ -1333,7 +1333,8 @@ set(PHY_SRC_UE
${
OPENAIR1_DIR
}
/PHY/NR_REFSIG/nr_gold_ue.c
${
OPENAIR1_DIR
}
/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
${
OPENAIR1_DIR
}
/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
${
OPENAIR1_DIR
}
/PHY/LTE_ESTIMATION/lte_ue_measurements.c
${
OPENAIR1_DIR
}
/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
${
OPENAIR1_DIR
}
/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/file_output.c
${
OPENAIR1_DIR
}
/PHY/TOOLS/cadd_vv.c
# ${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
...
...
executables/nr-ue.c
View file @
00465bdd
...
...
@@ -549,6 +549,7 @@ void *UE_thread(void *arg) {
void
*
rxp
[
NB_ANTENNAS_RX
],
*
txp
[
NB_ANTENNAS_TX
];
int
start_rx_stream
=
0
;
const
uint16_t
table_sf_slot
[
20
]
=
{
0
,
0
,
1
,
1
,
2
,
2
,
3
,
3
,
4
,
4
,
5
,
5
,
6
,
6
,
7
,
7
,
8
,
8
,
9
,
9
};
uint32_t
total_gain_dB_prev
=
0
;
AssertFatal
(
0
==
openair0_device_load
(
&
(
UE
->
rfdevice
),
&
openair0_cfg
[
0
]),
""
);
UE
->
rfdevice
.
host_type
=
RAU_HOST
;
AssertFatal
(
UE
->
rfdevice
.
trx_start_func
(
&
UE
->
rfdevice
)
==
0
,
"Could not start the device
\n
"
);
...
...
@@ -640,7 +641,15 @@ void *UE_thread(void *arg) {
curMsg
->
proc
.
frame_rx
=
(
absolute_slot
/
nb_slot_frame
)
%
MAX_FRAME_NUMBER
;
curMsg
->
proc
.
frame_tx
=
(
(
absolute_slot
+
DURATION_RX_TO_TX
)
/
nb_slot_frame
)
%
MAX_FRAME_NUMBER
;
curMsg
->
proc
.
decoded_frame_rx
=-
1
;
LOG_D
(
PHY
,
"Process slot %d thread Idx %d
\n
"
,
slot_nr
,
thread_idx
);
//LOG_I(PHY,"Process slot %d thread Idx %d total gain %d\n", slot_nr, thread_idx, UE->rx_total_gain_dB);
#ifdef OAI_ADRV9371_ZC706
if
(
total_gain_dB_prev
!=
UE
->
rx_total_gain_dB
)
{
total_gain_dB_prev
=
UE
->
rx_total_gain_dB
;
openair0_cfg
[
0
].
rx_gain
[
0
]
=
UE
->
rx_total_gain_dB
-
20
;
UE
->
rfdevice
.
trx_set_gains_func
(
&
UE
->
rfdevice
,
&
openair0_cfg
[
0
]);
}
#endif
for
(
int
i
=
0
;
i
<
UE
->
frame_parms
.
nb_antennas_rx
;
i
++
)
rxp
[
i
]
=
(
void
*
)
&
UE
->
common_vars
.
rxdata
[
i
][
UE
->
frame_parms
.
ofdm_symbol_size
+
...
...
oaienv
View file @
00465bdd
...
...
@@ -18,6 +18,6 @@ alias oailte='cd $OPENAIR_TARGETS/RT/USER'
alias oais='cd $OPENAIR_TARGETS/SIMU/USER'
alias oaiex='cd $OPENAIR_TARGETS/SIMU/EXAMPLES'
export IIOD_REMOTE=192.168.1
21.3
2
export IIOD_REMOTE=192.168.1
.
2
#export IIOD_REMOTE=192.168.1.11
openair1/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c
0 → 100644
View file @
00465bdd
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "PHY/types.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/phy_extern_nr_ue.h"
void
phy_adjust_gain_nr
(
PHY_VARS_NR_UE
*
ue
,
uint32_t
rx_power_fil_dB
,
uint8_t
eNB_id
)
{
LOG_I
(
PHY
,
"Gain control: rssi %d (%d,%d)
\n
"
,
rx_power_fil_dB
,
ue
->
measurements
.
rssi
,
ue
->
measurements
.
rx_power_avg_dB
[
eNB_id
]
);
// Gain control with hysterisis
// Adjust gain in ue->rx_vars[0].rx_total_gain_dB
if
(
rx_power_fil_dB
<
TARGET_RX_POWER
-
5
)
//&& (ue->rx_total_gain_dB < MAX_RF_GAIN) )
ue
->
rx_total_gain_dB
+=
5
;
else
if
(
rx_power_fil_dB
>
TARGET_RX_POWER
+
5
)
//&& (ue->rx_total_gain_dB > MIN_RF_GAIN) )
ue
->
rx_total_gain_dB
-=
5
;
if
(
ue
->
rx_total_gain_dB
>
MAX_RF_GAIN
)
{
/*
if ((openair_daq_vars.rx_rf_mode==0) && (openair_daq_vars.mode == openair_NOT_SYNCHED)) {
openair_daq_vars.rx_rf_mode=1;
ue->rx_total_gain_dB = max(MIN_RF_GAIN,MAX_RF_GAIN-25);
}
else {
*/
ue
->
rx_total_gain_dB
=
MAX_RF_GAIN
;
}
else
if
(
ue
->
rx_total_gain_dB
<
MIN_RF_GAIN
)
{
/*
if ((openair_daq_vars.rx_rf_mode==1) && (openair_daq_vars.mode == openair_NOT_SYNCHED)) {
openair_daq_vars.rx_rf_mode=0;
ue->rx_total_gain_dB = min(MAX_RF_GAIN,MIN_RF_GAIN+25);
}
else {
*/
ue
->
rx_total_gain_dB
=
MIN_RF_GAIN
;
}
LOG_I
(
PHY
,
"Gain control: rx_total_gain_dB = %d TARGET_RX_POWER %d (max %d,rxpf %d)
\n
"
,
ue
->
rx_total_gain_dB
,
TARGET_RX_POWER
,
MAX_RF_GAIN
,
rx_power_fil_dB
);
#ifdef DEBUG_PHY
/* if ((ue->frame%100==0) || (ue->frame < 10))
msg("[PHY][ADJUST_GAIN] frame %d, rx_power = %d, rx_power_fil = %d, rx_power_fil_dB = %d, coef=%d, ncoef=%d, rx_total_gain_dB = %d (%d,%d,%d)\n",
ue->frame,rx_power,rx_power_fil,rx_power_fil_dB,coef,ncoef,ue->rx_total_gain_dB,
TARGET_RX_POWER,MAX_RF_GAIN,MIN_RF_GAIN);
*/
#endif //DEBUG_PHY
}
openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
View file @
00465bdd
...
...
@@ -79,5 +79,13 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
uint8_t
subframe
,
unsigned
char
clear
,
short
coef
);
void
nr_ue_measurements
(
PHY_VARS_NR_UE
*
ue
,
unsigned
int
subframe_offset
,
unsigned
char
N0_symbol
,
unsigned
char
abstraction_flag
,
unsigned
char
rank_adaptation
,
uint8_t
subframe
);
#endif
openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
0 → 100644
View file @
00465bdd
This diff is collapsed.
Click to expand it.
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
00465bdd
...
...
@@ -2590,30 +2590,23 @@ void nr_ue_measurement_procedures(uint16_t l, // symbol index of each slot [0
{
LOG_D
(
PHY
,
"ue_measurement_procedures l %u Ncp %d
\n
"
,
l
,
ue
->
frame_parms
.
Ncp
);
#if 0
NR_DL_FRAME_PARMS
*
frame_parms
=&
ue
->
frame_parms
;
int
nr_tti_rx
=
proc
->
nr_tti_rx
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_MEASUREMENT_PROCEDURES
,
VCD_FUNCTION_IN
);
if (l==
0
) {
if
(
l
==
2
)
{
// UE measurements on symbol 0
if (abstraction_flag==0) {
LOG_D
(
PHY
,
"Calling measurements nr_tti_rx %d, rxdata %p
\n
"
,
nr_tti_rx
,
ue
->
common_vars
.
rxdata
);
lte_ue_measurements(ue,
(nr_tti_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME),
(nr_tti_rx == 1) ? 1 : 0,
0,
nr_ue_measurements
(
ue
,
0
,
nr_tti_rx);
} else {
lte_ue_measurements(ue,
0
,
0
,
1,
0
,
nr_tti_rx
);
}
//(nr_tti_rx*frame_parms->samples_per_tti+ue->rx_offset)%(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)
#if T_TRACER
if
(
slot
==
0
)
T
(
T_UE_PHY_MEAS
,
T_INT
(
eNB_id
),
T_INT
(
ue
->
Mod_id
),
T_INT
(
proc
->
frame_rx
%
1024
),
T_INT
(
proc
->
nr_tti_rx
),
...
...
@@ -2626,7 +2619,7 @@ void nr_ue_measurement_procedures(uint16_t l, // symbol index of each slot [0
T_INT
((
int
)
ue
->
common_vars
.
freq_offset
));
#endif
}
#if 0
if (l==(6-ue->frame_parms.Ncp)) {
// make sure we have signal from PSS/SSS for N0 measurement
...
...
@@ -2642,6 +2635,19 @@ void nr_ue_measurement_procedures(uint16_t l, // symbol index of each slot [0
}
#endif
// accumulate and filter timing offset estimation every subframe (instead of every frame)
if
((
slot
==
2
)
&&
(
l
==
(
2
-
frame_parms
->
Ncp
)))
{
// AGC
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL
,
VCD_FUNCTION_IN
);
//printf("start adjust gain power avg db %d\n", ue->measurements.rx_power_avg_dB[eNB_id]);
phy_adjust_gain_nr
(
ue
,
ue
->
measurements
.
rx_power_avg_dB
[
eNB_id
],
eNB_id
);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_MEASUREMENT_PROCEDURES
,
VCD_FUNCTION_OUT
);
}
...
...
@@ -4190,7 +4196,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
LOG_I
(
PHY
,
"[UE %d] Frame %d, nr_tti_rx %d: found %d DCIs
\n
"
,
ue
->
Mod_id
,
frame_rx
,
nr_tti_rx
,
dci_cnt
);
if
(
ue
->
no_timing_correction
==
0
)
{
LOG_
I
(
PHY
,
"start adjust sync slot = %d no timing %d
\n
"
,
nr_tti_rx
,
ue
->
no_timing_correction
);
LOG_
D
(
PHY
,
"start adjust sync slot = %d no timing %d
\n
"
,
nr_tti_rx
,
ue
->
no_timing_correction
);
nr_adjust_synch_ue
(
&
ue
->
frame_parms
,
ue
,
eNB_id
,
...
...
@@ -4216,9 +4222,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
nr_tti_rx
,
0
,
0
);
//printf("phy procedure pdsch start measurement\n");
nr_ue_measurement_procedures
(
m
,
ue
,
proc
,
eNB_id
,(
nr_tti_rx
<<
1
),
mode
);
}
//set active for testing, to be removed
...
...
@@ -4239,6 +4243,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
PDSCH
,
ue
->
dlsch
[
ue
->
current_thread_id
[
nr_tti_rx
]][
eNB_id
][
0
],
NULL
);
//printf("phy procedure pdsch start measurement\n");
nr_ue_measurement_procedures
(
2
,
ue
,
proc
,
eNB_id
,
nr_tti_rx
,
mode
);
/*
write_output("rxF.m","rxF",&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0],ue->frame_parms.ofdm_symbol_size*14,1,1);
...
...
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
View file @
00465bdd
...
...
@@ -146,7 +146,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info){
if
(
dl_info
->
dci_ind
!=
NULL
){
LOG_D
(
MAC
,
"[L2][IF MODULE][DL INDICATION][DCI_IND]
\n
"
);
for
(
i
=
0
;
i
<
dl_info
->
dci_ind
->
number_of_dcis
;
++
i
){
LOG_
I
(
MAC
,
">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d
\n
"
,
i
,
dl_info
->
dci_ind
->
number_of_dcis
);
LOG_
D
(
MAC
,
">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d
\n
"
,
i
,
dl_info
->
dci_ind
->
number_of_dcis
);
fapi_nr_dci_pdu_rel15_t
*
dci
=
&
dl_info
->
dci_ind
->
dci_list
[
i
].
dci
;
ret_mask
|=
(
handle_dci
(
...
...
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