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
wangjie
OpenXG-RAN
Commits
b5eec87e
Commit
b5eec87e
authored
Jul 17, 2017
by
tct-labo4
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ue_slot0_slot1_parallelization_bis' into develop_integration_w30
parents
08b8b314
ed145f57
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1550 additions
and
135 deletions
+1550
-135
openair1/PHY/LTE_TRANSPORT/dci_tools.c
openair1/PHY/LTE_TRANSPORT/dci_tools.c
+167
-42
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
+126
-28
openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
+50
-9
openair1/PHY/LTE_TRANSPORT/initial_sync.c
openair1/PHY/LTE_TRANSPORT/initial_sync.c
+8
-10
openair1/PHY/LTE_TRANSPORT/proto.h
openair1/PHY/LTE_TRANSPORT/proto.h
+8
-3
openair1/PHY/MODULATION/defs.h
openair1/PHY/MODULATION/defs.h
+11
-0
openair1/PHY/MODULATION/slot_fep.c
openair1/PHY/MODULATION/slot_fep.c
+212
-0
openair1/PHY/defs.h
openair1/PHY/defs.h
+44
-5
openair1/PHY/impl_defs_lte.h
openair1/PHY/impl_defs_lte.h
+6
-0
openair1/SCHED/defs.h
openair1/SCHED/defs.h
+7
-0
openair1/SCHED/phy_procedures_lte_ue.c
openair1/SCHED/phy_procedures_lte_ue.c
+869
-25
targets/COMMON/threads_t.h
targets/COMMON/threads_t.h
+3
-0
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+16
-1
targets/RT/USER/lte-softmodem.h
targets/RT/USER/lte-softmodem.h
+1
-0
targets/RT/USER/lte-ue.c
targets/RT/USER/lte-ue.c
+21
-11
targets/SIMU/USER/oaisim.c
targets/SIMU/USER/oaisim.c
+1
-1
No files found.
openair1/PHY/LTE_TRANSPORT/dci_tools.c
View file @
b5eec87e
This diff is collapsed.
Click to expand it.
openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
View file @
b5eec87e
This diff is collapsed.
Click to expand it.
openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
View file @
b5eec87e
...
...
@@ -636,7 +636,6 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t
first_symbol_flag
,
uint16_t
nb_rb
,
uint16_t
pbch_pss_sss_adjust
,
int16_t
**
llr32p
,
uint8_t
beamforming_mode
)
{
...
...
@@ -645,12 +644,14 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
int
i
,
len
;
uint8_t
symbol_mod
=
(
symbol
>=
(
7
-
frame_parms
->
Ncp
))
?
(
symbol
-
(
7
-
frame_parms
->
Ncp
))
:
symbol
;
/*
if (first_symbol_flag==1) {
llr32 = (uint32_t*)dlsch_llr;
} else {
llr32 = (uint32_t*)(*llr32p);
}
}
*/
llr32
=
(
uint32_t
*
)
dlsch_llr
;
if
(
!
llr32
)
{
msg
(
"dlsch_qpsk_llr: llr is null, symbol %d, llr32=%p
\n
"
,
symbol
,
llr32
);
return
(
-
1
);
...
...
@@ -672,6 +673,13 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
//printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
/*LOG_I(PHY,"dlsch_qpsk_llr: [symb %d / FirstSym %d / Length %d]: @LLR Buff %x, @LLR Buff(symb) %x \n",
symbol,
first_symbol_flag,
len,
dlsch_llr,
llr32);*/
//printf("ll32p=%p , dlsch_llr=%p, symbol=%d, flag=%d \n", llr32, dlsch_llr, symbol, first_symbol_flag);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
*
llr32
=
*
rxF
;
...
...
@@ -680,7 +688,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
llr32
++
;
}
*
llr32p
=
(
int16_t
*
)
llr32
;
//
*llr32p = (int16_t *)llr32;
return
(
0
);
}
...
...
@@ -1040,7 +1048,8 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t
first_symbol_flag
,
uint16_t
nb_rb
,
uint16_t
pbch_pss_sss_adjust
,
int16_t
**
llr_save
,
//int16_t **llr_save,
uint32_t
llr_offset
,
uint8_t
beamforming_mode
)
{
#if defined(__x86_64__) || defined(__i386__)
...
...
@@ -1054,11 +1063,18 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
unsigned
char
symbol_mod
,
len_mod4
;
short
*
llr
;
int16_t
*
llr2
;
int8_t
*
pllr_symbol
;
/*
if (first_symbol_flag==1)
llr = dlsch_llr;
else
llr = *llr_save;
*/
llr
=
dlsch_llr
;
pllr_symbol
=
(
int8_t
*
)
dlsch_llr
;
pllr_symbol
+=
llr_offset
;
symbol_mod
=
(
symbol
>=
(
7
-
frame_parms
->
Ncp
))
?
symbol
-
(
7
-
frame_parms
->
Ncp
)
:
symbol
;
...
...
@@ -1082,6 +1098,15 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
len
=
(
nb_rb
*
12
)
-
pbch_pss_sss_adjust
;
}
// printf("dlsch_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
/* LOG_I(PHY,"dlsch_64qam_llr [symb %d / FirstSym %d / Length %d]: @LLR Buff %x \n",
symbol,
first_symbol_flag,
len,
dlsch_llr,
pllr_symbol);*/
llr2
=
llr
;
llr
+=
(
len
*
6
);
...
...
@@ -1176,7 +1201,6 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
}
*
llr_save
=
llr
;
#if defined(__x86_64__) || defined(__i386__)
_mm_empty
();
_m_empty
();
...
...
@@ -8789,7 +8813,8 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t
first_symbol_flag
,
uint16_t
nb_rb
,
uint16_t
pbch_pss_sss_adjust
,
int16_t
**
llr16p
)
//int16_t **llr16p,
uint32_t
llr_offset
)
{
int16_t
*
rxF
=
(
int16_t
*
)
&
rxdataF_comp
[
0
][(
symbol
*
frame_parms
->
N_RB_DL
*
12
)];
...
...
@@ -8798,16 +8823,18 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
int16_t
*
ch_mag_i
=
(
int16_t
*
)
&
dl_ch_mag_i
[
0
][(
symbol
*
frame_parms
->
N_RB_DL
*
12
)];
int16_t
*
rho
=
(
int16_t
*
)
&
rho_i
[
0
][(
symbol
*
frame_parms
->
N_RB_DL
*
12
)];
int16_t
*
llr16
;
int8_t
*
pllr_symbol
;
// pointer where llrs should filled for this ofdm symbol
int
len
;
uint8_t
symbol_mod
=
(
symbol
>=
(
7
-
frame_parms
->
Ncp
))
?
(
symbol
-
(
7
-
frame_parms
->
Ncp
))
:
symbol
;
//first symbol has different structure due to more pilots
if
(
first_symbol_flag
==
1
)
{
/*
if (first_symbol_flag == 1) {
llr16 = (int16_t*)dlsch_llr;
} else {
llr16 = (int16_t*)(*llr16p);
}
}
*/
llr16
=
(
int16_t
*
)
dlsch_llr
;
if
(
!
llr16
)
{
msg
(
"dlsch_64qam_64qam_llr: llr is null, symbol %d
\n
"
,
symbol
);
return
(
-
1
);
...
...
@@ -8826,6 +8853,18 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
len
=
(
nb_rb
*
12
)
-
pbch_pss_sss_adjust
;
}
pllr_symbol
=
(
int8_t
*
)
dlsch_llr
;
pllr_symbol
+=
llr_offset
;
//printf("dlsch_64qam_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
/*LOG_I(PHY,"dlsch_64qam_64qam_llr [symb %d / FirstSym %d / Length %d / LLR Offset %d]: @LLR Buff %x, @LLR Buff(symb) %x, , @Compute LLR Buff(symb) %x \n",
symbol,
first_symbol_flag,
len,
llr_offset,
(int16_t*)dlsch_llr,
llr16,
pllr_symbol);*/
#ifdef __AVX2__
// Round length up to multiple of 16 words
...
...
@@ -8859,6 +8898,7 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
(
int32_t
*
)
rho_256i
,
len
);
#endif
free16
(
rxF_256i
,
sizeof
(
rxF_256i
));
free16
(
rxF_i_256i
,
sizeof
(
rxF_i_256i
));
free16
(
ch_mag_256i
,
sizeof
(
ch_mag_256i
));
...
...
@@ -8876,6 +8916,7 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
#endif
llr16
+=
(
6
*
len
);
*
llr16p
=
(
short
*
)
llr16
;
//*llr16p = (short *)llr16;
return
(
0
);
}
openair1/PHY/LTE_TRANSPORT/initial_sync.c
View file @
b5eec87e
...
...
@@ -233,19 +233,17 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
break
;
}
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
=
(((
ue
->
pbch_vars
[
0
]
->
decoded_output
[
2
]
&
3
)
<<
6
)
+
(
ue
->
pbch_vars
[
0
]
->
decoded_output
[
1
]
>>
2
))
<<
2
;
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
+=
frame_mod4
;
ue
->
proc
.
proc_rxtx
[
1
].
frame_rx
=
(((
ue
->
pbch_vars
[
0
]
->
decoded_output
[
2
]
&
3
)
<<
6
)
+
(
ue
->
pbch_vars
[
0
]
->
decoded_output
[
1
]
>>
2
))
<<
2
;
ue
->
proc
.
proc_rxtx
[
1
].
frame_rx
+=
frame_mod4
;
for
(
int
i
=
0
;
i
<
RX_NB_TH
;
i
++
)
{
ue
->
proc
.
proc_rxtx
[
i
].
frame_rx
=
(((
ue
->
pbch_vars
[
0
]
->
decoded_output
[
2
]
&
3
)
<<
6
)
+
(
ue
->
pbch_vars
[
0
]
->
decoded_output
[
1
]
>>
2
))
<<
2
;
ue
->
proc
.
proc_rxtx
[
i
].
frame_rx
=
(((
ue
->
pbch_vars
[
0
]
->
decoded_output
[
2
]
&
3
)
<<
6
)
+
(
ue
->
pbch_vars
[
0
]
->
decoded_output
[
1
]
>>
2
))
<<
2
;
#ifndef USER_MODE
// one frame delay
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
++
;
ue
->
proc
.
proc_rxtx
[
1
].
frame_rx
++
;
// one frame delay
ue
->
proc
.
proc_rxtx
[
i
].
frame_rx
++
;
#endif
ue
->
proc
.
proc_rxtx
[
0
].
frame_tx
=
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
;
ue
->
proc
.
proc_rxtx
[
1
].
frame_tx
=
ue
->
proc
.
proc_rxtx
[
1
].
frame_rx
;
ue
->
proc
.
proc_rxtx
[
i
].
frame_tx
=
ue
->
proc
.
proc_rxtx
[
0
].
frame_rx
;
}
#ifdef DEBUG_INITIAL_SYNCH
LOG_I
(
PHY
,
"[UE%d] Initial sync: pbch decoded sucessfully mode1_flag %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!
\n
"
,
ue
->
Mod_id
,
...
...
openair1/PHY/LTE_TRANSPORT/proto.h
View file @
b5eec87e
...
...
@@ -802,7 +802,8 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
unsigned
char
first_symbol_flag
,
unsigned
short
nb_rb
,
uint16_t
pbch_pss_sss_adjust
,
short
**
llr16p
);
//short **llr16p,
uint32_t
llr_offset
);
/** \brief This function generates log-likelihood ratios (decoder input) for single-stream QPSK received waveforms.
...
...
@@ -823,7 +824,7 @@ int32_t dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t
first_symbol_flag
,
uint16_t
nb_rb
,
uint16_t
pbch_pss_sss_adj
,
int16_t
**
llr128p
,
//
int16_t **llr128p,
uint8_t
beamforming_mode
);
/**
...
...
@@ -909,7 +910,8 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t
first_symbol_flag
,
uint16_t
nb_rb
,
uint16_t
pbch_pss_sss_adjust
,
int16_t
**
llr_save
,
//int16_t **llr_save,
uint32_t
llr_offset
,
uint8_t
beamforming_mode
);
...
...
@@ -1346,6 +1348,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
@param i_mod Modulation order of the interfering stream
*/
int32_t
rx_pdsch
(
PHY_VARS_UE
*
phy_vars_ue
,
UE_rxtx_proc_t
*
proc
,
PDSCH_t
type
,
uint8_t
eNB_id
,
uint8_t
eNB_id_i
,
...
...
@@ -1695,6 +1698,8 @@ int generate_ue_dlsch_params_from_dci(int frame,
void
*
dci_pdu
,
rnti_t
rnti
,
DCI_format_t
dci_format
,
LTE_UE_PDCCH
*
pdcch_vars
,
LTE_UE_PDSCH
*
pdsch_vars
,
LTE_UE_DLSCH_t
**
dlsch
,
LTE_DL_FRAME_PARMS
*
frame_parms
,
PDSCH_CONFIG_DEDICATED
*
pdsch_config_dedicated
,
...
...
openair1/PHY/MODULATION/defs.h
View file @
b5eec87e
...
...
@@ -78,6 +78,17 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
unsigned
char
eNb_id
,
int
no_prefix
);
int
front_end_fft
(
PHY_VARS_UE
*
ue
,
unsigned
char
l
,
unsigned
char
Ns
,
int
sample_offset
,
int
no_prefix
);
int
front_end_chanEst
(
PHY_VARS_UE
*
ue
,
unsigned
char
l
,
unsigned
char
Ns
,
int
reset_freq_est
);
void
normal_prefix_mod
(
int32_t
*
txdataF
,
int32_t
*
txdata
,
uint8_t
nsymb
,
LTE_DL_FRAME_PARMS
*
frame_parms
);
void
do_OFDM_mod
(
int32_t
**
txdataF
,
int32_t
**
txdata
,
uint32_t
frame
,
uint16_t
next_slot
,
LTE_DL_FRAME_PARMS
*
frame_parms
);
...
...
openair1/PHY/MODULATION/slot_fep.c
View file @
b5eec87e
...
...
@@ -242,3 +242,215 @@ int slot_fep(PHY_VARS_UE *ue,
#endif
return
(
0
);
}
int
front_end_fft
(
PHY_VARS_UE
*
ue
,
unsigned
char
l
,
unsigned
char
Ns
,
int
sample_offset
,
int
no_prefix
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
LTE_UE_COMMON
*
common_vars
=
&
ue
->
common_vars
;
unsigned
char
aa
;
unsigned
char
symbol
=
l
+
((
7
-
frame_parms
->
Ncp
)
*
(
Ns
&
1
));
///symbol within sub-frame
unsigned
int
nb_prefix_samples
=
(
no_prefix
?
0
:
frame_parms
->
nb_prefix_samples
);
unsigned
int
nb_prefix_samples0
=
(
no_prefix
?
0
:
frame_parms
->
nb_prefix_samples0
);
unsigned
int
subframe_offset
;
//,subframe_offset_F;
unsigned
int
slot_offset
;
unsigned
int
frame_length_samples
=
frame_parms
->
samples_per_tti
*
10
;
unsigned
int
rx_offset
;
/*LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id];
unsigned char harq_pid = dlsch_ue[0]->current_harq_pid;
LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid];
int uespec_pilot[9][1200];*/
void
(
*
dft
)(
int16_t
*
,
int16_t
*
,
int
);
int
tmp_dft_in
[
2048
]
__attribute__
((
aligned
(
32
)));
// This is for misalignment issues for 6 and 15 PRBs
switch
(
frame_parms
->
ofdm_symbol_size
)
{
case
128
:
dft
=
dft128
;
break
;
case
256
:
dft
=
dft256
;
break
;
case
512
:
dft
=
dft512
;
break
;
case
1024
:
dft
=
dft1024
;
break
;
case
1536
:
dft
=
dft1536
;
break
;
case
2048
:
dft
=
dft2048
;
break
;
default:
dft
=
dft512
;
break
;
}
if
(
no_prefix
)
{
subframe_offset
=
frame_parms
->
ofdm_symbol_size
*
frame_parms
->
symbols_per_tti
*
(
Ns
>>
1
);
slot_offset
=
frame_parms
->
ofdm_symbol_size
*
(
frame_parms
->
symbols_per_tti
>>
1
)
*
(
Ns
%
2
);
}
else
{
subframe_offset
=
frame_parms
->
samples_per_tti
*
(
Ns
>>
1
);
slot_offset
=
(
frame_parms
->
samples_per_tti
>>
1
)
*
(
Ns
%
2
);
}
// subframe_offset_F = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1);
if
(
l
<
0
||
l
>=
7
-
frame_parms
->
Ncp
)
{
printf
(
"slot_fep: l must be between 0 and %d
\n
"
,
7
-
frame_parms
->
Ncp
);
return
(
-
1
);
}
if
(
Ns
<
0
||
Ns
>=
20
)
{
printf
(
"slot_fep: Ns must be between 0 and 19
\n
"
);
return
(
-
1
);
}
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antennas_rx
;
aa
++
)
{
memset
(
&
common_vars
->
common_vars_rx_data_per_thread
[(
Ns
>>
1
)
&
0x1
].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
0
,
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
rx_offset
=
sample_offset
+
slot_offset
+
nb_prefix_samples0
+
subframe_offset
-
SOFFSET
;
// Align with 256 bit
// rx_offset = rx_offset&0xfffffff8;
if
(
l
==
0
)
{
if
(
rx_offset
>
(
frame_length_samples
-
frame_parms
->
ofdm_symbol_size
))
memcpy
((
short
*
)
&
common_vars
->
rxdata
[
aa
][
frame_length_samples
],
(
short
*
)
&
common_vars
->
rxdata
[
aa
][
0
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
if
((
rx_offset
&
7
)
!=
0
)
{
// if input to dft is not 256-bit aligned, issue for size 6,15 and 25 PRBs
memcpy
((
void
*
)
tmp_dft_in
,
(
void
*
)
&
common_vars
->
rxdata
[
aa
][
rx_offset
%
frame_length_samples
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
dft
((
int16_t
*
)
tmp_dft_in
,
(
int16_t
*
)
&
common_vars
->
common_vars_rx_data_per_thread
[(
Ns
>>
1
)
&
0x1
].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
}
else
{
// use dft input from RX buffer directly
start_meas
(
&
ue
->
rx_dft_stats
);
dft
((
int16_t
*
)
&
common_vars
->
rxdata
[
aa
][(
rx_offset
)
%
frame_length_samples
],
(
int16_t
*
)
&
common_vars
->
common_vars_rx_data_per_thread
[(
Ns
>>
1
)
&
0x1
].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
stop_meas
(
&
ue
->
rx_dft_stats
);
}
}
else
{
rx_offset
+=
(
frame_parms
->
ofdm_symbol_size
+
nb_prefix_samples
)
*
l
;
// +
// (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1);
#ifdef DEBUG_FEP
// if (ue->frame <100)
LOG_I
(
PHY
,
"slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d, frame_length_samples %d
\n
"
,
ue
->
proc
.
proc_rxtx
[(
Ns
>>
1
)
&
1
].
frame_rx
,
Ns
,
symbol
,
nb_prefix_samples
,
nb_prefix_samples0
,
slot_offset
,
subframe_offset
,
sample_offset
,
rx_offset
,
frame_length_samples
);
#endif
if
(
rx_offset
>
(
frame_length_samples
-
frame_parms
->
ofdm_symbol_size
))
memcpy
((
void
*
)
&
common_vars
->
rxdata
[
aa
][
frame_length_samples
],
(
void
*
)
&
common_vars
->
rxdata
[
aa
][
0
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
start_meas
(
&
ue
->
rx_dft_stats
);
if
((
rx_offset
&
7
)
!=
0
)
{
// if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
memcpy
((
void
*
)
tmp_dft_in
,
(
void
*
)
&
common_vars
->
rxdata
[
aa
][(
rx_offset
)
%
frame_length_samples
],
frame_parms
->
ofdm_symbol_size
*
sizeof
(
int
));
dft
((
int16_t
*
)
tmp_dft_in
,
(
int16_t
*
)
&
common_vars
->
common_vars_rx_data_per_thread
[(
Ns
>>
1
)
&
0x1
].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
}
else
{
// use dft input from RX buffer directly
dft
((
int16_t
*
)
&
common_vars
->
rxdata
[
aa
][(
rx_offset
)
%
frame_length_samples
],
(
int16_t
*
)
&
common_vars
->
common_vars_rx_data_per_thread
[(
Ns
>>
1
)
&
0x1
].
rxdataF
[
aa
][
frame_parms
->
ofdm_symbol_size
*
symbol
],
1
);
}
stop_meas
(
&
ue
->
rx_dft_stats
);
}
#ifdef DEBUG_FEP
// if (ue->frame <100)
printf
(
"slot_fep: frame %d: symbol %d rx_offset %d
\n
"
,
ue
->
proc
.
proc_rxtx
[(
Ns
>>
1
)
&
1
].
frame_rx
,
symbol
,
rx_offset
);
#endif
}
return
(
0
);
}
int
front_end_chanEst
(
PHY_VARS_UE
*
ue
,
unsigned
char
l
,
unsigned
char
Ns
,
int
reset_freq_est
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
=
&
ue
->
frame_parms
;
LTE_UE_COMMON
*
common_vars
=
&
ue
->
common_vars
;
uint8_t
eNB_id
=
0
;
//ue_common_vars->eNb_id;
unsigned
char
aa
;
unsigned
char
symbol
=
l
+
((
7
-
frame_parms
->
Ncp
)
*
(
Ns
&
1
));
///symbol within sub-frame
int
i
;
/*LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id];
unsigned char harq_pid = dlsch_ue[0]->current_harq_pid;
LTE_DL_UE_HARQ_t *dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid];
int uespec_pilot[9][1200];*/
if
(
ue
->
perfect_ce
==
0
)
{
if
((
l
==
0
)
||
(
l
==
(
4
-
frame_parms
->
Ncp
)))
{
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antenna_ports_eNB
;
aa
++
)
{
#ifdef DEBUG_FEP
printf
(
"Channel estimation eNB %d, aatx %d, slot %d, symbol %d
\n
"
,
eNB_id
,
aa
,
Ns
,
l
);
#endif
start_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
lte_dl_channel_estimation
(
ue
,
eNB_id
,
0
,
Ns
,
aa
,
l
,
symbol
);
stop_meas
(
&
ue
->
dlsch_channel_estimation_stats
);
for
(
i
=
0
;
i
<
ue
->
measurements
.
n_adj_cells
;
i
++
)
{
lte_dl_channel_estimation
(
ue
,
eNB_id
,
i
+
1
,
Ns
,
aa
,
l
,
symbol
);
}
}
// do frequency offset estimation here!
// use channel estimates from current symbol (=ch_t) and last symbol (ch_{t-1})
#ifdef DEBUG_FEP
printf
(
"Frequency offset estimation
\n
"
);
#endif
if
(
l
==
(
4
-
frame_parms
->
Ncp
))
{
start_meas
(
&
ue
->
dlsch_freq_offset_estimation_stats
);
lte_est_freq_offset
(
common_vars
->
common_vars_rx_data_per_thread
[(
Ns
>>
1
)
&
0x1
].
dl_ch_estimates
[
0
],
frame_parms
,
l
,
&
common_vars
->
freq_offset
,
reset_freq_est
);
stop_meas
(
&
ue
->
dlsch_freq_offset_estimation_stats
);
}
}
}
return
(
0
);
}
openair1/PHY/defs.h
View file @
b5eec87e
...
...
@@ -395,6 +395,32 @@ typedef struct {
pthread_mutex_t
mutex_rxtx
;
/// scheduling parameters for RXn-TXnp4 thread
struct
sched_param
sched_param_rxtx
;
/// internal This variable is protected by ref mutex_fep_slot1.
//int instance_cnt_slot0_dl_processing;
int
instance_cnt_slot1_dl_processing
;
/// pthread descriptor fep_slot1 thread
//pthread_t pthread_slot0_dl_processing;
pthread_t
pthread_slot1_dl_processing
;
/// pthread attributes for fep_slot1 processing thread
// pthread_attr_t attr_slot0_dl_processing;
pthread_attr_t
attr_slot1_dl_processing
;
/// condition variable for UE fep_slot1 thread;
//pthread_cond_t cond_slot0_dl_processing;
pthread_cond_t
cond_slot1_dl_processing
;
/// mutex for UE synch thread
//pthread_mutex_t mutex_slot0_dl_processing;
pthread_mutex_t
mutex_slot1_dl_processing
;
//
uint8_t
chan_est_pilot0_slot1_available
;
uint8_t
chan_est_slot1_available
;
uint8_t
llr_slot1_available
;
uint8_t
dci_slot0_available
;
uint8_t
first_symbol_available
;
uint8_t
channel_level
;
/// scheduling parameters for fep_slot1 thread
struct
sched_param
sched_param_fep_slot1
;
int
sub_frame_start
;
int
sub_frame_step
;
unsigned
long
long
gotIQs
;
...
...
@@ -875,9 +901,9 @@ typedef struct {
/// Transmission mode per eNB
uint8_t
transmission_mode
[
NUMBER_OF_CONNECTED_eNB_MAX
];
time_stats_t
phy_proc
;
time_stats_t
phy_proc
[
RX_NB_TH
]
;
time_stats_t
phy_proc_tx
;
time_stats_t
phy_proc_rx
[
2
];
time_stats_t
phy_proc_rx
[
RX_NB_TH
];
uint32_t
use_ia_receiver
;
...
...
@@ -891,8 +917,13 @@ typedef struct {
time_stats_t
ulsch_multiplexing_stats
;
time_stats_t
generic_stat
;
time_stats_t
pdsch_procedures_stat
;
time_stats_t
dlsch_procedures_stat
;
time_stats_t
generic_stat_bis
[
RX_NB_TH
][
LTE_SLOTS_PER_SUBFRAME
];
time_stats_t
ue_front_end_stat
[
RX_NB_TH
];
time_stats_t
ue_front_end_per_slot_stat
[
RX_NB_TH
][
LTE_SLOTS_PER_SUBFRAME
];
time_stats_t
pdcch_procedures_stat
[
RX_NB_TH
];
time_stats_t
pdsch_procedures_stat
[
RX_NB_TH
];
time_stats_t
pdsch_procedures_per_slot_stat
[
RX_NB_TH
][
LTE_SLOTS_PER_SUBFRAME
];
time_stats_t
dlsch_procedures_stat
[
RX_NB_TH
];
time_stats_t
ofdm_demod_stats
;
time_stats_t
dlsch_rx_pdcch_stats
;
...
...
@@ -904,7 +935,7 @@ typedef struct {
time_stats_t
dlsch_rate_unmatching_stats
;
time_stats_t
dlsch_turbo_decoding_stats
;
time_stats_t
dlsch_deinterleaving_stats
;
time_stats_t
dlsch_llr_stats
;
time_stats_t
dlsch_llr_stats
[
RX_NB_TH
][
LTE_SLOTS_PER_SUBFRAME
]
;
time_stats_t
dlsch_unscrambling_stats
;
time_stats_t
dlsch_rate_matching_stats
;
time_stats_t
dlsch_turbo_encoding_stats
;
...
...
@@ -934,6 +965,14 @@ typedef struct {
}
PHY_VARS_UE
;
/* this structure is used to pass both UE phy vars and
* proc to the function UE_thread_rxn_txnp4
*/
struct
rx_tx_thread_data
{
PHY_VARS_UE
*
UE
;
UE_rxtx_proc_t
*
proc
;
};
void
exit_fun
(
const
char
*
s
);
static
inline
int
wait_on_condition
(
pthread_mutex_t
*
mutex
,
pthread_cond_t
*
cond
,
int
*
instance_cnt
,
char
*
name
)
{
...
...
openair1/PHY/impl_defs_lte.h
View file @
b5eec87e
...
...
@@ -40,6 +40,8 @@
#define RX_NB_TH_MAX 2
#define RX_NB_TH 2
#define LTE_SLOTS_PER_SUBFRAME 2
#define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10
#define LTE_SLOTS_PER_FRAME 20
#define LTE_CE_FILTER_LENGTH 5
...
...
@@ -928,6 +930,10 @@ typedef struct {
//uint32_t *rb_alloc;
//uint8_t Qm[2];
//MIMO_mode_t mimo_mode;
// llr offset per ofdm symbol
uint32_t
llr_offset
[
14
];
// llr length per ofdm symbol
uint32_t
llr_length
[
14
];
}
LTE_UE_PDSCH
;
typedef
struct
{
...
...
openair1/SCHED/defs.h
View file @
b5eec87e
...
...
@@ -43,6 +43,7 @@ enum THREAD_INDEX { OPENAIR_THREAD_INDEX = 0,
#define OPENAIR_THREAD_STACK_SIZE PTHREAD_STACK_MIN //4096 //RTL_PTHREAD_STACK_MIN*6
//#define DLC_THREAD_STACK_SIZE 4096 //DLC stack size
//#define UE_SLOT_PARALLELISATION
enum
openair_SCHED_STATUS
{
openair_SCHED_STOPPED
=
1
,
...
...
@@ -139,6 +140,12 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t
@param phy_vars_rn pointer to RN variables
*/
int
phy_procedures_UE_RX
(
PHY_VARS_UE
*
phy_vars_ue
,
UE_rxtx_proc_t
*
proc
,
uint8_t
eNB_id
,
uint8_t
abstraction_flag
,
uint8_t
do_pdcch_flag
,
runmode_t
mode
,
relaying_type_t
r_type
,
PHY_VARS_RN
*
phy_vars_rn
);
int
phy_procedures_slot_parallelization_UE_RX
(
PHY_VARS_UE
*
ue
,
UE_rxtx_proc_t
*
proc
,
uint8_t
eNB_id
,
uint8_t
abstraction_flag
,
uint8_t
do_pdcch_flag
,
runmode_t
mode
,
relaying_type_t
r_type
,
PHY_VARS_RN
*
phy_vars_rn
);
#ifdef UE_SLOT_PARALLELISATION
void
*
UE_thread_slot1_dl_processing
(
void
*
arg
);
#endif
/*! \brief Scheduling for UE TX procedures in TDD S-subframes.
@param phy_vars_ue Pointer to UE variables on which to act
...
...
openair1/SCHED/phy_procedures_lte_ue.c
View file @
b5eec87e
This diff is collapsed.
Click to expand it.
targets/COMMON/threads_t.h
View file @
b5eec87e
...
...
@@ -6,6 +6,9 @@ typedef struct threads_s {
int
one
;
int
two
;
int
three
;
int
slot1_proc_one
;
int
slot1_proc_two
;
int
slot1_proc_three
;
}
threads_t
;
#endif
/* _THREADS_T_H_ */
targets/RT/USER/lte-softmodem.c
View file @
b5eec87e
...
...
@@ -222,7 +222,7 @@ double cpuf;
char
uecap_xer
[
1024
],
uecap_xer_in
=
0
;
int
oaisim_flag
=
0
;
threads_t
threads
=
{
-
1
,
-
1
,
-
1
,
-
1
};
threads_t
threads
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
};
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution
...
...
@@ -640,6 +640,9 @@ static void get_options (int argc, char **argv) {
LONG_OPTION_THREADONESUBFRAME
,
LONG_OPTION_THREADTWOSUBFRAME
,
LONG_OPTION_THREADTHREESUBFRAME
,
LONG_OPTION_THREADSLOT1PROCONE
,
LONG_OPTION_THREADSLOT1PROCTWO
,
LONG_OPTION_THREADSLOT1PROCTHREE
,
LONG_OPTION_DEMOD_SHIFT
,
#if T_TRACER
LONG_OPTION_T_PORT
,
...
...
@@ -677,6 +680,9 @@ static void get_options (int argc, char **argv) {
{
"threadOneSubframe"
,
required_argument
,
NULL
,
LONG_OPTION_THREADONESUBFRAME
},
{
"threadTwoSubframe"
,
required_argument
,
NULL
,
LONG_OPTION_THREADTWOSUBFRAME
},
{
"threadThreeSubframe"
,
required_argument
,
NULL
,
LONG_OPTION_THREADTHREESUBFRAME
},
{
"threadSlot1ProcOne"
,
required_argument
,
NULL
,
LONG_OPTION_THREADSLOT1PROCONE
},
{
"threadSlot1ProcTwo"
,
required_argument
,
NULL
,
LONG_OPTION_THREADSLOT1PROCTWO
},
{
"threadSlot1ProcThree"
,
required_argument
,
NULL
,
LONG_OPTION_THREADSLOT1PROCTHREE
},
{
"dlsch-demod-shift"
,
required_argument
,
NULL
,
LONG_OPTION_DEMOD_SHIFT
},
#if T_TRACER
{
"T_port"
,
required_argument
,
0
,
LONG_OPTION_T_PORT
},
...
...
@@ -811,6 +817,15 @@ static void get_options (int argc, char **argv) {
case
LONG_OPTION_THREADTHREESUBFRAME
:
threads
.
three
=
atoi
(
optarg
);
break
;
case
LONG_OPTION_THREADSLOT1PROCONE
:
threads
.
slot1_proc_one
=
atoi
(
optarg
);
break
;
case
LONG_OPTION_THREADSLOT1PROCTWO
:
threads
.
slot1_proc_two
=
atoi
(
optarg
);
break
;
case
LONG_OPTION_THREADSLOT1PROCTHREE
:
threads
.
slot1_proc_three
=
atoi
(
optarg
);
break
;
case
LONG_OPTION_DEMOD_SHIFT
:
{
extern
int16_t
dlsch_demod_shift
;
dlsch_demod_shift
=
atof
(
optarg
);
...
...
targets/RT/USER/lte-softmodem.h
View file @
b5eec87e
...
...
@@ -81,6 +81,7 @@ extern void kill_eNB_proc(int inst);
extern
int
setup_ue_buffers
(
PHY_VARS_UE
**
phy_vars_ue
,
openair0_config_t
*
openair0_cfg
);
extern
void
fill_ue_band_info
(
void
);
extern
void
init_UE
(
int
);
extern
void
init_thread
(
int
sched_runtime
,
int
sched_deadline
,
int
sched_fifo
,
cpu_set_t
*
cpuset
,
char
*
name
);
extern
void
reset_opp_meas
(
void
);
extern
void
print_opp_meas
(
void
);
...
...
targets/RT/USER/lte-ue.c
View file @
b5eec87e
...
...
@@ -476,15 +476,6 @@ static void *UE_thread_synch(void *arg) {
return
&
UE_thread_synch_retval
;
}
/* this structure is used to pass both UE phy vars and
* proc to the function UE_thread_rxn_txnp4
*/
struct
rx_tx_thread_data
{
PHY_VARS_UE
*
UE
;
UE_rxtx_proc_t
*
proc
;
};
/*!
* \brief This is the UE thread for RX subframe n and TX subframe n+4.
* This thread performs the phy_procedures_UE_RX() on every received slot.
...
...
@@ -507,12 +498,13 @@ static void *UE_thread_rxn_txnp4(void *arg) {
sprintf
(
threadname
,
"UE_%d_proc_%d"
,
UE
->
Mod_id
,
proc
->
sub_frame_start
);
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
if
(
(
proc
->
sub_frame_start
+
1
)
%
RX_NB_TH
==
0
&&
threads
.
one
!=
-
1
)
CPU_SET
(
threads
.
one
,
&
cpuset
);
if
(
(
proc
->
sub_frame_start
+
1
)
%
RX_NB_TH
==
1
&&
threads
.
two
!=
-
1
)
CPU_SET
(
threads
.
two
,
&
cpuset
);
if
(
(
proc
->
sub_frame_start
+
1
)
%
RX_NB_TH
==
2
&&
threads
.
three
!=
-
1
)
CPU_SET
(
threads
.
three
,
&
cpuset
);
CPU_SET
(
threads
.
three
,
&
cpuset
);
//CPU_SET(threads.three, &cpuset);
init_thread
(
900000
,
1000000
,
FIFO_PRIORITY
-
1
,
&
cpuset
,
threadname
);
...
...
@@ -558,7 +550,11 @@ static void *UE_thread_rxn_txnp4(void *arg) {
(
sf_type
==
SF_UL
?
"SF_UL"
:
(
sf_type
==
SF_S
?
"SF_S"
:
"UNKNOWN_SF_TYPE"
))));
}
#ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_UE_RX
(
UE
,
proc
,
0
,
0
,
1
,
UE
->
mode
,
no_relay
,
NULL
);
#else
phy_procedures_UE_RX
(
UE
,
proc
,
0
,
0
,
1
,
UE
->
mode
,
no_relay
,
NULL
);
#endif
}
#if UE_TIMING_TRACE
...
...
@@ -871,6 +867,10 @@ void *UE_thread(void *arg) {
* - UE_thread_rxtx0
* - UE_thread_rxtx1
* - UE_thread_synch
* - UE_thread_fep_slot0
* - UE_thread_fep_slot1
* - UE_thread_dlsch_proc_slot0
* - UE_thread_dlsch_proc_slot1
* and the locking between them.
*/
void
init_UE_threads
(
PHY_VARS_UE
*
UE
)
{
...
...
@@ -896,9 +896,19 @@ void init_UE_threads(PHY_VARS_UE *UE) {
UE
->
proc
.
proc_rxtx
[
i
].
sub_frame_step
=
nb_threads
;
printf
(
"Init_UE_threads rtd %d proc %d nb_threads %d i %d
\n
"
,
rtd
->
proc
->
sub_frame_start
,
UE
->
proc
.
proc_rxtx
[
i
].
sub_frame_start
,
nb_threads
,
i
);
pthread_create
(
&
UE
->
proc
.
proc_rxtx
[
i
].
pthread_rxtx
,
NULL
,
UE_thread_rxn_txnp4
,
rtd
);
#ifdef UE_SLOT_PARALLELISATION
//pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_slot0_dl_processing,NULL);
//pthread_cond_init(&UE->proc.proc_rxtx[i].cond_slot0_dl_processing,NULL);
//pthread_create(&UE->proc.proc_rxtx[i].pthread_slot0_dl_processing,NULL,UE_thread_slot0_dl_processing, rtd);
pthread_mutex_init
(
&
UE
->
proc
.
proc_rxtx
[
i
].
mutex_slot1_dl_processing
,
NULL
);
pthread_cond_init
(
&
UE
->
proc
.
proc_rxtx
[
i
].
cond_slot1_dl_processing
,
NULL
);
pthread_create
(
&
UE
->
proc
.
proc_rxtx
[
i
].
pthread_slot1_dl_processing
,
NULL
,
UE_thread_slot1_dl_processing
,
rtd
);
#endif
}
pthread_create
(
&
UE
->
proc
.
pthread_synch
,
NULL
,
UE_thread_synch
,(
void
*
)
UE
);
}
...
...
targets/SIMU/USER/oaisim.c
View file @
b5eec87e
...
...
@@ -184,7 +184,7 @@ extern LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
double
cpuf
;
#include "threads_t.h"
threads_t
threads
=
{
-
1
,
-
1
,
-
1
};
threads_t
threads
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
};
//#ifdef XFORMS
int
otg_enabled
;
...
...
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