Commit aa5aa9f3 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/channel-simulation-in-rfsimulator' into fix-rfsim-sync-ue

parents 924e10f7 77bd2751
...@@ -604,7 +604,6 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE ...@@ -604,7 +604,6 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE
add_library(tcp_bridge_oai MODULE ${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") set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
########################################################## ##########################################################
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON") include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
......
...@@ -80,12 +80,12 @@ int set_device(openair0_device *device) { ...@@ -80,12 +80,12 @@ int set_device(openair0_device *device) {
int set_transport(openair0_device *device) { int set_transport(openair0_device *device) {
switch (device->transp_type) { switch (device->transp_type) {
case ETHERNET_TP: 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; return 0;
break; break;
case NONE_TP: 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; return 0;
break; break;
......
...@@ -35,7 +35,6 @@ It should the set to "server" in the eNB or gNB ...@@ -35,7 +35,6 @@ It should the set to "server" in the eNB or gNB
## 4G case ## 4G case
For the UE, it should be set to the IP address of the eNB For the UE, it should be set to the IP address of the eNB
example: example:
```bash ```bash
sudo RFSIMULATOR=192.168.2.200 ./lte-uesoftmodem -C 2685000000 -r 50 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 ...@@ -45,10 +44,7 @@ If you reach 'RA not active' on UE, be careful to generate a valid SIM
```bash ```bash
$OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o . $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 ## 5G case
After regular build, add the simulation driver After regular build, add the simulation driver
(don't use ./build_oai -w SIMU until we merge 4G and 5G branches) (don't use ./build_oai -w SIMU until we merge 4G and 5G branches)
```bash ```bash
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
copyleft: OpenAirInterface Software Alliance and it's licence 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 <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
...@@ -129,6 +135,9 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si ...@@ -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)); 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->i += round(rx_tmp.y*pathLossLinear + noise_per_sample*gaussdouble(0.0,1.0));
out_ptr++; out_ptr++;
} }
...@@ -444,10 +453,10 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) { ...@@ -444,10 +453,10 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) {
if ( b->headerMode==false ) { if ( b->headerMode==false ) {
LOG_D(HW,"Set b->lastReceivedTS %ld\n", b->lastReceivedTS); LOG_D(HW,"Set b->lastReceivedTS %ld\n", b->lastReceivedTS);
b->lastReceivedTS=b->th.timestamp+b->th.size-byteToSample(b->remainToTransfer,b->th.nbAnt); b->lastReceivedTS=b->th.timestamp+b->th.size-byteToSample(b->remainToTransfer,b->th.nbAnt);
// First block in UE, resync with the eNB current TS // First block in UE, resync with the eNB current TS
if ( t->nextTimestamp == 0 ) if ( t->nextTimestamp == 0 )
t->nextTimestamp=b->lastReceivedTS-b->th.size; t->nextTimestamp=b->lastReceivedTS-b->th.size;
if ( b->remainToTransfer==0) { if ( b->remainToTransfer==0) {
LOG_D(HW,"Completed block reception: %ld\n", b->lastReceivedTS); LOG_D(HW,"Completed block reception: %ld\n", b->lastReceivedTS);
...@@ -500,11 +509,11 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo ...@@ -500,11 +509,11 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
for ( int sock=0; sock<FD_SETSIZE; sock++) { for ( int sock=0; sock<FD_SETSIZE; sock++) {
if ( t->buf[sock].circularBuf && t->buf[sock].alreadyRead ) if ( t->buf[sock].circularBuf && t->buf[sock].alreadyRead )
if ( t->buf[sock].lastReceivedTS == 0 || if ( t->buf[sock].lastReceivedTS == 0 ||
(t->nextTimestamp+nsamps) > t->buf[sock].lastReceivedTS ) { (t->nextTimestamp+nsamps) > t->buf[sock].lastReceivedTS ) {
have_to_wait=true; have_to_wait=true;
break; break;
} }
} }
if (have_to_wait) if (have_to_wait)
/*printf("Waiting on socket, current last ts: %ld, expected at least : %ld\n", /*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 ...@@ -519,7 +528,7 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
for (int a=0; a<nbAnt; a++) for (int a=0; a<nbAnt; a++)
memset(samplesVoid[a],0,sampleToByte(nsamps,1)); 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++) { for (int sock=0; sock<FD_SETSIZE; sock++) {
buffer_t *ptr=&t->buf[sock]; buffer_t *ptr=&t->buf[sock];
...@@ -578,7 +587,6 @@ __attribute__((__visibility__("default"))) ...@@ -578,7 +587,6 @@ __attribute__((__visibility__("default")))
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
// to change the log level, use this on command line // to change the log level, use this on command line
// --log_config.hw_log_level debug // --log_config.hw_log_level debug
//set_log(HW,OAILOG_DEBUG);
rfsimulator_state_t *rfsimulator = (rfsimulator_state_t *)calloc(sizeof(rfsimulator_state_t),1); rfsimulator_state_t *rfsimulator = (rfsimulator_state_t *)calloc(sizeof(rfsimulator_state_t),1);
if ((rfsimulator->ip=getenv("RFSIMULATOR")) == NULL ) { if ((rfsimulator->ip=getenv("RFSIMULATOR")) == NULL ) {
......
...@@ -811,7 +811,7 @@ int main( int argc, char **argv ) { ...@@ -811,7 +811,7 @@ int main( int argc, char **argv ) {
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX; //p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
if (IS_SOFTMODEM_SIML1 ) { 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; PHY_vars_UE_g[0][0]->no_timing_correction = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment