Merge remote-tracking branch 'origin/channel-simulation-in-rfsimulator' into fix-rfsim-sync-ue
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user