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
promise
OpenXG-RAN
Commits
ee1c5cbd
Commit
ee1c5cbd
authored
Dec 05, 2018
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdcch channel estimation in UE is ok (273 PRBs)
parent
e7c63993
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
378 additions
and
347 deletions
+378
-347
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
+14
-8
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
+15
-6
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+4
-4
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
+9
-6
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+2
-1
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.
openair1/PHY/INIT/nr_parms.c
View file @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
...
...
@@ -25,10 +25,15 @@
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
//
#define DEBUG_FEP
#define DEBUG_FEP
#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 @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
...
...
@@ -37,6 +37,7 @@
#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
,
...
...
@@ -185,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*/
...
...
@@ -278,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
++
)
{
...
...
@@ -292,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
;
...
...
@@ -315,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_UE_ESTIMATION/nr_dl_channel_estimation.c
View file @
ee1c5cbd
...
...
@@ -28,7 +28,7 @@
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "filt16a_32.h"
#include "T.h"
//
#define DEBUG_CH
#define DEBUG_CH
int
nr_pbch_channel_estimation
(
PHY_VARS_NR_UE
*
ue
,
...
...
@@ -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/defs_gNB.h
View file @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
ee1c5cbd
...
...
@@ -150,7 +150,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,6 +484,7 @@ 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
();
...
...
@@ -509,11 +510,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 +522,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 +661,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/gNB_scheduler_phytest.c
View file @
ee1c5cbd
...
...
@@ -72,7 +72,8 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
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
;
pdu_rel15
->
vrb_to_prb_mapping
=
0
;
...
...
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
View file @
ee1c5cbd
...
...
@@ -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 @
ee1c5cbd
...
...
@@ -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