diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 22394aa5ebf4691bfe15c52cbe222578313d22aa..8c85d49462c5c2e89235fb428880083efe52f5a3 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -604,7 +604,6 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} ) set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") - ########################################################## include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON") diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index 42a39f90ed546940e230bd601b066ad46853bf74..c1685e11ecd5beab3aeed890c8fee63a634132c1 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -80,12 +80,12 @@ int set_device(openair0_device *device) { int set_transport(openair0_device *device) { switch (device->transp_type) { case ETHERNET_TP: - printf("[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); + LOG_I(HW,"[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); return 0; break; case NONE_TP: - printf("[%s] has not loaded a transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); + LOG_I(HW,"[%s] has not loaded a transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); return 0; break; diff --git a/targets/ARCH/rfsimulator/README.md b/targets/ARCH/rfsimulator/README.md index ae82b27f93cd52210ea992613caf7844fd1c8f1a..2af138c738be183a6ca3608e4efa0dec60d08698 100644 --- a/targets/ARCH/rfsimulator/README.md +++ b/targets/ARCH/rfsimulator/README.md @@ -35,7 +35,6 @@ It should the set to "server" in the eNB or gNB ## 4G case For the UE, it should be set to the IP address of the eNB example: - ```bash sudo RFSIMULATOR=192.168.2.200 ./lte-uesoftmodem -C 2685000000 -r 50 ``` @@ -45,10 +44,7 @@ If you reach 'RA not active' on UE, be careful to generate a valid SIM ```bash $OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o . ``` -This simulator can also be used with the `--noS1` option, in this case you must run the eNodeB and the UE on different PCs. - ## 5G case - After regular build, add the simulation driver (don't use ./build_oai -w SIMU until we merge 4G and 5G branches) ```bash diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index c8c21fce4f6cf72102fee639085e467b4c659191..3b23d6de066484a5e8d9f440f70fe1d1e9c1a545 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -3,6 +3,12 @@ copyleft: OpenAirInterface Software Alliance and it's licence */ +/* + * Open issues and limitations + * The read and write should be called in the same thread, that is not new USRP UHD design + * When the opposite side switch from passive reading to active R+Write, the synchro is not fully deterministic + */ + #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> @@ -129,6 +135,9 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si } out_ptr->r += round(rx_tmp.x*pathLossLinear + noise_per_sample*gaussdouble(0.0,1.0)); + printf("in: %d, out %d= %f*%f + %f*%f\n", + input_sig[((TS+i)*nbTx)%CirSize].r, out_ptr->r , rx_tmp.x, + pathLossLinear, noise_per_sample,gaussdouble(0.0,1.0)); out_ptr->i += round(rx_tmp.y*pathLossLinear + noise_per_sample*gaussdouble(0.0,1.0)); out_ptr++; } @@ -444,10 +453,10 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) { if ( b->headerMode==false ) { LOG_D(HW,"Set b->lastReceivedTS %ld\n", b->lastReceivedTS); b->lastReceivedTS=b->th.timestamp+b->th.size-byteToSample(b->remainToTransfer,b->th.nbAnt); - - // First block in UE, resync with the eNB current TS - if ( t->nextTimestamp == 0 ) - t->nextTimestamp=b->lastReceivedTS-b->th.size; + + // First block in UE, resync with the eNB current TS + if ( t->nextTimestamp == 0 ) + t->nextTimestamp=b->lastReceivedTS-b->th.size; if ( b->remainToTransfer==0) { LOG_D(HW,"Completed block reception: %ld\n", b->lastReceivedTS); @@ -500,11 +509,11 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo for ( int sock=0; sock<FD_SETSIZE; sock++) { if ( t->buf[sock].circularBuf && t->buf[sock].alreadyRead ) if ( t->buf[sock].lastReceivedTS == 0 || - (t->nextTimestamp+nsamps) > t->buf[sock].lastReceivedTS ) { - have_to_wait=true; - break; + (t->nextTimestamp+nsamps) > t->buf[sock].lastReceivedTS ) { + have_to_wait=true; + break; } - } + } if (have_to_wait) /*printf("Waiting on socket, current last ts: %ld, expected at least : %ld\n", @@ -519,7 +528,7 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo for (int a=0; a<nbAnt; a++) memset(samplesVoid[a],0,sampleToByte(nsamps,1)); - // Add all input signal in the output buffer + // Add all input nodes signal in the output buffer for (int sock=0; sock<FD_SETSIZE; sock++) { buffer_t *ptr=&t->buf[sock]; @@ -578,7 +587,6 @@ __attribute__((__visibility__("default"))) 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 - //set_log(HW,OAILOG_DEBUG); rfsimulator_state_t *rfsimulator = (rfsimulator_state_t *)calloc(sizeof(rfsimulator_state_t),1); if ((rfsimulator->ip=getenv("RFSIMULATOR")) == NULL ) { diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index d9b03ac5fdfbfd63bc0cb2cbb40dd9a69decbccd..2a711be1a00f05e0eae2b59bc29f3b6e9cecc308 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -811,7 +811,7 @@ int main( int argc, char **argv ) { //p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX; if (IS_SOFTMODEM_SIML1 ) { - init_ocm((double)snr_dB,0); + init_ocm(snr_dB,0); PHY_vars_UE_g[0][0]->no_timing_correction = 1; }