use c16_t type for pm weights, as it is already same type

simplify SIMD version of precoder
This commit is contained in:
Laurent THOMAS
2025-10-09 16:04:43 +02:00
parent fb47748fae
commit e056acc896
7 changed files with 282 additions and 414 deletions
+2 -3
View File
@@ -760,7 +760,7 @@ static uint8_t pack_pm_table_tlv_value(void *tlv, uint8_t **ppWritePackedMsg, ui
for (int k = 0; k < pm_pdu->numLayers; k++) {
for (int j = 0; j < pm_pdu->num_ant_ports; j++) {
const nfapi_nr_pm_weights_t *pm_weight = &pm_pdu->weights[k][j];
if (!(push16(pm_weight->precoder_weight_Re, ppWritePackedMsg, end) && push16(pm_weight->precoder_weight_Im, ppWritePackedMsg, end))) {
if (!(push16(pm_weight->r, ppWritePackedMsg, end) && push16(pm_weight->i, ppWritePackedMsg, end))) {
return 0;
}
}
@@ -1307,8 +1307,7 @@ static uint8_t unpack_pm_table_tlv_value(void *tlv, uint8_t **ppReadPackedMsg, u
for (int k = 0; k < pm_pdu->numLayers; k++) {
for (int j = 0; j < pm_pdu->num_ant_ports; j++) {
nfapi_nr_pm_weights_t *pm_weight = &pm_pdu->weights[k][j];
if (!(pulls16(ppReadPackedMsg, &pm_weight->precoder_weight_Re, end)
&& pulls16(ppReadPackedMsg, &pm_weight->precoder_weight_Im, end))) {
if (!(pulls16(ppReadPackedMsg, &pm_weight->r, end) && pulls16(ppReadPackedMsg, &pm_weight->i, end))) {
return 0;
}
}
+5 -8
View File
@@ -287,8 +287,8 @@ bool eq_config_request(const nfapi_nr_config_request_scf_t *unpacked_req, const
for (int k = 0; k < req_pmi_pdu->num_ant_ports; ++k) {
const nfapi_nr_pm_weights_t* req_pm_weight = &req_pmi_pdu->weights[j][k];
const nfapi_nr_pm_weights_t* unpacked_pm_weight = &unpacked_pmi_pdu->weights[j][k];
EQ(unpacked_pm_weight->precoder_weight_Re, req_pm_weight->precoder_weight_Re);
EQ(unpacked_pm_weight->precoder_weight_Im, req_pm_weight->precoder_weight_Im);
EQ(unpacked_pm_weight->r, req_pm_weight->r);
EQ(unpacked_pm_weight->i, req_pm_weight->i);
}
}
}
@@ -848,10 +848,7 @@ void copy_config_request(const nfapi_nr_config_request_scf_t *src, nfapi_nr_conf
dst_pmi_pdu->num_ant_ports = src_pmi_pdu->num_ant_ports;
for (int j = 0; j < dst_pmi_pdu->numLayers; ++j) {
for (int k = 0; k < dst_pmi_pdu->num_ant_ports; ++k) {
nfapi_nr_pm_weights_t* dst_pm_weight = &dst_pmi_pdu->weights[j][k];
const nfapi_nr_pm_weights_t* src_pm_weight = &src_pmi_pdu->weights[j][k];
dst_pm_weight->precoder_weight_Re = src_pm_weight->precoder_weight_Re;
dst_pm_weight->precoder_weight_Im = src_pm_weight->precoder_weight_Im;
dst_pmi_pdu->weights[j][k] = src_pmi_pdu->weights[j][k];
}
}
}
@@ -1313,8 +1310,8 @@ void dump_config_request(const nfapi_nr_config_request_scf_t *msg)
for (int k = 0; k < pm_pdu->numLayers; k++) {
for (int l = 0; l < pm_pdu->num_ant_ports; l++) {
const nfapi_nr_pm_weights_t *pm_weights = &pm_pdu->weights[k][l];
INDENTED_GENERIC_PRINT("Dig Beam Weight Real", "0x%02x", pm_weights->precoder_weight_Re);
INDENTED_GENERIC_PRINT("Dig Beam Weight Imaginary", "0x%02x", pm_weights->precoder_weight_Im);
INDENTED_GENERIC_PRINT("Dig Beam Weight Real", "0x%02x", pm_weights->r);
INDENTED_GENERIC_PRINT("Dig Beam Weight Imaginary", "0x%02x", pm_weights->i);
}
}
depth--;
@@ -10,6 +10,7 @@
#define _NFAPI_NR_INTERFACE_SCF_H_
#include "stddef.h"
#include "common/platform_types.h"
#include "nfapi_interface.h"
#include "nfapi_nr_interface.h"
@@ -488,11 +489,7 @@ typedef struct {
} nfapi_nr_dbt_tlv_ve_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 c16_t nfapi_nr_pm_weights_t;
typedef struct {
uint16_t pm_idx;
+2 -2
View File
@@ -239,8 +239,8 @@ static void fill_config_request_tlv_tdd_rand(nfapi_nr_config_request_scf_t *nfap
for (int j = 0; j < num_layers; j++) {
for (int k = 0; k < num_ant_ports; k++) {
nfapi_nr_pm_weights_t* pm_weight = &pmi_pdu->weights[j][k];
pm_weight->precoder_weight_Re = (int16_t)rand16_range(1, 0xffff);
pm_weight->precoder_weight_Im = (int16_t)rand16_range(1, 0xffff);
pm_weight->r = (int16_t)rand16_range(1, 0xffff);
pm_weight->i = (int16_t)rand16_range(1, 0xffff);
}
}
}