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
wangwenhui
OpenXG-RAN
Commits
06c4da47
Commit
06c4da47
authored
5 years ago
by
Theoni Magounaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to add calibration symbol 10
parent
401549af
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
210 additions
and
72 deletions
+210
-72
cmake_targets/build_oai
cmake_targets/build_oai
+3
-3
common/utils/T/T_messages.txt
common/utils/T/T_messages.txt
+4
-0
openair1/PHY/INIT/lte_init_ru.c
openair1/PHY/INIT/lte_init_ru.c
+9
-19
openair1/PHY/MODULATION/ul_7_5_kHz.c
openair1/PHY/MODULATION/ul_7_5_kHz.c
+13
-1
openair1/PHY/defs_eNB.h
openair1/PHY/defs_eNB.h
+11
-2
openair1/SCHED/ru_procedures.c
openair1/SCHED/ru_procedures.c
+99
-17
targets/RT/USER/lte-ru.c
targets/RT/USER/lte-ru.c
+59
-30
targets/RT/USER/ru_control.c
targets/RT/USER/ru_control.c
+12
-0
No files found.
cmake_targets/build_oai
View file @
06c4da47
...
...
@@ -523,9 +523,9 @@ function main() {
$lte_build_dir
coding
\
libcoding.so
$dbin
/libcoding.so
# optional libs (used when noS1 with kernel modules
compilations
\
$lte_build_dir
nasmesh
\
CMakeFiles/nasmesh/nasmesh.ko
$dbin
/nasmesh.ko
#
compilations \
#
$lte_build_dir nasmesh \
#
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
compilations
\
$lte_build_dir
rb_tool
\
rb_tool
$dbin
/rb_tool
...
...
This diff is collapsed.
Click to expand it.
common/utils/T/T_messages.txt
View file @
06c4da47
...
...
@@ -45,6 +45,10 @@ ID = ENB_PHY_INPUT_SIGNAL
DESC = eNodeB received signal in the time domain for a duration of 1ms
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,rxdata
ID = CALIBRATION_CHANNEL_ESTIMATES
DESC = RAU received DMRS estimates from the RRUs
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
FORMAT = int,tag : int,frame : int,subframe : int,symbol : buffer,calib_ch
ID = ENB_PHY_OUTPUT_SIGNAL
DESC = eNodeB sent signal in the time domain for a duration of 1ms
GROUP = ALL:PHY:HEAVY:ENB
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/INIT/lte_init_ru.c
View file @
06c4da47
...
...
@@ -46,9 +46,7 @@ int phy_init_RU(RU_t *ru) {
LOG_I
(
PHY
,
"Initializing RU signal buffers (if_south %s) nb_tx %d
\n
"
,
ru_if_types
[
ru
->
if_south
],
ru
->
nb_tx
);
if
(
ru
->
is_slave
==
1
)
{
generate_ul_ref_sigs_rx
();
}
generate_ul_ref_sigs_rx
();
if
(
ru
->
if_south
<=
REMOTE_IF5
)
{
// this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals
// Time-domain signals
...
...
@@ -62,12 +60,10 @@ int phy_init_RU(RU_t *ru) {
fp
->
samples_per_tti
*
10
*
sizeof
(
int32_t
));
}
if
(
ru
->
is_slave
==
1
)
{
calibration
->
drs_ch_estimates_time
=
(
int32_t
**
)
malloc16_clear
(
ru
->
nb_rx
*
sizeof
(
int32_t
*
));
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
{
calibration
->
drs_ch_estimates_time
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
2
*
sizeof
(
int32_t
)
*
fp
->
ofdm_symbol_size
);
}
}
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
{
...
...
@@ -107,7 +103,6 @@ int phy_init_RU(RU_t *ru) {
LOG_I
(
PHY
,
"rxdataF[%d] %p for RU %d
\n
"
,
i
,
ru
->
common
.
rxdataF
[
i
],
ru
->
idx
);
}
if
(
ru
->
is_slave
==
1
)
{
// allocate FFT output buffers after extraction (RX)
calibration
->
rxdataF_ext
=
(
int32_t
**
)
malloc16
(
2
*
sizeof
(
int32_t
*
));
calibration
->
drs_ch_estimates
=
(
int32_t
**
)
malloc16
(
2
*
sizeof
(
int32_t
*
));
...
...
@@ -117,7 +112,6 @@ int phy_init_RU(RU_t *ru) {
LOG_I
(
PHY
,
"rxdataF_ext[%d] %p for RU %d
\n
"
,
i
,
calibration
->
rxdataF_ext
[
i
],
ru
->
idx
);
calibration
->
drs_ch_estimates
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
N_RB_UL
*
12
*
fp
->
symbols_per_tti
);
}
}
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
//AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
...
...
@@ -196,12 +190,10 @@ void phy_free_RU(RU_t *ru)
if
(
ru
->
if_south
<=
REMOTE_IF5
)
{
// this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals
for
(
i
=
0
;
i
<
ru
->
nb_tx
;
i
++
)
free_and_zero
(
ru
->
common
.
txdata
[
i
]);
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
free_and_zero
(
ru
->
common
.
rxdata
[
i
]);
if
(
ru
->
is_slave
==
1
)
{
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
{
free_and_zero
(
calibration
->
drs_ch_estimates_time
[
i
]);
}
free_and_zero
(
calibration
->
drs_ch_estimates_time
);
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
{
free_and_zero
(
calibration
->
drs_ch_estimates_time
[
i
]);
}
free_and_zero
(
calibration
->
drs_ch_estimates_time
);
free_and_zero
(
ru
->
common
.
txdata
);
free_and_zero
(
ru
->
common
.
rxdata
);
}
// else: IF5 or local RF -> nothing to free()
...
...
@@ -217,14 +209,12 @@ void phy_free_RU(RU_t *ru)
// free FFT output buffers (RX)
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
free_and_zero
(
ru
->
common
.
rxdataF
[
i
]);
free_and_zero
(
ru
->
common
.
rxdataF
);
if
(
ru
->
is_slave
==
1
)
{
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
{
free_and_zero
(
calibration
->
rxdataF_ext
[
i
]);
free_and_zero
(
calibration
->
drs_ch_estimates
[
i
]);
}
free_and_zero
(
calibration
->
rxdataF_ext
);
free_and_zero
(
calibration
->
drs_ch_estimates
);
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
{
free_and_zero
(
calibration
->
rxdataF_ext
[
i
]);
free_and_zero
(
calibration
->
drs_ch_estimates
[
i
]);
}
free_and_zero
(
calibration
->
rxdataF_ext
);
free_and_zero
(
calibration
->
drs_ch_estimates
);
for
(
i
=
0
;
i
<
ru
->
nb_rx
;
i
++
)
{
free_and_zero
(
ru
->
prach_rxsigF
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
openair1/PHY/MODULATION/ul_7_5_kHz.c
View file @
06c4da47
...
...
@@ -157,7 +157,19 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
(
2
*
frame_parms
->
nb_prefix_samples
)
+
frame_parms
->
nb_prefix_samples0
],
(
frame_parms
->
ofdm_symbol_size
+
frame_parms
->
nb_prefix_samples
)
*
sizeof
(
int32_t
));
}
}
// undo 7.5 kHz offset for symbol 10 (for calibration)
if
(
slot
==
3
){
memcpy
((
void
*
)
&
rxdata_7_5kHz
[
aa
][(
10
*
frame_parms
->
ofdm_symbol_size
)
+
(
8
*
frame_parms
->
nb_prefix_samples
)
+
2
*
frame_parms
->
nb_prefix_samples0
],
(
void
*
)
&
rxdata
[
aa
][
slot_offset
+
ru
->
N_TA_offset
+
(
3
*
frame_parms
->
ofdm_symbol_size
)
+
(
2
*
frame_parms
->
nb_prefix_samples
)
+
frame_parms
->
nb_prefix_samples0
],
(
frame_parms
->
ofdm_symbol_size
+
frame_parms
->
nb_prefix_samples
)
*
sizeof
(
int32_t
));
}
}
}
This diff is collapsed.
Click to expand it.
openair1/PHY/defs_eNB.h
View file @
06c4da47
...
...
@@ -311,9 +311,13 @@ typedef enum {
}
rru_cmd_t
;
typedef
struct
RU_t_s
{
/// tag of this ru
uint32_t
tag
;
/// number of RRUs
uint32_t
p
;
/// index of this ru
uint32_t
idx
;
/// Pointer to configuration file
/// Pointer to configuration file
char
*
rf_config_file
;
/// southbound interface
RU_if_south_t
if_south
;
...
...
@@ -345,6 +349,8 @@ typedef struct RU_t_s{
int
wait_cnt
;
/// counter to delay start of slave RUs until stable synchronization
int
wait_check
;
/// counter to count missed synch events during synchronization of RU
int
missed_synch_events
;
/// Total gain of receive chain
uint32_t
rx_total_gain_dB
;
/// number of bands that this device can support
...
...
@@ -533,7 +539,10 @@ typedef struct RRU_capabilities_s {
}
RRU_capabilities_t
;
typedef
struct
RRU_config_s
{
/// tag of an RU
uint32_t
tag
;
/// number of slave RRUs
uint32_t
p
;
/// Fronthaul format
RU_if_south_t
FH_fmt
;
/// number of EUTRA bands (<=4) configured in RRU
...
...
This diff is collapsed.
Click to expand it.
openair1/SCHED/ru_procedures.c
View file @
06c4da47
...
...
@@ -100,9 +100,9 @@ void feptx0(RU_t *ru,int slot) {
*/
int
num_symb
=
7
;
if
(
subframe_select
(
fp
,
subframe
)
==
SF_S
)
num_symb
=
fp
->
dl_symbols_in_S_subframe
+
1
;
//
if (subframe_select(fp,subframe) == SF_S) num_symb=fp->dl_symbols_in_S_subframe+1;
if
(
ru
->
generate_dmrs_sync
==
1
&&
s
lot
==
0
&&
s
ubframe
==
1
&&
aa
==
0
)
{
if
(
ru
->
generate_dmrs_sync
==
1
&&
subframe
==
1
&&
aa
==
0
)
{
//int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
//int32_t *dmrsp[2] ={dmrs,NULL}; //{&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
...
...
@@ -225,7 +225,9 @@ void feptx_ofdm_2thread(RU_t *ru) {
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
if
(
subframe_select
(
fp
,
subframe
)
==
SF_DL
)
{
//The 2nd check is to force the RRUs to send DMRS at symbol 10-subframe 1-slot 1 (for calibration)
if
(
subframe_select
(
fp
,
subframe
)
==
SF_DL
||
((
subframe_select
(
fp
,
subframe
)
==
SF_DL
||
subframe
==
1
)))
{
//if (subframe_select(fp,subframe)==SF_DL) {
// If this is not an S-subframe
if
(
pthread_mutex_timedlock
(
&
proc
->
mutex_feptx
,
&
wait
)
!=
0
)
{
printf
(
"[RU] ERROR pthread_mutex_lock for feptx thread (IC %d)
\n
"
,
proc
->
instance_cnt_feptx
);
...
...
@@ -628,7 +630,7 @@ void ru_fep_full_2thread(RU_t *ru) {
LTE_DL_FRAME_PARMS
*
fp
=
&
ru
->
frame_parms
;
RU_CALIBRATION
*
calibration
=
&
ru
->
calibration
;
RRU_CONFIG_msg_t
rru_config_msg
;
int
check_sync_pos
;
int
check_sync_pos
,
Ns
,
l
;
struct
timespec
wait
;
if
(
proc
->
subframe_rx
==
1
){
...
...
@@ -681,7 +683,42 @@ void ru_fep_full_2thread(RU_t *ru) {
printf
(
"delay in fep wait on condition in frame_rx: %d subframe_rx: %d
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
);
}
if
(
proc
->
subframe_rx
==
1
&&
ru
->
is_slave
==
1
/* && ru->state == RU_CHECK_SYNC*/
)
{
if
(
proc
->
subframe_rx
==
1
&&
ru
->
is_slave
==
0
)
{
Ns
=
1
;
l
=
10
;
ulsch_extract_rbs_single
(
ru
->
common
.
rxdataF
,
calibration
->
rxdataF_ext
,
0
,
fp
->
N_RB_DL
,
3
%
(
fp
->
symbols_per_tti
/
2
),
// l = symbol within slot
Ns
,
// Ns = slot number
fp
);
lte_ul_channel_estimation_RRU
(
fp
,
calibration
->
drs_ch_estimates
,
calibration
->
drs_ch_estimates_time
,
calibration
->
rxdataF_ext
,
fp
->
N_RB_DL
,
proc
->
frame_rx
,
proc
->
subframe_rx
,
0
,
0
,
0
,
l
,
0
,
0
);
T
(
T_CALIBRATION_CHANNEL_ESTIMATES
,
T_INT
(
ru
->
idx
),
T_INT
(
proc
->
frame_rx
),
T_INT
(
proc
->
subframe_rx
),
T_INT
(
l
),
T_BUFFER
(
&
calibration
->
drs_ch_estimates
[
0
][
l
*
12
*
fp
->
N_RB_UL
],
12
*
fp
->
N_RB_UL
*
sizeof
(
int32_t
)));
}
if
(
proc
->
subframe_rx
==
1
&&
ru
->
is_slave
==
1
)
{
Ns
=
0
;
l
=
3
;
//LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
ulsch_extract_rbs_single
(
ru
->
common
.
rxdataF
,
...
...
@@ -689,15 +726,9 @@ void ru_fep_full_2thread(RU_t *ru) {
0
,
fp
->
N_RB_DL
,
3
%
(
fp
->
symbols_per_tti
/
2
),
// l = symbol within slot
3
/
(
fp
->
symbols_per_tti
/
2
)
,
// Ns = slot number
Ns
,
// Ns = slot number
fp
);
/*lte_ul_channel_estimation((PHY_VARS_eNB *)NULL,
proc,
ru->idx,
3%(fp->symbols_per_tti/2),
3/(fp->symbols_per_tti/2));
*/
lte_ul_channel_estimation_RRU
(
fp
,
calibration
->
drs_ch_estimates
,
calibration
->
drs_ch_estimates_time
,
...
...
@@ -708,7 +739,7 @@ void ru_fep_full_2thread(RU_t *ru) {
0
,
//u = 0..29
0
,
//v = 0,1
/*eNB->ulsch[ru->idx]->cyclicShift,cyclic_shift,0..7*/
0
,
3
,
//l,
l
,
//l
0
,
//interpolate,
0
/*eNB->ulsch[ru->idx]->rnti rnti or ru->ulsch[eNB_id]->rnti*/
);
...
...
@@ -716,11 +747,29 @@ void ru_fep_full_2thread(RU_t *ru) {
check_sync_pos
=
lte_est_timing_advance_pusch
((
PHY_VARS_eNB
*
)
NULL
,
ru
->
idx
);
if
(
ru
->
state
==
RU_CHECK_SYNC
)
{
if
((
check_sync_pos
>=
0
&&
check_sync_pos
<
8
)
||
(
check_sync_pos
<
0
&&
check_sync_pos
>-
8
))
{
LOG_I
(
PHY
,
"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d
\n
"
,
check_sync_pos
,
proc
->
frame_rx
,
ru
->
wait_check
);
LOG_I
(
PHY
,
"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d
\n
"
,
check_sync_pos
,
proc
->
frame_rx
,
ru
->
wait_check
,
ru
->
missed_synch_events
);
ru
->
wait_check
++
;
}
else
{
ru
->
missed_synch_events
++
;
LOG_I
(
PHY
,
"!!!!!!!!!!!! check_sync_pos %d, frame %d, cnt %d, missed %d
\n
"
,
check_sync_pos
,
proc
->
frame_rx
,
ru
->
wait_check
,
ru
->
missed_synch_events
);
}
if
(
ru
->
missed_synch_events
>
2
)
{
ru
->
in_synch
=
0
;
if
(
ru
->
stop_rf
)
{
ru
->
stop_rf
(
ru
);
ru
->
state
=
RU_SYNC
;
ru
->
cmd
=
EMPTY
;
LOG_I
(
PHY
,
"RU %d rf device stopped
\n
"
,
ru
->
idx
);
LOG_M
(
"rxdata.m"
,
"rxdata"
,
&
ru
->
common
.
rxdata
[
0
][
0
],
fp
->
samples_per_tti
*
2
,
1
,
1
);
exit
(
-
1
);
}
else
AssertFatal
(
1
==
0
,
"ru->stop_rf doesn't exist
\n
"
);
}
if
(
ru
->
wait_check
==
20
)
{
ru
->
state
=
RU_RUN
;
...
...
@@ -730,7 +779,7 @@ void ru_fep_full_2thread(RU_t *ru) {
rru_config_msg
.
len
=
sizeof
(
RRU_CONFIG_msg_t
);
// TODO: set to correct msg len
LOG_I
(
PHY
,
"Sending RRU_sync_ok to RAU
\n
"
);
AssertFatal
((
ru
->
ifdevice
.
trx_ctlsend_func
(
&
ru
->
ifdevice
,
&
rru_config_msg
,
rru_config_msg
.
len
)
!=-
1
),
"Failed to send msg to RAU %d
\n
"
,
ru
->
idx
);
//LOG_I
(PHY,"~~~~~~~~~ RU_RUN\n");
LOG_D
(
PHY
,
"~~~~~~~~~ RU_RUN
\n
"
);
/*LOG_M("dmrs_time.m","dmrstime",calibration->drs_ch_estimates_time[0], (fp->ofdm_symbol_size),1,1);
LOG_M("rxdataF_ext.m","rxdataFext",&calibration->rxdataF_ext[0][36*fp->N_RB_DL], 12*(fp->N_RB_DL),1,1);
LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[0][0][23],600,1,1);
...
...
@@ -742,9 +791,42 @@ void ru_fep_full_2thread(RU_t *ru) {
// check for synchronization error
if
(
check_sync_pos
>=
8
||
check_sync_pos
<=-
8
)
{
LOG_E
(
PHY
,
"~~~~~~~~~~~~~~ check_sync_pos %d, frame %d ---> LOST SYNC-EXIT
\n
"
,
check_sync_pos
,
proc
->
frame_rx
);
LOG_M
(
"rxdata.m"
,
"rxdata"
,
&
ru
->
common
.
rxdata
[
0
][
0
],
fp
->
samples_per_tti
*
2
,
1
,
1
);
exit
(
-
1
);
LOG_M
(
"rxdata.m"
,
"rxdata"
,
&
ru
->
common
.
rxdata
[
0
][
0
],
fp
->
samples_per_tti
*
2
,
1
,
1
);
exit
(
-
1
);
}
T
(
T_CALIBRATION_CHANNEL_ESTIMATES
,
T_INT
(
ru
->
idx
),
T_INT
(
proc
->
frame_rx
),
T_INT
(
proc
->
subframe_rx
),
T_INT
(
l
),
T_BUFFER
(
&
calibration
->
drs_ch_estimates
[
0
][
l
*
12
*
fp
->
N_RB_UL
],
12
*
fp
->
N_RB_UL
*
sizeof
(
int32_t
)));
Ns
=
1
;
l
=
10
;
LOG_D
(
PHY
,
"Running check synchronization procedure for frame %d
\n
"
,
proc
->
frame_rx
);
ulsch_extract_rbs_single
(
ru
->
common
.
rxdataF
,
calibration
->
rxdataF_ext
,
0
,
fp
->
N_RB_DL
,
3
%
(
fp
->
symbols_per_tti
/
2
),
// l = symbol within slot
Ns
,
// Ns = slot number
fp
);
lte_ul_channel_estimation_RRU
(
fp
,
calibration
->
drs_ch_estimates
,
calibration
->
drs_ch_estimates_time
,
calibration
->
rxdataF_ext
,
fp
->
N_RB_DL
,
//N_rb_alloc,
proc
->
frame_rx
,
proc
->
subframe_rx
,
0
,
//u = 0..29
0
,
//v = 0,1
/*eNB->ulsch[ru->idx]->cyclicShift,cyclic_shift,0..7*/
0
,
l
,
//l
0
,
//interpolate,
0
/*eNB->ulsch[ru->idx]->rnti rnti or ru->ulsch[eNB_id]->rnti*/
);
T
(
T_CALIBRATION_CHANNEL_ESTIMATES
,
T_INT
(
ru
->
idx
),
T_INT
(
proc
->
frame_rx
),
T_INT
(
proc
->
subframe_rx
),
T_INT
(
l
),
T_BUFFER
(
&
calibration
->
drs_ch_estimates
[
0
][
l
*
12
*
fp
->
N_RB_UL
],
12
*
fp
->
N_RB_UL
*
sizeof
(
int32_t
)));
}
else
{
...
...
This diff is collapsed.
Click to expand it.
targets/RT/USER/lte-ru.c
View file @
06c4da47
...
...
@@ -692,8 +692,8 @@ void rx_rf(RU_t *ru,int *frame,int *subframe) {
void
tx_rf
(
RU_t
*
ru
)
{
RU_proc_t
*
proc
=
&
ru
->
proc
;
LTE_DL_FRAME_PARMS
*
fp
=
&
ru
->
frame_parms
;
void
*
txp
[
ru
->
nb_tx
];
unsigned
int
txs
;
void
*
txp
[
ru
->
nb_tx
]
,
*
txp1
[
ru
->
nb_tx
]
;
unsigned
int
txs
,
txs1
;
int
i
;
T
(
T_ENB_PHY_OUTPUT_SIGNAL
,
T_INT
(
0
),
T_INT
(
0
),
T_INT
(
proc
->
frame_tx
),
T_INT
(
proc
->
subframe_tx
),
T_INT
(
0
),
T_BUFFER
(
&
ru
->
common
.
txdata
[
0
][
proc
->
subframe_tx
*
fp
->
samples_per_tti
],
fp
->
samples_per_tti
*
4
));
...
...
@@ -704,30 +704,37 @@ void tx_rf(RU_t *ru) {
if
((
SF_type
==
SF_DL
)
||
(
SF_type
==
SF_S
))
{
int
siglen
=
fp
->
samples_per_tti
,
flags
=
1
;
if
(
SF_type
==
SF_S
)
{
int
txsymb
=
fp
->
dl_symbols_in_S_subframe
+
(
ru
->
is_slave
==
0
?
1
:
0
);
AssertFatal
(
txsymb
>
0
,
"illegal txsymb %d
\n
"
,
txsymb
);
/* end_of_burst_delay is used to stop TX only "after a while".
* If we stop right after effective signal, with USRP B210 and
* B200mini, we observe a high EVM on the S subframe (on the
* PSS).
* A value of 400 (for 30.72MHz) solves this issue. This is
* the default.
*/
siglen
=
(
fp
->
ofdm_symbol_size
+
fp
->
nb_prefix_samples0
)
+
(
txsymb
-
1
)
*
(
fp
->
ofdm_symbol_size
+
fp
->
nb_prefix_samples
)
+
ru
->
end_of_burst_delay
;
flags
=
3
;
// end of burst
}
if
(
fp
->
frame_type
==
TDD
&&
SF_type
==
SF_DL
&&
prevSF_type
==
SF_UL
)
{
flags
=
2
;
// start of burst
sf_extension
=
ru
->
sf_extension
;
}
int
siglen
=
fp
->
samples_per_tti
,
flags
=
1
;
int
siglen2
=
fp
->
samples_per_tti
+
fp
->
nb_prefix_samples
;
int
sigoff2
=
2
*
fp
->
nb_prefix_samples0
+
8
*
fp
->
nb_prefix_samples
+
10
*
fp
->
ofdm_symbol_size
;
if
(
SF_type
==
SF_S
)
{
int
txsymb
=
fp
->
dl_symbols_in_S_subframe
+
(
ru
->
is_slave
==
0
?
1
:
-
1
);
AssertFatal
(
txsymb
>
0
,
"illegal txsymb %d
\n
"
,
txsymb
);
/* end_of_burst_delay is used to stop TX only "after a while".
* If we stop right after effective signal, with USRP B210 and
* B200mini, we observe a high EVM on the S subframe (on the
* PSS).
* A value of 400 (for 30.72MHz) solves this issue. This is
* the default.
*/
siglen
=
(
fp
->
ofdm_symbol_size
+
fp
->
nb_prefix_samples0
)
+
(
txsymb
-
1
)
*
(
fp
->
ofdm_symbol_size
+
fp
->
nb_prefix_samples
)
+
ru
->
end_of_burst_delay
;
if
(
ru
->
state
==
RU_RUN
&&
proc
->
frame_tx
%
ru
->
p
==
ru
->
tag
)
{
siglen2
=
fp
->
ofdm_symbol_size
+
fp
->
nb_prefix_samples
;
// length of symbol 10
}
flags
=
3
;
// end of burst
}
if
(
fp
->
frame_type
==
TDD
&&
SF_type
==
SF_DL
&&
prevSF_type
==
SF_UL
)
{
flags
=
2
;
// start of burst
sf_extension
=
ru
->
sf_extension
;
}
#if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__
...
...
@@ -740,7 +747,9 @@ void tx_rf(RU_t *ru) {
#endif
for
(
i
=
0
;
i
<
ru
->
nb_tx
;
i
++
)
txp
[
i
]
=
(
void
*
)
&
ru
->
common
.
txdata
[
i
][(
proc
->
subframe_tx
*
fp
->
samples_per_tti
)
-
sf_extension
];
txp
[
i
]
=
(
void
*
)
&
ru
->
common
.
txdata
[
i
][(
proc
->
subframe_tx
*
fp
->
samples_per_tti
)
-
sf_extension
];
txp1
[
i
]
=
(
void
*
)
&
ru
->
common
.
txdata
[
i
][(
proc
->
subframe_tx
*
fp
->
samples_per_tti
)
+
(
sigoff2
)
-
sf_extension
];
// pointer to 1st sample of 10th symbol
/* add fail safe for late command */
if
(
late_control
!=
STATE_BURST_NORMAL
)
{
//stop burst
...
...
@@ -785,6 +794,20 @@ void tx_rf(RU_t *ru) {
siglen
+
sf_extension
,
ru
->
nb_tx
,
flags
);
if
(
ru
->
state
==
RU_RUN
&&
proc
->
frame_tx
%
ru
->
p
==
ru
->
tag
&&
proc
->
subframe_tx
==
1
)
{
txs1
=
ru
->
rfdevice
.
trx_write_func
(
&
ru
->
rfdevice
,
proc
->
timestamp_tx
+
(
ru
->
ts_offset
+
sigoff2
)
-
ru
->
openair0_cfg
.
tx_sample_advance
-
sf_extension
,
txp1
,
siglen2
+
sf_extension
,
ru
->
nb_tx
,
flags
);
//LOG_M("txdata.m","txdata",&ru->common.txdata[0][0], fp->samples_per_tti*10,1,1); // save 1 frame
//exit(-1);
int
se1
=
dB_fixed
(
signal_energy
(
txp1
[
0
],
siglen2
+
sf_extension
));
LOG_D
(
PHY
,
"******** frame %d subframe %d RRU sends DMRS of energy10 %d, energy3 %d
\n
"
,
proc
->
frame_tx
,
proc
->
subframe_tx
,
se1
,
dB_fixed
(
signal_energy
(
txp
[
0
],
siglen
+
sf_extension
)));
LOG_D
(
PHY
,
"txs1 %d, siglen2 %d, sf_extension %d
\n
"
,
txs1
,
siglen2
,
sf_extension
);
}
ru
->
south_out_cnt
++
;
LOG_D
(
PHY
,
"south_out_cnt %d
\n
"
,
ru
->
south_out_cnt
);
int
se
=
dB_fixed
(
signal_energy
(
txp
[
0
],
siglen
+
sf_extension
));
...
...
@@ -793,7 +816,13 @@ void tx_rf(RU_t *ru) {
(
long
long
unsigned
int
)
proc
->
timestamp_tx
,
proc
->
frame_tx
,
proc
->
frame_tx_unwrap
,
proc
->
subframe_tx
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE
,
0
);
// AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %d/%d)\n",txs, siglen);
if
(
ru
->
state
==
RU_RUN
&&
proc
->
frame_tx
%
ru
->
p
==
ru
->
tag
&&
proc
->
subframe_tx
==
1
)
{
if
(
(
txs1
!=
siglen2
+
sf_extension
)
&&
(
late_control
==
STATE_BURST_NORMAL
)
){
/* add fail safe for late command */
late_control
=
STATE_BURST_TERMINATE
;
LOG_E
(
PHY
,
"TX : Timeout (sent %d/%d) state =%d
\n
"
,
txs1
,
siglen2
,
late_control
);
}
}
if
(
(
txs
!=
siglen
+
sf_extension
)
&&
(
late_control
==
STATE_BURST_NORMAL
)
)
{
/* add fail safe for late command */
late_control
=
STATE_BURST_TERMINATE
;
LOG_E
(
PHY
,
"TX : Timeout (sent %d/%d) state =%d
\n
"
,
txs
,
siglen
,
late_control
);
...
...
@@ -1884,8 +1913,8 @@ void *ru_thread_synch(void *arg) {
LOG_M("ru_sync_rx.m","rurx",&ru->common.rxdata[0][0],LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti,1,1);
LOG_M("ru_sync_corr.m","sync_corr",ru->dmrs_corr,LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*fp->samples_per_tti,1,6);
LOG_M("ru_dmrs.m","rudmrs",&ru->dmrssync[0],fp->ofdm_symbol_size,1,1);
*/
//exit(-1);
exit(-1);
*/
}
// sync_pos > 0
else
//AssertFatal(cnt<1000,"Cannot find synch reference\n");
{
...
...
@@ -2633,7 +2662,7 @@ void init_RU(char *rf_config_file, clock_source_t clock_source,clock_source_t ti
// NOTE: multiple CC_id are not handled here yet!
ru
->
openair0_cfg
.
clock_source
=
clock_source
;
ru
->
openair0_cfg
.
time_source
=
time_source
;
ru
->
generate_dmrs_sync
=
(
ru
->
is_slave
==
0
)
?
1
:
0
;
ru
->
generate_dmrs_sync
=
(
ru
->
is_slave
==
0
)
?
1
:
1
;
if
(
ru
->
generate_dmrs_sync
==
1
)
{
generate_ul_ref_sigs
();
ru
->
dmrssync
=
(
int16_t
*
)
malloc16_clear
(
ru
->
frame_parms
.
ofdm_symbol_size
*
2
*
sizeof
(
int16_t
));
...
...
This diff is collapsed.
Click to expand it.
targets/RT/USER/ru_control.c
View file @
06c4da47
...
...
@@ -127,6 +127,8 @@ int send_config(RU_t *ru, RRU_CONFIG_msg_t rru_config_msg){
rru_config_msg
.
len
=
sizeof
(
RRU_CONFIG_msg_t
)
-
MAX_RRU_CONFIG_SIZE
+
sizeof
(
RRU_config_t
);
LOG_I
(
PHY
,
"Sending Configuration to RRU %d (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d
\n
"
,
ru
->
idx
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
p
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
tag
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
num_bands
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
band_list
[
0
],
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
tx_freq
[
0
],
...
...
@@ -235,6 +237,8 @@ int attach_rru(RU_t *ru) {
rru_config_msg
.
type
=
RRU_config
;
rru_config_msg
.
len
=
sizeof
(
RRU_CONFIG_msg_t
)
-
MAX_RRU_CONFIG_SIZE
+
sizeof
(
RRU_config_t
);
LOG_I
(
PHY
,
"Sending Configuration to RRU %d (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)
\n
"
,
ru
->
idx
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
p
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
tag
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
num_bands
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
band_list
[
0
],
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
tx_freq
[
0
],
...
...
@@ -328,6 +332,8 @@ int connect_rau(RU_t *ru) {
}
else
{
LOG_I
(
PHY
,
"Configuration received from RAU (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)
\n
"
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
p
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
tag
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
num_bands
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
band_list
[
0
],
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
tx_freq
[
0
],
...
...
@@ -425,6 +431,8 @@ void configure_ru(int idx,
config
->
N_RB_DL
[
0
]
=
ru
->
frame_parms
.
N_RB_DL
;
config
->
N_RB_UL
[
0
]
=
ru
->
frame_parms
.
N_RB_UL
;
config
->
threequarter_fs
[
0
]
=
ru
->
frame_parms
.
threequarter_fs
;
config
->
tag
=
idx
;
config
->
p
=
RC
.
nb_RU
;
if
(
ru
->
if_south
==
REMOTE_IF4p5
)
{
config
->
prach_FreqOffset
[
0
]
=
ru
->
frame_parms
.
prach_config_common
.
prach_ConfigInfo
.
prach_FreqOffset
;
config
->
prach_ConfigIndex
[
0
]
=
ru
->
frame_parms
.
prach_config_common
.
prach_ConfigInfo
.
prach_ConfigIndex
;
...
...
@@ -451,6 +459,8 @@ void configure_rru(int idx,
RRU_config_t
*
config
=
(
RRU_config_t
*
)
arg
;
RU_t
*
ru
=
RC
.
ru
[
idx
];
ru
->
tag
=
config
->
tag
;
ru
->
p
=
config
->
p
;
ru
->
frame_parms
.
eutra_band
=
config
->
band_list
[
0
];
ru
->
frame_parms
.
dl_CarrierFreq
=
config
->
tx_freq
[
0
];
ru
->
frame_parms
.
ul_CarrierFreq
=
config
->
rx_freq
[
0
];
...
...
@@ -569,6 +579,8 @@ void* ru_thread_control( void* param ) {
case
RRU_config
:
// RRU
if
(
ru
->
if_south
==
LOCAL_RF
){
LOG_I
(
PHY
,
"Configuration received from RAU (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)
\n
"
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
p
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
tag
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
num_bands
,
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
band_list
[
0
],
((
RRU_config_t
*
)
&
rru_config_msg
.
msg
[
0
])
->
tx_freq
[
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