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
alex037yang
OpenXG-RAN
Commits
d87e131c
Commit
d87e131c
authored
Dec 07, 2018
by
Guy De Souza
Browse files
Options
Browse Files
Download
Plain Diff
PBCH corrections
parents
a63c08d3
58f1dd5e
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
684 additions
and
625 deletions
+684
-625
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-1
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
+1
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
+3
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+3
-2
openair1/PHY/INIT/nr_parms.c
openair1/PHY/INIT/nr_parms.c
+2
-0
openair1/PHY/MODULATION/slot_fep_nr.c
openair1/PHY/MODULATION/slot_fep_nr.c
+13
-7
openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
+76
-71
openair1/PHY/NR_TRANSPORT/nr_dci.c
openair1/PHY/NR_TRANSPORT/nr_dci.c
+22
-12
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
+81
-75
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+3
-3
openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+177
-167
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+1
-1
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+11
-11
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+5
-0
openair1/SCHED_NR/fapi_nr_l1.c
openair1/SCHED_NR/fapi_nr_l1.c
+8
-8
openair1/SCHED_NR/phy_procedures_nr_common.c
openair1/SCHED_NR/phy_procedures_nr_common.c
+1
-1
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+15
-16
openair1/SCHED_NR/sched_nr.h
openair1/SCHED_NR/sched_nr.h
+10
-10
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+174
-173
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+12
-7
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+4
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+9
-8
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+12
-8
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+8
-8
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
+25
-25
openair2/NR_PHY_INTERFACE/NR_IF_Module.h
openair2/NR_PHY_INTERFACE/NR_IF_Module.h
+7
-7
No files found.
cmake_targets/CMakeLists.txt
View file @
d87e131c
...
...
@@ -1647,7 +1647,7 @@ set ( NR_LTE_UE_REUSE_SRC
${
OPENAIR1_DIR
}
/PHY/CODING/viterbi.c
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/phich_common.c
${
OPENAIR1_DIR
}
/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c
${
OPENAIR1_DIR
}
/PHY/LTE_TRANSPORT/dci_tools_common.c
#
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c
${
OPENAIR1_DIR
}
/PHY/CODING/lte_rate_matching.c
${
OPENAIR1_DIR
}
/PHY/CODING/ccoding_byte_lte.c
${
OPENAIR1_DIR
}
/PHY/CODING/ccoding_byte.c
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
View file @
d87e131c
...
...
@@ -452,7 +452,7 @@ typedef struct {
uint8_t
rnti_type
;
uint8_t
dci_format
;
/// Number of CRB in BWP that this DCI configures
uint
8
_t
n_RB_BWP
;
uint
16
_t
n_RB_BWP
;
uint8_t
config_type
;
uint8_t
search_space_type
;
uint8_t
aggregation_level
;
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
View file @
d87e131c
...
...
@@ -1079,11 +1079,13 @@ uint32_t polar_decoder_int16(int16_t *input,
int16_t
d_tilde
[
polarParams
->
N
];
// = malloc(sizeof(double) * polarParams->N);
for
(
int
i
=
0
;
i
<
polarParams
->
encoderLength
;
i
++
)
printf
(
"polar_input_RMin[%d] %d
\n
"
,
i
,
input
[
i
]);
nr_polar_rate_matching_int16
(
input
,
d_tilde
,
polarParams
->
rate_matching_pattern
,
polarParams
->
K
,
polarParams
->
N
,
polarParams
->
encoderLength
);
for
(
int
i
=
0
;
i
<
polarParams
->
N
;
i
++
)
{
if
(
d_tilde
[
i
]
<-
128
)
d_tilde
[
i
]
=-
128
;
else
if
(
d_tilde
[
i
]
>
127
)
d_tilde
[
i
]
=
128
;
}
for
(
int
i
=
0
;
i
<
polarParams
->
encoderLength
;
i
++
)
printf
(
"polar_input_RMout[%d] %d
\n
"
,
i
,
d_tilde
[
i
]);
memcpy
((
void
*
)
&
polarParams
->
tree
.
root
->
alpha
[
0
],(
void
*
)
&
d_tilde
[
0
],
sizeof
(
int16_t
)
*
polarParams
->
N
);
generic_polar_decoder
(
polarParams
,
polarParams
->
tree
.
root
);
...
...
@@ -1149,7 +1151,7 @@ uint32_t polar_decoder_int16(int16_t *input,
crc
=
(
uint64_t
)(
crc24c
(
A64_flip
,
len
)
>>
8
);
}
#if
0
#if
1
printf
(
"A %llx B %llx|%llx Cprime %llx|%llx (crc %x,rxcrc %llx %d)
\n
"
,
Ar
,
B
[
1
],
B
[
0
],
Cprime
[
1
],
Cprime
[
0
],
crc
,
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
View file @
d87e131c
...
...
@@ -30,7 +30,7 @@
* \warning
*/
//
#define DEBUG_POLAR_ENCODER
#define DEBUG_POLAR_ENCODER
//#define DEBUG_POLAR_ENCODER_DCI
//#define DEBUG_POLAR_ENCODER_TIMING
...
...
@@ -391,7 +391,8 @@ void polar_encoder_fast(uint64_t *A,
t_nrPolar_paramsPtr
polarParams
)
{
AssertFatal
(
polarParams
->
K
>
32
,
"K = %d < 33, is not supported yet
\n
"
,
polarParams
->
K
);
AssertFatal
(
polarParams
->
K
<
129
,
"K = %d > 64, is not supported yet
\n
"
,
polarParams
->
K
);
AssertFatal
(
polarParams
->
K
<
129
,
"K = %d > 128, is not supported yet
\n
"
,
polarParams
->
K
);
AssertFatal
(
polarParams
->
payloadBits
<
65
,
"payload bits = %d > 64, is not supported yet
\n
"
,
polarParams
->
payloadBits
);
uint64_t
B
[
4
]
=
{
0
,
0
,
0
,
0
},
Cprime
[
4
]
=
{
0
,
0
,
0
,
0
};
int
bitlen
=
polarParams
->
payloadBits
;
...
...
openair1/PHY/INIT/nr_parms.c
View file @
d87e131c
...
...
@@ -159,6 +159,8 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
fp
->
symbols_per_slot
=
((
Ncp
==
NORMAL
)
?
14
:
12
);
// to redefine for different slot formats
fp
->
samples_per_subframe_wCP
=
fp
->
ofdm_symbol_size
*
fp
->
symbols_per_slot
*
fp
->
slots_per_subframe
;
fp
->
samples_per_frame_wCP
=
10
*
fp
->
samples_per_subframe_wCP
;
fp
->
samples_per_slot_wCP
=
fp
->
symbols_per_slot
*
fp
->
ofdm_symbol_size
;
fp
->
samples_per_slot
=
fp
->
nb_prefix_samples0
+
((
fp
->
symbols_per_slot
-
1
)
*
fp
->
nb_prefix_samples
)
+
(
fp
->
symbols_per_slot
*
fp
->
ofdm_symbol_size
);
fp
->
samples_per_subframe
=
(
fp
->
samples_per_subframe_wCP
+
(
fp
->
nb_prefix_samples0
*
fp
->
slots_per_subframe
)
+
(
fp
->
nb_prefix_samples
*
fp
->
slots_per_subframe
*
(
fp
->
symbols_per_slot
-
1
)));
fp
->
samples_per_frame
=
10
*
fp
->
samples_per_subframe
;
...
...
openair1/PHY/MODULATION/slot_fep_nr.c
View file @
d87e131c
...
...
@@ -29,6 +29,11 @@
#define SOFFSET 0
/*#ifdef LOG_I
#undef LOG_I
#define LOG_I(A,B...) printf(A)
#endif*/
int
nr_slot_fep
(
PHY_VARS_NR_UE
*
ue
,
unsigned
char
l
,
unsigned
char
Ns
,
...
...
@@ -49,8 +54,8 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
//int i;
unsigned
int
frame_length_samples
=
frame_parms
->
samples_per_subframe
*
10
;
unsigned
int
rx_offset
;
//
NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[ue->current_thread_id[Ns>>1]][0];
uint16_t
coreset_start_subcarrier
=
frame_parms
->
first_carrier_offset
+
516
;
NR_UE_PDCCH
*
pdcch_vars
=
ue
->
pdcch_vars
[
ue
->
current_thread_id
[
Ns
>>
1
]][
0
];
uint16_t
coreset_start_subcarrier
=
frame_parms
->
first_carrier_offset
+
((
int
)
floor
(
frame_parms
->
ssb_start_subcarrier
/
NR_NB_SC_PER_RB
)
+
pdcch_vars
->
coreset
[
0
].
rb_offset
)
*
NR_NB_SC_PER_RB
;
uint16_t
nb_rb_coreset
=
24
;
uint16_t
bwp_start_subcarrier
=
frame_parms
->
first_carrier_offset
;
uint16_t
nb_rb_pdsch
=
100
;
...
...
@@ -128,6 +133,12 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
// Align with 256 bit
// rx_offset = rx_offset&0xfffffff8;
#ifdef DEBUG_FEP
// if (ue->frame <100)
/*LOG_I(PHY,*/
printf
(
"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
(
l
==
0
)
{
if
(
rx_offset
>
(
frame_length_samples
-
frame_parms
->
ofdm_symbol_size
))
...
...
@@ -156,11 +167,6 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
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
],
...
...
openair1/PHY/NR_REFSIG/nr_dmrs_rx.c
View file @
d87e131c
...
...
@@ -20,17 +20,18 @@
*/
/*! \file PHY/NR_REFSIG/nr_dl_dmrs.c
* \brief Top-level routines for generating DMRS from 38-211
* \author
* \date 2018
* \version 0.1
* \company Eurecom
* \email:
* \note
* \warning
*/
* \brief Top-level routines for generating DMRS from 38-211
* \author
* \date 2018
* \version 0.1
* \company Eurecom
* \email:
* \note
* \warning
*/
//#define DEBUG_DL_DMRS
#define DEBUG_PDCCH
//#define NR_PBCH_DMRS_LENGTH_DWORD 5
//#define NR_PBCH_DMRS_LENGTH 144
...
...
@@ -44,6 +45,10 @@
//#include "nr_mod_table.h"
#include "common/utils/LOG/log.h"
#ifdef LOG_I
#undef LOG_I
#define LOG_I(A,B...) printf(B)
#endif
/*Table 7.4.1.1.2-1/2 from 38.211 */
int
wf1
[
8
][
2
]
=
{{
1
,
1
},{
1
,
-
1
},{
1
,
1
},{
1
,
-
1
},{
1
,
1
},{
1
,
-
1
},{
1
,
1
},{
1
,
1
}};
int
wt1
[
8
][
2
]
=
{{
1
,
1
},{
1
,
1
},{
1
,
1
},{
1
,
1
},{
1
,
-
1
},{
1
,
-
1
},{
1
,
-
1
},{
1
,
-
1
}};
...
...
@@ -54,14 +59,14 @@ int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1
short
nr_rx_mod_table
[
NR_MOD_TABLE_SIZE_SHORT
]
=
{
0
,
0
,
23170
,
-
23170
,
-
23170
,
23170
,
23170
,
-
23170
,
23170
,
23170
,
-
23170
,
-
23170
,
-
23170
,
23170
};
/*int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
uint8_t eNB_offset,
unsigned int Ns,
unsigned int nr_gold_pdcch[7][20][3][10],
int32_t *output,
unsigned short p,
int length_dmrs,
unsigned short nb_rb_coreset)
{
uint8_t eNB_offset,
unsigned int Ns,
unsigned int nr_gold_pdcch[7][20][3][10],
int32_t *output,
unsigned short p,
int length_dmrs,
unsigned short nb_rb_coreset)
{
int32_t qpsk[4],n;
int w,ind,l,ind_dword,ind_qpsk_symb,kp,k;
short pamp;
...
...
@@ -78,32 +83,32 @@ short nr_rx_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,23170,-23170,-23170,23170,
((short *)&qpsk[3])[1] = pamp;
if (p==2000) {
for (n=0; n<nb_rb_coreset*3; n++) {
for (l =0; l<length_dmrs; l++){
for (kp=0; kp<3; kp++){
for (n=0; n<nb_rb_coreset*3; n++) {
for (l =0; l<length_dmrs; l++){
for (kp=0; kp<3; kp++){
ind = 3*n+kp;
ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
ind = 3*n+kp;
ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf;
output[k] = qpsk[(nr_gold_pdcch[eNB_offset][Ns][l][ind_dword]>>(2*ind_qpsk_symb))&3];
output[k] = qpsk[(nr_gold_pdcch[eNB_offset][Ns][l][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_DMRS
LOG_I(PHY,"Ns %d, p %d, ind_dword %d, ind_qpsk_symbol %d\n",
Ns,p,idx_dword,idx_qpsk_symb);
LOG_I(PHY,"index = %d\n",(nr_gold_pdsch[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif
#ifdef DEBUG_DL_DMRS
LOG_I(PHY,"Ns %d, p %d, ind_dword %d, ind_qpsk_symbol %d\n",
Ns,p,idx_dword,idx_qpsk_symb);
LOG_I(PHY,"index = %d\n",(nr_gold_pdsch[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif
k++;
}
}
}
k++;
}
}
}
} else {
LOG_E(PHY,"Illegal PDCCH DMRS port %d\n",p);
LOG_E(PHY,"Illegal PDCCH DMRS port %d\n",p);
}
return(0);
}*/
}*/
int
nr_pdsch_dmrs_rx
(
PHY_VARS_NR_UE
*
ue
,
uint8_t
eNB_offset
,
...
...
@@ -152,34 +157,34 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
wt
=
(
config_type
==
0
)
?
wt1
:
wt2
;
if
(
config_type
>
1
)
LOG_E
(
PHY
,
"Bad PDSCH DMRS config type %d
\n
"
,
config_type
);
LOG_E
(
PHY
,
"Bad PDSCH DMRS config type %d
\n
"
,
config_type
);
if
((
p
>=
1000
)
&&
(
p
<
((
config_type
==
0
)
?
1008
:
1012
)))
{
// r_n from 38.211 7.4.1.1
for
(
n
=
0
;
n
<
nb_rb_pdsch
*
((
config_type
==
0
)
?
3
:
2
);
n
++
)
{
for
(
lp
=
0
;
lp
<
length_dmrs
;
lp
++
){
for
(
kp
=
0
;
kp
<
2
;
kp
++
){
w
=
(
wf
[
p
-
1000
][
kp
])
*
(
wt
[
p
-
1000
][
lp
]);
qpsk_p
=
(
w
==
1
)
?
qpsk
:
nqpsk
;
// r_n from 38.211 7.4.1.1
for
(
n
=
0
;
n
<
nb_rb_pdsch
*
((
config_type
==
0
)
?
3
:
2
);
n
++
)
{
for
(
lp
=
0
;
lp
<
length_dmrs
;
lp
++
){
for
(
kp
=
0
;
kp
<
2
;
kp
++
){
w
=
(
wf
[
p
-
1000
][
kp
])
*
(
wt
[
p
-
1000
][
lp
]);
qpsk_p
=
(
w
==
1
)
?
qpsk
:
nqpsk
;
ind
=
2
*
n
+
kp
;
ind_dword
=
ind
>>
4
;
ind_qpsk_symb
=
ind
&
0xf
;
ind
=
2
*
n
+
kp
;
ind_dword
=
ind
>>
4
;
ind_qpsk_symb
=
ind
&
0xf
;
output
[
k
]
=
qpsk_p
[(
nr_gold_pdsch
[
0
][
Ns
][
lp
][
ind_dword
]
>>
(
2
*
ind_qpsk_symb
))
&
3
];
output
[
k
]
=
qpsk_p
[(
nr_gold_pdsch
[
0
][
Ns
][
lp
][
ind_dword
]
>>
(
2
*
ind_qpsk_symb
))
&
3
];
#ifdef DEBUG_DL_DMRS
LOG_I
(
PHY
,
"Ns %d, p %d, ind_dword %d, ind_qpsk_symbol %d
\n
"
,
Ns
,
p
,
i
dx_dword
,
idx
_qpsk_symb
);
LOG_I
(
PHY
,
"index = %d
\n
"
,(
nr_gold_pdsch
[
0
][
Ns
][
lp
rime
][
ind_dword
]
>>
(
2
*
ind_qpsk_symb
))
&
3
);
Ns
,
p
,
i
nd_dword
,
ind
_qpsk_symb
);
LOG_I
(
PHY
,
"index = %d
\n
"
,(
nr_gold_pdsch
[
0
][
Ns
][
lp
][
ind_dword
]
>>
(
2
*
ind_qpsk_symb
))
&
3
);
#endif
k
++
;
}
}
}
k
++
;
}
}
}
}
else
{
LOG_E
(
PHY
,
"Illegal p %d PDSCH DMRS port
\n
"
,
p
);
}
...
...
@@ -188,32 +193,32 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
}
int
nr_pdcch_dmrs_rx
(
PHY_VARS_NR_UE
*
ue
,
uint8_t
eNB_offset
,
unsigned
int
Ns
,
unsigned
int
*
nr_gold_pdcch
,
int32_t
*
output
,
unsigned
short
p
,
unsigned
short
nb_rb_coreset
)
uint8_t
eNB_offset
,
unsigned
int
Ns
,
unsigned
int
*
nr_gold_pdcch
,
int32_t
*
output
,
unsigned
short
p
,
unsigned
short
nb_rb_coreset
)
{
uint8_t
idx
=
0
;
//uint8_t pdcch_rb_offset =0;
//nr_gold_pdcch += ((int)floor(ue->frame_parms.ssb_start_subcarrier/12)+pdcch_rb_offset)*3/32;
uint8_t
idx
=
0
;
//uint8_t pdcch_rb_offset =0;
//nr_gold_pdcch += ((int)floor(ue->frame_parms.ssb_start_subcarrier/12)+pdcch_rb_offset)*3/32;
if
(
p
==
2000
)
{
for
(
int
i
=
0
;
i
<
((
nb_rb_coreset
*
6
)
>>
1
);
i
++
)
{
idx
=
((((
nr_gold_pdcch
[(
i
<<
1
)
>>
5
])
>>
((
i
<<
1
)
&
0x1f
))
&
1
)
<<
1
)
^
(((
nr_gold_pdcch
[((
i
<<
1
)
+
1
)
>>
5
])
>>
(((
i
<<
1
)
+
1
)
&
0x1f
))
&
1
);
((
int16_t
*
)
output
)[
i
<<
1
]
=
nr_rx_mod_table
[(
NR_MOD_TABLE_QPSK_OFFSET
+
idx
)
<<
1
];
((
int16_t
*
)
output
)[(
i
<<
1
)
+
1
]
=
nr_rx_mod_table
[((
NR_MOD_TABLE_QPSK_OFFSET
+
idx
)
<<
1
)
+
1
];
if
(
p
==
2000
)
{
for
(
int
i
=
0
;
i
<
((
nb_rb_coreset
*
6
)
>>
1
);
i
++
)
{
idx
=
((((
nr_gold_pdcch
[(
i
<<
1
)
>>
5
])
>>
((
i
<<
1
)
&
0x1f
))
&
1
)
<<
1
)
^
(((
nr_gold_pdcch
[((
i
<<
1
)
+
1
)
>>
5
])
>>
(((
i
<<
1
)
+
1
)
&
0x1f
))
&
1
);
((
int16_t
*
)
output
)[
i
<<
1
]
=
nr_rx_mod_table
[(
NR_MOD_TABLE_QPSK_OFFSET
+
idx
)
<<
1
];
((
int16_t
*
)
output
)[(
i
<<
1
)
+
1
]
=
nr_rx_mod_table
[((
NR_MOD_TABLE_QPSK_OFFSET
+
idx
)
<<
1
)
+
1
];
#ifdef DEBUG_PDCCH
if
(
i
<
8
)
printf
(
"i %d idx %d pdcch gold %u b0-b1 %d-%d mod_dmrs %d %d
\n
"
,
i
,
idx
,
nr_gold_pdcch
[(
i
<<
1
)
>>
5
],
(((
nr_gold_pdcch
[(
i
<<
1
)
>>
5
])
>>
((
i
<<
1
)
&
0x1f
))
&
1
),
(((
nr_gold_pdcch
[((
i
<<
1
)
+
1
)
>>
5
])
>>
(((
i
<<
1
)
+
1
)
&
0x1f
))
&
1
),
((
int16_t
*
)
output
)[
i
<<
1
],
((
int16_t
*
)
output
)[(
i
<<
1
)
+
1
],
&
output
[
0
]);
printf
(
"i %d idx %d pdcch gold %u b0-b1 %d-%d mod_dmrs %d %d
\n
"
,
i
,
idx
,
nr_gold_pdcch
[(
i
<<
1
)
>>
5
],
(((
nr_gold_pdcch
[(
i
<<
1
)
>>
5
])
>>
((
i
<<
1
)
&
0x1f
))
&
1
),
(((
nr_gold_pdcch
[((
i
<<
1
)
+
1
)
>>
5
])
>>
(((
i
<<
1
)
+
1
)
&
0x1f
))
&
1
),
((
int16_t
*
)
output
)[
i
<<
1
],
((
int16_t
*
)
output
)[(
i
<<
1
)
+
1
],
&
output
[
0
]);
#endif
}
}
}
}
return
(
0
);
return
(
0
);
}
int
nr_pbch_dmrs_rx
(
int
symbol
,
unsigned
int
*
nr_gold_pbch
,
int32_t
*
output
)
...
...
openair1/PHY/NR_TRANSPORT/nr_dci.c
View file @
d87e131c
...
...
@@ -32,11 +32,12 @@
#include "nr_dci.h"
//
#define DEBUG_PDCCH_DMRS
//
#define DEBUG_DCI
//
#define DEBUG_CHANNEL_CODING
#define DEBUG_PDCCH_DMRS
#define DEBUG_DCI
#define DEBUG_CHANNEL_CODING
#define PDCCH_TEST_POLAR_TEMP_FIX
extern
short
nr_mod_table
[
NR_MOD_TABLE_SIZE_SHORT
];
uint16_t
nr_get_dci_size
(
nfapi_nr_dci_format_e
format
,
...
...
@@ -148,11 +149,12 @@ void nr_pdcch_scrambling(uint32_t *in,
s
=
lte_gold_generic
(
&
x1
,
&
x2
,
reset
);
reset
=
0
;
if
(
i
){
in
++
;
out
++
;
}
in
++
;
out
++
;
}
}
(
*
out
)
^=
((((
*
in
)
>>
(
i
&
0x1f
))
&
1
)
^
((
s
>>
(
i
&
0x1f
))
&
1
))
<<
(
i
&
0x1f
);
printf
(
"nr_pdcch_scrambling: in %d => out %d
\n
"
,((
*
in
)
>>
(
i
&
0x1f
))
&
1
,((
*
out
)
>>
(
i
&
0x1f
))
&
1
);
}
}
...
...
@@ -184,10 +186,12 @@ uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars,
* in frequency: the first subcarrier is obtained by adding the first CRB overlapping the SSB and the rb_offset
* in time: by its first slot and its first symbol*/
uint16_t
cset_start_sc
=
frame_parms
.
first_carrier_offset
+
((
int
)
floor
(
frame_parms
.
ssb_start_subcarrier
/
NR_NB_SC_PER_RB
)
+
pdcch_params
.
rb_offset
)
*
NR_NB_SC_PER_RB
;
uint8_t
cset_start_symb
=
pdcch_params
.
first_slot
*
frame_parms
.
symbols_per_slot
+
pdcch_params
.
first_symbol
;
// uint8_t cset_start_symb = pdcch_params.first_slot*frame_parms.symbols_per_slot + pdcch_params.first_symbol;
uint8_t
cset_start_symb
=
pdcch_params
.
first_symbol
;
uint8_t
cset_nsymb
=
pdcch_params
.
n_symb
;
dci_idx
=
0
;
/// DMRS QPSK modulation
/*There is a need to shift from which index the pregenerated DMRS sequence is used
* see 38211 r15.2.0 section 7.4.1.3.2: assumption is the reference point for k refers to the DMRS sequence*/
...
...
@@ -277,12 +281,12 @@ printf("scrambled output: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%0
}
}
#ifdef DEBUG_DCI
printf
(
"
\n
Ordered REG list:
\n
"
);
for
(
int
i
=
0
;
i
<
nb_regs
;
i
++
)
printf
(
"%d
\t
"
,
reg_mapping_list
[
i
].
reg_idx
);
printf
(
"
\n
"
);
printf
(
"
\n
Ordered REG list:
\n
"
);
for
(
int
i
=
0
;
i
<
nb_regs
;
i
++
)
printf
(
"%d
\t
"
,
reg_mapping_list
[
i
].
reg_idx
);
printf
(
"
\n
"
);
#endif
if
(
pdcch_params
.
precoder_granularity
==
NFAPI_NR_CSET_ALL_CONTIGUOUS_RBS
)
{
/*in this case the DMRS are mapped on all the coreset*/
for
(
l
=
cset_start_symb
;
l
<
cset_start_symb
+
cset_nsymb
;
l
++
)
{
...
...
@@ -291,6 +295,9 @@ printf("\n");
while
(
dmrs_idx
<
3
*
pdcch_params
.
n_rb
)
{
((
int16_t
*
)
txdataF
[
aa
])[(
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
]
=
(
a
*
mod_dmrs
[
l
][
dmrs_idx
<<
1
])
>>
15
;
((
int16_t
*
)
txdataF
[
aa
])[((
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]
=
(
a
*
mod_dmrs
[
l
][(
dmrs_idx
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_PDCCH_DMRS
printf
(
"symbol %d position %d => (%d,%d)
\n
"
,
l
,
k
,((
int16_t
*
)
txdataF
[
aa
])[(
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
]
,
((
int16_t
*
)
txdataF
[
aa
])[((
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]);
#endif
k
+=
4
;
if
(
k
>=
frame_parms
.
ofdm_symbol_size
)
k
-=
frame_parms
.
ofdm_symbol_size
;
...
...
@@ -314,6 +321,9 @@ printf("\n");
if
(
pdcch_params
.
precoder_granularity
==
NFAPI_NR_CSET_SAME_AS_REG_BUNDLE
)
{
((
int16_t
*
)
txdataF
[
aa
])[(
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
]
=
(
a
*
mod_dmrs
[
l
][
dmrs_idx
<<
1
])
>>
15
;
((
int16_t
*
)
txdataF
[
aa
])[((
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]
=
(
a
*
mod_dmrs
[
l
][(
dmrs_idx
<<
1
)
+
1
])
>>
15
;
#ifdef DEBUG_PDCCH_DMRS
printf
(
"l %d position %d => (%d,%d)
\n
"
,
l
,
k
,((
int16_t
*
)
txdataF
[
aa
])[(
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
]
,
((
int16_t
*
)
txdataF
[
aa
])[((
l
*
frame_parms
.
ofdm_symbol_size
+
k
)
<<
1
)
+
1
]);
#endif
k_prime
++
;
dmrs_idx
++
;
}
...
...
openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
View file @
d87e131c
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
View file @
d87e131c
...
...
@@ -295,7 +295,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
fm
=
filt16a_m1
;
fr
=
filt16a_r1
;
// generate pilot
// generate pilot
nr_pdcch_dmrs_rx
(
ue
,
eNB_offset
,
Ns
,
ue
->
nr_gold_pdcch
[
eNB_offset
][
Ns
][
symbol
],
&
pilot
[
0
],
2000
,
nb_rb_coreset
);
for
(
aarx
=
0
;
aarx
<
ue
->
frame_parms
.
nb_antennas_rx
;
aarx
++
)
{
...
...
@@ -315,7 +315,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
printf
(
"rxF addr %p
\n
"
,
rxF
);
printf
(
"dl_ch addr %p
\n
"
,
dl_ch
);
//#endif
if
((
ue
->
frame_parms
.
N_RB_DL
&
1
)
==
0
)
{
//
if ((ue->frame_parms.N_RB_DL&1)==0) {
// Treat first 2 pilots specially (left edge)
ch
[
0
]
=
(
int16_t
)(((
int32_t
)
pil
[
0
]
*
rxF
[
0
]
-
(
int32_t
)
pil
[
1
]
*
rxF
[
1
])
>>
15
);
...
...
@@ -421,7 +421,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
}
}
//
}
}
...
...
openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
View file @
d87e131c
This diff is collapsed.
Click to expand it.
openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
View file @
d87e131c
...
...
@@ -1638,7 +1638,7 @@ uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms,
uint8_t
tdd_mapindex
,
uint16_t
Nf
);
void
nr_pdcch_unscrambling
(
uint16_t
crnti
,
NR_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
nr_tti_rx
,
u
int16_t
*
z
,
uint32_t
length
,
uint16_t
pdcch_DMRS_scrambling_id
,
int
do_common
);
int16_t
*
z
,
uint32_t
length
,
uint16_t
pdcch_DMRS_scrambling_id
,
int
do_common
);
uint32_t
lte_gold_generic
(
uint32_t
*
x1
,
uint32_t
*
x2
,
uint8_t
reset
);
...
...
openair1/PHY/defs_gNB.h
View file @
d87e131c
...
...
@@ -83,16 +83,16 @@ typedef struct {
}
NR_gNB_COMMON
;
/// Context data structure for RX/TX portion of s
ubframe
processing
/// Context data structure for RX/TX portion of s
lot
processing
typedef
struct
{
/// Component Carrier index
uint8_t
CC_id
;
/// timestamp transmitted to HW
openair0_timestamp
timestamp_tx
;
/// s
ubframe
to act upon for transmission
int
s
ubframe
_tx
;
/// s
ubframe
to act upon for reception
int
s
ubframe
_rx
;
/// s
lot
to act upon for transmission
int
s
lot
_tx
;
/// s
lot
to act upon for reception
int
s
lot
_rx
;
/// frame to act upon for transmission
int
frame_tx
;
/// frame to act upon for reception
...
...
@@ -120,7 +120,7 @@ typedef struct {
}
gNB_L1_rxtx_proc_t
;
/// Context data structure for eNB s
ubframe
processing
/// Context data structure for eNB s
lot
processing
typedef
struct
gNB_L1_proc_t_s
{
/// Component Carrier index
uint8_t
CC_id
;
...
...
@@ -130,10 +130,10 @@ typedef struct gNB_L1_proc_t_s {
openair0_timestamp
timestamp_rx
;
/// timestamp to send to "slave rru"
openair0_timestamp
timestamp_tx
;
/// s
ubframe
to act upon for reception
int
s
ubframe
_rx
;
/// s
ubframe
to act upon for PRACH
int
s
ubframe
_prach
;
/// s
lot
to act upon for reception
int
s
lot
_rx
;
/// s
lot
to act upon for PRACH
int
s
lot
_prach
;
/// frame to act upon for reception
int
frame_rx
;
/// frame to act upon for transmission
...
...
@@ -391,7 +391,7 @@ typedef struct PHY_VARS_gNB_s {
/// cba_last successful reception for each group, used for collision detection
uint8_t
cba_last_reception
[
4
];
// Pointers for active physicalConfigDedicated to be applied in current s
ubframe
// Pointers for active physicalConfigDedicated to be applied in current s
lot
struct
PhysicalConfigDedicated
*
physicalConfigDedicated
[
NUMBER_OF_UE_MAX
];
...
...
openair1/PHY/defs_nr_common.h
View file @
d87e131c
...
...
@@ -40,6 +40,7 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#define nr_subframe_t lte_subframe_t
#define nr_slot_t lte_subframe_t
#define MAX_NUM_SUBCARRIER_SPACING 5
...
...
@@ -209,12 +210,16 @@ typedef struct NR_DL_FRAME_PARMS {
uint16_t
slots_per_frame
;
/// Number of samples in a subframe
uint32_t
samples_per_subframe
;
/// Number of samples in a slot
uint32_t
samples_per_slot
;
/// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
uint16_t
symbols_per_tti
;
/// Number of samples in a radio frame
uint32_t
samples_per_frame
;
/// Number of samples in a subframe without CP
uint32_t
samples_per_subframe_wCP
;
/// Number of samples in a slot without CP
uint32_t
samples_per_slot_wCP
;
/// Number of samples in a radio frame without CP
uint32_t
samples_per_frame_wCP
;
/// Number of samples in a tti (same as subrame in LTE, depending on numerology in NR)
...
...
openair1/SCHED_NR/fapi_nr_l1.c
View file @
d87e131c
...
...
@@ -55,19 +55,19 @@ void handle_nr_nfapi_bch_pdu(PHY_VARS_gNB *gNB,
void
handle_nfapi_nr_dci_dl_pdu
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
s
ubframe
,
int
frame
,
int
s
lot
,
gNB_L1_rxtx_proc_t
*
proc
,
nfapi_nr_dl_config_request_pdu_t
*
dl_config_pdu
)
{
int
idx
=
s
ubframe
&
1
;
int
idx
=
s
lot
&
1
;
NR_gNB_PDCCH
*
pdcch_vars
=
&
gNB
->
pdcch_vars
;
LOG_D
(
PHY
,
"Frame %d, S
ubframe %d: DCI processing - populating pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d
\n
"
,
frame
,
subframe
,
pdcch_vars
->
num_dci
,
proc
->
subframe
_tx
,
idx
,
pdcch_vars
->
num_dci
);
LOG_D
(
PHY
,
"Frame %d, S
lot %d: DCI processing - populating pdcch_vars->dci_alloc[%d] proc:slot_tx:%d idx:%d pdcch_vars->num_dci:%d
\n
"
,
frame
,
slot
,
pdcch_vars
->
num_dci
,
proc
->
slot
_tx
,
idx
,
pdcch_vars
->
num_dci
);
// copy dci configuration into gNB structure
nr_fill_dci_and_dlsch
(
gNB
,
frame
,
s
ubframe
,
proc
,
&
pdcch_vars
->
dci_alloc
[
pdcch_vars
->
num_dci
],
dl_config_pdu
);
nr_fill_dci_and_dlsch
(
gNB
,
frame
,
s
lot
,
proc
,
&
pdcch_vars
->
dci_alloc
[
pdcch_vars
->
num_dci
],
dl_config_pdu
);
LOG_D
(
PHY
,
"Frame %d, S
ubframe %d: DCI processing - populated pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d
\n
"
,
proc
->
frame_tx
,
proc
->
subframe_tx
,
pdcch_vars
->
num_dci
,
proc
->
subframe
_tx
,
idx
,
pdcch_vars
->
num_dci
);
LOG_D
(
PHY
,
"Frame %d, S
lot %d: DCI processing - populated pdcch_vars->dci_alloc[%d] proc:slot_tx:%d idx:%d pdcch_vars->num_dci:%d
\n
"
,
proc
->
frame_tx
,
proc
->
slot_tx
,
pdcch_vars
->
num_dci
,
proc
->
slot
_tx
,
idx
,
pdcch_vars
->
num_dci
);
}
...
...
@@ -80,7 +80,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
nfapi_nr_dl_config_request_t
*
DL_req
=
Sched_INFO
->
DL_req
;
nfapi_tx_request_t
*
TX_req
=
Sched_INFO
->
TX_req
;
frame_t
frame
=
Sched_INFO
->
frame
;
sub_frame_t
s
ubframe
=
Sched_INFO
->
subframe
;
sub_frame_t
s
lot
=
Sched_INFO
->
slot
;
AssertFatal
(
RC
.
gNB
!=
NULL
,
"RC.gNB is null
\n
"
);
AssertFatal
(
RC
.
gNB
[
Mod_id
]
!=
NULL
,
"RC.gNB[%d] is null
\n
"
,
Mod_id
);
...
...
@@ -96,7 +96,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
int
i
;
LOG_D
(
PHY
,
"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d
\n
"
,
frame
,
s
ubframe
,
frame
,
s
lot
,
NFAPI_SFNSF2SFN
(
DL_req
->
sfn_sf
),
NFAPI_SFNSF2SF
(
DL_req
->
sfn_sf
),
number_dl_pdu
,
NFAPI_SFNSF2SFN
(
TX_req
->
sfn_sf
),
NFAPI_SFNSF2SF
(
TX_req
->
sfn_sf
),
TX_req
->
tx_request_body
.
number_of_pdus
);
...
...
@@ -124,7 +124,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
case
NFAPI_NR_DL_CONFIG_DCI_DL_PDU_TYPE
:
handle_nfapi_nr_dci_dl_pdu
(
gNB
,
frame
,
s
ubframe
,
frame
,
s
lot
,
proc
,
dl_config_pdu
);
gNB
->
pdcch_vars
.
num_dci
++
;
...
...
openair1/SCHED_NR/phy_procedures_nr_common.c
View file @
d87e131c
...
...
@@ -36,7 +36,7 @@
nr_subframe_t
nr_s
ubframe_select
(
nfapi_nr_config_request_t
*
cfg
,
unsigned
char
subframe
)
nr_subframe_t
nr_s
lot_select
(
nfapi_nr_config_request_t
*
cfg
,
unsigned
char
slot
)
{
if
(
cfg
->
subframe_config
.
duplex_mode
.
value
==
FDD
)
return
(
SF_DL
);
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
d87e131c
...
...
@@ -116,32 +116,32 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PAR
LOG_D
(
PHY
,
"SSB first subcarrier %d (%d,%d)
\n
"
,
fp
->
ssb_start_subcarrier
,
start_rb
,
cfg
->
sch_config
.
ssb_subcarrier_offset
.
value
);
}
void
nr_common_signal_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
s
ubframe
)
{
void
nr_common_signal_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
s
lot
)
{
NR_DL_FRAME_PARMS
*
fp
=&
gNB
->
frame_parms
;
nfapi_nr_config_request_t
*
cfg
=
&
gNB
->
gNB_config
;
int
**
txdataF
=
gNB
->
common_vars
.
txdataF
;
uint8_t
*
pbch_pdu
=&
gNB
->
pbch_pdu
[
0
];
int
ss_s
ubframe
=
(
cfg
->
sch_config
.
half_frame_index
.
value
)
?
5
:
0
;
int
ss_s
lot
=
(
cfg
->
sch_config
.
half_frame_index
.
value
)
?
10
:
0
;
uint8_t
Lmax
,
ssb_index
=
0
,
n_hf
=
0
;
LOG_D
(
PHY
,
"common_signal_procedures: frame %d, s
ubframe %d
\n
"
,
frame
,
subframe
);
LOG_D
(
PHY
,
"common_signal_procedures: frame %d, s
lot %d
\n
"
,
frame
,
slot
);
int
ssb_start_symbol
=
nr_get_ssb_start_symbol
(
cfg
,
fp
);
nr_set_ssb_first_subcarrier
(
cfg
,
fp
);
Lmax
=
(
fp
->
dl_CarrierFreq
<
3e9
)
?
4
:
8
;
if
(
s
ubframe
==
ss_subframe
)
if
(
s
lot
==
ss_slot
)
{
// Current implementation is based on SSB in first half frame, first candidate
LOG_D
(
PHY
,
"SS TX: frame %d, s
ubframe %d, start_symbol %d
\n
"
,
frame
,
subframe
,
ssb_start_symbol
);
LOG_D
(
PHY
,
"SS TX: frame %d, s
lot %d, start_symbol %d
\n
"
,
frame
,
slot
,
ssb_start_symbol
);
nr_generate_pss
(
gNB
->
d_pss
,
txdataF
,
AMP
,
ssb_start_symbol
,
cfg
,
fp
);
nr_generate_sss
(
gNB
->
d_sss
,
txdataF
,
AMP_OVER_2
,
ssb_start_symbol
,
cfg
,
fp
);
if
(
!
(
frame
&
7
)){
LOG_D
(
PHY
,
"%d.%d : pbch_configured %d
\n
"
,
frame
,
s
ubframe
,
gNB
->
pbch_configured
);
LOG_D
(
PHY
,
"%d.%d : pbch_configured %d
\n
"
,
frame
,
s
lot
,
gNB
->
pbch_configured
);
if
(
gNB
->
pbch_configured
!=
1
)
return
;
gNB
->
pbch_configured
=
0
;
}
...
...
@@ -160,12 +160,12 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) {
}
void
phy_procedures_gNB_TX
(
PHY_VARS_gNB
*
gNB
,
gNB_L1_rxtx_proc_t
*
proc
,
int
do_meas
)
gNB_L1_rxtx_proc_t
*
proc
,
int
do_meas
)
{
int
aa
;
int
frame
=
proc
->
frame_tx
;
int
s
ubframe
=
proc
->
subframe
_tx
;
int
s
lot
=
proc
->
slot
_tx
;
uint8_t
num_dci
=
0
;
NR_DL_FRAME_PARMS
*
fp
=&
gNB
->
frame_parms
;
...
...
@@ -173,33 +173,32 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
int
offset
=
gNB
->
CC_id
;
if
((
cfg
->
subframe_config
.
duplex_mode
.
value
==
TDD
)
&&
(
nr_s
ubframe_select
(
cfg
,
subframe
)
==
SF_UL
))
return
;
if
((
cfg
->
subframe_config
.
duplex_mode
.
value
==
TDD
)
&&
(
nr_s
lot_select
(
cfg
,
slot
)
==
SF_UL
))
return
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX
+
offset
,
1
);
if
(
do_meas
==
1
)
start_meas
(
&
gNB
->
phy_proc_tx
);
// clear the transmit data array for the current subframe
for
(
aa
=
0
;
aa
<
cfg
->
rf_config
.
tx_antenna_ports
.
value
;
aa
++
)
{
memset
(
gNB
->
common_vars
.
txdataF
[
aa
],
0
,
fp
->
samples_per_s
ubframe
_wCP
*
sizeof
(
int32_t
));
memset
(
gNB
->
common_vars
.
txdataF
[
aa
],
0
,
fp
->
samples_per_s
lot
_wCP
*
sizeof
(
int32_t
));
}
if
(
nfapi_mode
==
0
||
nfapi_mode
==
1
)
{
nr_common_signal_procedures
(
gNB
,
frame
,
s
ubframe
);
nr_common_signal_procedures
(
gNB
,
frame
,
s
lot
);
//if (frame == 9)
//write_output("txdataF.m","txdataF",gNB->common_vars.txdataF[aa],fp->samples_per_frame_wCP, 1, 1);
}
num_dci
=
gNB
->
pdcch_vars
.
num_dci
;
if
(
num_dci
)
{
LOG_I
(
PHY
,
"[gNB %d] Frame %d s
ubframe
%d \
Calling nr_generate_dci_top (number of DCI %d)
\n
"
,
gNB
->
Mod_id
,
frame
,
s
ubframe
,
num_dci
);
LOG_I
(
PHY
,
"[gNB %d] Frame %d s
lot
%d \
Calling nr_generate_dci_top (number of DCI %d)
\n
"
,
gNB
->
Mod_id
,
frame
,
s
lot
,
num_dci
);
uint8_t
slot_idx
=
gNB
->
pdcch_vars
.
dci_alloc
[
0
].
pdcch_params
.
first_slot
;
if
(
nfapi_mode
==
0
||
nfapi_mode
==
1
)
nr_generate_dci_top
(
gNB
->
pdcch_vars
,
&
gNB
->
nrPolar_params
,
gNB
->
nr_gold_pdcch_dmrs
[
slot
_idx
],
gNB
->
nr_gold_pdcch_dmrs
[
slot
],
gNB
->
common_vars
.
txdataF
,
AMP
,
*
fp
,
*
cfg
);
}
...
...
openair1/SCHED_NR/sched_nr.h
View file @
d87e131c
...
...
@@ -34,22 +34,22 @@
#include "PHY/NR_TRANSPORT/nr_dci.h"
lte_subframe_t
nr_subframe_select
(
nfapi_nr_config_request_t
*
cfg
,
unsigned
char
subframe
);
nr_slot_t
nr_slot_select
(
nfapi_nr_config_request_t
*
cfg
,
unsigned
char
slot
);
void
nr_set_ssb_first_subcarrier
(
nfapi_nr_config_request_t
*
cfg
,
NR_DL_FRAME_PARMS
*
fp
);
void
phy_procedures_gNB_TX
(
PHY_VARS_gNB
*
gNB
,
gNB_L1_rxtx_proc_t
*
proc
,
int
do_meas
);
void
nr_common_signal_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
s
ubframe
);
void
nr_common_signal_procedures
(
PHY_VARS_gNB
*
gNB
,
int
frame
,
int
s
lot
);
void
nr_init_feptx_thread
(
RU_t
*
ru
,
pthread_attr_t
*
attr_feptx
);
void
nr_feptx_ofdm
(
RU_t
*
ru
);
void
nr_feptx_ofdm_2thread
(
RU_t
*
ru
);
void
nr_feptx0
(
RU_t
*
ru
,
int
slot
);
void
nr_configure_css_dci_
from_mib
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
pdcch_params
,
nr_scs_e
scs_common
,
nr_scs_e
pdcch_scs
,
nr_frequency_range_e
freq_range
,
uint8_t
rmsi_pdcch_config
,
uint8_t
ssb_idx
,
uint16_t
nb_slots_per_frame
,
uint16_t
N_RB
);
void
nr_configure_css_dci_
initial
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
pdcch_params
,
nr_scs_e
scs_common
,
nr_scs_e
pdcch_scs
,
nr_frequency_range_e
freq_range
,
uint8_t
rmsi_pdcch_config
,
uint8_t
ssb_idx
,
uint16_t
nb_slots_per_frame
,
uint16_t
N_RB
);
#endif
openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
View file @
d87e131c
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
d87e131c
...
...
@@ -79,6 +79,8 @@ NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);}
int8_t
dummy_nr_ue_dl_indication
(
nr_downlink_indication_t
*
dl_info
){
return
(
0
);}
int8_t
dummy_nr_ue_ul_indication
(
nr_uplink_indication_t
*
ul_info
){
return
(
0
);}
lte_subframe_t
subframe_select
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
unsigned
char
subframe
)
{
return
(
SF_DL
);}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
const
char
*
msg
=
s
==
NULL
?
"no comment"
:
s
;
printf
(
"Exiting at: %s:%d %s(), %s
\n
"
,
file
,
line
,
function
,
msg
);
...
...
@@ -150,7 +152,7 @@ int main(int argc, char **argv)
unsigned
char
frame_type
=
0
;
unsigned
char
pbch_phase
=
0
;
int
frame
=
0
,
s
ubframe
=
1
;
int
frame
=
0
,
s
lot
=
1
;
int
frame_length_complex_samples
;
int
frame_length_complex_samples_no_prefix
;
NR_DL_FRAME_PARMS
*
frame_parms
;
...
...
@@ -484,12 +486,13 @@ int main(int argc, char **argv)
}
nr_gold_pbch
(
UE
);
nr_gold_pdcch
(
UE
,
0
,
2
);
RC
.
nb_nr_macrlc_inst
=
1
;
mac_top_init_gNB
();
gNB_mac
=
RC
.
nrmac
[
0
];
config_common
(
0
,
0
,
78
,(
uint64_t
)
3640000000L
,
N_RB_DL
*
180000
*
(
mu
+
1
)
);
config_common
(
0
,
0
,
78
,(
uint64_t
)
3640000000L
,
N_RB_DL
);
nr_l2_init_ue
();
UE_mac
=
get_mac_inst
(
0
);
...
...
@@ -509,11 +512,11 @@ int main(int argc, char **argv)
gNB
->
pbch_configured
=
1
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
gNB
->
pbch_pdu
[
i
]
=
i
+
1
;
nr_schedule_css_dlsch_phytest
(
0
,
frame
,
s
ubframe
);
nr_schedule_css_dlsch_phytest
(
0
,
frame
,
s
lot
);
Sched_INFO
.
module_id
=
0
;
Sched_INFO
.
CC_id
=
0
;
Sched_INFO
.
frame
=
frame
;
Sched_INFO
.
s
ubframe
=
subframe
;
Sched_INFO
.
s
lot
=
slot
;
Sched_INFO
.
DL_req
=
&
gNB_mac
->
DL_req
[
0
];
Sched_INFO
.
UL_req
=
NULL
;
Sched_INFO
.
HI_DCI0_req
=
NULL
;
...
...
@@ -521,7 +524,7 @@ int main(int argc, char **argv)
nr_schedule_response
(
&
Sched_INFO
);
gNB_proc
.
frame_tx
=
frame
;
gNB_proc
.
s
ubframe_tx
=
subframe
;
gNB_proc
.
s
lot_tx
=
slot
;
phy_procedures_gNB_TX
(
gNB
,
&
gNB_proc
,
0
);
//nr_common_signal_procedures (gNB,frame,subframe);
...
...
@@ -660,12 +663,14 @@ int main(int argc, char **argv)
UE
->
rx_offset
=
0
;
UE_proc
.
frame_rx
=
frame
;
UE_proc
.
nr_tti_rx
=
s
ubframe
;
UE_proc
.
subframe_rx
=
s
ubframe
;
UE_proc
.
nr_tti_rx
=
s
lot
;
UE_proc
.
subframe_rx
=
s
lot
;
UE_mac
->
scheduled_response
.
dl_config
=
&
dl_config
;
nr_ue_scheduled_response
(
&
UE_mac
->
scheduled_response
);
printf
(
"Running phy procedures UE RX %d.%d
\n
"
,
frame
,
slot
);
phy_procedures_nrUE_RX
(
UE
,
&
UE_proc
,
0
,
...
...
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
d87e131c
...
...
@@ -168,6 +168,8 @@ void config_common(int Mod_idP,
nfapi_nr_config_request_t
*
cfg
=
&
RC
.
nrmac
[
Mod_idP
]
->
config
[
CC_idP
];
int
mu
=
1
;
// FDD
cfg
->
subframe_config
.
duplex_mode
.
value
=
1
;
cfg
->
subframe_config
.
duplex_mode
.
tl
.
tag
=
NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG
;
...
...
@@ -179,11 +181,11 @@ void config_common(int Mod_idP,
cfg
->
nfapi_config
.
rf_bands
.
tl
.
tag
=
NFAPI_PHY_RF_BANDS_TAG
;
cfg
->
num_tlv
++
;
cfg
->
nfapi_config
.
nrarfcn
.
value
=
to_nrarfcn
(
nr_bandP
,
dl_CarrierFreqP
,
dl_BandwidthP
);
cfg
->
nfapi_config
.
nrarfcn
.
value
=
to_nrarfcn
(
nr_bandP
,
dl_CarrierFreqP
,
dl_BandwidthP
*
180000
*
(
1
+
mu
)
);
cfg
->
nfapi_config
.
nrarfcn
.
tl
.
tag
=
NFAPI_NR_NFAPI_NRARFCN_TAG
;
cfg
->
num_tlv
++
;
cfg
->
subframe_config
.
numerology_index_mu
.
value
=
1
;
cfg
->
subframe_config
.
numerology_index_mu
.
value
=
mu
;
//cfg->subframe_config.tl.tag =
//cfg->num_tlv++;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
View file @
d87e131c
...
...
@@ -37,7 +37,7 @@ extern RAN_CONTEXT_t RC;
* current version has only a DCI for type 1 PDCCH for RA-RNTI*/
void
nr_schedule_css_dlsch_phytest
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
s
ubframe
P
)
sub_frame_t
s
lot
P
)
{
uint8_t
CC_id
;
...
...
@@ -48,7 +48,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
nfapi_tx_request_pdu_t
*
TX_req
;
nfapi_nr_config_request_t
*
cfg
=
&
nr_mac
->
config
[
0
];
uint16_t
sfn_sf
=
frameP
<<
4
|
s
ubframe
P
;
uint16_t
sfn_sf
=
frameP
<<
4
|
s
lot
P
;
int
dl_carrier_bandwidth
=
cfg
->
rf_config
.
dl_carrier_bandwidth
.
value
;
// everything here is hard-coded to 30 kHz
...
...
@@ -59,8 +59,6 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
LOG_I
(
MAC
,
"Scheduling common search space DCI type 1 for CC_id %d
\n
"
,
CC_id
);
dl_req
=
&
nr_mac
->
DL_req
[
CC_id
].
dl_config_request_body
;
dl_config_pdu
=
&
dl_req
->
dl_config_pdu_list
[
dl_req
->
number_pdu
];
memset
((
void
*
)
dl_config_pdu
,
0
,
sizeof
(
nfapi_nr_dl_config_request_pdu_t
));
...
...
@@ -70,10 +68,13 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
nfapi_nr_dl_config_dci_dl_pdu_rel15_t
*
pdu_rel15
=
&
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel15
;
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
params_rel15
=
&
dl_config_pdu
->
dci_dl_pdu
.
pdcch_params_rel15
;
nr_configure_css_dci_from_mib
(
params_rel15
,
scs
,
scs
,
nr_FR1
,
0
,
0
,
slots_per_frame
,
dl_carrier_bandwidth
);
nr_configure_css_dci_initial
(
params_rel15
,
scs
,
scs
,
nr_FR1
,
0
,
0
,
slots_per_frame
,
dl_carrier_bandwidth
);
params_rel15
->
first_slot
=
0
;
pdu_rel15
->
frequency_domain_assignment
=
5
;
pdu_rel15
->
time_domain_assignment
=
2
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
d87e131c
...
...
@@ -140,14 +140,14 @@ int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP){
}
}
void
nr_configure_css_dci_
from_mib
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
pdcch_params
,
nr_scs_e
scs_common
,
nr_scs_e
pdcch_scs
,
nr_frequency_range_e
freq_range
,
uint8_t
rmsi_pdcch_config
,
uint8_t
ssb_idx
,
uint16_t
nb_slots_per_frame
,
uint16_t
N_RB
)
void
nr_configure_css_dci_
initial
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
pdcch_params
,
nr_scs_e
scs_common
,
nr_scs_e
pdcch_scs
,
nr_frequency_range_e
freq_range
,
uint8_t
rmsi_pdcch_config
,
uint8_t
ssb_idx
,
uint16_t
nb_slots_per_frame
,
uint16_t
N_RB
)
{
uint8_t
O
,
M
;
uint8_t
ss_idx
=
rmsi_pdcch_config
&
0xf
;
...
...
@@ -250,6 +250,10 @@ void nr_configure_css_dci_from_mib(nfapi_nr_dl_config_pdcch_parameters_rel15_t*
pdcch_params
->
precoder_granularity
=
NFAPI_NR_CSET_SAME_AS_REG_BUNDLE
;
pdcch_params
->
reg_bundle_size
=
6
;
pdcch_params
->
interleaver_size
=
2
;
// set initial banwidth part to full bandwidth
pdcch_params
->
n_RB_BWP
=
N_RB
;
}
void
nr_configure_css_dci_from_pdcch_config
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
pdcch_params
,
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
d87e131c
...
...
@@ -66,14 +66,14 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
sub_frame_t
subframeP
);
void
nr_configure_css_dci_
from_mib
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
pdcch_params
,
nr_scs_e
scs_common
,
nr_scs_e
pdcch_scs
,
nr_frequency_range_e
freq_range
,
uint8_t
rmsi_pdcch_config
,
uint8_t
ssb_idx
,
uint16_t
nb_slots_per_frame
,
uint16_t
N_RB
);
void
nr_configure_css_dci_
initial
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
pdcch_params
,
nr_scs_e
scs_common
,
nr_scs_e
pdcch_scs
,
nr_frequency_range_e
freq_range
,
uint8_t
rmsi_pdcch_config
,
uint8_t
ssb_idx
,
uint16_t
nb_slots_per_frame
,
uint16_t
N_RB
);
void
nr_configure_css_dci_from_pdcch_config
(
nfapi_nr_dl_config_pdcch_parameters_rel15_t
*
pdcch_params
,
...
...
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
View file @
d87e131c
...
...
@@ -59,7 +59,7 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) {
AssertFatal
(
UL_info
->
rach_ind
.
rach_indication_body
.
number_of_preambles
==
1
,
"More than 1 preamble not supported
\n
"
);
UL_info
->
rach_ind
.
rach_indication_body
.
number_of_preambles
=
0
;
LOG_D
(
MAC
,
"UL_info[Frame %d, S
ubframe %d] Calling initiate_ra_proc RACH:SFN/SF:%d
\n
"
,
UL_info
->
frame
,
UL_info
->
subframe
,
NFAPI_SFNSF2DEC
(
UL_info
->
rach_ind
.
sfn_sf
));
LOG_D
(
MAC
,
"UL_info[Frame %d, S
lot %d] Calling initiate_ra_proc RACH:SFN/SF:%d
\n
"
,
UL_info
->
frame
,
UL_info
->
slot
,
NFAPI_SFNSF2DEC
(
UL_info
->
rach_ind
.
sfn_sf
));
initiate_ra_proc
(
UL_info
->
module_id
,
UL_info
->
CC_id
,
NFAPI_SFNSF2SFN
(
UL_info
->
rach_ind
.
sfn_sf
),
...
...
@@ -80,12 +80,12 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) {
for
(
i
=
0
;
i
<
UL_info
->
rach_ind_br
.
rach_indication_body
.
number_of_preambles
;
i
++
)
{
AssertFatal
(
UL_info
->
rach_ind_br
.
rach_indication_body
.
preamble_list
[
i
].
preamble_rel13
.
rach_resource_type
>
0
,
"Got regular PRACH preamble, not BL/CE
\n
"
);
LOG_D
(
MAC
,
"Frame %d, S
ubframe %d Calling initiate_ra_proc (CE_level %d)
\n
"
,
UL_info
->
frame
,
UL_info
->
subframe
,
LOG_D
(
MAC
,
"Frame %d, S
lot %d Calling initiate_ra_proc (CE_level %d)
\n
"
,
UL_info
->
frame
,
UL_info
->
slot
,
UL_info
->
rach_ind_br
.
rach_indication_body
.
preamble_list
[
i
].
preamble_rel13
.
rach_resource_type
-
1
);
initiate_ra_proc
(
UL_info
->
module_id
,
UL_info
->
CC_id
,
UL_info
->
frame
,
UL_info
->
s
ubframe
,
UL_info
->
s
lot
,
UL_info
->
rach_ind_br
.
rach_indication_body
.
preamble_list
[
i
].
preamble_rel8
.
preamble
,
UL_info
->
rach_ind_br
.
rach_indication_body
.
preamble_list
[
i
].
preamble_rel8
.
timing_advance
,
UL_info
->
rach_ind_br
.
rach_indication_body
.
preamble_list
[
i
].
preamble_rel8
.
rnti
,
...
...
@@ -113,7 +113,7 @@ void handle_nr_sr(NR_UL_IND_t *UL_info) {
SR_indication
(
UL_info
->
module_id
,
UL_info
->
CC_id
,
UL_info
->
frame
,
UL_info
->
s
ubframe
,
UL_info
->
s
lot
,
UL_info
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
[
i
].
rx_ue_information
.
rnti
,
UL_info
->
sr_ind
.
sr_indication_body
.
sr_pdu_list
[
i
].
ul_cqi_information
.
ul_cqi
);
}
...
...
@@ -133,7 +133,7 @@ void handle_nr_cqi(NR_UL_IND_t *UL_info) {
nfapi_cqi_indication_t
ind
;
ind
.
header
.
message_id
=
NFAPI_RX_CQI_INDICATION
;
ind
.
sfn_sf
=
UL_info
->
frame
<<
4
|
UL_info
->
s
ubframe
;
ind
.
sfn_sf
=
UL_info
->
frame
<<
4
|
UL_info
->
s
lot
;
ind
.
cqi_indication_body
=
UL_info
->
cqi_ind
;
oai_nfapi_cqi_indication
(
&
ind
);
...
...
@@ -147,7 +147,7 @@ void handle_nr_cqi(NR_UL_IND_t *UL_info) {
cqi_indication
(
UL_info
->
module_id
,
UL_info
->
CC_id
,
UL_info
->
frame
,
UL_info
->
s
ubframe
,
UL_info
->
s
lot
,
UL_info
->
cqi_ind
.
cqi_pdu_list
[
i
].
rx_ue_information
.
rnti
,
&
UL_info
->
cqi_ind
.
cqi_pdu_list
[
i
].
cqi_indication_rel9
,
UL_info
->
cqi_ind
.
cqi_raw_pdu_list
[
i
].
pdu
,
...
...
@@ -220,11 +220,11 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
UL_info
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
i
].
rx_ue_information
.
rnti
)
{
LOG_D
(
PHY
,
"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d
\n
"
,
j
,
UL_info
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
[
j
].
crc_indication_rel8
.
crc_flag
);
if
(
UL_info
->
crc_ind
.
crc_indication_body
.
crc_pdu_list
[
j
].
crc_indication_rel8
.
crc_flag
==
1
)
{
// CRC error indication
LOG_D
(
MAC
,
"Frame %d, S
ubframe %d Calling rx_sdu (CRC error)
\n
"
,
UL_info
->
frame
,
UL_info
->
subframe
);
LOG_D
(
MAC
,
"Frame %d, S
lot %d Calling rx_sdu (CRC error)
\n
"
,
UL_info
->
frame
,
UL_info
->
slot
);
rx_sdu
(
UL_info
->
module_id
,
UL_info
->
CC_id
,
NFAPI_SFNSF2SFN
(
UL_info
->
rx_ind
.
sfn_sf
),
//UL_info->frame,
NFAPI_SFNSF2SF
(
UL_info
->
rx_ind
.
sfn_sf
),
//UL_info->s
ubframe
,
NFAPI_SFNSF2SF
(
UL_info
->
rx_ind
.
sfn_sf
),
//UL_info->s
lot
,
UL_info
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
i
].
rx_ue_information
.
rnti
,
(
uint8_t
*
)
NULL
,
UL_info
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
i
].
rx_indication_rel8
.
length
,
...
...
@@ -232,11 +232,11 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
UL_info
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
i
].
rx_indication_rel8
.
ul_cqi
);
}
else
{
LOG_D
(
MAC
,
"Frame %d, S
ubframe %d Calling rx_sdu (CRC ok)
\n
"
,
UL_info
->
frame
,
UL_info
->
subframe
);
LOG_D
(
MAC
,
"Frame %d, S
lot %d Calling rx_sdu (CRC ok)
\n
"
,
UL_info
->
frame
,
UL_info
->
slot
);
rx_sdu
(
UL_info
->
module_id
,
UL_info
->
CC_id
,
NFAPI_SFNSF2SFN
(
UL_info
->
rx_ind
.
sfn_sf
),
//UL_info->frame,
NFAPI_SFNSF2SF
(
UL_info
->
rx_ind
.
sfn_sf
),
//UL_info->s
ubframe
,
NFAPI_SFNSF2SF
(
UL_info
->
rx_ind
.
sfn_sf
),
//UL_info->s
lot
,
UL_info
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
i
].
rx_ue_information
.
rnti
,
UL_info
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
i
].
data
,
UL_info
->
rx_ind
.
rx_indication_body
.
rx_pdu_list
[
i
].
rx_indication_rel8
.
length
,
...
...
@@ -250,12 +250,12 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
}
// for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
UL_info
->
crc_ind
.
crc_indication_body
.
number_of_crcs
=
0
;
UL_info
->
rx_ind
.
rx_indication_body
.
number_of_pdus
=
0
;
}
// UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->s
ubframe
&& UL_info->crc_ind.crc_indication_body.number_of_crcs>0
}
// UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->s
lot
&& UL_info->crc_ind.crc_indication_body.number_of_crcs>0
else
if
(
UL_info
->
rx_ind
.
rx_indication_body
.
number_of_pdus
!=
0
||
UL_info
->
crc_ind
.
crc_indication_body
.
number_of_crcs
!=
0
)
{
LOG_E
(
PHY
,
"hoping not to have mis-match between CRC ind and RX ind - hopefully the missing message is coming shortly rx_ind:%d(SFN/SF:%05d) crc_ind:%d(SFN/SF:%05d) UL_info(SFN/SF):%04d%d
\n
"
,
UL_info
->
rx_ind
.
rx_indication_body
.
number_of_pdus
,
NFAPI_SFNSF2DEC
(
UL_info
->
rx_ind
.
sfn_sf
),
UL_info
->
crc_ind
.
crc_indication_body
.
number_of_crcs
,
NFAPI_SFNSF2DEC
(
UL_info
->
crc_ind
.
sfn_sf
),
UL_info
->
frame
,
UL_info
->
s
ubframe
);
UL_info
->
frame
,
UL_info
->
s
lot
);
}
}
}
...
...
@@ -276,7 +276,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
gNB_MAC_INST
*
mac
=
RC
.
nrmac
[
module_id
];
LOG_D
(
PHY
,
"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]
\n
"
,
UL_info
->
frame
,
UL_info
->
s
ubframe
,
UL_info
->
frame
,
UL_info
->
s
lot
,
module_id
,
CC_id
,
UL_info
->
rx_ind
.
rx_indication_body
.
number_of_pdus
,
UL_info
->
harq_ind
.
harq_indication_body
.
number_of_harqs
,
UL_info
->
crc_ind
.
crc_indication_body
.
number_of_crcs
,
UL_info
->
cqi_ind
.
number_of_cqis
,
UL_info
->
rach_ind
.
rach_indication_body
.
number_of_preambles
,
UL_info
->
sr_ind
.
sr_indication_body
.
number_of_srs
);
...
...
@@ -284,18 +284,18 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
{
if
(
ifi
->
CC_mask
==
0
)
{
ifi
->
current_frame
=
UL_info
->
frame
;
ifi
->
current_s
ubframe
=
UL_info
->
subframe
;
ifi
->
current_s
lot
=
UL_info
->
slot
;
}
else
{
AssertFatal
(
UL_info
->
frame
!=
ifi
->
current_frame
,
"CC_mask %x is not full and frame has changed
\n
"
,
ifi
->
CC_mask
);
AssertFatal
(
UL_info
->
s
ubframe
!=
ifi
->
current_subframe
,
"CC_mask %x is not full and subframe
has changed
\n
"
,
ifi
->
CC_mask
);
AssertFatal
(
UL_info
->
s
lot
!=
ifi
->
current_slot
,
"CC_mask %x is not full and slot
has changed
\n
"
,
ifi
->
CC_mask
);
}
ifi
->
CC_mask
|=
(
1
<<
CC_id
);
}
// clear DL/UL info for new scheduling round
clear_nr_nfapi_information
(
RC
.
nrmac
[
module_id
],
CC_id
,
UL_info
->
frame
,
UL_info
->
s
ubframe
);
clear_nr_nfapi_information
(
RC
.
nrmac
[
module_id
],
CC_id
,
UL_info
->
frame
,
UL_info
->
s
lot
);
handle_nr_rach
(
UL_info
);
...
...
@@ -315,24 +315,24 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
if
(
ifi
->
CC_mask
==
((
1
<<
MAX_NUM_CCs
)
-
1
))
{
/*
eNB_dlsch_ulsch_scheduler(module_id,
(UL_info->frame+((UL_info->s
ubframe
>(9-sf_ahead))?1:0)) % 1024,
(UL_info->s
ubframe
+sf_ahead)%10);
(UL_info->frame+((UL_info->s
lot
>(9-sf_ahead))?1:0)) % 1024,
(UL_info->s
lot
+sf_ahead)%10);
*/
gNB_dlsch_ulsch_scheduler
(
module_id
,
(
UL_info
->
frame
+
((
UL_info
->
s
ubframe
>
(
9
-
sf_ahead
))
?
1
:
0
))
%
1024
,
(
UL_info
->
s
ubframe
+
sf_ahead
)
%
10
);
(
UL_info
->
frame
+
((
UL_info
->
s
lot
>
(
9
-
sf_ahead
))
?
1
:
0
))
%
1024
,
(
UL_info
->
s
lot
+
sf_ahead
)
%
10
);
ifi
->
CC_mask
=
0
;
sched_info
->
module_id
=
module_id
;
sched_info
->
CC_id
=
CC_id
;
sched_info
->
frame
=
(
UL_info
->
frame
+
((
UL_info
->
s
ubframe
>
(
9
-
sf_ahead
))
?
1
:
0
))
%
1024
;
sched_info
->
s
ubframe
=
(
UL_info
->
subframe
+
sf_ahead
)
%
10
;
sched_info
->
frame
=
(
UL_info
->
frame
+
((
UL_info
->
s
lot
>
(
9
-
sf_ahead
))
?
1
:
0
))
%
1024
;
sched_info
->
s
lot
=
(
UL_info
->
slot
+
sf_ahead
)
%
10
;
sched_info
->
DL_req
=
&
mac
->
DL_req
[
CC_id
];
sched_info
->
HI_DCI0_req
=
&
mac
->
HI_DCI0_req
[
CC_id
];
if
((
mac
->
common_channels
[
CC_id
].
tdd_Config
==
NULL
)
||
(
is_nr_UL_sf
(
&
mac
->
common_channels
[
CC_id
],(
sched_info
->
s
ubframe
+
sf_ahead
)
%
10
)
>
0
))
(
is_nr_UL_sf
(
&
mac
->
common_channels
[
CC_id
],(
sched_info
->
s
lot
+
sf_ahead
)
%
10
)
>
0
))
sched_info
->
UL_req
=
&
mac
->
UL_req
[
CC_id
];
else
sched_info
->
UL_req
=
NULL
;
...
...
@@ -352,7 +352,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
ifi
->
NR_Schedule_response
(
sched_info
);
}
LOG_D
(
PHY
,
"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d
\n
"
,
sched_info
->
frame
,
sched_info
->
s
ubframe
,
sched_info
->
DL_req
->
dl_config_request_body
.
number_pdu
);
LOG_D
(
PHY
,
"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d
\n
"
,
sched_info
->
frame
,
sched_info
->
s
lot
,
sched_info
->
DL_req
->
dl_config_request_body
.
number_pdu
);
}
}
}
...
...
@@ -374,4 +374,4 @@ NR_IF_Module_t *NR_IF_Module_init(int Mod_id){
"allocation of if_inst[%d]->if_mutex fails
\n
"
,
Mod_id
);
}
return
if_inst
[
Mod_id
];
}
\ No newline at end of file
}
openair2/NR_PHY_INTERFACE/NR_IF_Module.h
View file @
d87e131c
...
...
@@ -57,8 +57,8 @@ typedef struct{
int
CC_id
;
/// frame
frame_t
frame
;
/// s
ubframe
s
ub_frame_t
subframe
;
/// s
lot
s
lot_t
slot
;
/// harq indication list
nfapi_harq_indication_t
harq_ind
;
...
...
@@ -88,7 +88,7 @@ typedef struct{
}
NR_UL_IND_t
;
// Downlink s
ubframe
P7
// Downlink s
lot
P7
typedef
struct
{
...
...
@@ -98,8 +98,8 @@ typedef struct{
uint8_t
CC_id
;
/// frame
frame_t
frame
;
/// s
ubframe
s
ub_frame_t
subframe
;
/// s
lot
s
lot_t
slot
;
/// nFAPI DL Config Request
nfapi_nr_dl_config_request_t
*
DL_req
;
/// nFAPI UL Config Request
...
...
@@ -123,7 +123,7 @@ typedef struct NR_IF_Module_s{
void
(
*
NR_PHY_config_req
)(
NR_PHY_Config_t
*
config_INFO
);
uint32_t
CC_mask
;
uint16_t
current_frame
;
uint8_t
current_s
ubframe
;
uint8_t
current_s
lot
;
pthread_mutex_t
if_mutex
;
}
NR_IF_Module_t
;
...
...
@@ -137,4 +137,4 @@ void NR_UL_indication(NR_UL_IND_t *UL_INFO);
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
void
NR_Schedule_Response
(
NR_Sched_Rsp_t
*
Sched_INFO
);
#endif
/*_NFAPI_INTERFACE_NR_H_*/
\ No newline at end of file
#endif
/*_NFAPI_INTERFACE_NR_H_*/
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