Commit 4dbf6709 authored by lfq's avatar lfq

add amp log

parent d610c9a0
......@@ -81,6 +81,18 @@ unsigned char offset_mumimo_llr_drange[29][3]={{8,8,8},{7,7,7},{7,7,7},{7,7,7},{
#define print_ints(s,x) printf("%s = %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
#define print_shorts(s,x) printf("%s = [%d+j*%d, %d+j*%d, %d+j*%d, %d+j*%d]\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
unsigned int cal_amp(int16_t *dataIn, int len)
{
int i;
unsigned int sumA = 0;
for(i=0;i<len;i++)
{
sumA += abs(dataIn[i]);
}
sumA = sumA/len;
return sumA;
}
/* compute H_h_H matrix inversion up to 4x4 matrices */
uint8_t nr_zero_forcing_rx(uint32_t rx_size_symbol,
unsigned char n_rx,
......@@ -406,10 +418,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
//--------------------- RBs extraction ---------------------
//----------------------------------------------------------
const int n_rx = frame_parms->nb_antennas_rx;
__attribute__((aligned(32))) c16_t rxdataF_ext[nbRx][rx_size_symbol];
start_meas(&ue->generic_stat_bis[slot]);
{
__attribute__((aligned(32))) c16_t rxdataF_ext[nbRx][rx_size_symbol];
memset(rxdataF_ext, 0, sizeof(rxdataF_ext));
nr_dlsch_extract_rbs(ue->frame_parms.samples_per_slot_wCP,
......@@ -444,6 +456,14 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
//----------------------------------------------------------
//--------------------- Channel Scaling --------------------
//----------------------------------------------------------
if ((pilots == 0) && (dlsch[0].rnti_type == _SI_RNTI_))
{
unsigned int pdsch_amp;
pdsch_amp = cal_amp((int16_t *)&rxdataF_ext[0][0 ], nb_rb_pdsch * 12);
LOG_I(PHY, "frame %d %d, SIB symbol %d pdsch_amp %u, rb %d\n", frame, nr_slot_rx, symbol, pdsch_amp, nb_rb_pdsch);
}
start_meas(&ue->generic_stat_bis[slot]);
nr_dlsch_scale_channel(rx_size_symbol, dl_ch_estimates_ext, frame_parms, nl, n_rx, symbol, pilots, nb_re_pdsch, nb_rb_pdsch);
stop_meas(&ue->generic_stat_bis[slot]);
......@@ -533,6 +553,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nr_zero_forcing_rx(
rx_size_symbol, n_rx, nl, rxdataF_comp, dl_ch_mag, dl_ch_magb, dl_ch_magr, dl_ch_estimates_ext, nb_rb_pdsch, dlsch[0].dlsch_config.qamModOrder, *log2_maxh, symbol, nb_re_pdsch);
}
stop_meas(&ue->generic_stat_bis[slot]);
if (cpumeas(CPUMEAS_GETSTATE))
......
......@@ -940,6 +940,7 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slot, 0);
fapi_nr_ul_config_srs_pdu *srs_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].srs_config_pdu;
LOG_I(PHY, "frame %d, %d, n_slots_frame %d, period %d, offset %d\n", frame, slot, n_slots_frame, period, offset);
configure_srs_pdu(mac, srs_resource, srs_config_pdu, period, offset);
fill_ul_config(ul_config, frame, slot, FAPI_NR_UL_CONFIG_TYPE_SRS);
......
......@@ -267,7 +267,7 @@ RUs = (
##beamforming 1x2 matrix: 1 layer x 2 antennas
#bf_weights = [0x00007fff, 0x0000];
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
sdr_addrs = "dev=pciex:0,auxdac1=340";
sdr_addrs = "dev=pciex:0,auxdac1=1511";
clock_src = "internal";
}
......
......@@ -215,7 +215,7 @@ RUs = (
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 85
att_tx = 85;
att_rx = 0;
bands = [78];
max_pdschReferenceSignalPower = -27;
......@@ -224,7 +224,7 @@ RUs = (
eNB_instances = [0];
#beamforming 1x4 matrix:
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
sdr_addrs = "dev=pciex:0,auxdac1=340";
sdr_addrs = "dev=pciex:0,auxdac1=1511";
clock_src = "internal";
}
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment