Merge remote-tracking branch 'origin/develop' into oairu
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#ifndef COMMON_LIB_H
|
||||
#define COMMON_LIB_H
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <openair1/PHY/TOOLS/tools_defs.h>
|
||||
#include "record_player.h"
|
||||
|
||||
@@ -68,8 +68,10 @@ int read_recplayconfig(recplay_conf_t **recplay_conf, recplay_state_t **recplay_
|
||||
*recplay_conf=NULL;
|
||||
}
|
||||
|
||||
if (u_sf_replay == 1) return RECPLAY_REPLAYMODE;
|
||||
else if (u_sf_record == 1) return RECPLAY_RECORDMODE;
|
||||
if (u_sf_replay == 1)
|
||||
return RECPLAY_REPLAYMODE;
|
||||
else if (u_sf_record == 1)
|
||||
return RECPLAY_RECORDMODE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -80,7 +82,7 @@ int read_recplayconfig(recplay_conf_t **recplay_conf, recplay_state_t **recplay_
|
||||
*/
|
||||
void iqrecorder_end(openair0_device *device) {
|
||||
if (device->recplay_state != NULL) { // subframes store
|
||||
iqfile_header_t fh = {device->type,device->openair0_cfg->tx_sample_advance, device->openair0_cfg->rx_bw,OAIIQFILE_ID};
|
||||
iqfile_header_t fh = {device->type,device->openair0_cfg->tx_sample_advance, device->openair0_cfg->rx_bw,0,OAIIQFILE_ID};
|
||||
recplay_state_t *rs = device->recplay_state;
|
||||
recplay_conf_t *rc = device->openair0_cfg[0].recplay_conf;
|
||||
rs->pFile = fopen (rc->u_sf_filename,"wb+");
|
||||
@@ -91,16 +93,20 @@ void iqrecorder_end(openair0_device *device) {
|
||||
unsigned int i = 0;
|
||||
unsigned int modu = 0;
|
||||
|
||||
if ((modu = rs->nb_samples % 10) != 0) {
|
||||
rs->nb_samples -= modu; // store entire number of frames
|
||||
if ((modu = rs->nbSamplesBlocks % 10) != 0) {
|
||||
rs->nbSamplesBlocks -= modu; // store entire number of frames
|
||||
}
|
||||
|
||||
fh.nbSamplesBlocks=rs->nbSamplesBlocks;
|
||||
LOG_I(HW,"Writing file header to %s \n", rc->u_sf_filename );
|
||||
fwrite(&fh, sizeof(fh), 1, rs->pFile);
|
||||
LOG_UI(HW,"Writing %u subframes to %s \n",rs->nb_samples, rc->u_sf_filename );
|
||||
LOG_UI(HW,"Writing %u subframes to %s \n",rs->nbSamplesBlocks, rc->u_sf_filename );
|
||||
uint8_t *ptr=(uint8_t *)rs->ms_sample;
|
||||
|
||||
for (i = 0; i < rs->nb_samples; i++) {
|
||||
fwrite(rs->ms_sample+i, sizeof(unsigned char), sizeof(iqrec_t), rs->pFile);
|
||||
for (i = 0; i < rs->nbSamplesBlocks; i++) {
|
||||
int blockBytes=sizeof(iqrec_t)+((iqrec_t *)ptr)->nbBytes;
|
||||
fwrite(ptr, sizeof(unsigned char), blockBytes, rs->pFile);
|
||||
ptr+=blockBytes;
|
||||
}
|
||||
|
||||
fclose (rs->pFile);
|
||||
@@ -112,4 +118,4 @@ void iqrecorder_end(openair0_device *device) {
|
||||
rs->ms_sample = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,21 +46,22 @@ extern "C"
|
||||
#define BELL_LABS_IQ_HEADER 0xabababababababab
|
||||
#define BELL_LABS_IQ_PER_SF 7680 // Up to 5MHz bw for now
|
||||
#define BELL_LABS_IQ_BYTES_PER_SF (BELL_LABS_IQ_PER_SF * 4)
|
||||
#define MAX_BELL_LABS_IQ_BYTES_PER_SF BELL_LABS_IQ_BYTES_PER_SF*10
|
||||
|
||||
#define OAIIQFILE_ID "OIQF"
|
||||
#define OAIIQFILE_ID {'O', 'I','Q','F'}
|
||||
typedef struct {
|
||||
uint64_t devtype;
|
||||
uint64_t tx_sample_advance;
|
||||
double bw;
|
||||
unsigned int nbSamplesBlocks;
|
||||
char oaiid[4];
|
||||
} iqfile_header_t;
|
||||
|
||||
typedef struct {
|
||||
int64_t header;
|
||||
int64_t ts;
|
||||
int64_t rfu1;
|
||||
int64_t nbBytes;
|
||||
int64_t rfu2; // pad for 256 bits alignement required by AVX2
|
||||
unsigned char samples[BELL_LABS_IQ_BYTES_PER_SF]; // iq's for one subframe
|
||||
} iqrec_t;
|
||||
#define DEF_NB_SF 120000 // default nb of sf or ms to capture (2 minutes at 5MHz)
|
||||
#define DEF_SF_FILE "/tmp/iqfile" // default subframes file name
|
||||
@@ -114,14 +115,16 @@ typedef struct {
|
||||
int use_mmap; // default is to use mmap
|
||||
size_t mapsize;
|
||||
FILE *pFile;
|
||||
int mmapfd;
|
||||
int iqfd;
|
||||
int fd;
|
||||
iqrec_t *ms_sample; // memory for all subframes
|
||||
unsigned int nb_samples;
|
||||
unsigned int nbSamplesBlocks;
|
||||
uint8_t *currentPtr;
|
||||
uint64_t currentTs;
|
||||
unsigned int curSamplesBlock;
|
||||
int64_t wrap_count;
|
||||
size_t maxSizeBytes;
|
||||
} recplay_state_t;
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -153,7 +153,7 @@ int check_ref_locked(usrp_state_t *s,size_t mboard) {
|
||||
}
|
||||
|
||||
static int sync_to_gps(openair0_device *device) {
|
||||
uhd::set_thread_priority_safe();
|
||||
//uhd::set_thread_priority_safe();
|
||||
//std::string args;
|
||||
//Set up program options
|
||||
//po::options_description desc("Allowed options");
|
||||
@@ -276,7 +276,7 @@ static int trx_usrp_start(openair0_device *device) {
|
||||
// setup GPIO for TDD, GPIO(4) = ATR_RX
|
||||
//set data direction register (DDR) to output
|
||||
s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff);
|
||||
//set lower 7 bits to be controlled automatically by ATR (the rest 5 bits are controlled manually)
|
||||
//set lower 7 bits to be controlled automatically by ATR (the rest 5 bits are controlled manually)
|
||||
s->usrp->set_gpio_attr("FP0", "CTRL", 0x7f,0xfff);
|
||||
//set pins 4 (RX_TX_Switch) and 6 (Shutdown PA) to 1 when the radio is only receiving (ATR_RX)
|
||||
s->usrp->set_gpio_attr("FP0", "ATR_RX", (1<<4)|(1<<6), 0x7f);
|
||||
@@ -301,7 +301,7 @@ static int trx_usrp_start(openair0_device *device) {
|
||||
}
|
||||
|
||||
uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
|
||||
cmd.time_spec = uhd::time_spec_t(1.0);
|
||||
cmd.time_spec = uhd::time_spec_t(1.0);
|
||||
cmd.stream_now = false; // start at constant delay
|
||||
s->rx_stream->issue_stream_cmd(cmd);
|
||||
|
||||
@@ -315,7 +315,7 @@ static void trx_usrp_end(openair0_device *device) {
|
||||
return;
|
||||
|
||||
usrp_state_t *s = (usrp_state_t *)device->priv;
|
||||
|
||||
|
||||
if (s == NULL)
|
||||
return;
|
||||
iqrecorder_end(device);
|
||||
@@ -436,7 +436,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHI
|
||||
buff_ptrs.push_back(&(((int16_t *)buff_tx[i])[0]));
|
||||
|
||||
ret = (int)s->tx_stream->send(buff_ptrs, nsamps, s->tx_md);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ret = (int)s->tx_stream->send(&(((int16_t *)buff_tx[0])[0]), nsamps, s->tx_md);
|
||||
}
|
||||
@@ -481,7 +481,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHI
|
||||
@param antenna_id index of the antenna if the device has multiple antennas
|
||||
@param flags flags must be set to TRUE if timestamp parameter needs to be applied
|
||||
*/
|
||||
void *trx_usrp_write_thread(void * arg){
|
||||
void *trx_usrp_write_thread(void * arg){
|
||||
int ret=0;
|
||||
openair0_device *device=(openair0_device *)arg;
|
||||
openair0_thread_t *write_thread = &device->write_thread;
|
||||
@@ -550,7 +550,7 @@ void *trx_usrp_write_thread(void * arg){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
s->tx_md.has_time_spec = true;
|
||||
s->tx_md.start_of_burst = (s->tx_count==0) ? true : first_packet;
|
||||
s->tx_md.end_of_burst = last_packet;
|
||||
@@ -573,7 +573,7 @@ void *trx_usrp_write_thread(void * arg){
|
||||
buff_ptrs.push_back(&(((int16_t *)buff_tx[i])[0]));
|
||||
|
||||
ret = (int)s->tx_stream->send(buff_ptrs, nsamps, s->tx_md);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ret = (int)s->tx_stream->send(&(((int16_t *)buff_tx[0])[0]), nsamps, s->tx_md);
|
||||
}
|
||||
@@ -590,7 +590,7 @@ void *trx_usrp_write_thread(void * arg){
|
||||
|
||||
int trx_usrp_write_init(openair0_device *device){
|
||||
|
||||
uhd::set_thread_priority_safe(1.0);
|
||||
//uhd::set_thread_priority_safe(1.0);
|
||||
openair0_thread_t *write_thread = &device->write_thread;
|
||||
printf("initializing tx write thread\n");
|
||||
|
||||
@@ -598,7 +598,8 @@ int trx_usrp_write_init(openair0_device *device){
|
||||
write_thread->end = 0;
|
||||
write_thread->count_write = 0;
|
||||
printf("end of tx write thread\n");
|
||||
|
||||
pthread_mutex_init(&write_thread->mutex_write, NULL);
|
||||
pthread_cond_init(&write_thread->cond_write, NULL);
|
||||
pthread_create(&write_thread->pthread_write,NULL,trx_usrp_write_thread,(void *)device);
|
||||
|
||||
return(0);
|
||||
@@ -722,15 +723,23 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
s->usrp->set_gpio_attr("FP0", "OUT", gpio789<<7, 0x380);
|
||||
s->usrp->clear_command_time();
|
||||
gpio789 = (gpio789+1)&7;*/
|
||||
recplay_state_t *recPlay=device->recplay_state;
|
||||
|
||||
if (device->recplay_state != NULL) { // record mode
|
||||
if ( recPlay != NULL) { // record mode
|
||||
// Copy subframes to memory (later dump on a file)
|
||||
if (device->recplay_state->nb_samples < device->openair0_cfg->recplay_conf->u_sf_max) {
|
||||
(device->recplay_state->ms_sample+device->recplay_state->nb_samples)->header = BELL_LABS_IQ_HEADER;
|
||||
(device->recplay_state->ms_sample+device->recplay_state->nb_samples)->ts = *ptimestamp;
|
||||
memcpy((device->recplay_state->ms_sample+device->recplay_state->nb_samples)->samples, buff[0], nsamps*4);
|
||||
device->recplay_state->nb_samples++;
|
||||
} else exit_function(__FILE__, __FUNCTION__, __LINE__,"Recording reaches max iq limit\n");
|
||||
if (recPlay->nbSamplesBlocks < device->openair0_cfg->recplay_conf->u_sf_max &&
|
||||
recPlay->maxSizeBytes > (recPlay->currentPtr-(uint8_t *)recPlay->ms_sample) +
|
||||
sizeof(iqrec_t) + nsamps*4 ) {
|
||||
iqrec_t *hdr=(iqrec_t *)recPlay->currentPtr;
|
||||
hdr->header = BELL_LABS_IQ_HEADER;
|
||||
hdr->ts = *ptimestamp;
|
||||
hdr->nbBytes=nsamps*4;
|
||||
memcpy(hdr+1, buff[0], nsamps*4);
|
||||
recPlay->currentPtr+=sizeof(iqrec_t)+nsamps*4;
|
||||
recPlay->nbSamplesBlocks++;
|
||||
LOG_D(HW,"recorded %d samples, for TS %lu, shift in buffer %ld\n", nsamps, hdr->ts, recPlay->currentPtr-(uint8_t *)recPlay->ms_sample);
|
||||
} else
|
||||
exit_function(__FILE__, __FUNCTION__, __LINE__,"Recording reaches max iq limit\n");
|
||||
}
|
||||
|
||||
return samples_received;
|
||||
@@ -965,29 +974,29 @@ extern "C" {
|
||||
|
||||
|
||||
// hotfix! to be checked later
|
||||
uhd::set_thread_priority_safe(1.0);
|
||||
//uhd::set_thread_priority_safe(1.0);
|
||||
// Initialize USRP device
|
||||
int vers=0,subvers=0,subsubvers=0;
|
||||
int bw_gain_adjust=0;
|
||||
|
||||
|
||||
if (device->openair0_cfg->recplay_mode == RECPLAY_RECORDMODE) {
|
||||
std::cerr << "USRP device initialized in subframes record mode" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
sscanf(uhd::get_version_string().c_str(),"%d.%d.%d",&vers,&subvers,&subsubvers);
|
||||
LOG_I(HW,"UHD version %s (%d.%d.%d)\n",
|
||||
uhd::get_version_string().c_str(),vers,subvers,subsubvers);
|
||||
std::string args;
|
||||
|
||||
|
||||
if (openair0_cfg[0].sdr_addrs == NULL) {
|
||||
args = "type=b200";
|
||||
} else {
|
||||
args = openair0_cfg[0].sdr_addrs;
|
||||
LOG_I(HW,"Checking for USRP with args %s\n",openair0_cfg[0].sdr_addrs);
|
||||
}
|
||||
|
||||
|
||||
uhd::device_addrs_t device_adds = uhd::device::find(args);
|
||||
|
||||
|
||||
if (device_adds.size() == 0) {
|
||||
LOG_E(HW,"No USRP Device Found.\n ");
|
||||
free(s);
|
||||
@@ -997,38 +1006,38 @@ extern "C" {
|
||||
free(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
LOG_I(HW,"Found USRP %s\n", device_adds[0].get("type").c_str());
|
||||
double usrp_master_clock;
|
||||
|
||||
|
||||
if (device_adds[0].get("type") == "b200") {
|
||||
device->type = USRP_B200_DEV;
|
||||
usrp_master_clock = 30.72e6;
|
||||
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
|
||||
args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=7680, recv_frame_size=7680" ;
|
||||
}
|
||||
|
||||
|
||||
if (device_adds[0].get("type") == "n3xx") {
|
||||
printf("Found USRP n300\n");
|
||||
device->type=USRP_N300_DEV;
|
||||
device->type=USRP_N300_DEV;
|
||||
usrp_master_clock = 122.88e6;
|
||||
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
|
||||
//args += ", send_buff_size=33554432";
|
||||
}
|
||||
|
||||
|
||||
if (device_adds[0].get("type") == "x300") {
|
||||
printf("Found USRP x300\n");
|
||||
device->type=USRP_X300_DEV;
|
||||
usrp_master_clock = 184.32e6;
|
||||
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
|
||||
|
||||
|
||||
// USRP recommended: https://files.ettus.com/manual/page_usrp_x3x0_config.html
|
||||
if ( 0 != system("sysctl -w net.core.rmem_max=33554432 net.core.wmem_max=33554432") )
|
||||
LOG_W(HW,"Can't set kernel parameters for X3xx\n");
|
||||
}
|
||||
|
||||
|
||||
s->usrp = uhd::usrp::multi_usrp::make(args);
|
||||
|
||||
|
||||
if (args.find("clock_source")==std::string::npos) {
|
||||
if (openair0_cfg[0].clock_source == internal) {
|
||||
s->usrp->set_clock_source("internal");
|
||||
@@ -1042,7 +1051,7 @@ extern "C" {
|
||||
s->usrp->set_clock_source("gpsdo");
|
||||
LOG_D(HW,"Setting clock source to gpsdo\n");
|
||||
}
|
||||
else {
|
||||
else {
|
||||
LOG_W(HW,"Clock source set neither in usrp_args nor on command line, using default!\n");
|
||||
}
|
||||
}
|
||||
@@ -1065,7 +1074,7 @@ extern "C" {
|
||||
s->usrp->set_time_source("gpsdo");
|
||||
LOG_D(HW,"Setting time source to gpsdo\n");
|
||||
}
|
||||
else {
|
||||
else {
|
||||
LOG_W(HW,"Time source set neither in usrp_args nor on command line, using default!\n");
|
||||
}
|
||||
}
|
||||
@@ -1075,10 +1084,10 @@ extern "C" {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (s->usrp->get_clock_source(0) == "gpsdo") {
|
||||
s->use_gps = 1;
|
||||
|
||||
|
||||
if (sync_to_gps(device)==EXIT_SUCCESS) {
|
||||
LOG_I(HW,"USRP synced with GPS!\n");
|
||||
} else {
|
||||
@@ -1093,15 +1102,15 @@ extern "C" {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (device->type==USRP_X300_DEV) {
|
||||
openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
|
||||
std::cerr << "-- Using calibration table: calib_table_x310" << std::endl;
|
||||
std::cerr << "-- Using calibration table: calib_table_x310" << std::endl;
|
||||
}
|
||||
|
||||
if (device->type==USRP_N300_DEV) {
|
||||
openair0_cfg[0].rx_gain_calib_table = calib_table_n310;
|
||||
std::cerr << "-- Using calibration table: calib_table_n310" << std::endl;
|
||||
std::cerr << "-- Using calibration table: calib_table_n310" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -1116,7 +1125,7 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 80e6;
|
||||
openair0_cfg[0].rx_bw = 80e6;
|
||||
break;
|
||||
|
||||
|
||||
case 92160000:
|
||||
// from usrp_time_offset
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
@@ -1124,7 +1133,7 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 80e6;
|
||||
openair0_cfg[0].rx_bw = 80e6;
|
||||
break;
|
||||
|
||||
|
||||
case 61440000:
|
||||
// from usrp_time_offset
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
@@ -1132,14 +1141,14 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 40e6;
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
|
||||
|
||||
case 46080000:
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
openair0_cfg[0].tx_sample_advance = 65;
|
||||
openair0_cfg[0].tx_sample_advance = 15;
|
||||
openair0_cfg[0].tx_bw = 40e6;
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
|
||||
|
||||
case 30720000:
|
||||
// from usrp_time_offset
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
@@ -1147,35 +1156,35 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 20e6;
|
||||
openair0_cfg[0].rx_bw = 20e6;
|
||||
break;
|
||||
|
||||
|
||||
case 15360000:
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
openair0_cfg[0].tx_sample_advance = 40;
|
||||
openair0_cfg[0].tx_sample_advance = 45;
|
||||
openair0_cfg[0].tx_bw = 10e6;
|
||||
openair0_cfg[0].rx_bw = 10e6;
|
||||
break;
|
||||
|
||||
|
||||
case 7680000:
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
openair0_cfg[0].tx_sample_advance = 50;
|
||||
openair0_cfg[0].tx_bw = 5e6;
|
||||
openair0_cfg[0].rx_bw = 5e6;
|
||||
break;
|
||||
|
||||
|
||||
case 1920000:
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
openair0_cfg[0].tx_sample_advance = 50;
|
||||
openair0_cfg[0].tx_bw = 1.25e6;
|
||||
openair0_cfg[0].rx_bw = 1.25e6;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
LOG_E(HW,"Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (device->type == USRP_B200_DEV) {
|
||||
if ((vers == 3) && (subvers == 9) && (subsubvers>=2)) {
|
||||
openair0_cfg[0].rx_gain_calib_table = calib_table_b210;
|
||||
@@ -1186,7 +1195,7 @@ extern "C" {
|
||||
bw_gain_adjust=1;
|
||||
std::cerr << "-- Using calibration table: calib_table_b210_38" << std::endl; // Bell Labs info
|
||||
}
|
||||
|
||||
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
case 46080000:
|
||||
s->usrp->set_master_clock_rate(46.08e6);
|
||||
@@ -1195,7 +1204,7 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 40e6;
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
|
||||
|
||||
case 30720000:
|
||||
s->usrp->set_master_clock_rate(30.72e6);
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
@@ -1203,7 +1212,7 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 20e6;
|
||||
openair0_cfg[0].rx_bw = 20e6;
|
||||
break;
|
||||
|
||||
|
||||
case 23040000:
|
||||
s->usrp->set_master_clock_rate(23.04e6); //to be checked
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
@@ -1211,7 +1220,7 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 20e6;
|
||||
openair0_cfg[0].rx_bw = 20e6;
|
||||
break;
|
||||
|
||||
|
||||
case 15360000:
|
||||
s->usrp->set_master_clock_rate(30.72e06);
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
@@ -1219,7 +1228,7 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 20e6;
|
||||
openair0_cfg[0].rx_bw = 20e6;
|
||||
break;
|
||||
|
||||
|
||||
case 7680000:
|
||||
s->usrp->set_master_clock_rate(30.72e6);
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
@@ -1227,7 +1236,7 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 20e6;
|
||||
openair0_cfg[0].rx_bw = 20e6;
|
||||
break;
|
||||
|
||||
|
||||
case 1920000:
|
||||
s->usrp->set_master_clock_rate(30.72e6);
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
@@ -1235,20 +1244,20 @@ extern "C" {
|
||||
openair0_cfg[0].tx_bw = 20e6;
|
||||
openair0_cfg[0].rx_bw = 20e6;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
LOG_E(HW,"Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
|
||||
exit(-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 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
|
||||
|
||||
|
||||
for(int i=0; i<((int) s->usrp->get_rx_num_channels()); i++) {
|
||||
if (i<openair0_cfg[0].rx_num_channels) {
|
||||
s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i);
|
||||
@@ -1265,13 +1274,13 @@ extern "C" {
|
||||
openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOG_D(HW, "usrp->get_tx_num_channels() == %zd\n", s->usrp->get_tx_num_channels());
|
||||
LOG_D(HW, "openair0_cfg[0].tx_num_channels == %d\n", openair0_cfg[0].tx_num_channels);
|
||||
|
||||
|
||||
for(int i=0; i<((int) s->usrp->get_tx_num_channels()); i++) {
|
||||
::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(i);
|
||||
|
||||
|
||||
if (i<openair0_cfg[0].tx_num_channels) {
|
||||
s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i);
|
||||
s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i);
|
||||
@@ -1279,7 +1288,7 @@ extern "C" {
|
||||
LOG_I(HW,"USRP TX_GAIN:%3.2lf gain_range:%3.2lf tx_gain:%3.2lf\n", gain_range_tx.stop()-openair0_cfg[0].tx_gain[i], gain_range_tx.stop(), openair0_cfg[0].tx_gain[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//s->usrp->set_clock_source("external");
|
||||
//s->usrp->set_time_source("external");
|
||||
// display USRP settings
|
||||
@@ -1293,11 +1302,11 @@ extern "C" {
|
||||
int max=s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps();
|
||||
samples/=10000;
|
||||
LOG_I(HW,"RF board max packet size %u, size for 100µs jitter %d \n", max, samples);
|
||||
|
||||
|
||||
if ( samples < max ) {
|
||||
stream_args_rx.args["spp"] = str(boost::format("%d") % samples );
|
||||
}
|
||||
|
||||
|
||||
LOG_I(HW,"rx_max_num_samps %zu\n",
|
||||
s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps());
|
||||
|
||||
@@ -1308,19 +1317,19 @@ extern "C" {
|
||||
|
||||
s->rx_stream = s->usrp->get_rx_stream(stream_args_rx);
|
||||
uhd::stream_args_t stream_args_tx("sc16", "sc16");
|
||||
|
||||
|
||||
for (int i = 0; i<openair0_cfg[0].tx_num_channels; i++)
|
||||
stream_args_tx.channels.push_back(i);
|
||||
|
||||
|
||||
s->tx_stream = s->usrp->get_tx_stream(stream_args_tx);
|
||||
|
||||
|
||||
/* Setting TX/RX BW after streamers are created due to USRP calibration issue */
|
||||
for(int i=0; i<((int) s->usrp->get_tx_num_channels()) && i<openair0_cfg[0].tx_num_channels; i++)
|
||||
s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
|
||||
|
||||
|
||||
for(int i=0; i<((int) s->usrp->get_rx_num_channels()) && i<openair0_cfg[0].rx_num_channels; i++)
|
||||
s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
|
||||
|
||||
|
||||
for (int i=0; i<openair0_cfg[0].rx_num_channels; i++) {
|
||||
LOG_I(HW,"RX Channel %d\n",i);
|
||||
LOG_I(HW," Actual RX sample rate: %fMSps...\n",s->usrp->get_rx_rate(i)/1e6);
|
||||
@@ -1329,7 +1338,7 @@ extern "C" {
|
||||
LOG_I(HW," Actual RX bandwidth: %fM...\n", s->usrp->get_rx_bandwidth(i)/1e6);
|
||||
LOG_I(HW," Actual RX antenna: %s...\n", s->usrp->get_rx_antenna(i).c_str());
|
||||
}
|
||||
|
||||
|
||||
for (int i=0; i<openair0_cfg[0].tx_num_channels; i++) {
|
||||
LOG_I(HW,"TX Channel %d\n",i);
|
||||
LOG_I(HW," Actual TX sample rate: %fMSps...\n", s->usrp->get_tx_rate(i)/1e6);
|
||||
@@ -1339,33 +1348,35 @@ extern "C" {
|
||||
LOG_I(HW," Actual TX antenna: %s...\n", s->usrp->get_tx_antenna(i).c_str());
|
||||
LOG_I(HW," Actual TX packet size: %lu\n",s->tx_stream->get_max_num_samps());
|
||||
}
|
||||
|
||||
|
||||
LOG_I(HW,"Device timestamp: %f...\n", s->usrp->get_time_now().get_real_secs());
|
||||
device->trx_write_func = trx_usrp_write;
|
||||
device->trx_read_func = trx_usrp_read;
|
||||
s->sample_rate = openair0_cfg[0].sample_rate;
|
||||
|
||||
|
||||
// TODO:
|
||||
// init tx_forward_nsamps based usrp_time_offset ex
|
||||
if(is_equal(s->sample_rate, (double)30.72e6))
|
||||
s->tx_forward_nsamps = 176;
|
||||
|
||||
|
||||
if(is_equal(s->sample_rate, (double)15.36e6))
|
||||
s->tx_forward_nsamps = 90;
|
||||
|
||||
|
||||
if(is_equal(s->sample_rate, (double)7.68e6))
|
||||
s->tx_forward_nsamps = 50;
|
||||
|
||||
|
||||
if (device->recplay_state != NULL) { // record mode
|
||||
device->recplay_state->ms_sample = (iqrec_t *) malloc(openair0_cfg[0].recplay_conf->u_sf_max * sizeof(iqrec_t));
|
||||
|
||||
if (device->recplay_state->ms_sample == NULL) {
|
||||
|
||||
recplay_state_t *recPlay=device->recplay_state;
|
||||
|
||||
if (recPlay != NULL) { // record mode
|
||||
recPlay->maxSizeBytes=openair0_cfg[0].recplay_conf->u_sf_max *
|
||||
(sizeof(iqrec_t)+BELL_LABS_IQ_BYTES_PER_SF);
|
||||
recPlay->ms_sample = (iqrec_t *) malloc(recPlay->maxSizeBytes);
|
||||
recPlay->currentPtr= (uint8_t *)recPlay->ms_sample;
|
||||
|
||||
if (recPlay->ms_sample == NULL) {
|
||||
std::cerr<< "Memory allocation failed for subframe record or replay mode." << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
memset(device->recplay_state->ms_sample, 0, openair0_cfg[0].recplay_conf->u_sf_max * BELL_LABS_IQ_BYTES_PER_SF);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -39,18 +39,15 @@
|
||||
#include "assertions.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void parse_iqfile_header(openair0_device *device, iqfile_header_t *iq_fh) {
|
||||
AssertFatal((memcmp(iq_fh->oaiid,OAIIQFILE_ID,sizeof(OAIIQFILE_ID)) == 0),
|
||||
"iqfile doesn't seem to be compatible with oai (invalid id %.4s in header)\n",
|
||||
iq_fh->oaiid);
|
||||
char tmp[4]=OAIIQFILE_ID;
|
||||
AssertFatal((memcmp(iq_fh->oaiid,tmp,sizeof(iq_fh->oaiid)) == 0),
|
||||
"iqfile doesn't seem to be compatible with oai (invalid id %.4s in header)\n",
|
||||
iq_fh->oaiid);
|
||||
device->type = iq_fh->devtype;
|
||||
device->openair0_cfg[0].tx_sample_advance=iq_fh->tx_sample_advance;
|
||||
device->openair0_cfg[0].tx_bw = device->openair0_cfg[0].rx_bw = iq_fh->bw;
|
||||
device->recplay_state->nbSamplesBlocks=iq_fh->nbSamplesBlocks;
|
||||
LOG_UI(HW,"Replay iqs from %s device, bandwidth %e\n",get_devname(iq_fh->devtype),iq_fh->bw);
|
||||
}
|
||||
|
||||
@@ -62,89 +59,73 @@ static int iqplayer_loadfile(openair0_device *device, openair0_config_t *openair
|
||||
recplay_state_t *s = device->recplay_state;
|
||||
recplay_conf_t *c = openair0_cfg->recplay_conf;
|
||||
|
||||
struct stat sb;
|
||||
s->fd = open(c->u_sf_filename, O_RDONLY );
|
||||
if (s->fd >= 0 ) {
|
||||
fstat(s->fd, &sb);
|
||||
} else {
|
||||
LOG_E( HW,"Cannot open %s exiting.\n", c->u_sf_filename );
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (s->use_mmap) {
|
||||
// use mmap
|
||||
s->mmapfd = open(c->u_sf_filename, O_RDONLY );
|
||||
|
||||
if (s->mmapfd != 0) {
|
||||
struct stat sb;
|
||||
fstat(s->mmapfd, &sb);
|
||||
s->mapsize=sb.st_size;
|
||||
LOG_I(HW,"Loading subframes using mmap() from %s size=%lu bytes ...\n",c->u_sf_filename, (uint64_t)sb.st_size );
|
||||
void *mptr = mmap(NULL, sb.st_size, PROT_WRITE, MAP_PRIVATE, s->mmapfd, 0) ;
|
||||
s->ms_sample = (iqrec_t *) ( mmap(NULL, sb.st_size, PROT_WRITE, MAP_PRIVATE, s->mmapfd, 0) + sizeof(iqfile_header_t));
|
||||
void *mptr = mmap(NULL, sb.st_size, PROT_WRITE, MAP_PRIVATE, s->fd, 0) ;
|
||||
s->ms_sample = (iqrec_t *) ( mmap(NULL, sb.st_size, PROT_WRITE, MAP_PRIVATE, s->fd, 0) + sizeof(iqfile_header_t));
|
||||
|
||||
if (mptr != MAP_FAILED) {
|
||||
parse_iqfile_header(device, (iqfile_header_t *)mptr);
|
||||
s->ms_sample = (iqrec_t *)((char *)mptr + sizeof(iqfile_header_t));
|
||||
s->nb_samples = ((sb.st_size-sizeof(iqfile_header_t)) / sizeof(iqrec_t));
|
||||
int aligned = (((unsigned long)s->ms_sample & 31) == 0)? 1:0;
|
||||
LOG_I(HW,"Loaded %u subframes.\n",s->nb_samples );
|
||||
|
||||
if (aligned == 0) {
|
||||
LOG_E(HW, "mmap address is not 32 bytes aligned, exiting.\n" );
|
||||
close(s->mmapfd);
|
||||
exit(-1);
|
||||
}
|
||||
LOG_I(HW,"Loaded %u subframes.\n",s->nbSamplesBlocks );
|
||||
} else {
|
||||
LOG_E(HW,"Cannot mmap file, exiting.\n");
|
||||
close(s->mmapfd);
|
||||
close(s->fd);
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
LOG_E( HW,"Cannot open %s exiting.\n", c->u_sf_filename );
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
s->iqfd = open(c->u_sf_filename, O_RDONLY);
|
||||
iqfile_header_t fh;
|
||||
size_t hs = read(s->fd,&fh,sizeof(fh));
|
||||
|
||||
if (s->iqfd != 0) {
|
||||
struct stat sb;
|
||||
iqfile_header_t fh;
|
||||
size_t hs = read(s->iqfd,&fh,sizeof(fh));
|
||||
|
||||
if (hs == sizeof(fh)) {
|
||||
parse_iqfile_header(device, &fh);
|
||||
fstat(s->iqfd, &sb);
|
||||
if (hs == sizeof(fh)) {
|
||||
parse_iqfile_header(device, &fh);
|
||||
fstat(s->fd, &sb);
|
||||
s->mapsize=sb.st_size;
|
||||
s->nb_samples = ((sb.st_size-sizeof(iqfile_header_t))/ sizeof(iqrec_t));
|
||||
LOG_I(HW, "Loading %u subframes from %s,size=%lu bytes ...\n",s->nb_samples, c->u_sf_filename,(uint64_t)sb.st_size);
|
||||
LOG_I(HW, "Loading %u subframes from %s,size=%lu bytes ...\n",s->nbSamplesBlocks, c->u_sf_filename,(uint64_t)sb.st_size);
|
||||
// allocate buffer for 1 sample at a time
|
||||
s->ms_sample = (iqrec_t *) malloc(sizeof(iqrec_t));
|
||||
s->ms_sample = (iqrec_t *) malloc(sizeof(iqrec_t)+MAX_BELL_LABS_IQ_BYTES_PER_SF*4);
|
||||
|
||||
if (s->ms_sample == NULL) {
|
||||
LOG_E(HW,"Memory allocation failed for individual subframe replay mode.\n" );
|
||||
close(s->iqfd);
|
||||
close(s->fd);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
memset(s->ms_sample, 0, sizeof(iqrec_t));
|
||||
|
||||
// point at beginning of iqs in file
|
||||
if (lseek(s->iqfd,sizeof(iqfile_header_t), SEEK_SET) == 0) {
|
||||
if (lseek(s->fd,sizeof(iqfile_header_t), SEEK_SET) == 0) {
|
||||
LOG_I(HW,"Initial seek at beginning of the file\n" );
|
||||
} else {
|
||||
LOG_I(HW,"Problem initial seek at beginning of the file\n");
|
||||
}
|
||||
} else {
|
||||
LOG_E(HW,"Cannot read header in %s exiting.\n",c->u_sf_filename );
|
||||
close(s->iqfd);
|
||||
close(s->fd);
|
||||
exit(-1);
|
||||
}
|
||||
} else {
|
||||
LOG_E(HW,"Cannot open %s exiting.\n",c->u_sf_filename );
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
s->currentPtr=(uint8_t *)s->ms_sample;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief start the oai iq player
|
||||
* \param device, the hardware used
|
||||
*/
|
||||
static int trx_iqplayer_start(openair0_device *device){
|
||||
return 0;
|
||||
static int trx_iqplayer_start(openair0_device *device) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief Terminate operation of the oai iq player
|
||||
@@ -156,28 +137,22 @@ static void trx_iqplayer_end(openair0_device *device) {
|
||||
|
||||
if (device->recplay_state == NULL)
|
||||
return;
|
||||
|
||||
|
||||
if (device->recplay_state->use_mmap) {
|
||||
if (device->recplay_state->ms_sample != MAP_FAILED) {
|
||||
munmap(device->recplay_state->ms_sample, device->recplay_state->mapsize);
|
||||
device->recplay_state->ms_sample = NULL;
|
||||
}
|
||||
|
||||
if (device->recplay_state->mmapfd != 0) {
|
||||
close(device->recplay_state->mmapfd);
|
||||
device->recplay_state->mmapfd = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (device->recplay_state->ms_sample != NULL) {
|
||||
free(device->recplay_state->ms_sample);
|
||||
device->recplay_state->ms_sample = NULL;
|
||||
}
|
||||
|
||||
if (device->recplay_state->iqfd != 0) {
|
||||
close(device->recplay_state->iqfd);
|
||||
device->recplay_state->iqfd = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
device->recplay_state->ms_sample = NULL;
|
||||
if (device->recplay_state->fd >= 0) {
|
||||
close(device->recplay_state->fd);
|
||||
device->recplay_state->fd = -1;
|
||||
}
|
||||
|
||||
}
|
||||
/*! \brief Write iqs function when in replay mode, just introduce a delay, as configured at init time,
|
||||
@param device pointer to the device structure specific to the RF hardware target
|
||||
@@ -207,93 +182,68 @@ static int trx_iqplayer_write(openair0_device *device, openair0_timestamp timest
|
||||
* \returns the number of sample read
|
||||
*/
|
||||
static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
|
||||
int samples_received=0;
|
||||
static unsigned int cur_samples;
|
||||
static int64_t wrap_count;
|
||||
static int64_t wrap_ts;
|
||||
recplay_state_t *s = device->recplay_state;
|
||||
|
||||
if (cur_samples == s->nb_samples) {
|
||||
cur_samples = 0;
|
||||
wrap_count++;
|
||||
if (s->curSamplesBlock==0 && s->wrap_count==0 )
|
||||
s->currentTs=s->ms_sample->ts;
|
||||
|
||||
if (s->curSamplesBlock == s->nbSamplesBlocks) {
|
||||
LOG_I(HW, "wrapping on iq file (%ld)\n", s->wrap_count);
|
||||
s->curSamplesBlock = 0;
|
||||
s->wrap_count++;
|
||||
|
||||
if (wrap_count == device->openair0_cfg->recplay_conf->u_sf_loops) {
|
||||
LOG_W(HW, "iqplayer device terminating subframes replay after %u iteration\n",device->openair0_cfg->recplay_conf->u_sf_loops);
|
||||
if (s->wrap_count == device->openair0_cfg->recplay_conf->u_sf_loops) {
|
||||
LOG_W(HW, "iqplayer device terminating subframes replay after %u iteration\n",
|
||||
device->openair0_cfg->recplay_conf->u_sf_loops);
|
||||
exit_function(__FILE__, __FUNCTION__, __LINE__,"replay ended, triggering process termination\n");
|
||||
}
|
||||
|
||||
wrap_ts = wrap_count * (s->nb_samples * (((int)(device->openair0_cfg[0].sample_rate)) / 1000));
|
||||
LOG_I(HW,"go back at the beginning of IQ file");
|
||||
device->recplay_state->currentPtr=(uint8_t *)device->recplay_state->ms_sample;
|
||||
|
||||
if (!device->recplay_state->use_mmap) {
|
||||
if (lseek(device->recplay_state->iqfd, 0, SEEK_SET) == 0) {
|
||||
LOG_I(HW,"Seeking at the beginning of IQ file");
|
||||
} else {
|
||||
LOG_I(HW, "Problem seeking at the beginning of IQ file");
|
||||
if (!s->use_mmap) {
|
||||
if (lseek(device->recplay_state->fd, 0, SEEK_SET) != 0) {
|
||||
LOG_E(HW, "Problem seeking at the beginning of IQ file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (s->use_mmap) {
|
||||
if (cur_samples < s->nb_samples) {
|
||||
*ptimestamp = (s->ms_sample[0].ts + (cur_samples * (((int)(device->openair0_cfg[0].sample_rate)) / 1000))) + wrap_ts;
|
||||
|
||||
if (cur_samples == 0) {
|
||||
LOG_I(HW,"starting subframes file with wrap_count=%lu wrap_ts=%lu ts=%lu\n", wrap_count,wrap_ts,*ptimestamp);
|
||||
}
|
||||
|
||||
memcpy(buff[0], &s->ms_sample[cur_samples].samples[0], nsamps*4);
|
||||
cur_samples++;
|
||||
}
|
||||
} else {
|
||||
if (!s->use_mmap) {
|
||||
// read sample from file
|
||||
if (read(s->iqfd, s->ms_sample, sizeof(iqrec_t)) != sizeof(iqrec_t)) {
|
||||
LOG_E(HW,"pb reading iqfile at index %lu\n",sizeof(iqrec_t)*cur_samples );
|
||||
close(s->iqfd);
|
||||
free(s->ms_sample);
|
||||
s->ms_sample = NULL;
|
||||
s->iqfd = 0;
|
||||
if (read(s->fd, s->ms_sample, sizeof(iqrec_t)) != sizeof(iqrec_t)) {
|
||||
LOG_E(HW,"pb reading iqfile at index %lu\n",sizeof(iqrec_t)*s->curSamplesBlock );
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (cur_samples < s->nb_samples) {
|
||||
static int64_t ts0 = 0;
|
||||
|
||||
if ((cur_samples == 0) && (wrap_count == 0)) {
|
||||
ts0 = s->ms_sample->ts;
|
||||
}
|
||||
|
||||
*ptimestamp = ts0 + (cur_samples * (((int)(device->openair0_cfg[0].sample_rate)) / 1000)) + wrap_ts;
|
||||
|
||||
if (cur_samples == 0) {
|
||||
LOG_I(HW, "starting subframes file with wrap_count=%lu wrap_ts=%lu ts=%lu ",wrap_count,wrap_ts, *ptimestamp);
|
||||
}
|
||||
|
||||
memcpy(buff[0], &s->ms_sample->samples[0], nsamps*4);
|
||||
cur_samples++;
|
||||
// Prepare for next read
|
||||
off_t where = lseek(s->iqfd, cur_samples * sizeof(iqrec_t), SEEK_SET);
|
||||
|
||||
if (where < 0) {
|
||||
LOG_E(HW,"Cannot lseek in iqfile: %s\n",strerror(errno));
|
||||
} else {
|
||||
if (read(s->fd, s->ms_sample+1, s->ms_sample->nbBytes) != s->ms_sample->nbBytes) {
|
||||
LOG_E(HW,"pb reading iqfile at index %lu\n",sizeof(iqrec_t)*s->curSamplesBlock );
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iqrec_t *curHeader=(iqrec_t *)s->currentPtr;
|
||||
AssertFatal(curHeader->header==BELL_LABS_IQ_HEADER,"" );
|
||||
// the current timestamp is the stored timestamp until we wrap on input
|
||||
// USRP shifts 1 sample time to time
|
||||
AssertFatal(s->wrap_count !=0 || abs(curHeader->ts-s->currentTs) < 5 ,"");
|
||||
AssertFatal(nsamps*4==curHeader->nbBytes,"");
|
||||
*ptimestamp = s->currentTs;
|
||||
memcpy(buff[0], curHeader+1, nsamps*4);
|
||||
s->curSamplesBlock++;
|
||||
// Prepare for next read
|
||||
s->currentTs+=nsamps;
|
||||
|
||||
if (s->use_mmap)
|
||||
s->currentPtr+=sizeof(iqrec_t)+s->ms_sample->nbBytes;
|
||||
|
||||
struct timespec req;
|
||||
|
||||
req.tv_sec = 0;
|
||||
|
||||
req.tv_nsec = (device->openair0_cfg[0].recplay_conf->u_sf_read_delay) * 1000;
|
||||
|
||||
nanosleep(&req, NULL);
|
||||
|
||||
LOG_D(HW, "returning %d samples at ts %lu\n", nsamps, *ptimestamp);
|
||||
return nsamps;
|
||||
|
||||
return samples_received;
|
||||
}
|
||||
|
||||
|
||||
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
device->openair0_cfg = openair0_cfg;
|
||||
device->trx_start_func = trx_iqplayer_start;
|
||||
@@ -312,5 +262,4 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
LOG_UI(HW,"iqplayer device initialized, replay %s for %i iterations",openair0_cfg->recplay_conf->u_sf_filename,openair0_cfg->recplay_conf->u_sf_loops);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -65,17 +65,8 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
|
||||
// Fixme: not sure when it is "volts" so dB is 20*log10(...) or "power", so dB is 10*log10(...)
|
||||
const double pathLossLinear = pow(10,channelDesc->path_loss_dB/20.0);
|
||||
// Energy in one sample to calibrate input noise
|
||||
//Fixme: modified the N0W computation, not understand the origin value
|
||||
const double KT=1.38e-23*290; //Boltzman*temperature
|
||||
// sampling rate is linked to acquisition band (the input pass band filter)
|
||||
const double noise_figure_watt = KT*channelDesc->sampling_rate;
|
||||
// Fixme: how to convert a noise in Watt into a 12 bits value out of the RF ADC ?
|
||||
// the parameter "-s" is declared as SNR, but the input power is not well defined
|
||||
// −132.24 dBm is a LTE subcarrier noise, that was used in origin code (15KHz BW thermal noise)
|
||||
const double rxGain= 132.24 - channelmod_get_snr_dB();
|
||||
// sqrt(4*noise_figure_watt) is the thermal noise factor (volts)
|
||||
// fixme: the last constant is pure trial results to make decent noise
|
||||
const double noise_per_sample = sqrt(4*noise_figure_watt) * pow(10,rxGain/20) *10;
|
||||
// the normalized OAI value seems to be 256 as average amplitude (numerical amplification = 1)
|
||||
const double noise_per_sample = pow(10,channelDesc->noise_power_dB/10.0) * 256;
|
||||
// Fixme: we don't fill the offset length samples at begining ?
|
||||
// anyway, in today code, channel_offset=0
|
||||
const int dd = abs(channelDesc->channel_offset);
|
||||
|
||||
@@ -66,7 +66,9 @@
|
||||
|
||||
#define RFSIMU_SECTION "rfsimulator"
|
||||
#define RFSIMU_OPTIONS_PARAMNAME "options"
|
||||
# define RFSIM_CONFIG_HELP_OPTIONS " list of comma separated options to enable rf simulator functionalities. Available options: \n"\
|
||||
|
||||
|
||||
#define RFSIM_CONFIG_HELP_OPTIONS " list of comma separated options to enable rf simulator functionalities. Available options: \n"\
|
||||
" chanmod: enable channel modelisation\n"\
|
||||
" saviq: enable saving written iqs to a file\n"
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
@@ -75,21 +77,21 @@
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define simOpt PARAMFLAG_NOFREE|PARAMFLAG_CMDLINE_NOPREFIXENABLED
|
||||
#define RFSIMULATOR_PARAMS_DESC { \
|
||||
{"serveraddr", "<ip address to connect to>\n", simOpt , strptr:&(rfsimulator->ip), defstrval:"127.0.0.1", TYPE_STRING, 0 },\
|
||||
{"serverport", "<port to connect to>\n", simOpt, u16ptr:&(rfsimulator->port), defuintval:PORT, TYPE_UINT16, 0 },\
|
||||
{RFSIMU_OPTIONS_PARAMNAME, RFSIM_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0 },\
|
||||
{"IQfile", "<file path to use when saving IQs>\n",simOpt, strptr:&(saveF), defstrval:"/tmp/rfsimulator.iqs",TYPE_STRING, 0 },\
|
||||
{"modelname", "<channel model name>\n", simOpt, strptr:&(modelname), defstrval:"AWGN", TYPE_STRING, 0 },\
|
||||
{"ploss", "<channel path loss in dB>\n", simOpt, dblptr:&(rfsimulator->chan_pathloss), defdblval:0, TYPE_DOUBLE, 0 },\
|
||||
{"forgetfact", "<channel forget factor ((0 to 1)>\n", simOpt, dblptr:&(rfsimulator->chan_forgetfact), defdblval:0, TYPE_DOUBLE, 0 },\
|
||||
{"offset", "<channel offset in samps>\n", simOpt, iptr:&(rfsimulator->chan_offset), defintval:0, TYPE_INT, 0 }\
|
||||
{"serveraddr", "<ip address to connect to>\n", simOpt, strptr:&(rfsimulator->ip), defstrval:"127.0.0.1", TYPE_STRING, 0 },\
|
||||
{"serverport", "<port to connect to>\n", simOpt, u16ptr:&(rfsimulator->port), defuintval:PORT, TYPE_UINT16, 0 },\
|
||||
{RFSIMU_OPTIONS_PARAMNAME, RFSIM_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0 },\
|
||||
{"IQfile", "<file path to use when saving IQs>\n",simOpt, strptr:&(saveF), defstrval:"/tmp/rfsimulator.iqs",TYPE_STRING, 0 },\
|
||||
{"modelname", "<channel model name>\n", simOpt, strptr:&(modelname), defstrval:"AWGN", TYPE_STRING, 0 },\
|
||||
{"ploss", "<channel path loss in dB>\n", simOpt, dblptr:&(rfsimulator->chan_pathloss), defdblval:0, TYPE_DOUBLE, 0 },\
|
||||
{"forgetfact", "<channel forget factor ((0 to 1)>\n", simOpt, dblptr:&(rfsimulator->chan_forgetfact), defdblval:0, TYPE_DOUBLE, 0 },\
|
||||
{"offset", "<channel offset in samps>\n", simOpt, iptr:&(rfsimulator->chan_offset), defintval:0, TYPE_INT, 0 }\
|
||||
};
|
||||
|
||||
|
||||
|
||||
static int rfsimu_setchanmod_cmd(char *buff, int debug, telnet_printfunc_t prnt, void *arg);
|
||||
static telnetshell_cmddef_t rfsimu_cmdarray[] = {
|
||||
{"setmodel","<model name>",(cmdfunc_t)rfsimu_setchanmod_cmd,TELNETSRV_CMDFLAG_PUSHINTPOOLQ},
|
||||
{"setmodel","<model name> <model type>",(cmdfunc_t)rfsimu_setchanmod_cmd,TELNETSRV_CMDFLAG_PUSHINTPOOLQ},
|
||||
{"","",NULL},
|
||||
};
|
||||
|
||||
@@ -130,6 +132,7 @@ typedef struct {
|
||||
double chan_pathloss;
|
||||
double chan_forgetfact;
|
||||
int chan_offset;
|
||||
float noise_power_dB;
|
||||
void *telnetcmd_qid;
|
||||
poll_telnetcmdq_func_t poll_telnetcmdq;
|
||||
} rfsimulator_state_t;
|
||||
@@ -179,15 +182,9 @@ static void allocCirBuf(rfsimulator_state_t *bridge, int sock) {
|
||||
tableNor(rand);
|
||||
init_done=true;
|
||||
}
|
||||
|
||||
ptr->channel_model=new_channel_desc_scm(bridge->tx_num_channels,bridge->rx_num_channels,
|
||||
bridge->channelmod,
|
||||
bridge->sample_rate,
|
||||
bridge->tx_bw,
|
||||
30e-9, // TDL delay-spread parameter
|
||||
bridge->chan_forgetfact, // forgetting_factor
|
||||
bridge->chan_offset, // maybe used for TA
|
||||
bridge->chan_pathloss); // path_loss in dB
|
||||
char *modelname = (bridge->typeStamp == ENB_MAGICDL) ? "rfsimu_channel_ue0":"rfsimu_channel_enB0";
|
||||
ptr->channel_model=find_channel_desc_fromname(modelname); // path_loss in dB
|
||||
AssertFatal((ptr->channel_model!= NULL),"Channel model %s not found, check config file\n",modelname);
|
||||
set_channeldesc_owner(ptr->channel_model, RFSIMU_MODULEID);
|
||||
random_channel(ptr->channel_model,false);
|
||||
}
|
||||
@@ -296,7 +293,8 @@ static void rfsimulator_readconfig(rfsimulator_state_t *rfsimulator) {
|
||||
break;
|
||||
} else if (strcmp(rfsimu_params[p].strlistptr[i],"chanmod") == 0) {
|
||||
init_channelmod();
|
||||
rfsimulator->channelmod=modelid_fromname(modelname);
|
||||
load_channellist(rfsimulator->tx_num_channels, rfsimulator->rx_num_channels, rfsimulator->sample_rate, rfsimulator->tx_bw);
|
||||
rfsimulator->channelmod=true;
|
||||
} else {
|
||||
fprintf(stderr,"Unknown rfsimulator option: %s\n",rfsimu_params[p].strlistptr[i]);
|
||||
exit(-1);
|
||||
@@ -317,20 +315,27 @@ static void rfsimulator_readconfig(rfsimulator_state_t *rfsimulator) {
|
||||
|
||||
static int rfsimu_setchanmod_cmd(char *buff, int debug, telnet_printfunc_t prnt, void *arg) {
|
||||
char *modelname=NULL;
|
||||
int s = sscanf(buff,"%ms\n",&modelname);
|
||||
char *modeltype=NULL;
|
||||
if (debug)
|
||||
prnt("rfsimu_setchanmod_cmd buffer \"%s\"\n",buff);
|
||||
int s = sscanf(buff,"%m[^ ] %ms\n",&modelname, &modeltype);
|
||||
|
||||
if (s == 1) {
|
||||
int channelmod=modelid_fromname(modelname);
|
||||
if (s == 2) {
|
||||
int channelmod=modelid_fromstrtype(modeltype);
|
||||
|
||||
if (channelmod<0)
|
||||
prnt("ERROR: model %s unknown\n",modelname);
|
||||
prnt("ERROR: model type %s unknown\n",modeltype);
|
||||
else {
|
||||
rfsimulator_state_t *t = (rfsimulator_state_t *)arg;
|
||||
|
||||
int found=0;
|
||||
for (int i=0; i<FD_SETSIZE; i++) {
|
||||
buffer_t *b=&t->buf[i];
|
||||
if ( b->channel_model==NULL)
|
||||
continue;
|
||||
if (b->channel_model->model_name==NULL)
|
||||
continue;
|
||||
if (b->conn_sock >= 0 && (strcmp(b->channel_model->model_name,modelname)==0)) {
|
||||
|
||||
if (b->conn_sock >= 0 ) {
|
||||
channel_desc_t *newmodel=new_channel_desc_scm(t->tx_num_channels,t->rx_num_channels,
|
||||
channelmod,
|
||||
t->sample_rate,
|
||||
@@ -338,21 +343,29 @@ static int rfsimu_setchanmod_cmd(char *buff, int debug, telnet_printfunc_t prnt,
|
||||
30e-9, // TDL delay-spread parameter
|
||||
t->chan_forgetfact, // forgetting_factor
|
||||
t->chan_offset, // maybe used for TA
|
||||
t->chan_pathloss); // path_loss in dB
|
||||
t->chan_pathloss,
|
||||
t->noise_power_dB
|
||||
); // path_loss in dB
|
||||
set_channeldesc_owner(newmodel, RFSIMU_MODULEID);
|
||||
set_channeldesc_name(newmodel,modelname);
|
||||
random_channel(newmodel,false);
|
||||
channel_desc_t *oldmodel=b->channel_model;
|
||||
b->channel_model=newmodel;
|
||||
free_channel_desc_scm(oldmodel);
|
||||
prnt("New model %s applied to channel connected to sock %d\n",modelname,i);
|
||||
prnt("New model type %s applied to channel %s connected to sock %d\n",modeltype,modelname,i);
|
||||
found=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} /* for */
|
||||
if (found==0)
|
||||
prnt("Channel %s not found or not currently used\n",modelname);
|
||||
}
|
||||
} else {
|
||||
prnt("ERROR: no model specified\n");
|
||||
prnt("ERROR: 2 parameters required: model name and model type (%i found)\n",s);
|
||||
}
|
||||
|
||||
free(modelname);
|
||||
free(modeltype);
|
||||
return CMDSTATUS_FOUND;
|
||||
}
|
||||
|
||||
@@ -771,6 +784,11 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
// to change the log level, use this on command line
|
||||
// --log_config.hw_log_level debug
|
||||
rfsimulator_state_t *rfsimulator = (rfsimulator_state_t *)calloc(sizeof(rfsimulator_state_t),1);
|
||||
// initialize channel simulation
|
||||
rfsimulator->tx_num_channels=openair0_cfg->tx_num_channels;
|
||||
rfsimulator->rx_num_channels=openair0_cfg->rx_num_channels;
|
||||
rfsimulator->sample_rate=openair0_cfg->sample_rate;
|
||||
rfsimulator->tx_bw=openair0_cfg->tx_bw;
|
||||
rfsimulator_readconfig(rfsimulator);
|
||||
pthread_mutex_init(&Sockmutex, NULL);
|
||||
LOG_I(HW,"rfsimulator: running as %s\n", rfsimulator-> typeStamp == ENB_MAGICDL ? "server waiting opposite rfsimulators to connect" : "client: will connect to a rfsimulator server side");
|
||||
@@ -795,11 +813,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
rfsimulator->buf[i].conn_sock=-1;
|
||||
|
||||
AssertFatal((rfsimulator->epollfd = epoll_create1(0)) != -1,"");
|
||||
// initialize channel simulation
|
||||
rfsimulator->tx_num_channels=openair0_cfg->tx_num_channels;
|
||||
rfsimulator->rx_num_channels=openair0_cfg->rx_num_channels;
|
||||
rfsimulator->sample_rate=openair0_cfg->sample_rate;
|
||||
rfsimulator->tx_bw=openair0_cfg->tx_bw;
|
||||
|
||||
//randominit(0);
|
||||
set_taus_seed(0);
|
||||
/* look for telnet server, if it is loaded, add the channel modeling commands to it */
|
||||
|
||||
@@ -186,14 +186,14 @@ int main(int argc, char *argv[]) {
|
||||
serviceSock=client_start(argv[2],atoi(argv[3]));
|
||||
}
|
||||
|
||||
uint64_t typeStamp=ENB_MAGICDL_FDD;
|
||||
uint64_t typeStamp=ENB_MAGICDL;
|
||||
boolean_t raw=false;
|
||||
|
||||
if ( argc == 5 ) {
|
||||
raw=true;
|
||||
|
||||
if (strcmp(argv[4],"UL") == 0 )
|
||||
typeStamp=UE_MAGICDL_FDD;
|
||||
typeStamp=UE_MAGICDL;
|
||||
}
|
||||
|
||||
samplesBlockHeader_t header;
|
||||
@@ -201,7 +201,6 @@ int main(int argc, char *argv[]) {
|
||||
void *buff=malloc(bufSize);
|
||||
uint64_t timestamp=0;
|
||||
const int blockSize=1920;
|
||||
|
||||
// If fileSize is not multiple of blockSize*4 then discard remaining samples
|
||||
fileSize = (fileSize/(blockSize<<2))*(blockSize<<2);
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
# include "enb_app.h"
|
||||
# include "openair2/LAYER2/MAC/mac_proto.h"
|
||||
#include <executables/split_headers.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
# include "mce_app.h"
|
||||
# include "mme_app.h"
|
||||
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
//extern RAN_CONTEXT_t RC;
|
||||
|
||||
int create_tasks_mbms(uint32_t enb_nb) {
|
||||
|
||||
@@ -15,7 +15,8 @@ gNBs =
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
|
||||
plmn_list = ({mcc = 222; mnc = 01; mnc_length = 2;});
|
||||
#plmn_list = ({mcc = 222; mnc = 01; mnc_length = 2;});
|
||||
plmn_list = ({mcc = 208; mnc = 99; mnc_length = 2;});
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
@@ -66,7 +67,17 @@ gNBs =
|
||||
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_1 = 53; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
@@ -92,9 +103,7 @@ gNBs =
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 74;
|
||||
zeroCorrelationZoneConfig = 13;
|
||||
preambleReceivedTargetPower = -118;
|
||||
#preambleReceivedTargetPower = -104;
|
||||
#preambleReceivedTargetPower = -108;
|
||||
preambleReceivedTargetPower = -108;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
#powerRampingStep
|
||||
@@ -124,13 +133,13 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPk2_1 = 2; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
@@ -196,7 +205,7 @@ gNBs =
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.18.99";
|
||||
mme_ip_address = ( { ipv4 = "192.168.18.150"; #"192.168.18.99";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
@@ -276,7 +285,6 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
//parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_DISABLE";
|
||||
|
||||
@@ -58,27 +58,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=3
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_3 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 261;
|
||||
|
||||
@@ -58,27 +58,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=3
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 257;
|
||||
@@ -133,20 +120,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 4;
|
||||
initialULBWPk2_2 = 4; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,22 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=3
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot (but is not used here)
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 257;
|
||||
@@ -126,15 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 2; # used for mixed slot (not used here)
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
|
||||
@@ -58,27 +58,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=3
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 261;
|
||||
@@ -133,20 +120,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 4;
|
||||
initialULBWPk2_2 = 4; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 66;
|
||||
@@ -132,20 +119,18 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 66;
|
||||
@@ -132,20 +119,18 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
|
||||
@@ -56,22 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=3
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -126,16 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 2; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,13 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
@@ -132,21 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 2; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,22 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=3
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot (but not used here)
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -126,16 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 2; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 63; # this is SS=7 L=5
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
initialULBWPstartSymbolAndLength_2 = 91; # this is SS=7 L=7
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,13 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
initialDLBWPk0_3 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
|
||||
@@ -56,22 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=3
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -126,16 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 2; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,13 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; # used for (full) DL slot
|
||||
initialDLBWPmappingType_0 = 0; # 0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; # this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
initialDLBWPk0_1 = 0; # used for DL part mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; # this is SS=1,L=5
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
@@ -132,20 +118,17 @@ gNBs =
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPk2_0 = 6; # used for (full) UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPk2_1 = 6; # used for UL part mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
@@ -132,20 +119,17 @@ gNBs =
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -131,21 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6; #2;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 6; #2;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -131,16 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 2; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_3 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_3 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_3 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -131,21 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;#2;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 6;#2;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -58,27 +58,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -133,20 +120,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_1 = 2; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -56,27 +56,14 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_1 = 53;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4 //5 (4 is for 43, 5 is for 57)
|
||||
initialDLBWPstartSymbolAndLength_3 = 57; //43; //57;
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
ul_frequencyBand = 78;
|
||||
@@ -131,20 +118,17 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 2; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_1 = 2; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -13,7 +13,7 @@ gNBs =
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({mcc = 222; mnc = 93; mnc_length = 2;});
|
||||
plmn_list = ({mcc = 208; mnc = 92; mnc_length = 2;});
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
@@ -21,6 +21,7 @@ gNBs =
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
@@ -51,7 +52,7 @@ gNBs =
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=41,L=24 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 6368;
|
||||
initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
@@ -60,32 +61,13 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_0 = 53;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=10
|
||||
initialDLBWPstartSymbolAndLength_1 = 81;
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 95;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=2,L=7
|
||||
initialDLBWPstartSymbolAndLength_3 = 86;
|
||||
|
||||
initialDLBWPk0_4 = 0;
|
||||
initialDLBWPmappingType_4 = 0;
|
||||
#this is SS=2,L=5
|
||||
initialDLBWPstartSymbolAndLength_4 = 58;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
@@ -99,7 +81,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 6368;
|
||||
initialULBWPlocationAndBandwidth = 12952;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
@@ -111,7 +93,7 @@ gNBs =
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 13;
|
||||
preambleReceivedTargetPower = -100;
|
||||
preambleReceivedTargetPower = -96;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
#powerRampingStep
|
||||
@@ -141,20 +123,17 @@ gNBs =
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
@@ -196,7 +175,7 @@ gNBs =
|
||||
nrofUplinkSlots = 2;
|
||||
nrofUplinkSymbols = 4;
|
||||
|
||||
ssPBCH_BlockPower = 10;
|
||||
ssPBCH_BlockPower = -25;
|
||||
}
|
||||
|
||||
);
|
||||
@@ -255,10 +234,11 @@ MACRLCs = (
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
pusch_proc_threads = 8;
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
|
||||
@@ -13,7 +13,7 @@ gNBs =
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({mcc = 222; mnc = 93; mnc_length = 2;});
|
||||
plmn_list = ({mcc = 208; mnc = 92; mnc_length = 2;});
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
@@ -21,6 +21,7 @@ gNBs =
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
@@ -50,8 +51,8 @@ gNBs =
|
||||
dl_carrierBandwidth = 106;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=41,L=24 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 6368;
|
||||
# this is RBstart=27,L=48 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
@@ -60,27 +61,13 @@ gNBs =
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0;
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=12
|
||||
initialDLBWPstartSymbolAndLength_0 = 53;
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
#this is SS=2,L=10
|
||||
initialDLBWPstartSymbolAndLength_1 = 81;
|
||||
|
||||
initialDLBWPk0_2 = 0;
|
||||
initialDLBWPmappingType_2 = 0;
|
||||
#this is SS=1,L=12
|
||||
initialDLBWPstartSymbolAndLength_2 = 54;
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
@@ -94,7 +81,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 6368;
|
||||
initialULBWPlocationAndBandwidth = 12952;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
@@ -106,7 +93,7 @@ gNBs =
|
||||
prach_msg1_FDM = 0;
|
||||
prach_msg1_FrequencyStart = 0;
|
||||
zeroCorrelationZoneConfig = 13;
|
||||
preambleReceivedTargetPower = -100;
|
||||
preambleReceivedTargetPower = -96;
|
||||
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
|
||||
preambleTransMax = 6;
|
||||
#powerRampingStep
|
||||
@@ -136,20 +123,17 @@ gNBs =
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
initialULBWPstartSymbolAndLength_1 = 69; # this is SS=0 L=12
|
||||
|
||||
initialULBWPk2_2 = 7;
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
@@ -191,7 +175,7 @@ gNBs =
|
||||
nrofUplinkSlots = 2;
|
||||
nrofUplinkSymbols = 4;
|
||||
|
||||
ssPBCH_BlockPower = 10;
|
||||
ssPBCH_BlockPower = -25;
|
||||
}
|
||||
|
||||
);
|
||||
@@ -250,10 +234,11 @@ MACRLCs = (
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
pusch_proc_threads = 8;
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
|
||||
@@ -858,7 +858,6 @@ static void *ru_thread_asynch_rxtx( void *param ) {
|
||||
LOG_I(PHY, "devices ok (ru_thread_asynch_rxtx)\n");
|
||||
|
||||
while (!oai_exit) {
|
||||
if (oai_exit) break;
|
||||
|
||||
if (ru->state != RU_RUN) {
|
||||
subframe=0;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <sched.h>
|
||||
|
||||
#include "rt_wrapper.h"
|
||||
#include <common/utils/msc/msc.h>
|
||||
|
||||
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
@@ -56,6 +57,8 @@
|
||||
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
#include <openair1/PHY/phy_extern_ue.h>
|
||||
|
||||
#include "PHY/phy_vars.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "LAYER2/MAC/mac_vars.h"
|
||||
@@ -100,6 +103,8 @@ pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
|
||||
msc_interface_t msc_interface;
|
||||
|
||||
|
||||
uint16_t sf_ahead=4;
|
||||
|
||||
@@ -174,7 +179,6 @@ RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mas
|
||||
int transmission_mode=1;
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
int usrp_tx_thread = 0;
|
||||
|
||||
THREAD_STRUCT thread_struct;
|
||||
/* struct for ethernet specific parameters given in eNB conf file */
|
||||
@@ -741,7 +745,7 @@ int main ( int argc, char **argv )
|
||||
fflush(stderr);
|
||||
// end of CI modifications
|
||||
//getchar();
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
load_softscope("enb",NULL);
|
||||
itti_wait_tasks_end();
|
||||
oai_exit=1;
|
||||
@@ -749,7 +753,7 @@ int main ( int argc, char **argv )
|
||||
// stop threads
|
||||
|
||||
if (RC.nb_inst == 0 || !NODE_IS_CU(node_type)) {
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
end_forms();
|
||||
|
||||
LOG_I(ENB_APP,"stopping MODEM threads\n");
|
||||
|
||||
@@ -95,6 +95,7 @@ extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
|
||||
extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
|
||||
|
||||
|
||||
int tx_req_num_elems;
|
||||
extern uint16_t sf_ahead;
|
||||
//extern int tx_req_UE_MAC1();
|
||||
|
||||
@@ -181,9 +182,8 @@ PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t abstraction_flag)
|
||||
|
||||
{
|
||||
PHY_VARS_UE *ue = (PHY_VARS_UE *)malloc(sizeof(PHY_VARS_UE));
|
||||
memset(ue,0,sizeof(PHY_VARS_UE));
|
||||
|
||||
PHY_VARS_UE *ue = (PHY_VARS_UE *)calloc(1,sizeof(PHY_VARS_UE));
|
||||
AssertFatal(ue,"");
|
||||
if (frame_parms!=(LTE_DL_FRAME_PARMS *)NULL) { // if we want to give initial frame parms, allocate the PHY_VARS_UE structure and put them in
|
||||
memcpy(&(ue->frame_parms), frame_parms, sizeof(LTE_DL_FRAME_PARMS));
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
#include "lte-softmodem.h"
|
||||
|
||||
|
||||
msc_interface_t msc_interface;
|
||||
/* temporary compilation wokaround (UE/eNB split */
|
||||
uint16_t sf_ahead;
|
||||
|
||||
@@ -168,7 +169,6 @@ extern void get_uethreads_params(void);
|
||||
|
||||
int transmission_mode=1;
|
||||
|
||||
int usrp_tx_thread = 0;
|
||||
|
||||
|
||||
char *usrp_args=NULL;
|
||||
@@ -746,7 +746,7 @@ int main( int argc, char **argv ) {
|
||||
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
|
||||
|
||||
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
load_softscope("ue",NULL);
|
||||
|
||||
config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||
@@ -771,7 +771,7 @@ int main( int argc, char **argv ) {
|
||||
printf("oai_exit=%d\n",oai_exit);
|
||||
|
||||
// stop threads
|
||||
if(IS_SOFTMODEM_DOFORMS)
|
||||
if(IS_SOFTMODEM_DOSCOPE)
|
||||
end_forms();
|
||||
|
||||
printf("stopping MODEM threads\n");
|
||||
|
||||
@@ -0,0 +1,492 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file rfsim.c
|
||||
* \brief function for simulated RF device
|
||||
* \author R. Knopp
|
||||
* \date 2018
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: openair_tech@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <execinfo.h>
|
||||
#include <time.h>
|
||||
#include <mcheck.h>
|
||||
#include <sys/timerfd.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "rfsim.h"
|
||||
#include "openair1/SIMULATION/TOOLS/sim.h"
|
||||
#include "enb_config.h"
|
||||
#include "enb_paramdef.h"
|
||||
#include "platform_constants.h"
|
||||
#include "common/config/config_paramdesc.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/defs_RU.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
extern PHY_VARS_UE ***PHY_vars_UE_g;
|
||||
|
||||
|
||||
// put all of these in a common structure after
|
||||
sim_t sim;
|
||||
|
||||
|
||||
void init_ru_devices(void);
|
||||
|
||||
void init_RU(char *,int send_dmrssync);
|
||||
|
||||
void *rfsim_top(void *n_frames);
|
||||
|
||||
void wait_RUs(void) {
|
||||
int i;
|
||||
// wait for all RUs to be configured over fronthaul
|
||||
pthread_mutex_lock(&RC.ru_mutex);
|
||||
|
||||
while (RC.ru_mask>0) {
|
||||
pthread_cond_wait(&RC.ru_cond,&RC.ru_mutex);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&RC.ru_mutex);
|
||||
|
||||
// copy frame parameters from RU to UEs
|
||||
for (i=0; i<NB_UE_INST; i++) {
|
||||
sim.current_UE_rx_timestamp[i][0] = RC.ru[0]->frame_parms->samples_per_tti + RC.ru[0]->frame_parms->ofdm_symbol_size + RC.ru[0]->frame_parms->nb_prefix_samples0;
|
||||
}
|
||||
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) sim.current_ru_rx_timestamp[ru_id][0] = RC.ru[ru_id]->frame_parms->samples_per_tti;
|
||||
|
||||
printf("RUs are ready, let's go\n");
|
||||
}
|
||||
|
||||
void wait_eNBs(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void RCConfig_sim(void) {
|
||||
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
|
||||
// Get num RU instances
|
||||
config_getlist( &RUParamList,NULL,0, NULL);
|
||||
RC.nb_RU = RUParamList.numelt;
|
||||
AssertFatal(RC.nb_RU>0,"we need at least 1 RU for simulation\n");
|
||||
printf("returned with %d rus\n",RC.nb_RU);
|
||||
init_RU(NULL,0);
|
||||
printf("Waiting for RUs to get set up\n");
|
||||
wait_RUs();
|
||||
init_ru_devices();
|
||||
static int nframes = 100000;
|
||||
AssertFatal(0 == pthread_create(&sim.rfsim_thread,
|
||||
NULL,
|
||||
rfsim_top,
|
||||
(void *)&nframes), "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ru_trx_start(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
void ru_trx_end(openair0_device *device) {
|
||||
return;
|
||||
}
|
||||
|
||||
int ru_trx_stop(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
int UE_trx_start(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
void UE_trx_end(openair0_device *device) {
|
||||
return;
|
||||
}
|
||||
int UE_trx_stop(openair0_device *device) {
|
||||
return(0);
|
||||
}
|
||||
int ru_trx_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dummy) {
|
||||
return(0);
|
||||
}
|
||||
int ru_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
return(0);
|
||||
}
|
||||
int UE_trx_set_freq(openair0_device *device, openair0_config_t *openair0_cfg, int dummy) {
|
||||
return(0);
|
||||
}
|
||||
int UE_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
extern pthread_mutex_t subframe_mutex;
|
||||
extern int subframe_ru_mask,subframe_UE_mask;
|
||||
|
||||
|
||||
int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
|
||||
int ru_id = device->Mod_id;
|
||||
int CC_id = device->CC_id;
|
||||
int subframe;
|
||||
int sample_count=0;
|
||||
*ptimestamp = sim.last_ru_rx_timestamp[ru_id][CC_id];
|
||||
LOG_D(SIM,"RU_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps,
|
||||
(unsigned long long)sim.current_ru_rx_timestamp[ru_id][CC_id],
|
||||
(unsigned long long)sim.last_ru_rx_timestamp[ru_id][CC_id],
|
||||
(int)((*ptimestamp/RC.ru[ru_id]->frame_parms->samples_per_tti)%10));
|
||||
|
||||
// if we're at a subframe boundary generate UL signals for this ru
|
||||
|
||||
while (sample_count<nsamps) {
|
||||
while (sim.current_ru_rx_timestamp[ru_id][CC_id]<
|
||||
(nsamps+sim.last_ru_rx_timestamp[ru_id][CC_id])) {
|
||||
LOG_D(SIM,"RU: current TS %"PRIi64", last TS %"PRIi64", sleeping\n",sim.current_ru_rx_timestamp[ru_id][CC_id],sim.last_ru_rx_timestamp[ru_id][CC_id]);
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
subframe = (sim.last_ru_rx_timestamp[ru_id][CC_id]/RC.ru[ru_id]->frame_parms->samples_per_tti)%10;
|
||||
|
||||
if (subframe_select(RC.ru[ru_id]->frame_parms,subframe) != SF_DL || RC.ru[ru_id]->frame_parms->frame_type == FDD) {
|
||||
LOG_D(SIM,"RU_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n",
|
||||
subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)sim.current_ru_rx_timestamp[ru_id][CC_id]);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_UL_SIGNAL,1);
|
||||
do_UL_sig(&sim,
|
||||
subframe,
|
||||
0, // abstraction_flag
|
||||
RC.ru[ru_id]->frame_parms,
|
||||
0, // frame is only used for abstraction
|
||||
ru_id,
|
||||
CC_id);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_UL_SIGNAL,0);
|
||||
}
|
||||
|
||||
sim.last_ru_rx_timestamp[ru_id][CC_id] += RC.ru[ru_id]->frame_parms->samples_per_tti;
|
||||
sample_count += RC.ru[ru_id]->frame_parms->samples_per_tti;
|
||||
}
|
||||
|
||||
return(nsamps);
|
||||
}
|
||||
|
||||
int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_UE_TRX_READ,1);
|
||||
int UE_id = device->Mod_id;
|
||||
int CC_id = device->CC_id;
|
||||
int subframe;
|
||||
int sample_count=0;
|
||||
int read_size;
|
||||
int sptti = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti;
|
||||
*ptimestamp = sim.last_UE_rx_timestamp[UE_id][CC_id];
|
||||
LOG_D(PHY,"UE %d DL simulation 0: UE_trx_read nsamps %d TS %llu (%llu, offset %d) antenna %d\n",
|
||||
UE_id,
|
||||
nsamps,
|
||||
(unsigned long long)sim.current_UE_rx_timestamp[UE_id][CC_id],
|
||||
(unsigned long long)sim.last_UE_rx_timestamp[UE_id][CC_id],
|
||||
(int)(sim.last_UE_rx_timestamp[UE_id][CC_id]%sptti),
|
||||
cc);
|
||||
|
||||
if (nsamps < sptti)
|
||||
read_size = nsamps;
|
||||
else
|
||||
read_size = sptti;
|
||||
|
||||
while (sample_count<nsamps) {
|
||||
LOG_D(SIM,"UE %d: DL simulation 1: UE_trx_read : current TS now %"PRIi64", last TS %"PRIi64"\n",UE_id,sim.current_UE_rx_timestamp[UE_id][CC_id],sim.last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
|
||||
while (sim.current_UE_rx_timestamp[UE_id][CC_id] <
|
||||
(sim.last_UE_rx_timestamp[UE_id][CC_id]+read_size)) {
|
||||
LOG_D(SIM,"UE %d: DL simulation 2: UE_trx_read : current TS %"PRIi64", last TS %"PRIi64", sleeping\n",UE_id,sim.current_UE_rx_timestamp[UE_id][CC_id],sim.last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
LOG_D(SIM,"UE %d: DL simulation 3: UE_trx_read : current TS now %"PRIi64", last TS %"PRIi64"\n",UE_id,sim.current_UE_rx_timestamp[UE_id][CC_id],sim.last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
// if we cross a subframe-boundary
|
||||
subframe = (sim.last_UE_rx_timestamp[UE_id][CC_id]/sptti)%10;
|
||||
// tell top-level we are busy
|
||||
pthread_mutex_lock(&sim.subframe_mutex);
|
||||
sim.subframe_UE_mask|=(1<<UE_id);
|
||||
LOG_D(SIM,"Setting UE_id %d mask to busy (%d)\n",UE_id,sim.subframe_UE_mask);
|
||||
pthread_mutex_unlock(&sim.subframe_mutex);
|
||||
LOG_D(PHY,"UE %d: DL simulation 4: UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu,nsamps %d)\n",
|
||||
UE_id,subframe,(unsigned long long)*ptimestamp,
|
||||
(unsigned long long)sim.current_UE_rx_timestamp[UE_id][CC_id],
|
||||
nsamps);
|
||||
LOG_D(SIM,"UE %d: DL simulation 5: Doing DL simulation for %d samples starting in subframe %d at offset %d\n",
|
||||
UE_id,nsamps,subframe,
|
||||
(int)(sim.last_UE_rx_timestamp[UE_id][CC_id]%sptti));
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_DL_SIGNAL,1);
|
||||
do_DL_sig(&sim,
|
||||
subframe,
|
||||
sim.last_UE_rx_timestamp[UE_id][CC_id]%sptti,
|
||||
sptti,
|
||||
0, //abstraction_flag,
|
||||
&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
|
||||
UE_id,
|
||||
CC_id);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_DL_SIGNAL,0);
|
||||
LOG_D(PHY,"UE %d: DL simulation 6: UE_trx_read @ TS %"PRIi64" (%"PRIi64")=> frame %d, subframe %d\n",
|
||||
UE_id, sim.current_UE_rx_timestamp[UE_id][CC_id],
|
||||
sim.last_UE_rx_timestamp[UE_id][CC_id],
|
||||
(int)((sim.last_UE_rx_timestamp[UE_id][CC_id]/(sptti*10))&1023),
|
||||
subframe);
|
||||
sim.last_UE_rx_timestamp[UE_id][CC_id] += read_size;
|
||||
sample_count += read_size;
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_UE_TRX_READ,0);
|
||||
return(nsamps);
|
||||
}
|
||||
|
||||
|
||||
int ru_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
|
||||
int ru_id = device->Mod_id;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = RC.ru[ru_id]->frame_parms;
|
||||
pthread_mutex_lock(&sim.subframe_mutex);
|
||||
LOG_D(SIM,"[TXPATH] ru_trx_write: RU %d mask %d\n",ru_id,sim.subframe_ru_mask);
|
||||
pthread_mutex_unlock(&sim.subframe_mutex);
|
||||
// compute amplitude of TX signal from first symbol in subframe
|
||||
// note: assumes that the packet is an entire subframe
|
||||
sim.ru_amp[ru_id] = 0;
|
||||
|
||||
for (int aa=0; aa<RC.ru[ru_id]->nb_tx; aa++) {
|
||||
sim.ru_amp[ru_id] += (double)signal_energy((int32_t *)buff[aa],frame_parms->ofdm_symbol_size)/(12*frame_parms->N_RB_DL);
|
||||
}
|
||||
|
||||
sim.ru_amp[ru_id] = sqrt(sim.ru_amp[ru_id]);
|
||||
LOG_D(PHY,"Setting amp for RU %d to %f (%d)\n",ru_id,sim.ru_amp[ru_id], dB_fixed((double)signal_energy((int32_t *)buff[0],frame_parms->ofdm_symbol_size)));
|
||||
// tell top-level we are done
|
||||
pthread_mutex_lock(&sim.subframe_mutex);
|
||||
sim.subframe_ru_mask|=(1<<ru_id);
|
||||
LOG_D(SIM,"Setting RU %d to busy\n",ru_id);
|
||||
pthread_mutex_unlock(&sim.subframe_mutex);
|
||||
return(nsamps);
|
||||
}
|
||||
|
||||
int UE_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
|
||||
return(nsamps);
|
||||
}
|
||||
|
||||
void init_ru_devices() {
|
||||
module_id_t ru_id;
|
||||
RU_t *ru;
|
||||
|
||||
// allocate memory for RU if not already done
|
||||
if (RC.ru==NULL) RC.ru = (RU_t **)malloc(RC.nb_RU*sizeof(RU_t *));
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
LOG_D(SIM,"Initiaizing rfdevice for RU %d\n",ru_id);
|
||||
|
||||
if (RC.ru[ru_id]==NULL) RC.ru[ru_id] = (RU_t *)malloc(sizeof(RU_t));
|
||||
|
||||
ru = RC.ru[ru_id];
|
||||
ru->rfdevice.Mod_id = ru_id;
|
||||
ru->rfdevice.CC_id = 0;
|
||||
ru->rfdevice.trx_start_func = ru_trx_start;
|
||||
ru->rfdevice.trx_read_func = ru_trx_read;
|
||||
ru->rfdevice.trx_write_func = ru_trx_write;
|
||||
ru->rfdevice.trx_end_func = ru_trx_end;
|
||||
ru->rfdevice.trx_stop_func = ru_trx_stop;
|
||||
ru->rfdevice.trx_set_freq_func = ru_trx_set_freq;
|
||||
ru->rfdevice.trx_set_gains_func = ru_trx_set_gains;
|
||||
sim.last_ru_rx_timestamp[ru_id][0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void init_ue_devices(PHY_VARS_UE *UE) {
|
||||
AssertFatal(UE!=NULL,"UE context is not allocated\n");
|
||||
printf("Initializing UE %d.%d\n",UE->Mod_id,UE->CC_id);
|
||||
UE->rfdevice.Mod_id = UE->Mod_id;
|
||||
UE->rfdevice.CC_id = UE->CC_id;
|
||||
UE->rfdevice.trx_start_func = UE_trx_start;
|
||||
UE->rfdevice.trx_read_func = UE_trx_read;
|
||||
UE->rfdevice.trx_write_func = UE_trx_write;
|
||||
UE->rfdevice.trx_end_func = UE_trx_end;
|
||||
UE->rfdevice.trx_stop_func = UE_trx_stop;
|
||||
UE->rfdevice.trx_set_freq_func = UE_trx_set_freq;
|
||||
UE->rfdevice.trx_set_gains_func = UE_trx_set_gains;
|
||||
sim.last_UE_rx_timestamp[UE->Mod_id][UE->CC_id] = 0;
|
||||
}
|
||||
|
||||
void init_ocm(void) {
|
||||
module_id_t UE_id, ru_id;
|
||||
int CC_id;
|
||||
double DS_TDL = .03;
|
||||
randominit(0);
|
||||
set_taus_seed(0);
|
||||
init_channelmod();
|
||||
double snr_dB = channelmod_get_snr_dB();
|
||||
double sinr_dB = channelmod_get_sinr_dB();
|
||||
init_channel_vars ();//fp, &s_re, &s_im, &r_re, &r_im, &r_re0, &r_im0);
|
||||
// initialize channel descriptors
|
||||
LOG_I(PHY,"Initializing channel descriptors (nb_RU %d, nb_UE %d)\n",RC.nb_RU,NB_UE_INST);
|
||||
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
LOG_I(PHY,"Initializing channel descriptors (RU %d, UE %d) for N_RB_DL %d\n",ru_id,UE_id,
|
||||
RC.ru[ru_id]->frame_parms->N_RB_DL);
|
||||
sim.RU2UE[ru_id][UE_id][CC_id] =
|
||||
new_channel_desc_scm(RC.ru[ru_id]->nb_tx,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_rx,
|
||||
AWGN,
|
||||
N_RB2sampling_rate(RC.ru[ru_id]->frame_parms->N_RB_DL),
|
||||
N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms->N_RB_DL),
|
||||
DS_TDL,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
random_channel(sim.RU2UE[ru_id][UE_id][CC_id],0);
|
||||
LOG_D(OCM,"[SIM] Initializing channel (%s) from UE %d to ru %d\n", "AWGN", UE_id, ru_id);
|
||||
|
||||
sim.UE2RU[UE_id][ru_id][CC_id] =
|
||||
new_channel_desc_scm(PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_tx,
|
||||
RC.ru[ru_id]->nb_rx,
|
||||
AWGN,
|
||||
N_RB2sampling_rate(RC.ru[ru_id]->frame_parms->N_RB_UL),
|
||||
N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms->N_RB_UL),
|
||||
DS_TDL,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
random_channel(sim.UE2RU[UE_id][ru_id][CC_id],0);
|
||||
// to make channel reciprocal uncomment following line instead of previous. However this only works for SISO at the moment. For MIMO the channel would need to be transposed.
|
||||
//UE2RU[UE_id][ru_id] = RU2UE[ru_id][UE_id];
|
||||
AssertFatal(sim.RU2UE[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
|
||||
AssertFatal(sim.UE2RU[UE_id][ru_id][CC_id]!=NULL,"UE2RU[%d][%d][%d] is null\n",UE_id,ru_id,CC_id);
|
||||
|
||||
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
|
||||
if (ru_id == (UE_id % RC.nb_RU)) {
|
||||
sim.RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower;
|
||||
sim.UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower;
|
||||
} else {
|
||||
sim.RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower;
|
||||
sim.UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower;
|
||||
}
|
||||
|
||||
LOG_I(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",ru_id,UE_id,CC_id,
|
||||
sim.RU2UE[ru_id][UE_id][CC_id]->path_loss_dB,
|
||||
RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower,
|
||||
snr_dB);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void update_ocm(double snr_dB,double sinr_dB) {
|
||||
module_id_t UE_id, ru_id;
|
||||
int CC_id;
|
||||
|
||||
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
|
||||
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
AssertFatal(sim.RU2UE[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
|
||||
AssertFatal(sim.UE2RU[UE_id][ru_id][CC_id]!=NULL,"UE2RU[%d][%d][%d] is null\n",UE_id,ru_id,CC_id);
|
||||
|
||||
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
|
||||
if (ru_id == (UE_id % RC.nb_RU)) {
|
||||
sim.RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower;
|
||||
sim.UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower;
|
||||
} else {
|
||||
sim.RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower;
|
||||
sim.UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower;
|
||||
}
|
||||
|
||||
LOG_D(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",ru_id,UE_id,CC_id,
|
||||
sim.RU2UE[ru_id][UE_id][CC_id]->path_loss_dB,
|
||||
RC.ru[ru_id]->frame_parms->pdsch_config_common.referenceSignalPower,
|
||||
snr_dB);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_channel_vars(void) {
|
||||
int i;
|
||||
memset(sim.RU_output_mask,0,sizeof(int)*NUMBER_OF_UE_MAX);
|
||||
|
||||
for (i=0; i<NB_UE_INST; i++)
|
||||
pthread_mutex_init(&sim.RU_output_mutex[i],NULL);
|
||||
|
||||
memset(sim.UE_output_mask,0,sizeof(int)*NUMBER_OF_RU_MAX);
|
||||
|
||||
for (i=0; i<RC.nb_RU; i++)
|
||||
pthread_mutex_init(&sim.UE_output_mutex[i],NULL);
|
||||
}
|
||||
|
||||
|
||||
void *rfsim_top(void *n_frames) {
|
||||
wait_sync("rfsim_top");
|
||||
printf("Running rfsim with %d frames\n",*(int *)n_frames);
|
||||
|
||||
for (int frame = 0; frame < *(int *)n_frames; frame++) {
|
||||
for (int sf = 0; sf < 10; sf++) {
|
||||
int CC_id=0;
|
||||
int all_done=0;
|
||||
|
||||
while (all_done==0) {
|
||||
pthread_mutex_lock(&sim.subframe_mutex);
|
||||
int subframe_ru_mask_local = (subframe_select(RC.ru[0]->frame_parms,(sf+4)%10)!=SF_UL) ? sim.subframe_ru_mask : ((1<<RC.nb_RU)-1);
|
||||
int subframe_UE_mask_local = (RC.ru[0]->frame_parms->frame_type == FDD || subframe_select(RC.ru[0]->frame_parms,(sf+4)%10)!=SF_DL) ? sim.subframe_UE_mask : ((1<<NB_UE_INST)-1);
|
||||
pthread_mutex_unlock(&sim.subframe_mutex);
|
||||
LOG_D(SIM,"Frame %d, Subframe %d, NB_RU %d, NB_UE %d: Checking masks %x,%x\n",frame,sf,RC.nb_RU,NB_UE_INST,subframe_ru_mask_local,subframe_UE_mask_local);
|
||||
|
||||
if ((subframe_ru_mask_local == ((1<<RC.nb_RU)-1)) &&
|
||||
(subframe_UE_mask_local == ((1<<NB_UE_INST)-1))) all_done=1;
|
||||
else usleep(1500);
|
||||
}
|
||||
|
||||
//clear subframe masks for next round
|
||||
pthread_mutex_lock(&sim.subframe_mutex);
|
||||
sim.subframe_ru_mask=0;
|
||||
sim.subframe_UE_mask=0;
|
||||
pthread_mutex_unlock(&sim.subframe_mutex);
|
||||
|
||||
// increment timestamps
|
||||
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
sim.current_ru_rx_timestamp[ru_id][CC_id] += RC.ru[ru_id]->frame_parms->samples_per_tti;
|
||||
LOG_D(SIM,"RU %d/%d: TS %"PRIi64"\n",ru_id,CC_id,sim.current_ru_rx_timestamp[ru_id][CC_id]);
|
||||
}
|
||||
|
||||
for (int UE_inst = 0; UE_inst<NB_UE_INST; UE_inst++) {
|
||||
sim.current_UE_rx_timestamp[UE_inst][CC_id] += PHY_vars_UE_g[UE_inst][CC_id]->frame_parms.samples_per_tti;
|
||||
LOG_D(SIM,"UE %d/%d: TS %"PRIi64"\n",UE_inst,CC_id,sim.current_UE_rx_timestamp[UE_inst][CC_id]);
|
||||
}
|
||||
|
||||
if (oai_exit == 1) return((void *)NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return((void *)NULL);
|
||||
}
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <sys/sysinfo.h>
|
||||
#include "rt_wrapper.h"
|
||||
#include <errno.h>
|
||||
#include <common/utils/msc/msc.h>
|
||||
|
||||
#include "openair1/PHY/defs_common.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user