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
lizhongxiao
OpenXG-RAN
Commits
c8afb25d
Commit
c8afb25d
authored
Mar 08, 2023
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving generation of precoding matrices at MAC and trying to adapt to SCF (1st version)
parent
7514bb91
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
640 additions
and
715 deletions
+640
-715
common/utils/nr/nr_common.h
common/utils/nr/nr_common.h
+2
-0
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+44
-43
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+3
-388
openair1/PHY/MODULATION/nr_modulation.c
openair1/PHY/MODULATION/nr_modulation.c
+53
-41
openair1/PHY/MODULATION/nr_modulation.h
openair1/PHY/MODULATION/nr_modulation.h
+5
-2
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+41
-47
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+0
-7
openair1/PHY/defs_nr_common.h
openair1/PHY/defs_nr_common.h
+0
-1
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+11
-25
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+460
-148
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+1
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+17
-10
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+2
-1
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+1
-0
No files found.
common/utils/nr/nr_common.h
View file @
c8afb25d
...
...
@@ -76,6 +76,8 @@ static inline const char *rnti_types(nr_rnti_type_t rr)
}
#undef R
#define NR_MAX_NB_LAYERS 4 // 8
typedef
enum
{
nr_FR1
=
0
,
nr_FR2
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
View file @
c8afb25d
...
...
@@ -449,6 +449,26 @@ typedef struct
}
nfapi_nr_measurement_config_t
;
// Table 3–62 Precoding matrix (PM) PDU (v.222.10.04)
typedef
struct
{
int16_t
precoder_weight_Re
;
int16_t
precoder_weight_Im
;
}
nfapi_nr_pm_weights_t
;
typedef
struct
{
uint16_t
pm_idx
;
uint16_t
numLayers
;
uint16_t
num_ant_ports
;
nfapi_nr_pm_weights_t
weights
[
4
][
4
];
// TODO temporary hardcoding
}
nfapi_nr_pm_pdu_t
;
typedef
struct
{
uint16_t
num_pm_idx
;
nfapi_nr_pm_pdu_t
*
pmi_pdu
;
}
nfapi_nr_pm_list_t
;
// ERROR enums
typedef
enum
{
// Table 2-22
NFAPI_NR_PARAM_MSG_OK
=
0
,
...
...
@@ -560,6 +580,7 @@ typedef struct {
nfapi_nr_tdd_table_t
tdd_table
;
nfapi_nr_measurement_config_t
measurement_config
;
nfapi_nr_nfapi_t
nfapi_config
;
nfapi_nr_pm_list_t
pmi_list
;
}
nfapi_nr_config_request_scf_t
;
...
...
@@ -648,26 +669,6 @@ typedef struct {
}
nfapi_nr_dbt_pdu_t
;
//table 3-33
//?
typedef
struct
{
uint16_t
num_ant_ports
;
int16_t
precoder_weight_Re
;
int16_t
precoder_weight_Im
;
}
nfapi_nr_num_ant_ports_t
;
typedef
struct
{
uint16_t
numLayers
;
//0~65535
nfapi_nr_num_ant_ports_t
*
num_ant_ports_list
;
}
nfapi_nr_num_layers_t
;
typedef
struct
{
uint16_t
pm_idx
;
//0~65535
nfapi_nr_num_layers_t
*
num_layers_list
;
//0~65535
//nfapi_nr_num_ant_ports_t* num_ant_ports_list;
}
nfapi_nr_pm_pdu_t
;
// Section 3.4
// Section 3.4.1 slot indication
...
...
openair1/PHY/INIT/nr_init.c
View file @
c8afb25d
This diff is collapsed.
Click to expand it.
openair1/PHY/MODULATION/nr_modulation.c
View file @
c8afb25d
...
...
@@ -703,13 +703,17 @@ c16_t nr_layer_precoder_cm(int n_layers,
int
n_symbols
,
int
symSz
,
c16_t
datatx_F_precoding
[
n_layers
][
n_symbols
][
symSz
],
c16_t
*
prec_matrix
,
int
ap
,
nfapi_nr_pm_pdu_t
*
pmi_pdu
,
int
symbol
,
int
offset
)
{
c16_t
precodatatx_F
=
{
0
};
for
(
int
al
=
0
;
al
<
n_layers
;
al
++
)
precodatatx_F
=
c16maddShift
(
datatx_F_precoding
[
al
][
symbol
][
offset
],
prec_matrix
[
al
],
precodatatx_F
,
15
);
for
(
int
al
=
0
;
al
<
n_layers
;
al
++
)
{
nfapi_nr_pm_weights_t
*
w
=
&
pmi_pdu
->
weights
[
al
][
ap
];
c16_t
prec_weight
=
{.
r
=
w
->
precoder_weight_Re
,
.
i
=
w
->
precoder_weight_Im
};
precodatatx_F
=
c16maddShift
(
datatx_F_precoding
[
al
][
symbol
][
offset
],
prec_weight
,
precodatatx_F
,
15
);
}
return
precodatatx_F
;
}
...
...
@@ -717,29 +721,33 @@ void nr_layer_precoder_simd(const int n_layers,
const
int
n_symbols
,
const
int
symSz
,
const
c16_t
txdataF_res_mapped
[
n_layers
][
n_symbols
][
symSz
],
const
c16_t
prec_matrix
[
n_layers
],
const
int
ant
,
const
nfapi_nr_pm_pdu_t
*
pmi_pdu
,
const
int
symbol
,
const
int
sc_offset
,
const
int
re_cnt
,
c16_t
*
txdataF_precoded
)
{
uint32_t
sc
=
sc_offset
;
c16_t
prec_weight
=
{
0
};
// For x86, use 256 SIMD for every 8 RE and 128 SIMD for last 4 RE
// For aarch64, use 128 SIMD for every 4 RE
// 256 SIMD: Do 8 RE in one iteration, 3 iterations for 2 RB
#ifdef __AVX2__
#ifdef __AVX2__
const
uint32_t
re_cnt_align8
=
re_cnt
&
~
7
;
for
(;
sc
<
sc_offset
+
(
re_cnt_align8
);
sc
+=
sizeof
(
simde__m256i
)
/
sizeof
(
*
prec_matrix
))
{
for
(;
sc
<
sc_offset
+
(
re_cnt_align8
);
sc
+=
sizeof
(
simde__m256i
)
/
sizeof
(
prec_weight
))
{
// Matrix multiplication for 4 elements of the result (sizeof(simde__m256i) / sizeof(*prec_matrix) = 8)
simde__m256i
y
=
simde_mm256_set1_epi16
(
0
);
// Y = W[0]*X[0] + W[1]*X[1] + ... + W[nrOfLayers-1]*X[nrOfLayers-1]
for
(
int
nl
=
0
;
nl
<
n_layers
;
nl
++
){
for
(
int
nl
=
0
;
nl
<
n_layers
;
nl
++
)
{
prec_weight
.
r
=
pmi_pdu
->
weights
[
nl
][
ant
].
precoder_weight_Re
;
prec_weight
.
i
=
pmi_pdu
->
weights
[
nl
][
ant
].
precoder_weight_Im
;
const
simde__m256i
x
=
simde_mm256_loadu_epi32
(
&
txdataF_res_mapped
[
nl
][
symbol
][
sc
]);
// Rearrange precoding matrix weight to match complex multiplication and broadcast it to match SIMD size
const
simde__m256i
w_c
=
simde_mm256_set1_epi32
(
c16toI32
(
c16conj
(
prec_matrix
[
nl
]
)));
// broadcast conjugate of w
const
simde__m256i
w_s
=
simde_mm256_set1_epi32
(
c16toI32
(
c16swap
(
prec_matrix
[
nl
]
)));
// broadcast swapped real and img of w
const
simde__m256i
w_c
=
simde_mm256_set1_epi32
(
c16toI32
(
c16conj
(
prec_weight
)));
// broadcast conjugate of w
const
simde__m256i
w_s
=
simde_mm256_set1_epi32
(
c16toI32
(
c16swap
(
prec_weight
)));
// broadcast swapped real and img of w
// Multiplication and shift
const
simde__m256i
reals
=
simde_mm256_srai_epi32
(
simde_mm256_madd_epi16
(
x
,
w_c
),
15
);
// (int32_t) .r = (x.r * w.r - x.i * w.i) >> 15
...
...
@@ -754,19 +762,20 @@ void nr_layer_precoder_simd(const int n_layers,
// Store the result to txdataF
simde_mm256_storeu_si256
(
&
txdataF_precoded
[
sc
],
y
);
}
#endif
#endif
// 128 SIMD: Do 4 RE in one iteration, 3 iterations for 1 RB
const
uint32_t
re_cnt_align4
=
re_cnt
&
~
3
;
for
(;
sc
<
sc_offset
+
re_cnt_align4
;
sc
+=
sizeof
(
simde__m128i
)
/
sizeof
(
*
prec_matrix
))
{
for
(;
sc
<
sc_offset
+
re_cnt_align4
;
sc
+=
sizeof
(
simde__m128i
)
/
sizeof
(
prec_weight
))
{
#ifdef DEBUG_DLSCH_PRECODING_PRINT_WITH_TRIVIAL // Get result with trivial solution, TODO: To be removed
c16_t
y_triv
[
4
];
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
y_triv
[
i
]
=
nr_layer_precoder_cm
(
n_layers
,
NR_SYMBOLS_PER_SLOT
,
symSz
,
txdataF_res_mapped
,
prec_matrix
,
ant
,
pmi_pdu
,
symbol
,
sc
+
i
);
memcpy
(
&
txdataF_precoded
[
sc
],
y_triv
,
sizeof
(
y_triv
));
...
...
@@ -774,12 +783,15 @@ void nr_layer_precoder_simd(const int n_layers,
// Matrix multiplication for 4 elements of the result (sizeof(simde__m128i) / sizeof(c16_t) = 4)
simde__m128i
y
=
simde_mm_set1_epi16
(
0
);
// Y = W[0]*X[0] + W[1]*X[1] + ... + W[nrOfLayers-1]*X[nrOfLayers-1]
for
(
int
nl
=
0
;
nl
<
n_layers
;
nl
++
){
for
(
int
nl
=
0
;
nl
<
n_layers
;
nl
++
)
{
prec_weight
.
r
=
pmi_pdu
->
weights
[
nl
][
ant
].
precoder_weight_Re
;
prec_weight
.
i
=
pmi_pdu
->
weights
[
nl
][
ant
].
precoder_weight_Im
;
const
simde__m128i
x
=
simde_mm_loadu_epi32
(
&
txdataF_res_mapped
[
nl
][
symbol
][
sc
]);
// Rearrange precoding matrix weight to match complex multiplication and broadcast it to match SIMD size
const
simde__m128i
w_c
=
simde_mm_set1_epi32
(
c16toI32
(
c16conj
(
prec_
matrix
[
nl
]
)));
// broadcast conjugate of w
const
simde__m128i
w_s
=
simde_mm_set1_epi32
(
c16toI32
(
c16swap
(
prec_
matrix
[
nl
]
)));
// broadcast swapped real and img of w
const
simde__m128i
w_c
=
simde_mm_set1_epi32
(
c16toI32
(
c16conj
(
prec_
weight
)));
// broadcast conjugate of w
const
simde__m128i
w_s
=
simde_mm_set1_epi32
(
c16toI32
(
c16swap
(
prec_
weight
)));
// broadcast swapped real and img of w
// Multiplication and shift
const
simde__m128i
reals
=
simde_mm_srai_epi32
(
simde_mm_madd_epi16
(
x
,
w_c
),
15
);
// (int32_t) .r = (x.r * w.r - x.i * w.i) >> 15
...
...
openair1/PHY/MODULATION/nr_modulation.h
View file @
c8afb25d
...
...
@@ -138,11 +138,13 @@ void apply_nr_rotation_RX(NR_DL_FRAME_PARMS *frame_parms,
@param[in] n_layers, number of DLSCH layers
*/
int
nr_layer_precoder
(
int16_t
**
datatx_F_precoding
,
const
char
*
prec_matrix
,
uint8_t
n_layers
,
int32_t
re_offset
);
c16_t
nr_layer_precoder_cm
(
int
n_layers
,
int
n_symbols
,
int
symSz
,
c16_t
datatx_F_precoding
[
n_layers
][
n_symbols
][
symSz
],
c16_t
*
prec_matrix
,
int
ap
,
nfapi_nr_pm_pdu_t
*
pmi_pdu
,
int
symbol
,
int
offset
);
...
...
@@ -156,7 +158,8 @@ void nr_layer_precoder_simd(const int n_layers,
const
int
n_symbols
,
const
int
symSz
,
const
c16_t
txdataF_res_mapped
[
n_layers
][
n_symbols
][
symSz
],
const
c16_t
prec_matrix
[
n_layers
],
const
int
ant
,
const
nfapi_nr_pm_pdu_t
*
pmi_pdu
,
const
int
symbol
,
const
int
sc_offset
,
const
int
re_cnt
,
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch.c
View file @
c8afb25d
...
...
@@ -535,28 +535,22 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
}
}
else
{
// non-unitary Precoding
if
(
frame_parms
->
nb_antennas_tx
==
1
){
// no precoding matrix defined
memcpy
(
&
txdataF
[
ant
][
txdataF_offset_per_symbol
+
subCarrier
],
&
txdataF_precoding
[
ant
][
l_symbol
][
subCarrier
],
re_cnt
*
sizeof
(
**
txdataF
));
subCarrier
+=
re_cnt
;
if
(
subCarrier
>=
frame_parms
->
ofdm_symbol_size
)
{
subCarrier
-=
frame_parms
->
ofdm_symbol_size
;
}
}
else
{
// precoding with more than 1 tx
AssertFatal
(
frame_parms
->
nb_antennas_tx
>
1
,
"No precoding can be done with a single antenna port
\n
"
);
//get the precoding matrix weights:
c16_t
**
mat
=
(
c16_t
**
)
gNB
->
nr_mimo_precoding_matrix
[
rel15
->
nrOfLayers
-
1
];
//i_row =0,...,dl_antenna_port
//j_col =0,...,nrOfLayers
//mat[pmi][i_rows*2+j_col]
c16_t
*
W_prec
=
&
mat
[
pmi
][
ant
*
rel15
->
nrOfLayers
];
nfapi_nr_pm_pdu_t
*
pmi_pdu
=
&
gNB
->
gNB_config
.
pmi_list
.
pmi_pdu
[
pmi
-
1
];
// pmi 0 is identity matrix
AssertFatal
(
pmi
==
pmi_pdu
->
pm_idx
,
"PMI %d doesn't match to the one in precoding matrix %d
\n
"
,
pmi
,
pmi_pdu
->
pm_idx
);
AssertFatal
(
ant
<
pmi_pdu
->
num_ant_ports
,
"Antenna port index %d exceeds precoding matrix AP size %d
\n
"
,
ant
,
pmi_pdu
->
num_ant_ports
);
AssertFatal
(
rel15
->
nrOfLayers
==
pmi_pdu
->
numLayers
,
"Number of layers %d doesn't match to the one in precoding matrix %d
\n
"
,
rel15
->
nrOfLayers
,
pmi_pdu
->
numLayers
);
if
((
subCarrier
+
re_cnt
)
<
frame_parms
->
ofdm_symbol_size
){
// within ofdm_symbol_size, use SIMDe
nr_layer_precoder_simd
(
rel15
->
nrOfLayers
,
NR_SYMBOLS_PER_SLOT
,
frame_parms
->
ofdm_symbol_size
,
txdataF_precoding
,
W_prec
,
ant
,
pmi_pdu
,
l_symbol
,
subCarrier
,
re_cnt
,
...
...
@@ -570,7 +564,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
NR_SYMBOLS_PER_SLOT
,
frame_parms
->
ofdm_symbol_size
,
txdataF_precoding
,
W_prec
,
ant
,
pmi_pdu
,
l_symbol
,
subCarrier
);
#ifdef DEBUG_DLSCH_MAPPING
...
...
@@ -586,7 +581,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
}
}
}
// else{ // crossing ofdm_symbol_size, use simple arithmetic operations
}
// else { // precoding with more than 1 tx
}
// else { // non-unitary Precoding
rb
+=
rb_step
;
...
...
openair1/PHY/defs_gNB.h
View file @
c8afb25d
...
...
@@ -619,13 +619,6 @@ typedef struct PHY_VARS_gNB_s {
/// PDSCH DMRS sequence
uint32_t
****
nr_gold_pdsch_dmrs
;
/// PDSCH codebook I precoding LUTs
/// first dimension: Rank number [0,...,noOfLayers-1[
/// second dimension: PMI [0,...,CodeSize-1[
/// third dimension: [i_rows*noOfLayers+j_col], i_rows=0,...pdsch_AntennaPorts-1 and j_col=0,...,noOfLayers-1
int32_t
***
nr_mimo_precoding_matrix
;
int
pmiq_size
[
NR_MAX_NB_LAYERS
];
/// PUSCH DMRS
uint32_t
****
nr_gold_pusch_dmrs
;
...
...
openair1/PHY/defs_nr_common.h
View file @
c8afb25d
...
...
@@ -79,7 +79,6 @@
#define NR_MAX_PDCCH_AGG_LEVEL 16 // 3GPP TS 38.211 V15.8 Section 7.3.2 Table 7.3.2.1-1: Supported PDCCH aggregation levels
#define NR_MAX_NB_LAYERS 4 // 8
#define NR_MAX_NB_PORTS 32
#define NR_MAX_PDSCH_TBS 3824
...
...
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
c8afb25d
...
...
@@ -223,35 +223,21 @@ nrUE_params_t *get_nrUE_params(void) {
}
void
validate_input_pmi
(
nr_pdsch_AntennaPorts_t
pdsch_AntennaPorts
,
int
nrOfLayers
,
int
pmi
)
void
validate_input_pmi
(
nfapi_nr_config_request_scf_t
*
gNB_config
,
nr_pdsch_AntennaPorts_t
pdsch_AntennaPorts
,
int
nrOfLayers
,
int
pmi
)
{
if
(
pmi
==
0
)
return
;
nfapi_nr_pm_pdu_t
*
pmi_pdu
=
&
gNB_config
->
pmi_list
.
pmi_pdu
[
pmi
-
1
];
// pmi 0 is identity matrix
AssertFatal
(
pmi
==
pmi_pdu
->
pm_idx
,
"PMI %d doesn't match to the one in precoding matrix %d
\n
"
,
pmi
,
pmi_pdu
->
pm_idx
);
AssertFatal
(
nrOfLayers
==
pmi_pdu
->
numLayers
,
"Number of layers %d doesn't match to the one in precoding matrix %d for PMI %d
\n
"
,
nrOfLayers
,
pmi_pdu
->
numLayers
,
pmi
);
int
num_antenna_ports
=
pdsch_AntennaPorts
.
N1
*
pdsch_AntennaPorts
.
N2
*
pdsch_AntennaPorts
.
XP
;
int
N1
=
pdsch_AntennaPorts
.
N1
;
int
N2
=
pdsch_AntennaPorts
.
N2
;
int
O1
=
N1
>
1
?
4
:
1
;
int
O2
=
N2
>
1
?
4
:
1
;
int
K1
,
K2
;
if
(
num_antenna_ports
>
2
)
get_K1_K2
(
N1
,
N2
,
&
K1
,
&
K2
);
else
{
K1
=
1
;
K2
=
1
;
}
int
num_pmi
=
1
;
// pmi = 0 is the identity matrix
switch
(
nrOfLayers
)
{
case
1
:
num_pmi
+=
N1
*
O1
*
N2
*
O2
*
4
;
AssertFatal
(
pmi
<
num_pmi
,
"Input PMI index %d exceeds the limit of configured matrices %d for %d layers
\n
"
,
pmi
,
num_pmi
,
nrOfLayers
);
return
;
case
2
:
num_pmi
+=
N1
*
O1
*
N2
*
O2
*
K1
*
K2
*
2
;
AssertFatal
(
pmi
<
num_pmi
,
"Input PMI index %d exceeds the limit of conigured matrices %d for %d layers
\n
"
,
pmi
,
num_pmi
,
nrOfLayers
);
break
;
default
:
AssertFatal
(
false
,
"Precoding with more than 2 nrOfLayers not yet supported
\n
"
);
}
AssertFatal
(
num_antenna_ports
==
pmi_pdu
->
num_ant_ports
,
"Configured antenna ports %d does not match precoding matrix AP size %d for PMI %d
\n
"
,
num_antenna_ports
,
pmi_pdu
->
num_ant_ports
,
pmi
);
}
...
...
@@ -709,7 +695,7 @@ int main(int argc, char **argv)
gNB
->
ap_N2
=
pdsch_AntennaPorts
.
N2
;
gNB
->
ap_XP
=
pdsch_AntennaPorts
.
XP
;
validate_input_pmi
(
pdsch_AntennaPorts
,
g_nrOfLayers
,
g_pmi
);
validate_input_pmi
(
&
gNB_mac
->
config
[
0
],
pdsch_AntennaPorts
,
g_nrOfLayers
,
g_pmi
);
NR_UE_NR_Capability_t
*
UE_Capability_nr
=
CALLOC
(
1
,
sizeof
(
NR_UE_NR_Capability_t
));
prepare_sim_uecap
(
UE_Capability_nr
,
scc
,
mu
,
...
...
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
c8afb25d
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
c8afb25d
...
...
@@ -668,8 +668,7 @@ static void pf_dl(module_id_t module_id,
else
sched_pdsch
->
mcs
=
get_mcs_from_bler
(
bo
,
stats
,
&
sched_ctrl
->
dl_bler_stats
,
max_mcs
,
frame
);
sched_pdsch
->
nrOfLayers
=
get_dl_nrOfLayers
(
sched_ctrl
,
current_BWP
->
dci_format
);
sched_pdsch
->
pm_index
=
mac
->
identity_pm
?
0
:
get_pm_index
(
UE
,
sched_pdsch
->
nrOfLayers
,
mac
->
radio_config
.
pdsch_AntennaPorts
.
XP
);
sched_pdsch
->
pm_index
=
mac
->
identity_pm
?
0
:
get_pm_index
(
mac
,
UE
,
sched_pdsch
->
nrOfLayers
,
mac
->
radio_config
.
pdsch_AntennaPorts
.
XP
);
const
uint8_t
Qm
=
nr_get_Qm_dl
(
sched_pdsch
->
mcs
,
current_BWP
->
mcsTableIdx
);
const
uint16_t
R
=
nr_get_code_rate_dl
(
sched_pdsch
->
mcs
,
current_BWP
->
mcsTableIdx
);
uint32_t
tbs
=
nr_compute_tbs
(
Qm
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
c8afb25d
...
...
@@ -129,29 +129,36 @@ uint8_t get_dl_nrOfLayers(const NR_UE_sched_ctrl_t *sched_ctrl,
}
uint16_t
get_pm_index
(
const
NR_UE_info_t
*
UE
,
uint16_t
get_pm_index
(
const
gNB_MAC_INST
*
nrmac
,
const
NR_UE_info_t
*
UE
,
int
layers
,
int
xp_pdsch_antenna_ports
)
{
if
(
layers
==
1
)
return
0
;
int
xp_pdsch_antenna_ports
)
{
const
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE
->
UE_sched_ctrl
;
const
int
report_id
=
sched_ctrl
->
CSI_report
.
cri_ri_li_pmi_cqi_report
.
csi_report_id
;
const
nr_csi_report_t
*
csi_report
=
&
UE
->
csi_report_template
[
report_id
];
const
int
N1
=
csi_report
->
N1
;
const
int
N2
=
csi_report
->
N2
;
const
int
antenna_ports
=
(
N1
*
N2
)
<<
1
;
const
int
antenna_ports
=
(
N1
*
N2
)
<<
1
;
if
(
xp_pdsch_antenna_ports
==
1
&&
antenna_ports
>
1
)
if
(
xp_pdsch_antenna_ports
==
1
)
return
0
;
//identity matrix (basic 5G configuration handled by PMI report is with XP antennas)
const
int
x1
=
sched_ctrl
->
CSI_report
.
cri_ri_li_pmi_cqi_report
.
pmi_x1
;
const
int
x2
=
sched_ctrl
->
CSI_report
.
cri_ri_li_pmi_cqi_report
.
pmi_x2
;
LOG_D
(
NR_MAC
,
"PMI report: x1 %d x2 %d
\n
"
,
x1
,
x2
);
LOG_D
(
NR_MAC
,
"PMI report: x1 %d x2 %d layers: %d
\n
"
,
x1
,
x2
,
layers
);
int
prev_layers_size
=
0
;
for
(
int
i
=
1
;
i
<
layers
;
i
++
)
prev_layers_size
+=
nrmac
->
precoding_matrix_size
[
i
-
1
];
// need to return PM index to matrix initialized in init_DL_MIMO_codebook
// index 0 is for identity matrix
// order of matrices depends on layers to be transmitted
// elements from 1 to n for 1 layer
// elements from n+1 to m for 2 layers etc.
if
(
antenna_ports
==
2
)
return
x2
;
return
1
+
prev_layers_size
+
x2
;
// 0 for identity matrix
else
AssertFatal
(
1
==
0
,
"More than 2 antenna ports not yet supported
\n
"
);
}
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
c8afb25d
...
...
@@ -377,7 +377,8 @@ NR_pdsch_dmrs_t get_dl_dmrs_params(const NR_ServingCellConfigCommon_t *scc,
const
NR_tda_info_t
*
tda_info
,
const
int
Layers
);
uint16_t
get_pm_index
(
const
NR_UE_info_t
*
UE
,
uint16_t
get_pm_index
(
const
gNB_MAC_INST
*
nrmac
,
const
NR_UE_info_t
*
UE
,
int
layers
,
int
xp_pdsch_antenna_ports
);
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
c8afb25d
...
...
@@ -852,6 +852,7 @@ typedef struct gNB_MAC_INST_s {
uint8_t
min_grant_prb
;
uint8_t
min_grant_mcs
;
bool
identity_pm
;
int
precoding_matrix_size
[
NR_MAX_NB_LAYERS
];
nr_mac_rrc_ul_if_t
mac_rrc
;
f1_config_t
f1_config
;
...
...
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