Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
5e581a4b
Commit
5e581a4b
authored
Feb 22, 2018
by
Cédric Roux
Browse files
Merge remote-tracking branch 'origin/dlsim-ulsim-fix' into develop_integration_2018_w08
parents
5357ef20
1c46dd7c
Changes
33
Hide whitespace changes
Inline
Side-by-side
cmake_targets/CMakeLists.txt
View file @
5e581a4b
...
...
@@ -1300,7 +1300,6 @@ set(L2_SRC
)
set
(
L2_SRC_UE
${
OPENAIR2_DIR
}
/LAYER2/openair2_proc.c
${
PDCP_DIR
}
/pdcp.c
${
PDCP_DIR
}
/pdcp_fifo.c
${
PDCP_DIR
}
/pdcp_sequence_manager.c
...
...
@@ -2148,11 +2147,12 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
${
OPENAIR1_DIR
}
/SIMULATION/LTE_PHY/
${
myExe
}
.c
${
XFORMS_SOURCE
}
${
T_SOURCE
}
${
CONFIG_SOURCES
}
)
target_link_libraries
(
${
myExe
}
-Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS
${
ITTI_LIB
}
LFDS7 -Wl,--end-group
pthread m rt
${
CONFIG_LIBRARIES
}
${
ATLAS_LIBRARIES
}
${
XFORMS_LIBRARIES
}
${
T_LIB
}
pthread m rt
${
CONFIG_LIBRARIES
}
${
ATLAS_LIBRARIES
}
${
XFORMS_LIBRARIES
}
${
T_LIB
}
dl
)
endforeach
(
myExe
)
...
...
openair1/PHY/CODING/crc_byte.c
View file @
5e581a4b
...
...
@@ -109,7 +109,7 @@ crc24a (unsigned char * inptr, int bitlen)
resbit
=
(
bitlen
%
8
);
while
(
octetlen
--
>
0
)
{
//
printf("in %x => crc %x\n",crc,*inptr);
// printf("
crc24a:
in %x => crc %x\n",crc,*inptr);
crc
=
(
crc
<<
8
)
^
crc24aTable
[(
*
inptr
++
)
^
(
crc
>>
24
)];
}
...
...
@@ -128,6 +128,7 @@ unsigned int crc24b (unsigned char * inptr, int bitlen)
resbit
=
(
bitlen
%
8
);
while
(
octetlen
--
>
0
)
{
// printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]);
crc
=
(
crc
<<
8
)
^
crc24bTable
[(
*
inptr
++
)
^
(
crc
>>
24
)];
}
...
...
openair1/PHY/CODING/lte_rate_matching.c
View file @
5e581a4b
...
...
@@ -749,6 +749,10 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
for
(;
(
ind
<
Ncb
)
&&
(
k
<
E
);
ind
++
)
{
if
(
dummy_w
[
ind
]
!=
LTE_NULL
)
{
/*
if ((w[ind]>0 && soft_input2[k]<0) ||
(w[ind]<0 && soft_input2[k]>0))
printf("ind %d: w %d => soft_in %d\n",ind,w[ind],soft_input2[k]);*/
w
[
ind
]
+=
soft_input2
[
k
++
];
#ifdef RM_DEBUG
printf
(
"RM_RX k%d Ind: %d (%d)
\n
"
,
k
-
1
,
ind
,
w
[
ind
]);
...
...
openair1/PHY/INIT/defs.h
View file @
5e581a4b
...
...
@@ -330,19 +330,25 @@ void init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms);
//void copy_lte_parms_to_phy_framing(LTE_DL_FRAME_PARMS *frame_parm, PHY_FRAMING *phy_framing);
void
lte_param_init
(
unsigned
char
N_tx_port_eNB
,
unsigned
char
N_tx
,
unsigned
char
N_rx
,
void
lte_param_init
(
PHY_VARS_eNB
**
eNBp
,
PHY_VARS_UE
**
UEp
,
RU_t
**
rup
,
unsigned
char
N_tx_port_eNB
,
unsigned
char
N_tx_phy
,
unsigned
char
N_rx_ru
,
unsigned
char
N_rx_ue
,
unsigned
char
transmission_mode
,
uint8_t
extended_prefix_flag
,
frame_t
frame_type
,
uint16_t
Nid_cell
,
uint8_t
tdd_config
,
uint8_t
N_RB_DL
,
uint8_t
pa
,
uint8_t
threequarter_fs
,
uint8_t
osf
,
uint32_t
perfect_ce
);
#if defined(Rel10) || defined(Rel14)
void
phy_config_dedicated_scell_ue
(
uint8_t
Mod_id
,
uint8_t
eNB_index
,
...
...
@@ -367,18 +373,6 @@ void phy_config_request(PHY_Config_t *phy_config);
int
init_frame_parms
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
osf
);
void
dump_frame_parms
(
LTE_DL_FRAME_PARMS
*
frame_parms
);
void
lte_param_init
(
unsigned
char
N_tx_port_eNB
,
unsigned
char
N_tx_phy
,
unsigned
char
N_rx
,
unsigned
char
transmission_mode
,
uint8_t
extended_prefix_flag
,
frame_t
frame_type
,
uint16_t
Nid_cell
,
uint8_t
tdd_config
,
uint8_t
N_RB_DL
,
uint8_t
threequarter_fs
,
uint8_t
osf
,
uint32_t
perfect_ce
);
/** @} */
#endif
openair1/PHY/INIT/lte_init.c
View file @
5e581a4b
...
...
@@ -882,11 +882,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
AssertFatal
(
fp
->
N_RB_UL
>
5
,
"fp->N_RB_UL %d < 6
\n
"
,
fp
->
N_RB_UL
);
for
(
i
=
0
;
i
<
2
;
i
++
)
{
// RK 2 times because of output format of FFT!
// FIXME We should get rid of this
, consider also phy_free_lte_eNB()
pusch_vars
[
UE_id
]
->
rxdataF_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
2
*
sizeof
(
int32_t
)
*
fp
->
N_RB_UL
*
12
*
fp
->
symbols_per_tti
);
// FIXME We should get rid of this
pusch_vars
[
UE_id
]
->
rxdataF_ext
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
N_RB_UL
*
12
*
fp
->
symbols_per_tti
);
pusch_vars
[
UE_id
]
->
rxdataF_ext2
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
N_RB_UL
*
12
*
fp
->
symbols_per_tti
);
pusch_vars
[
UE_id
]
->
drs_ch_estimates
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
N_RB_UL
*
12
*
fp
->
symbols_per_tti
);
pusch_vars
[
UE_id
]
->
drs_ch_estimates_time
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
2
*
2
*
sizeof
(
int32_t
)
*
fp
->
ofdm_symbol_size
);
pusch_vars
[
UE_id
]
->
drs_ch_estimates_time
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
2
*
sizeof
(
int32_t
)
*
fp
->
ofdm_symbol_size
);
pusch_vars
[
UE_id
]
->
rxdataF_comp
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
sizeof
(
int32_t
)
*
fp
->
N_RB_UL
*
12
*
fp
->
symbols_per_tti
);
pusch_vars
[
UE_id
]
->
ul_ch_mag
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
symbols_per_tti
*
sizeof
(
int32_t
)
*
fp
->
N_RB_UL
*
12
);
pusch_vars
[
UE_id
]
->
ul_ch_magb
[
i
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
symbols_per_tti
*
sizeof
(
int32_t
)
*
fp
->
N_RB_UL
*
12
);
...
...
openair1/PHY/INIT/lte_init_ru.c
View file @
5e581a4b
...
...
@@ -32,6 +32,11 @@
#include
"assertions.h"
#include
<math.h>
#undef LOG_I
#define LOG_I(A,B,C...) printf(B,C)
#undef LOG_D
#define LOG_D(A,B,C...) printf(B,C)
int
phy_init_RU
(
RU_t
*
ru
)
{
LTE_DL_FRAME_PARMS
*
fp
=
&
ru
->
frame_parms
;
...
...
@@ -60,7 +65,7 @@ int phy_init_RU(RU_t *ru) {
}
}
// IF5 or local RF
else
{
LOG_I
(
PHY
,
"No rxdata/txdata for RU
\n
"
);
//
LOG_I(PHY,"No rxdata/txdata for RU\n");
ru
->
common
.
txdata
=
(
int32_t
**
)
NULL
;
ru
->
common
.
rxdata
=
(
int32_t
**
)
NULL
;
...
...
@@ -91,8 +96,8 @@ int phy_init_RU(RU_t *ru) {
}
/* 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
]),
"nb_antennas_rx too large"
);
//
AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]),
//
"nb_antennas_rx too large");
ru
->
prach_rxsigF
=
(
int16_t
**
)
malloc
(
ru
->
nb_rx
*
sizeof
(
int16_t
*
));
for
(
j
=
0
;
j
<
4
;
j
++
)
ru
->
prach_rxsigF_br
[
j
]
=
(
int16_t
**
)
malloc
(
ru
->
nb_rx
*
sizeof
(
int16_t
*
));
...
...
openair1/PHY/INIT/lte_param_init.c
View file @
5e581a4b
...
...
@@ -32,16 +32,22 @@
extern
PHY_VARS_eNB
*
eNB
;
extern
PHY_VARS_UE
*
UE
;
extern
RU_t
*
ru
;
void
lte_param_init
(
unsigned
char
N_tx_port_eNB
,
void
lte_param_init
(
PHY_VARS_eNB
**
eNBp
,
PHY_VARS_UE
**
UEp
,
RU_t
**
rup
,
unsigned
char
N_tx_port_eNB
,
unsigned
char
N_tx_phy
,
unsigned
char
N_rx
,
unsigned
char
N_rx_ru
,
unsigned
char
N_rx_ue
,
unsigned
char
transmission_mode
,
uint8_t
extended_prefix_flag
,
frame_t
frame_type
,
uint16_t
Nid_cell
,
uint8_t
tdd_config
,
uint8_t
N_RB_DL
,
uint8_t
pa
,
uint8_t
threequarter_fs
,
uint8_t
osf
,
uint32_t
perfect_ce
)
...
...
@@ -49,13 +55,27 @@ void lte_param_init(unsigned char N_tx_port_eNB,
LTE_DL_FRAME_PARMS
*
frame_parms
;
int
i
;
PHY_VARS_eNB
*
eNB
;
PHY_VARS_UE
*
UE
;
RU_t
*
ru
;
printf
(
"Start lte_param_init
\n
"
);
eNB
=
malloc
(
sizeof
(
PHY_VARS_eNB
));
UE
=
malloc
(
sizeof
(
PHY_VARS_UE
));
*
eNBp
=
malloc
(
sizeof
(
PHY_VARS_eNB
));
*
UEp
=
malloc
(
sizeof
(
PHY_VARS_UE
));
*
rup
=
malloc
(
sizeof
(
RU_t
));
eNB
=
*
eNBp
;
UE
=
*
UEp
;
ru
=
*
rup
;
printf
(
"eNB %p, UE %p, ru %p
\n
"
,
eNB
,
UE
,
ru
);
memset
((
void
*
)
eNB
,
0
,
sizeof
(
PHY_VARS_eNB
));
memset
((
void
*
)
UE
,
0
,
sizeof
(
PHY_VARS_UE
));
memset
((
void
*
)
ru
,
0
,
sizeof
(
RU_t
));
ru
->
eNB_list
[
0
]
=
eNB
;
eNB
->
RU_list
[
0
]
=
ru
;
ru
->
num_eNB
=
1
;
srand
(
0
);
randominit
(
0
);
...
...
@@ -71,7 +91,7 @@ void lte_param_init(unsigned char N_tx_port_eNB,
frame_parms
->
Nid_cell
=
Nid_cell
;
frame_parms
->
nushift
=
Nid_cell
%
6
;
frame_parms
->
nb_antennas_tx
=
N_tx_phy
;
frame_parms
->
nb_antennas_rx
=
N_rx
;
frame_parms
->
nb_antennas_rx
=
N_rx
_ru
;
frame_parms
->
nb_antenna_ports_eNB
=
N_tx_port_eNB
;
frame_parms
->
phich_config_common
.
phich_resource
=
oneSixth
;
frame_parms
->
phich_config_common
.
phich_duration
=
normal
;
...
...
@@ -90,12 +110,18 @@ void lte_param_init(unsigned char N_tx_port_eNB,
UE
->
is_secondary_ue
=
0
;
UE
->
frame_parms
=
*
frame_parms
;
eNB
->
frame_parms
=
*
frame_parms
;
UE
->
frame_parms
.
nb_antennas_rx
=
N_rx_ue
;
// eNB->frame_parms = *frame_parms;
ru
->
frame_parms
=
*
frame_parms
;
ru
->
nb_tx
=
N_tx_phy
;
ru
->
nb_rx
=
N_rx_ru
;
ru
->
if_south
=
LOCAL_RF
;
eNB
->
configured
=
1
;
eNB
->
transmission_mode
[
0
]
=
transmission_mode
;
UE
->
transmission_mode
[
0
]
=
transmission_mode
;
init_lte_top
(
frame_parms
);
dump_frame_parms
(
frame_parms
);
UE
->
measurements
.
n_adj_cells
=
0
;
...
...
@@ -105,23 +131,24 @@ void lte_param_init(unsigned char N_tx_port_eNB,
for
(
i
=
0
;
i
<
3
;
i
++
)
lte_gold
(
frame_parms
,
UE
->
lte_gold_table
[
i
],
Nid_cell
+
i
);
init_lte_ue
(
UE
,
1
,
0
);
printf
(
"Calling init_lte_ue_signal
\n
"
);
init_lte_ue_signal
(
UE
,
1
,
0
);
printf
(
"Calling phy_init_lte_eNB
\n
"
);
phy_init_lte_eNB
(
eNB
,
0
,
0
);
printf
(
"Calling phy_init_RU (%p)
\n
"
,
ru
);
phy_init_RU
(
ru
);
generate_pcfich_reg_mapping
(
&
UE
->
frame_parms
);
generate_phich_reg_mapping
(
&
UE
->
frame_parms
);
// DL power control init
//if (transmission_mode == 1) {
UE
->
pdsch_config_dedicated
->
p_a
=
pa
;
if
(
transmission_mode
==
1
||
transmission_mode
==
7
)
{
eNB
->
pdsch_config_dedicated
->
p_a
=
dB0
;
// 4 = 0dB
((
eNB
->
frame_parms
).
pdsch_config_common
).
p_b
=
0
;
UE
->
pdsch_config_dedicated
->
p_a
=
dB0
;
// 4 = 0dB
((
UE
->
frame_parms
).
pdsch_config_common
).
p_b
=
0
;
}
else
{
// rho_a = rhob
eNB
->
pdsch_config_dedicated
->
p_a
=
dBm3
;
// 4 = 0dB
((
eNB
->
frame_parms
).
pdsch_config_common
).
p_b
=
1
;
UE
->
pdsch_config_dedicated
->
p_a
=
dBm3
;
// 4 = 0dB
((
UE
->
frame_parms
).
pdsch_config_common
).
p_b
=
1
;
}
...
...
@@ -130,6 +157,13 @@ void lte_param_init(unsigned char N_tx_port_eNB,
/* the UE code is multi-thread "aware", we need to setup this array */
for
(
i
=
0
;
i
<
10
;
i
++
)
UE
->
current_thread_id
[
i
]
=
i
%
2
;
if
(
eNB
->
frame_parms
.
frame_type
==
TDD
)
{
if
(
eNB
->
frame_parms
.
N_RB_DL
==
100
)
ru
->
N_TA_offset
=
624
;
else
if
(
eNB
->
frame_parms
.
N_RB_DL
==
50
)
ru
->
N_TA_offset
=
624
/
2
;
else
if
(
eNB
->
frame_parms
.
N_RB_DL
==
25
)
ru
->
N_TA_offset
=
624
/
4
;
}
else
ru
->
N_TA_offset
=
0
;
printf
(
"Done lte_param_init
\n
"
);
...
...
openair1/PHY/LTE_ESTIMATION/freq_equalization.c
View file @
5e581a4b
...
...
@@ -306,7 +306,7 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
AssertFatal
(
symbol
<
frame_parms
->
symbols_per_tti
,
"symbol %d >= %d
\n
"
,
symbol
,
frame_parms
->
symbols_per_tti
);
AssertFatal
(
Msc_RS
<
frame_parms
->
N_RB_UL
*
12
,
"Msc_RS %d >= %d
\n
"
,
AssertFatal
(
Msc_RS
<
=
frame_parms
->
N_RB_UL
*
12
,
"Msc_RS %d >= %d
\n
"
,
Msc_RS
,
frame_parms
->
N_RB_UL
*
12
);
for
(
re
=
0
;
re
<
(
Msc_RS
>>
2
);
re
++
)
{
...
...
openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
View file @
5e581a4b
...
...
@@ -34,6 +34,9 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
#define SCALE 0x3FFF
//#undef LOG_D
//#define LOG_D(A,B,C...) printf(B,C)
int32_t
lte_ul_channel_estimation
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
uint8_t
UE_id
,
...
...
@@ -100,7 +103,7 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
return
(
-
1
);
}
//
LOG_
I
(PHY,"subframe %d, Ns %d, l %d, Msc_RS = %d, Msc_RS_idx = %d, u %d, v %d, cyclic_shift %d\n",subframe,Ns,l,Msc_RS, Msc_RS_idx,u,v,cyclic_shift);
LOG_
D
(
PHY
,
"subframe %d, Ns %d, l %d, Msc_RS = %d, Msc_RS_idx = %d, u %d, v %d, cyclic_shift %d
\n
"
,
subframe
,
Ns
,
l
,
Msc_RS
,
Msc_RS_idx
,
u
,
v
,
cyclic_shift
);
#ifdef DEBUG_CH
if
(
Ns
==
0
)
...
...
openair1/PHY/LTE_TRANSPORT/dci.c
View file @
5e581a4b
...
...
@@ -52,6 +52,9 @@
//extern uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3];
//extern uint16_t pcfich_reg[4];
//#undef LOG_D
//#define LOG_D(A,B,C...) printf(B,C)
uint32_t
check_phich_reg
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint32_t
kprime
,
uint8_t
lprime
,
uint8_t
mi
)
{
...
...
@@ -177,7 +180,7 @@ void dci_encoding(uint8_t *a,
// encode dci
#ifdef DEBUG_DCI_ENCODING
printf
(
"Doing DCI encoding for %d bits, e %p, rnti %x
\n
"
,
A
,
e
,
rnti
);
printf
(
"Doing DCI encoding for %d bits, e %p, rnti %x
, E %d
\n
"
,
A
,
e
,
rnti
,
E
);
#endif
memset
((
void
*
)
d
,
LTE_NULL
,
96
);
...
...
@@ -231,18 +234,23 @@ uint8_t *generate_dci0(uint8_t *dci,
coded_bits
=
72
*
aggregation_level
;
/*
#ifdef DEBUG_DCI_ENCODING
for (i=0;i<1+((DCI_LENGTH+16)/8);i++)
for
(
int
i
=
0
;
i
<
1
+
((
DCI_LENGTH
+
16
)
/
8
);
i
++
)
printf
(
"i %d : %x
\n
"
,
i
,
dci
[
i
]);
#endif
*/
if
(
DCI_LENGTH
<=
32
)
{
dci_flip
[
0
]
=
dci
[
3
];
dci_flip
[
1
]
=
dci
[
2
];
dci_flip
[
2
]
=
dci
[
1
];
dci_flip
[
3
]
=
dci
[
0
];
#ifdef DEBUG_DCI_ENCODING
printf
(
"DCI => %x,%x,%x,%x
\n
"
,
dci_flip
[
0
],
dci_flip
[
1
],
dci_flip
[
2
],
dci_flip
[
3
]);
#endif
}
else
{
dci_flip
[
0
]
=
dci
[
7
];
dci_flip
[
1
]
=
dci
[
6
];
...
...
@@ -2271,7 +2279,7 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
/* clear all bits, the above code may generate too much false detections
* (not sure about this, to be checked somehow)
*/
//
memset(e, 0, DCI_BITS_MAX);
// memset(e, 0, DCI_BITS_MAX);
e_ptr
=
e
;
...
...
@@ -2285,11 +2293,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
if
(
dci_alloc
[
i
].
L
==
(
uint8_t
)
L
)
{
#ifdef DEBUG_DCI_ENCODING
if
(
dci_alloc
[
i
].
rnti
==
0x
02
)
LOG_
I
(
PHY
,
"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x
\n
"
,
i
,
num_dci
,
dci_alloc
[
i
].
firstCCE
,
dci_alloc
[
i
].
dci_length
,
dci_alloc
[
i
].
L
,
if
(
dci_alloc
[
i
].
rnti
==
0x
1234
)
LOG_
D
(
PHY
,
"Generating DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x), rnti %x
\n
"
,
i
,
num_dci
,
dci_alloc
[
i
].
firstCCE
,
dci_alloc
[
i
].
dci_length
,
dci_alloc
[
i
].
L
,
*
(
unsigned
int
*
)
dci_alloc
[
i
].
dci_pdu
,
dci_alloc
[
i
].
rnti
);
//
dump_dci(frame_parms,&dci_alloc[i]);
dump_dci
(
frame_parms
,
&
dci_alloc
[
i
]);
#endif
if
(
dci_alloc
[
i
].
firstCCE
>=
0
)
{
...
...
@@ -2894,17 +2902,17 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
LOG_D
(
PHY
,
"[DCI search nPdcch %d - common] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)
\n
"
,
pdcch_vars
[
eNB_id
]
->
num_pdcch_symbols
,
m
,
L2
,
sizeof_bits
,
CCEind
,
nCCE
,
*
CCEmap
,
CCEmap_mask
);
else
LOG_D
(
PHY
,
"[DCI search nPdcch %d - ue spec] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x) format %d
\n
"
,
pdcch_vars
[
eNB_id
]
->
num_pdcch_symbols
,
m
,
L2
,
sizeof_bits
,
CCEind
,
nCCE
,
*
CCEmap
,
CCEmap_mask
,
format_c
);
LOG_D
(
PHY
,
"[DCI search nPdcch %d - ue spec
%x
] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x) format %d
\n
"
,
pdcch_vars
[
eNB_id
]
->
num_pdcch_symbols
,
pdcch_vars
[
eNB_id
]
->
crnti
,
m
,
L2
,
sizeof_bits
,
CCEind
,
nCCE
,
*
CCEmap
,
CCEmap_mask
,
format_c
);
dci_decoding
(
sizeof_bits
,
L
,
&
pdcch_vars
[
eNB_id
]
->
e_rx
[
CCEind
*
72
],
&
dci_decoded_output
[
current_thread_id
][
0
]);
/*
/*
for (i=0;i<3+(sizeof_bits>>3);i++)
printf("dci_decoded_output[%d] => %x\n",i,dci_decoded_output[i]);
*/
printf("dci_decoded_output[%d]
[%d]
=> %x\n",
current_thread_id,
i,dci_decoded_output[
current_thread_id][
i]);
*/
crc
=
(
crc16
(
&
dci_decoded_output
[
current_thread_id
][
0
],
sizeof_bits
)
>>
16
)
^
extract_crc
(
&
dci_decoded_output
[
current_thread_id
][
0
],
sizeof_bits
);
#ifdef DEBUG_DCI_DECODING
...
...
@@ -3823,7 +3831,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
}
else
if
(
tmode
==
3
)
{
LOG_D
(
PHY
,
" Now check UE_SPEC format 2A_2A search aggregation 1 dci length: %d[bits] %d[bytes]
\n
"
,
format2A_size_bits
,
format2A_size_bytes
);
//
LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 1 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes);
// Now check UE_SPEC format 2A_2A search spaces at aggregation 1
old_dci_cnt
=
dci_cnt
;
dci_decoding_procedure0
(
pdcch_vars
,
0
,
mode
,
...
...
@@ -3895,7 +3903,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return
(
dci_cnt
);
// Now check UE_SPEC format 2_2A search spaces at aggregation 4
LOG_D
(
PHY
,
" Now check UE_SPEC format 2_2A search spaces at aggregation 4
\n
"
);
//
LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 4 \n");
old_dci_cnt
=
dci_cnt
;
dci_decoding_procedure0
(
pdcch_vars
,
0
,
mode
,
subframe
,
...
...
@@ -4238,3 +4246,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return
(
dci_cnt
);
}
openair1/PHY/LTE_TRANSPORT/dci_tools.c
View file @
5e581a4b
...
...
@@ -44,6 +44,12 @@
#include
"LAYER2/MAC/extern.h"
#include
"LAYER2/MAC/defs.h"
/*#undef LOG_D
#define LOG_D(A,B,C...) printf(B,C)
#undef LOG_I
#define LOG_I(A,B,C...) printf(B,C)
*/
//#define DEBUG_DCI
uint32_t
localRIV2alloc_LUT6
[
32
];
...
...
@@ -2660,11 +2666,12 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else
if
(
ulsch
->
harq_processes
[
harq_pid
]
->
n_DMRS
==
7
)
ulsch
->
harq_processes
[
harq_pid
]
->
n_DMRS2
=
9
;
LOG_D
(
PHY
,
"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d
\n
"
,
LOG_D
(
PHY
,
"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d
ulsch_pdu:rvidx:%d
\n
"
,
eNB
->
Mod_id
,
harq_pid
,
frame
,
subframe
,
ulsch
->
harq_processes
[
harq_pid
]
->
n_DMRS2
,
ulsch
->
harq_processes
[
harq_pid
]
->
n_DMRS
,
ulsch
->
harq_processes
[
harq_pid
]
->
ndi
,
ulsch_pdu
->
ulsch_pdu_rel8
.
new_data_indication
,
new_ulsch
,
ulsch
->
harq_processes
[
harq_pid
]
->
status
);
ulsch
->
harq_processes
[
harq_pid
]
->
ndi
,
ulsch_pdu
->
ulsch_pdu_rel8
.
new_data_indication
,
new_ulsch
,
ulsch
->
harq_processes
[
harq_pid
]
->
status
,
ulsch_pdu
->
ulsch_pdu_rel8
.
redundancy_version
);
ulsch
->
harq_processes
[
harq_pid
]
->
rvidx
=
ulsch_pdu
->
ulsch_pdu_rel8
.
redundancy_version
;
ulsch
->
harq_processes
[
harq_pid
]
->
Qm
=
ulsch_pdu
->
ulsch_pdu_rel8
.
modulation_type
;
...
...
@@ -4680,13 +4687,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
if
(
harq_pid
>=
8
)
{
LOG_I
(
PHY
,
"bad harq id
\n
"
);
//
LOG_I(PHY,"bad harq id \n");
return
(
0
);
}
if
(
dci_format
==
format1
&&
((
rnti
==
si_rnti
)
||
(
rnti
==
p_rnti
)
||
(
rnti
==
ra_rnti
))
)
{
LOG_I
(
PHY
,
"bad dci format
\n
"
);
//
LOG_I(PHY,"bad dci format \n");
return
(
0
);
}
...
...
@@ -4695,13 +4702,13 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
{
if
(
pdlsch0_harq
->
round
==
0
)
{
LOG_I
(
PHY
,
"bad dci mcs + round
\n
"
);
//
LOG_I(PHY,"bad dci mcs + round \n");
return
(
0
);
}
if
((
rnti
==
si_rnti
)
||
(
rnti
==
p_rnti
)
||
(
rnti
==
ra_rnti
))
{
LOG_I
(
PHY
,
"bad dci mcs + rnti
\n
"
);
//
LOG_I(PHY,"bad dci mcs + rnti \n");
return
(
0
);
}
}
...
...
@@ -4767,7 +4774,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
if
(
rballoc
>
RIV_max
)
{
LOG_I
(
PHY
,
"bad dci rballoc rballoc %d RIV_max %lld
\n
"
,
rballoc
,
RIV_max
);
//
LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max);
// DCI false detection
return
(
0
);
}
...
...
@@ -4775,7 +4782,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
if
(
NPRB
==
0
)
{
// DCI false detection
LOG_I
(
PHY
,
"bad NPRB = 0
\n
"
);
//
LOG_I(PHY,"bad NPRB = 0 \n");
return
(
0
);
}
...
...
@@ -4894,13 +4901,13 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
// I- check dci content minimum coherency
if
(
harq_pid
>=
8
)
{
LOG_I
(
PHY
,
"bad harq pid
\n
"
);
//
LOG_I(PHY,"bad harq pid\n");
return
(
0
);
}
if
(
(
rnti
==
si_rnti
)
||
(
rnti
==
p_rnti
)
||
(
rnti
==
ra_rnti
)
)
{
LOG_I
(
PHY
,
"bad rnti
\n
"
);
//
LOG_I(PHY,"bad rnti\n");
return
(
0
);
}
...
...
@@ -4909,7 +4916,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
{
if
(
pdlsch0_harq
->
round
==
0
)
{
LOG_I
(
PHY
,
"bad mcs1
\n
"
);
//
LOG_I(PHY,"bad mcs1\n");
return
(
0
);
}
}
...
...
@@ -4918,7 +4925,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
{
if
(
pdlsch1_harq
->
round
==
0
)
{
LOG_I
(
PHY
,
"bad mcs2
\n
"
);
//
LOG_I(PHY,"bad mcs2\n");
return
(
0
);
}
}
...
...
@@ -4927,14 +4934,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
if
((
pdlsch0_harq
->
round
==
0
)
&&
(
rv1
>
0
)
&&
(
mcs1
!=
0
))
{
// DCI false detection
LOG_I
(
PHY
,
"bad rv1
\n
"
);
//
LOG_I(PHY,"bad rv1\n");
return
(
0
);
}
if
((
pdlsch1_harq
->
round
==
0
)
&&
(
rv2
>
0
)
&&
(
mcs2
!=
0
))
{
// DCI false detection
LOG_I
(
PHY
,
"bad rv2
\n
"
);
//
LOG_I(PHY,"bad rv2\n");
return
(
0
);
}
...
...
@@ -4995,14 +5002,14 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
if
(
(
rballoc
>
RIV_max
)
&&
(
rah
==
1
)
)
{
// DCI false detection
LOG_I
(
PHY
,
"bad rballoc %d RIV_max %lld
\n
"
,
rballoc
,
RIV_max
);
//
LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max);
return
(
0
);
}
if
(
NPRB
==
0
)
{
// DCI false detection
LOG_I
(
PHY
,
"bad NPRB
\n
"
);
//
LOG_I(PHY,"bad NPRB\n");
return
(
0
);
}
...
...
@@ -5026,7 +5033,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
pdsch_vars
->
llr_offset
[
pdcch_vars
->
num_pdcch_symbols
]
=
0
;
//
LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm);
LOG_I
(
PHY
,
"compute_llr_offset: nb RB %d - Qm %d
\n
"
,
nb_rb_alloc
,
dlsch0_harq
->
Qm
);
//dlsch0_harq->rb_alloc_even;
//dlsch0_harq->rb_alloc_odd;
...
...
@@ -5056,15 +5063,15 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
if
(
symbol
<
(
frame_parms
->
symbols_per_tti
-
1
))
pdsch_vars
->
llr_offset
[
symbol
+
1
]
=
pdsch_vars
->
llr_offset
[
symbol
]
+
llr_offset
;
//
LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb);
//
LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re);
//
LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re);
//
LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re);
LOG_I
(
PHY
,
"Granted Re subframe %d / symbol %d => %d (%d RBs)
\n
"
,
subframe
,
symbol_mod
,
granted_re
,
dlsch0_harq
->
nb_rb
);
LOG_I
(
PHY
,
"Pbch/PSS/SSS Re subframe %d / symbol %d => %d
\n
"
,
subframe
,
symbol_mod
,
pbch_pss_sss_re
);
LOG_I
(
PHY
,
"CRS Re Per PRB subframe %d / symbol %d => %d
\n
"
,
subframe
,
symbol_mod
,
crs_re
);
LOG_I
(
PHY
,
"Data Re subframe %d / symbol %d => %d
\n
"
,
subframe
,
symbol_mod
,
data_re
);
//
LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol,
//
pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]);
LOG_I
(
PHY
,
"Data Re subframe %d-symbol %d => llr length %d, llr offset %d
\n
"
,
subframe
,
symbol
,
pdsch_vars
->
llr_length
[
symbol
],
pdsch_vars
->
llr_offset
[
symbol
]);
}
}
void
prepare_dl_decoding_format1_1A
(
DCI_format_t
dci_format
,
...
...
@@ -5179,7 +5186,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
//packet was actually decoded in previous transmission (ACK was missed by eNB)
//However, the round is not a good check as it might have been decoded in a retransmission prior to this one.
{
LOG_D
(
PHY
,
"skip pdsch decoding and report ack
\n
"
);
//
LOG_D(PHY,"skip pdsch decoding and report ack\n");
// skip pdsch decoding and report ack
//pdlsch0_harq->status = SCH_IDLE;
pdlsch0
->
active
=
0
;
...
...
@@ -5804,7 +5811,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
//LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW0 subframe %d (pid %d, round %d)\n",
// subframe,harq_pid,dlsch0_harq->round);
if
(
dlsch0_harq
->
first_tx
==
1
)
{
LOG_D
(
PHY
,
"Format 2 DCI First TX0: Clearing flag
\n
"
);
//
LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n");