Commit 3c21e1dd authored by rdoost's avatar rdoost

changed multi-iris support, by reading configs into config struct array for...

changed multi-iris support, by reading configs into config struct array for each iris, switched to 2.6 in conf for TDD, total antenna numbers are set in carrier conf and calculated for each iris in softmodem
parent 549deb02
......@@ -233,7 +233,7 @@ typedef struct {
//! local Ethernet interface (eNB/BBU, UE)
char *local_if_name;
//! tx_sample_advance for RF + ETH
uint8_t tx_sample_advance;
int8_t tx_sample_advance;
//! tx_scheduling_advance for RF + ETH
uint8_t tx_scheduling_advance;
//! iq_txshift for RF + ETH
......
......@@ -474,7 +474,7 @@ extern "C" {
*/
int device_init(openair0_device* device, openair0_config_t *openair0_cfg) {
size_t i;
size_t i,r,card;
int bw_gain_adjust=0;
openair0_cfg[0].rx_gain_calib_table = calib_table_iris;
iris_state_t *s = (iris_state_t*)malloc(sizeof(iris_state_t));
......@@ -482,19 +482,24 @@ extern "C" {
// Initialize Iris device
device->openair0_cfg = openair0_cfg;
char* remote_addr = device->openair0_cfg->remote_addr;
char* drvtype = strtok(remote_addr, ",");
char *srl = strtok(NULL, ",");
while (srl != NULL)
{
LOG_I(HW,"Attempting to open Iris device: %s\n", srl);
std::string args = "driver="+std::string(drvtype)+",serial="+std::string(srl)+",remote:prot=tcp";
s->iris.push_back(SoapySDR::Device::make(args));
srl = strtok(NULL, ",");
}
for (card = 0; card < MAX_CARDS; card++)
{
char* remote_addr = device->openair0_cfg[card].remote_addr;
if (remote_addr == NULL) {printf("Opened %d cards...\n", card);break;}
char* drvtype = strtok(remote_addr, ",");
char *srl = strtok(NULL, ",");
while (srl != NULL)
{
LOG_I(HW,"Attempting to open Iris device: %s\n", srl);
std::string args = "driver="+std::string(drvtype)+",serial="+std::string(srl)+",remote:prot=tcp";
s->iris.push_back(SoapySDR::Device::make(args));
srl = strtok(NULL, ",");
}
//openair0_cfg[0].iq_txshift = 4;//if radio needs OAI to shift left the tx samples for preserving bit precision
}
s->device_num = s->iris.size();
openair0_cfg[0].iq_txshift = 4;//if radio needs OAI to shift left the tx samples for preserving bit precision
device->type=IRIS_DEV;
switch ((int)openair0_cfg[0].sample_rate) {
case 30720000:
//openair0_cfg[0].samples_per_packet = 1024;
......@@ -531,9 +536,10 @@ extern "C" {
exit(-1);
break;
}
printf("tx_sample_advance %d\n", openair0_cfg[0].tx_sample_advance);
s->rx_num_channels = openair0_cfg[0].rx_num_channels / s->device_num;
s->tx_num_channels = openair0_cfg[0].tx_num_channels / s->device_num;
s->rx_num_channels = openair0_cfg[0].rx_num_channels;
s->tx_num_channels = openair0_cfg[0].tx_num_channels;
if ((s->rx_num_channels == 1 || s->rx_num_channels == 2) && (s->tx_num_channels == 1 || s->tx_num_channels == 2))
printf("Enabling %d rx and %d tx channel(s) on each device...\n", s->rx_num_channels, s->tx_num_channels);
else
......@@ -541,7 +547,7 @@ extern "C" {
printf("Invalid rx or tx number of channels (%d, %d)\n", s->rx_num_channels, s->tx_num_channels);
exit(-1);
}
int r;
for (r = 0; r < s->device_num; r++)
{
s->iris[r]->setMasterClockRate(8*openair0_cfg[0].sample_rate); // sample*8=clock_rate for Soapy
......
......@@ -31,7 +31,7 @@ eNBs =
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 38;
downlink_frequency = 2580000000L;
downlink_frequency = 2600000000L;
uplink_frequency_offset = 0;
Nid_cell = 57;
N_RB_DL = 25;
......@@ -146,7 +146,7 @@ eNBs =
rrh_gw_config = ({
local_if_name = "eth0";
remote_address = "remote,0106";
remote_address = "remote,0127";
local_address = "10.224.20.40";
local_port = 50000; #for raw option local port must be the same to remote
remote_port = 50000;
......@@ -154,7 +154,7 @@ rrh_gw_config = ({
tr_preference = "raw";
rf_preference = "iris030";
iq_txshift = 4;
tx_sample_advance = 60;
tx_sample_advance = -40;
tx_scheduling_advance = 9;
if_compression = "alaw";
}
......
......@@ -31,14 +31,14 @@ eNBs =
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 38;
downlink_frequency = 2580000000L;
downlink_frequency = 2600000000L;
uplink_frequency_offset = 0;
Nid_cell = 57;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 4;
nb_antennas_rx = 4;
nb_antennas_tx = 2;
nb_antennas_rx = 2;
tx_gain = 52;
rx_gain = 110;
prach_root = 0;
......@@ -59,7 +59,7 @@ eNBs =
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
pusch_nDMRS1 = 0;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
......@@ -68,7 +68,7 @@ eNBs =
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -90;
pusch_p0_Nominal = -85;
pusch_alpha = "AL1";
pucch_p0_Nominal = -96;
msg3_delta_Preamble = 6;
......@@ -85,7 +85,7 @@ eNBs =
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_powerRampingStep = 2;
rach_preambleInitialReceivedTargetPower = -96;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
......@@ -144,9 +144,10 @@ eNBs =
}
);
rrh_gw_config = ({
rrh_gw_config = (
{
local_if_name = "eth0";
remote_address = "remote,0212,0213,0216,0221";
remote_address = "remote,0127";
local_address = "10.224.20.40";
local_port = 50000; #for raw option local port must be the same to remote
remote_port = 50000;
......@@ -154,10 +155,95 @@ rrh_gw_config = ({
tr_preference = "raw";
rf_preference = "iris030";
iq_txshift = 4;
tx_sample_advance = 60;
tx_sample_advance = -40;
tx_scheduling_advance = 9;
if_compression = "alaw";
},
{
local_if_name = "eth0";
remote_address = "remote,0120";
local_address = "10.224.20.40";
local_port = 50000; #for raw option local port must be the same to remote
remote_port = 50000;
rrh_gw_active = "yes";
tr_preference = "raw";
rf_preference = "iris030";
iq_txshift = 4;
tx_sample_advance = -40;
tx_scheduling_advance = 9;
if_compression = "alaw";
}
#{
# local_if_name = "eth0";
# remote_address = "remote,0125";
# local_address = "10.224.20.40";
# local_port = 50000; #for raw option local port must be the same to remote
# remote_port = 50000;
# rrh_gw_active = "yes";
# tr_preference = "raw";
# rf_preference = "iris030";
# iq_txshift = 4;
# tx_sample_advance = -40;
# tx_scheduling_advance = 9;
# if_compression = "alaw";
#}
#{
# local_if_name = "eth0";
# remote_address = "remote,0113";
# local_address = "10.224.20.40";
# local_port = 50000; #for raw option local port must be the same to remote
# remote_port = 50000;
# rrh_gw_active = "yes";
# tr_preference = "raw";
# rf_preference = "iris030";
# iq_txshift = 4;
# tx_sample_advance = -40;
# tx_scheduling_advance = 9;
# if_compression = "alaw";
#},
#{
# local_if_name = "eth0";
# remote_address = "remote,0112";
# local_address = "10.224.20.40";
# local_port = 50000; #for raw option local port must be the same to remote
# remote_port = 50000;
# rrh_gw_active = "yes";
# tr_preference = "raw";
# rf_preference = "iris030";
# iq_txshift = 4;
# tx_sample_advance = -40;
# tx_scheduling_advance = 9;
# if_compression = "alaw";
#}
#{
# local_if_name = "eth0";
# remote_address = "remote,0113";
# local_address = "10.224.20.40";
# local_port = 50000; #for raw option local port must be the same to remote
# remote_port = 50000;
# rrh_gw_active = "yes";
# tr_preference = "raw";
# rf_preference = "iris030";
# iq_txshift = 4;
# tx_sample_advance = -40;
# tx_scheduling_advance = 9;
# if_compression = "alaw";
#}
#,
#{
# local_if_name = "eth0";
# remote_address = "remote,0118";
# local_address = "10.224.20.40";
# local_port = 50000; #for raw option local port must be the same to remote
# remote_port = 50000;
# rrh_gw_active = "yes";
# tr_preference = "raw";
# rf_preference = "iris030";
# iq_txshift = 4;
# tx_sample_advance = -40;
# tx_scheduling_advance = 9;
# if_compression = "alaw";
#}
);
NETWORK_INTERFACES :
......
......@@ -282,6 +282,8 @@ uint8_t local_remote_radio = BBU_LOCAL_RADIO_HEAD;
/* struct for ethernet specific parameters given in eNB conf file */
eth_params_t *eth_params;
int navail_cards = 0;
openair0_config_t openair0_cfg[MAX_CARDS];
double cpuf;
......@@ -1123,7 +1125,7 @@ static void get_options (int argc, char **argv)
MAX_NUM_CCs, enb_properties->properties[i]->nb_cc, i);
eth_params = (eth_params_t*)malloc(enb_properties->properties[i]->nb_rrh_gw * sizeof(eth_params_t));
memset(eth_params, 0, enb_properties->properties[i]->nb_rrh_gw * sizeof(eth_params_t));
navail_cards = enb_properties->properties[i]->nb_rrh_gw;
for (j=0; j<enb_properties->properties[i]->nb_rrh_gw; j++) {
if (enb_properties->properties[i]->rrh_gw_config[j].active == 1 ) {
......@@ -1133,7 +1135,7 @@ static void get_options (int argc, char **argv)
(eth_params+j)->my_port = enb_properties->properties[i]->rrh_gw_config[j].local_port;
(eth_params+j)->remote_addr = enb_properties->properties[i]->rrh_gw_config[j].remote_address;
(eth_params+j)->remote_port = enb_properties->properties[i]->rrh_gw_config[j].remote_port;
printf("enb properties: rrh_gw_config : remote_address %s\n", enb_properties->properties[i]->rrh_gw_config[j].remote_address);
if (enb_properties->properties[i]->rrh_gw_config[j].raw == 1) {
(eth_params+j)->transp_preference = ETH_RAW_MODE;
} else if (enb_properties->properties[i]->rrh_gw_config[j].rawif4p5 == 1) {
......@@ -1201,7 +1203,7 @@ static void get_options (int argc, char **argv)
init_all_otg(0);
g_otg->seed = 0;
init_seeds(g_otg->seed);
/*
for (k=0; k<enb_properties->properties[i]->num_otg_elements; k++) {
j=enb_properties->properties[i]->otg_ue_id[k]; // ue_id
g_otg->application_idx[i][j] = 1;
......@@ -1212,7 +1214,7 @@ static void get_options (int argc, char **argv)
printf("[OTG] configuring traffic type %d for eNB %d UE %d (Background traffic is %s)\n",
g_otg->application_type[i][j][0], i, j,(g_otg->background[i][j][0]==1)?"Enabled":"Disabled");
}
*/
init_predef_traffic(enb_properties->properties[i]->num_otg_elements, 1);
......@@ -1330,8 +1332,8 @@ void init_openair0() {
int card;
int i;
for (card=0; card<MAX_CARDS; card++) {
printf("Available cards %d\n", navail_cards);
for (card=0; card<navail_cards; card++) {
openair0_cfg[card].mmapped_dma=mmapped_dma;
openair0_cfg[card].configFilename = NULL;
......@@ -1380,24 +1382,26 @@ void init_openair0() {
openair0_cfg[card].tdd_recip_calib = 0;
if (local_remote_radio == BBU_REMOTE_RADIO_HEAD) {
openair0_cfg[card].remote_addr = (eth_params+card)->remote_addr;
openair0_cfg[card].remote_port = (eth_params+card)->remote_port;
openair0_cfg[card].my_addr = (eth_params+card)->my_addr;
openair0_cfg[card].my_port = (eth_params+card)->my_port;
openair0_cfg[card].remote_addr = (eth_params+card)->remote_addr;
openair0_cfg[card].remote_port = (eth_params+card)->remote_port;
openair0_cfg[card].my_addr = (eth_params+card)->my_addr;
openair0_cfg[card].my_port = (eth_params+card)->my_port;
openair0_cfg[card].tx_sample_advance = (eth_params+card)->tx_sample_advance;
openair0_cfg[card].iq_txshift = (eth_params+card)->iq_txshift;
}
printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card,
((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx),
((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx));
printf("HW: Configuring card %d with address %s, nb_antennas_tx/rx %d/%d\n",card,openair0_cfg[card].remote_addr,
((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx/navail_cards : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx),
((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx/navail_cards : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx));
openair0_cfg[card].Mod_id = 0;
if (UE_flag) {
printf("ETHERNET: Configuring UE ETH for %s:%d\n",rrh_UE_ip,rrh_UE_port);
openair0_cfg[card].remote_addr = &rrh_UE_ip[0];
openair0_cfg[card].remote_port = rrh_UE_port;
openair0_cfg[card].tx_sample_advance = tx_sample_advance; //BS will set this in the config file
printf("Set tx_sample_advance to %d\n", openair0_cfg[card].tx_sample_advance);
}
openair0_cfg[card].tx_sample_advance = tx_sample_advance; //BS will set this in the config file
printf("Set tx_sample_advance to %d\n", openair0_cfg[card].tx_sample_advance);
openair0_cfg[card].gain_calib_val = gain_calib_val;
printf("Set gain calibration value to %d\n", openair0_cfg[card].gain_calib_val);
......@@ -1405,8 +1409,8 @@ void init_openair0() {
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
openair0_cfg[card].tx_num_channels=min(4,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx));
openair0_cfg[card].rx_num_channels=min(4,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx));
openair0_cfg[card].tx_num_channels=min(4,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx/navail_cards : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx));
openair0_cfg[card].rx_num_channels=min(4,((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx/navail_cards : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx));
for (i=0; i<4; i++) {
......
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