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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
bedc5bea
Commit
bedc5bea
authored
Feb 02, 2024
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove a gcc warning while making the code a bit simpler
parent
d26f0b91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
281 additions
and
224 deletions
+281
-224
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+281
-224
No files found.
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
bedc5bea
...
@@ -104,263 +104,320 @@ nfapi_nr_pm_list_t init_DL_MIMO_codebook(gNB_MAC_INST *gNB, nr_pdsch_AntennaPort
...
@@ -104,263 +104,320 @@ nfapi_nr_pm_list_t init_DL_MIMO_codebook(gNB_MAC_INST *gNB, nr_pdsch_AntennaPort
nfapi_nr_pm_pdu_t
*
pmi_pdu
=
malloc16
(
mat
.
num_pm_idx
*
sizeof
(
*
pmi_pdu
));
nfapi_nr_pm_pdu_t
*
pmi_pdu
=
malloc16
(
mat
.
num_pm_idx
*
sizeof
(
*
pmi_pdu
));
AssertFatal
(
pmi_pdu
!=
NULL
,
"out of memory
\n
"
);
AssertFatal
(
pmi_pdu
!=
NULL
,
"out of memory
\n
"
);
mat
.
pmi_pdu
=
pmi_pdu
;
mat
.
pmi_pdu
=
pmi_pdu
;
AssertFatal
(
num_antenna_ports
<
16
,
"Max number of antenna ports supported is currently 16
\n
"
);
// Generation of codebook Type1 with codebookMode 1 (num_antenna_ports < 16)
// Generation of codebook Type1 with codebookMode 1 (num_antenna_ports < 16)
if
(
num_antenna_ports
<
16
)
{
// Generate DFT vertical beams
//Generate DFT vertical beams
// ll: index of a vertical beams vector (represented by i1_1 in TS 38.214)
//ll: index of a vertical beams vector (represented by i1_1 in TS 38.214)
const
int
max_l
=
N1
*
O1
+
(
K1
-
1
)
*
O1
;
const
int
max_l
=
N1
*
O1
+
(
K1
-
1
)
*
O1
;
double
complex
v
[
max_l
][
N1
];
double
complex
v
[
max_l
][
N1
];
for
(
int
ll
=
0
;
ll
<
max_l
;
ll
++
)
{
// i1_1
for
(
int
ll
=
0
;
ll
<
max_l
;
ll
++
)
{
//i1_1
for
(
int
nn
=
0
;
nn
<
N1
;
nn
++
)
{
for
(
int
nn
=
0
;
nn
<
N1
;
nn
++
)
{
v
[
ll
][
nn
]
=
cexp
(
I
*
(
2
*
M_PI
*
nn
*
ll
)
/
(
N1
*
O1
));
v
[
ll
][
nn
]
=
cexp
(
I
*
(
2
*
M_PI
*
nn
*
ll
)
/
(
N1
*
O1
));
LOG_D
(
PHY
,
"v[%d][%d] = %f +j %f
\n
"
,
ll
,
nn
,
creal
(
v
[
ll
][
nn
]),
cimag
(
v
[
ll
][
nn
]));
LOG_D
(
PHY
,
"v[%d][%d] = %f +j %f
\n
"
,
ll
,
nn
,
creal
(
v
[
ll
][
nn
]),
cimag
(
v
[
ll
][
nn
]));
}
}
//Generate DFT Horizontal beams
//mm: index of a Horizontal beams vector (represented by i1_2 in TS 38.214)
const
int
max_m
=
N2
*
O2
+
(
K2
-
1
)
*
O2
;
double
complex
u
[
max_m
][
N2
];
for
(
int
mm
=
0
;
mm
<
max_m
;
mm
++
)
{
//i1_2
for
(
int
nn
=
0
;
nn
<
N2
;
nn
++
)
{
u
[
mm
][
nn
]
=
cexp
(
I
*
(
2
*
M_PI
*
nn
*
mm
)
/
(
N2
*
O2
));
LOG_D
(
PHY
,
"u[%d][%d] = %f +j %f
\n
"
,
mm
,
nn
,
creal
(
u
[
mm
][
nn
]),
cimag
(
u
[
mm
][
nn
]));
}
}
}
//Generate co-phasing angles
}
//i_2: index of a co-phasing vector
// Generate DFT Horizontal beams
//i1_1, i1_2, and i_2 are reported from UEs
// mm: index of a Horizontal beams vector (represented by i1_2 in TS 38.214)
double
complex
theta_n
[
4
];
const
int
max_m
=
N2
*
O2
+
(
K2
-
1
)
*
O2
;
for
(
int
nn
=
0
;
nn
<
4
;
nn
++
)
{
double
complex
u
[
max_m
][
N2
];
theta_n
[
nn
]
=
cexp
(
I
*
M_PI
*
nn
/
2
);
for
(
int
mm
=
0
;
mm
<
max_m
;
mm
++
)
{
// i1_2
LOG_D
(
PHY
,
"theta_n[%d] = %f +j %f
\n
"
,
nn
,
creal
(
theta_n
[
nn
]),
cimag
(
theta_n
[
nn
]));
for
(
int
nn
=
0
;
nn
<
N2
;
nn
++
)
{
u
[
mm
][
nn
]
=
cexp
(
I
*
(
2
*
M_PI
*
nn
*
mm
)
/
(
N2
*
O2
));
LOG_D
(
PHY
,
"u[%d][%d] = %f +j %f
\n
"
,
mm
,
nn
,
creal
(
u
[
mm
][
nn
]),
cimag
(
u
[
mm
][
nn
]));
}
}
//Kronecker product v_lm
}
double
complex
v_lm
[
max_l
][
max_m
][
N2
*
N1
];
// Generate co-phasing angles
//v_ll_mm_codebook denotes the elements of a precoding matrix W_i1,1_i_1,2
// i_2: index of a co-phasing vector
for
(
int
ll
=
0
;
ll
<
max_l
;
ll
++
)
{
//i_1_1
// i1_1, i1_2, and i_2 are reported from UEs
for
(
int
mm
=
0
;
mm
<
max_m
;
mm
++
)
{
//i_1_2
double
complex
theta_n
[
4
];
for
(
int
nn1
=
0
;
nn1
<
N1
;
nn1
++
)
{
for
(
int
nn
=
0
;
nn
<
4
;
nn
++
)
{
for
(
int
nn2
=
0
;
nn2
<
N2
;
nn2
++
)
{
theta_n
[
nn
]
=
cexp
(
I
*
M_PI
*
nn
/
2
);
v_lm
[
ll
][
mm
][
nn1
*
N2
+
nn2
]
=
v
[
ll
][
nn1
]
*
u
[
mm
][
nn2
];
LOG_D
(
PHY
,
"theta_n[%d] = %f +j %f
\n
"
,
nn
,
creal
(
theta_n
[
nn
]),
cimag
(
theta_n
[
nn
]));
LOG_D
(
PHY
,
"v_lm[%d][%d][%d] = %f +j %f
\n
"
,
ll
,
mm
,
nn1
*
N2
+
nn2
,
creal
(
v_lm
[
ll
][
mm
][
nn1
*
N2
+
nn2
]),
cimag
(
v_lm
[
ll
][
mm
][
nn1
*
N2
+
nn2
]));
}
}
// Kronecker product v_lm
double
complex
v_lm
[
max_l
][
max_m
][
N2
*
N1
];
// v_ll_mm_codebook denotes the elements of a precoding matrix W_i1,1_i_1,2
for
(
int
ll
=
0
;
ll
<
max_l
;
ll
++
)
{
// i_1_1
for
(
int
mm
=
0
;
mm
<
max_m
;
mm
++
)
{
// i_1_2
for
(
int
nn1
=
0
;
nn1
<
N1
;
nn1
++
)
{
for
(
int
nn2
=
0
;
nn2
<
N2
;
nn2
++
)
{
v_lm
[
ll
][
mm
][
nn1
*
N2
+
nn2
]
=
v
[
ll
][
nn1
]
*
u
[
mm
][
nn2
];
LOG_D
(
PHY
,
"v_lm[%d][%d][%d] = %f +j %f
\n
"
,
ll
,
mm
,
nn1
*
N2
+
nn2
,
creal
(
v_lm
[
ll
][
mm
][
nn1
*
N2
+
nn2
]),
cimag
(
v_lm
[
ll
][
mm
][
nn1
*
N2
+
nn2
]));
}
}
}
}
}
}
}
double
complex
res_code
;
double
complex
res_code
;
//Table 5.2.2.2.1-5:
// Table 5.2.2.2.1-5:
int
pmiq
=
0
;
int
pmiq
=
0
;
//Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
// Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
for
(
int
ll
=
0
;
ll
<
N1
*
O1
;
ll
++
)
{
//i_1_1
for
(
int
ll
=
0
;
ll
<
N1
*
O1
;
ll
++
)
{
// i_1_1
for
(
int
mm
=
0
;
mm
<
N2
*
O2
;
mm
++
)
{
//i_1_2
for
(
int
mm
=
0
;
mm
<
N2
*
O2
;
mm
++
)
{
// i_1_2
for
(
int
nn
=
0
;
nn
<
4
;
nn
++
)
{
for
(
int
nn
=
0
;
nn
<
4
;
nn
++
)
{
pmiq
=
ll
*
N2
*
O2
*
4
+
mm
*
4
+
nn
;
pmiq
=
ll
*
N2
*
O2
*
4
+
mm
*
4
+
nn
;
pmi_pdu
[
pmiq
].
pm_idx
=
pmiq
+
1
;
// index 0 is the identity matrix
pmi_pdu
[
pmiq
].
pm_idx
=
pmiq
+
1
;
// index 0 is the identity matrix
pmi_pdu
[
pmiq
].
numLayers
=
1
;
pmi_pdu
[
pmiq
].
numLayers
=
1
;
pmi_pdu
[
pmiq
].
num_ant_ports
=
num_antenna_ports
;
pmi_pdu
[
pmiq
].
num_ant_ports
=
num_antenna_ports
;
LOG_D
(
PHY
,
"layer 1 Codebook pmiq = %d
\n
"
,
pmiq
);
LOG_D
(
PHY
,
"layer 1 Codebook pmiq = %d
\n
"
,
pmiq
);
for
(
int
len
=
0
;
len
<
N1
*
N2
;
len
++
)
{
for
(
int
len
=
0
;
len
<
N1
*
N2
;
len
++
)
{
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
0
][
len
];
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
0
][
len
];
res_code
=
sqrt
(
1
/
(
double
)
num_antenna_ports
)
*
v_lm
[
ll
][
mm
][
len
];
res_code
=
sqrt
(
1
/
(
double
)
num_antenna_ports
)
*
v_lm
[
ll
][
mm
][
len
];
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
LOG_D
(
PHY
,
"1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
LOG_D
(
PHY
,
pmiq
,
len
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
"1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
}
pmiq
,
len
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
}
for
(
int
len
=
N1
*
N2
;
len
<
2
*
N1
*
N2
;
len
++
)
{
for
(
int
len
=
N1
*
N2
;
len
<
2
*
N1
*
N2
;
len
++
)
{
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
0
][
len
];
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
0
][
len
];
res_code
=
sqrt
(
1
/
(
double
)
num_antenna_ports
)
*
theta_n
[
nn
]
*
v_lm
[
ll
][
mm
][
len
-
N1
*
N2
];
res_code
=
sqrt
(
1
/
(
double
)
num_antenna_ports
)
*
theta_n
[
nn
]
*
v_lm
[
ll
][
mm
][
len
-
N1
*
N2
];
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
LOG_D
(
PHY
,
"1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
LOG_D
(
PHY
,
pmiq
,
len
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
"1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
}
pmiq
,
len
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
}
}
}
}
}
}
int
llc
=
0
;
}
int
mmc
=
0
;
int
llc
=
0
;
double
complex
phase_sign
=
0
;
int
mmc
=
0
;
//Table 5.2.2.2.1-6:
double
complex
phase_sign
=
0
;
//Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
// Table 5.2.2.2.1-6:
//Compute the code book size for generating 2 layers out of Tx antenna ports
// Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
// Compute the code book size for generating 2 layers out of Tx antenna ports
//pmi=1,...,pmi_size, we construct
for
(
int
ll
=
0
;
ll
<
N1
*
O1
;
ll
++
)
{
//i_1_1
// pmi=1,...,pmi_size, we construct
for
(
int
mm
=
0
;
mm
<
N2
*
O2
;
mm
++
)
{
// i_1_2
for
(
int
ll
=
0
;
ll
<
N1
*
O1
;
ll
++
)
{
// i_1_1
for
(
int
k1
=
0
;
k1
<
K1
;
k1
++
)
{
for
(
int
mm
=
0
;
mm
<
N2
*
O2
;
mm
++
)
{
// i_1_2
for
(
int
k2
=
0
;
k2
<
K2
;
k2
++
)
{
for
(
int
k1
=
0
;
k1
<
K1
;
k1
++
)
{
for
(
int
nn
=
0
;
nn
<
2
;
nn
++
)
{
// i_2
for
(
int
k2
=
0
;
k2
<
K2
;
k2
++
)
{
pmiq
++
;
for
(
int
nn
=
0
;
nn
<
2
;
nn
++
)
{
// i_2
pmi_pdu
[
pmiq
].
pm_idx
=
pmiq
+
1
;
// index 0 is the identity matrix
pmiq
++
;
pmi_pdu
[
pmiq
].
numLayers
=
2
;
pmi_pdu
[
pmiq
].
pm_idx
=
pmiq
+
1
;
// index 0 is the identity matrix
pmi_pdu
[
pmiq
].
num_ant_ports
=
num_antenna_ports
;
pmi_pdu
[
pmiq
].
numLayers
=
2
;
LOG_D
(
PHY
,
"layer 2 Codebook pmiq = %d
\n
"
,
pmiq
);
pmi_pdu
[
pmiq
].
num_ant_ports
=
num_antenna_ports
;
for
(
int
j_col
=
0
;
j_col
<
2
;
j_col
++
)
{
LOG_D
(
PHY
,
"layer 2 Codebook pmiq = %d
\n
"
,
pmiq
);
if
(
j_col
==
0
)
{
for
(
int
j_col
=
0
;
j_col
<
2
;
j_col
++
)
{
llc
=
ll
;
if
(
j_col
==
0
)
{
mmc
=
mm
;
llc
=
ll
;
phase_sign
=
1
;
mmc
=
mm
;
}
phase_sign
=
1
;
if
(
j_col
==
1
)
{
}
llc
=
ll
+
k1
*
O1
;
if
(
j_col
==
1
)
{
mmc
=
mm
+
k2
*
O2
;
llc
=
ll
+
k1
*
O1
;
phase_sign
=
-
1
;
mmc
=
mm
+
k2
*
O2
;
}
phase_sign
=
-
1
;
for
(
int
i_rows
=
0
;
i_rows
<
N1
*
N2
;
i_rows
++
)
{
}
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
for
(
int
i_rows
=
0
;
i_rows
<
N1
*
N2
;
i_rows
++
)
{
res_code
=
sqrt
(
1
/
(
double
)(
2
*
num_antenna_ports
))
*
v_lm
[
llc
][
mmc
][
i_rows
];
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
res_code
=
sqrt
(
1
/
(
double
)(
2
*
num_antenna_ports
))
*
v_lm
[
llc
][
mmc
][
i_rows
];
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
LOG_D
(
PHY
,
"2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
LOG_D
(
PHY
,
}
"2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
for
(
int
i_rows
=
N1
*
N2
;
i_rows
<
2
*
N1
*
N2
;
i_rows
++
)
{
pmiq
,
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
i_rows
,
res_code
=
sqrt
(
1
/
(
double
)(
2
*
num_antenna_ports
))
*
(
phase_sign
)
*
theta_n
[
nn
]
*
v_lm
[
llc
][
mmc
][
i_rows
-
N1
*
N2
];
j_col
,
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
creal
(
res_code
),
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
cimag
(
res_code
),
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
weights
->
precoder_weight_Re
,
LOG_D
(
PHY
,
"2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
weights
->
precoder_weight_Im
);
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
}
}
for
(
int
i_rows
=
N1
*
N2
;
i_rows
<
2
*
N1
*
N2
;
i_rows
++
)
{
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
res_code
=
sqrt
(
1
/
(
double
)(
2
*
num_antenna_ports
))
*
(
phase_sign
)
*
theta_n
[
nn
]
*
v_lm
[
llc
][
mmc
][
i_rows
-
N1
*
N2
];
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
LOG_D
(
PHY
,
"2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
}
}
}
}
}
}
}
}
}
}
}
}
}
if
(
max_mimo_layers
<
3
)
if
(
max_mimo_layers
<
3
)
return
mat
;
return
mat
;
//Table 5.2.2.2.1-7:
// Table 5.2.2.2.1-7:
//Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
// Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
//pmi=1,...,pmi_size are computed as follows
// pmi=1,...,pmi_size are computed as follows
for
(
int
ll
=
0
;
ll
<
N1
*
O1
;
ll
++
)
{
//i_1_1
for
(
int
ll
=
0
;
ll
<
N1
*
O1
;
ll
++
)
{
// i_1_1
for
(
int
mm
=
0
;
mm
<
N2
*
O2
;
mm
++
)
{
// i_1_2
for
(
int
mm
=
0
;
mm
<
N2
*
O2
;
mm
++
)
{
// i_1_2
for
(
int
k1
=
0
;
k1
<
K1
;
k1
++
)
{
for
(
int
k1
=
0
;
k1
<
K1
;
k1
++
)
{
for
(
int
k2
=
0
;
k2
<
K2
;
k2
++
)
{
for
(
int
k2
=
0
;
k2
<
K2
;
k2
++
)
{
for
(
int
nn
=
0
;
nn
<
2
;
nn
++
)
{
// i_2
for
(
int
nn
=
0
;
nn
<
2
;
nn
++
)
{
// i_2
pmiq
++
;
pmiq
++
;
pmi_pdu
[
pmiq
].
pm_idx
=
pmiq
+
1
;
// index 0 is the identity matrix
pmi_pdu
[
pmiq
].
pm_idx
=
pmiq
+
1
;
// index 0 is the identity matrix
pmi_pdu
[
pmiq
].
numLayers
=
3
;
pmi_pdu
[
pmiq
].
numLayers
=
3
;
pmi_pdu
[
pmiq
].
num_ant_ports
=
num_antenna_ports
;
pmi_pdu
[
pmiq
].
num_ant_ports
=
num_antenna_ports
;
LOG_D
(
PHY
,
"layer 3 Codebook pmiq = %d
\n
"
,
pmiq
);
LOG_D
(
PHY
,
"layer 3 Codebook pmiq = %d
\n
"
,
pmiq
);
for
(
int
j_col
=
0
;
j_col
<
3
;
j_col
++
)
{
for
(
int
j_col
=
0
;
j_col
<
3
;
j_col
++
)
{
if
(
j_col
==
0
)
{
if
(
j_col
==
0
)
{
llc
=
ll
;
llc
=
ll
;
mmc
=
mm
;
mmc
=
mm
;
phase_sign
=
1
;
phase_sign
=
1
;
}
}
if
(
j_col
==
1
)
{
if
(
j_col
==
1
)
{
llc
=
ll
+
k1
*
O1
;
llc
=
ll
+
k1
*
O1
;
mmc
=
mm
+
k2
*
O2
;
mmc
=
mm
+
k2
*
O2
;
phase_sign
=
1
;
phase_sign
=
1
;
}
}
if
(
j_col
==
2
)
{
if
(
j_col
==
2
)
{
llc
=
ll
;
llc
=
ll
;
mmc
=
mm
;
mmc
=
mm
;
phase_sign
=
-
1
;
phase_sign
=
-
1
;
}
}
for
(
int
i_rows
=
0
;
i_rows
<
N1
*
N2
;
i_rows
++
)
{
for
(
int
i_rows
=
0
;
i_rows
<
N1
*
N2
;
i_rows
++
)
{
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
res_code
=
sqrt
(
1
/
(
double
)(
3
*
num_antenna_ports
))
*
v_lm
[
llc
][
mmc
][
i_rows
];
res_code
=
sqrt
(
1
/
(
double
)(
3
*
num_antenna_ports
))
*
v_lm
[
llc
][
mmc
][
i_rows
];
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
LOG_D
(
PHY
,
"3 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
LOG_D
(
PHY
,
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
"3 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
}
pmiq
,
for
(
int
i_rows
=
N1
*
N2
;
i_rows
<
2
*
N1
*
N2
;
i_rows
++
)
{
i_rows
,
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
j_col
,
res_code
=
sqrt
(
1
/
(
double
)(
3
*
num_antenna_ports
))
*
(
phase_sign
)
*
theta_n
[
nn
]
*
v_lm
[
llc
][
mmc
][
i_rows
-
N1
*
N2
];
creal
(
res_code
),
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
cimag
(
res_code
),
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
weights
->
precoder_weight_Im
);
LOG_D
(
PHY
,
"3 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
}
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
for
(
int
i_rows
=
N1
*
N2
;
i_rows
<
2
*
N1
*
N2
;
i_rows
++
)
{
}
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
res_code
=
sqrt
(
1
/
(
double
)(
3
*
num_antenna_ports
))
*
(
phase_sign
)
*
theta_n
[
nn
]
*
v_lm
[
llc
][
mmc
][
i_rows
-
N1
*
N2
];
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
LOG_D
(
PHY
,
"3 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
}
}
}
}
}
}
}
}
}
}
}
}
}
if
(
max_mimo_layers
<
4
)
return
mat
;
if
(
max_mimo_layers
<
4
)
// Table 5.2.2.2.1-8:
return
mat
;
// Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
//Table 5.2.2.2.1-8:
for
(
int
ll
=
0
;
ll
<
N1
*
O1
;
ll
++
)
{
// i_1_1
//Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
for
(
int
mm
=
0
;
mm
<
N2
*
O2
;
mm
++
)
{
// i_1_2
for
(
int
k1
=
0
;
k1
<
K1
;
k1
++
)
{
for
(
int
ll
=
0
;
ll
<
N1
*
O1
;
ll
++
)
{
//i_1_1
for
(
int
k2
=
0
;
k2
<
K2
;
k2
++
)
{
for
(
int
mm
=
0
;
mm
<
N2
*
O2
;
mm
++
)
{
// i_1_2
for
(
int
nn
=
0
;
nn
<
2
;
nn
++
)
{
// i_2
for
(
int
k1
=
0
;
k1
<
K1
;
k1
++
)
{
pmiq
++
;
for
(
int
k2
=
0
;
k2
<
K2
;
k2
++
)
{
pmi_pdu
[
pmiq
].
pm_idx
=
pmiq
+
1
;
// index 0 is the identity matrix
for
(
int
nn
=
0
;
nn
<
2
;
nn
++
)
{
// i_2
pmi_pdu
[
pmiq
].
numLayers
=
4
;
pmiq
++
;
pmi_pdu
[
pmiq
].
num_ant_ports
=
num_antenna_ports
;
pmi_pdu
[
pmiq
].
pm_idx
=
pmiq
+
1
;
// index 0 is the identity matrix
LOG_D
(
PHY
,
"layer 4 pmiq = %d
\n
"
,
pmiq
);
pmi_pdu
[
pmiq
].
numLayers
=
4
;
for
(
int
j_col
=
0
;
j_col
<
4
;
j_col
++
)
{
pmi_pdu
[
pmiq
].
num_ant_ports
=
num_antenna_ports
;
if
(
j_col
==
0
)
{
LOG_D
(
PHY
,
"layer 4 pmiq = %d
\n
"
,
pmiq
);
llc
=
ll
;
for
(
int
j_col
=
0
;
j_col
<
4
;
j_col
++
)
{
mmc
=
mm
;
if
(
j_col
==
0
)
{
phase_sign
=
1
;
llc
=
ll
;
}
mmc
=
mm
;
if
(
j_col
==
1
)
{
phase_sign
=
1
;
llc
=
ll
+
k1
*
O1
;
}
mmc
=
mm
+
k2
*
O2
;
if
(
j_col
==
1
)
{
phase_sign
=
1
;
llc
=
ll
+
k1
*
O1
;
}
mmc
=
mm
+
k2
*
O2
;
if
(
j_col
==
2
)
{
phase_sign
=
1
;
llc
=
ll
;
}
mmc
=
mm
;
if
(
j_col
==
2
)
{
phase_sign
=
-
1
;
llc
=
ll
;
}
mmc
=
mm
;
if
(
j_col
==
3
)
{
phase_sign
=
-
1
;
llc
=
ll
+
k1
*
O1
;
}
mmc
=
mm
+
k2
*
O2
;
if
(
j_col
==
3
)
{
phase_sign
=
-
1
;
llc
=
ll
+
k1
*
O1
;
}
mmc
=
mm
+
k2
*
O2
;
for
(
int
i_rows
=
0
;
i_rows
<
N1
*
N2
;
i_rows
++
)
{
phase_sign
=
-
1
;
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
}
res_code
=
sqrt
(
1
/
(
double
)(
4
*
num_antenna_ports
))
*
v_lm
[
llc
][
mmc
][
i_rows
];
for
(
int
i_rows
=
0
;
i_rows
<
N1
*
N2
;
i_rows
++
)
{
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
res_code
=
sqrt
(
1
/
(
double
)(
4
*
num_antenna_ports
))
*
v_lm
[
llc
][
mmc
][
i_rows
];
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
LOG_D
(
PHY
,
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
"4 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
pmiq
,
LOG_D
(
PHY
,
"4 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
i_rows
,
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
j_col
,
}
creal
(
res_code
),
for
(
int
i_rows
=
N1
*
N2
;
i_rows
<
2
*
N1
*
N2
;
i_rows
++
)
{
cimag
(
res_code
),
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
weights
->
precoder_weight_Re
,
res_code
=
sqrt
(
1
/
(
double
)(
4
*
num_antenna_ports
))
*
(
phase_sign
)
*
theta_n
[
nn
]
*
v_lm
[
llc
][
mmc
][
i_rows
-
N1
*
N2
];
weights
->
precoder_weight_Im
);
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
}
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
for
(
int
i_rows
=
N1
*
N2
;
i_rows
<
2
*
N1
*
N2
;
i_rows
++
)
{
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
nfapi_nr_pm_weights_t
*
weights
=
&
pmi_pdu
[
pmiq
].
weights
[
j_col
][
i_rows
];
LOG_D
(
PHY
,
"4 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
res_code
=
sqrt
(
1
/
(
double
)(
4
*
num_antenna_ports
))
*
(
phase_sign
)
*
theta_n
[
nn
]
*
v_lm
[
llc
][
mmc
][
i_rows
-
N1
*
N2
];
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
c16_t
precoder_weight
=
convert_precoder_weight
(
res_code
);
}
weights
->
precoder_weight_Re
=
precoder_weight
.
r
;
weights
->
precoder_weight_Im
=
precoder_weight
.
i
;
LOG_D
(
PHY
,
"4 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d
\n
"
,
pmiq
,
i_rows
,
j_col
,
creal
(
res_code
),
cimag
(
res_code
),
weights
->
precoder_weight_Re
,
weights
->
precoder_weight_Im
);
}
}
}
}
}
}
}
}
}
}
}
}
return
mat
;
}
}
else
return
mat
;
AssertFatal
(
false
,
"Max number of antenna ports supported is currently 16
\n
"
);
}
}
static
void
process_rlcBearerConfig
(
struct
NR_CellGroupConfig__rlc_BearerToAddModList
*
rlc_bearer2add_list
,
static
void
process_rlcBearerConfig
(
struct
NR_CellGroupConfig__rlc_BearerToAddModList
*
rlc_bearer2add_list
,
...
...
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