Merge remote-tracking branch 'origin/fix-usage-iq_rxrescale-iq_txshift' into integration_2026_w02 (!3832)
Remove global iq_txshift and iq_rxrescale iq_txshift and iq_rxrescale are defined but not used, this commit fixes it
This commit is contained in:
@@ -108,10 +108,6 @@ int main(int argc, char **argv) {
|
||||
.sdr_addrs=usrp_addrs,
|
||||
//! Auto calibration flag
|
||||
.autocal={0},
|
||||
//! rf devices work with x bits iqs when oai have its own iq format
|
||||
//! the two following parameters are used to convert iqs
|
||||
.iq_txshift=0,
|
||||
.iq_rxrescale=0,
|
||||
//! Configuration file for LMS7002M
|
||||
.configFilename="",
|
||||
//! remote IP/MAC addr for Ethernet interface
|
||||
|
||||
@@ -957,8 +957,6 @@ int device_init(openair0_device *device,
|
||||
/* device specific */
|
||||
//openair0_cfg->txlaunch_wait = 1;//manage when TX processing is triggered
|
||||
//openair0_cfg->txlaunch_wait_slotcount = 1; //manage when TX processing is triggered
|
||||
openair0_cfg->iq_txshift = 0;// shift
|
||||
openair0_cfg->iq_rxrescale = 15;//rescale iqs
|
||||
|
||||
// init required params
|
||||
switch ((int)openair0_cfg->sample_rate) {
|
||||
@@ -983,8 +981,6 @@ int device_init(openair0_device *device,
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
openair0_cfg->iq_txshift= 0;
|
||||
openair0_cfg->iq_rxrescale = 15; /*not sure*/
|
||||
openair0_cfg->rx_gain_calib_table = calib_table_fx4;
|
||||
|
||||
// The number of buffers to use in the underlying data stream
|
||||
|
||||
@@ -276,10 +276,6 @@ typedef struct openair0_config {
|
||||
char *sdr_addrs;
|
||||
//! Auto calibration flag
|
||||
int autocal[8];
|
||||
//! rf devices work with x bits iqs when oai have its own iq format
|
||||
//! the two following parameters are used to convert iqs
|
||||
int iq_txshift;
|
||||
int iq_rxrescale;
|
||||
//! Configuration file for LMS7002M
|
||||
char *configFilename;
|
||||
//! remote IP/MAC addr for Ethernet interface
|
||||
|
||||
@@ -540,40 +540,6 @@ int transport_init(openair0_device *device,
|
||||
|
||||
eth->if_name = eth_params->local_if_name;
|
||||
device->priv = eth;
|
||||
|
||||
|
||||
/* device specific */
|
||||
// openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
|
||||
// openair0_cfg[0].iq_txshift = eth_params->iq_txshift;// shift
|
||||
// openair0_cfg[0].tx_sample_advance = eth_params->tx_sample_advance;
|
||||
|
||||
/* RRU does not have any information to make this configuration atm */
|
||||
/*
|
||||
if (device->host_type == RAU_HOST) {
|
||||
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
case 30720000:
|
||||
openair0_cfg[0].samples_per_packet = 3840;
|
||||
break;
|
||||
case 23040000:
|
||||
openair0_cfg[0].samples_per_packet = 2880;
|
||||
break;
|
||||
case 15360000:
|
||||
openair0_cfg[0].samples_per_packet = 1920;
|
||||
break;
|
||||
case 7680000:
|
||||
openair0_cfg[0].samples_per_packet = 960;
|
||||
break;
|
||||
case 1920000:
|
||||
openair0_cfg[0].samples_per_packet = 240;
|
||||
break;
|
||||
default:
|
||||
printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
device->openair0_cfg=&openair0_cfg[0];
|
||||
return 0;
|
||||
}
|
||||
|
||||
+12
-15
@@ -478,14 +478,15 @@ static int trx_usrp_write(openair0_device *device,
|
||||
nsamps2 = (nsamps+7)>>3;
|
||||
simde__m256i buff_tx[cc < 2 ? 2 : cc][nsamps2];
|
||||
|
||||
// bring RX data into 12 LSBs for softmodem RX
|
||||
// bring TX data into 16 MSBs, assuming it is on the 12 LSB after OAI computation
|
||||
const int shift = 4;
|
||||
for (int i = 0; i < cc; i++) {
|
||||
for (int j = 0; j < nsamps2; j++) {
|
||||
if ((((uintptr_t)buff[i]) & 0x1F) == 0) {
|
||||
buff_tx[i][j] = simde_mm256_slli_epi16(((simde__m256i *)buff[i])[j], 4);
|
||||
buff_tx[i][j] = simde_mm256_slli_epi16(((simde__m256i *)buff[i])[j], shift);
|
||||
} else {
|
||||
simde__m256i tmp = simde_mm256_loadu_si256(((simde__m256i *)buff[i]) + j);
|
||||
buff_tx[i][j] = simde_mm256_slli_epi16(tmp, 4);
|
||||
buff_tx[i][j] = simde_mm256_slli_epi16(tmp, shift);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -605,17 +606,17 @@ void *trx_usrp_write_thread(void * arg){
|
||||
|
||||
nsamps2 = (nsamps+7)>>3;
|
||||
simde__m256i buff_tx[cc < 2 ? 2 : cc][nsamps2];
|
||||
|
||||
// bring RX data into 12 LSBs for softmodem RX
|
||||
// bring TX data into 16 MSBs, assuming it is on the 12 LSB after OAI computation
|
||||
const int shift = 4;
|
||||
for (int i = 0; i < cc; i++) {
|
||||
for (int j = 0; j < nsamps2; j++) {
|
||||
if ((((uintptr_t) buff[i])&0x1F)==0) {
|
||||
buff_tx[i][j] = simde_mm256_slli_epi16(((simde__m256i *)buff[i])[j], 4);
|
||||
buff_tx[i][j] = simde_mm256_slli_epi16(((simde__m256i *)buff[i])[j], shift);
|
||||
}
|
||||
else
|
||||
{
|
||||
simde__m256i tmp = simde_mm256_loadu_si256(((simde__m256i *)buff[i]) + j);
|
||||
buff_tx[i][j] = simde_mm256_slli_epi16(tmp,4);
|
||||
buff_tx[i][j] = simde_mm256_slli_epi16(tmp, shift);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -752,11 +753,13 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
// bring RX data into 12 LSBs for softmodem RX
|
||||
for (int i=0; i<cc; i++) {
|
||||
for (int j = 0; j < nsamps2; j++) {
|
||||
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
|
||||
|
||||
// bring RX data into 12 LSBs for softmodem RX,
|
||||
// this keeps the significant bits of B210 and may loose better ADC results,
|
||||
// but it makes free bits in MSB for signal processing on int16
|
||||
if ((((uintptr_t) buff[i])&0x1F)==0) {
|
||||
((simde__m256i *)buff[i])[j] = simde_mm256_srai_epi16(buff_tmp[i][j], rxshift);
|
||||
} else {
|
||||
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
|
||||
simde__m256i tmp = simde_mm256_srai_epi16(buff_tmp[i][j], rxshift);
|
||||
simde_mm256_storeu_si256(((simde__m256i *)buff[i]) + j, tmp);
|
||||
}
|
||||
@@ -1339,12 +1342,6 @@ extern "C" {
|
||||
}
|
||||
}
|
||||
|
||||
/* device specific */
|
||||
//openair0_cfg[0].txlaunch_wait = 1;//manage when TX processing is triggered
|
||||
//openair0_cfg[0].txlaunch_wait_slotcount = 1; //manage when TX processing is triggered
|
||||
openair0_cfg[0].iq_txshift = 4;//shift
|
||||
openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
|
||||
|
||||
if(openair0_cfg[0].tx_subdev!=NULL){
|
||||
LOG_I(HW, "openair0_cfg[0].tx_subdev == %s\n", openair0_cfg[0].tx_subdev);
|
||||
tx_subdev = openair0_cfg[0].tx_subdev;
|
||||
|
||||
Reference in New Issue
Block a user