diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c index 39a845c0f6..b0e1a326ee 100644 --- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c @@ -114,17 +114,16 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t //VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id ); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 ); clock_gettime( CLOCK_MONOTONIC, &start_comp); - /* ru->ifdevice.trx_write_func2(&ru->ifdevice, + ru->ifdevice.trx_write_func2(&ru->ifdevice, (proc_timestamp + packet_id*spp_eth), (void*)txp[aid], spp_eth, aid, - 0); */ + 0); clock_gettime( CLOCK_MONOTONIC, &end_comp); LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp)); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 ); - for (i=0; i < fp->nb_antennas_tx; i++) - txp[i] += spp_eth; + txp[aid] += spp_eth; } } diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index f49005b5d7..2b9d195771 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -96,6 +96,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) int prach_ifft_cnt=0; #endif + nb_rx = ru->nb_rx; if(eNB) { fp = &(eNB->frame_parms); nb_rx = fp->nb_antennas_rx; @@ -197,7 +198,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, AssertFatal(ru!=NULL,"ru is null\n"); for (aa=0; aaif_south == LOCAL_RF) { // set the time-domain signal if we have to use it in this node + if (ru->if_south == LOCAL_RF || ru->function == NGFI_RAU_IF5) { // set the time-domain signal if we have to use it in this node // DJP - indexing below in subframe zero takes us off the beginning of the array??? prach[aa] = (int16_t *)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset]; diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c index 6564c0637d..b8063e269d 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c @@ -276,13 +276,47 @@ int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, voi - /* buff[i] points to the position in tx buffer where the payload to be sent is + + int nsamps2; // aligned to upper 32 or 16 byte boundary + +#if defined(__x86_64) || defined(__i386__) +#ifdef __AVX2__ + nsamps2 = (nsamps+7)>>3; + __m256i buff_tx[nsamps2+1]; + __m256i *buff_tx2=buff_tx+1; +#else + nsamps2 = (nsamps+3)>>2; + __m128i buff_tx[nsamps2+2]; + __m128i *buff_tx2=buff_tx+2; +#endif +#elif defined(__arm__) + nsamps2 = (nsamps+3)>>2; + int16x8_t buff_tx[nsamps2+2]; + int16x8_t *buff_tx2=buff_tx+2; +#else +#error Unsupported CPU architecture, USRP device cannot be built +#endif + + + // bring RX data into 12 LSBs for softmodem RX + for (int j=0; j 16381\n"); - *(uint16_t *)(buff2 + 2) = (nsamps<<2); + *(uint8_t *)(buff2 + 2) = (nsamps<<2)>>8; + *(uint8_t *)(buff2 + 3) = (nsamps<<2)&0xff; // ECPRI PC_ID (2 bytes) *(uint16_t *)(buff2 + 4) = cc; // OAI modified SEQ_ID (4 bytes) *(uint64_t *)(buff2 + 6) = ((uint64_t )timestamp)*3; + /* + printf("ECPRI TX (REV %x, MessType %d, Payload size %d, PC_ID %d, TS %llu\n", + *(uint8_t *)buff2, + *(uint8_t *)(buff2+1), + *(uint16_t *)(buff2+2), + *(uint16_t *)(buff2+4), + *(uint64_t *)(buff2+6)); + */ int sent_byte; if (eth->compression == ALAW_COMPRESS) { @@ -361,7 +404,8 @@ int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, voi int block_cnt=0; int again_cnt=0; char temp0[APP_HEADER_SIZE_BYTES]; - + static int packet_cnt=0; + eth->rx_nsamps=256; /* buff[i] points to the position in rx buffer where the payload to be received will be placed @@ -394,7 +438,16 @@ int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, voi rcvfrom_flag, (struct sockaddr *)ð->dest_addrd, (socklen_t *)ð->addr_len); - + /* + if (packet_cnt%1000000<10) { + printf("[AW2S] Received ECPRI packet %d (REV %x, MessType %d, Payload size %d, PC_ID %d, TS %llu\n", + packet_cnt,*(uint8_t *)buff2, + *(uint8_t *)(buff2+1), + (*(uint8_t *)(buff2+2)<<8)+*(uint8_t *)(buff2+3), + *(uint16_t *)(buff2+4), + *(uint64_t *)(buff2+6)); + }*/ + packet_cnt++; if (bytes_received ==-1) { eth->num_rx_errors++; if (errno == EAGAIN) { diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h index 10b3f63eaa..57c995135e 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h @@ -52,7 +52,7 @@ #define ECPRICOMMON_BYTES 4 #define ECPRIPCID_BYTES 2 #define APP_HEADER_SIZE_BYTES (ECPRICOMMON_BYTES + ECPRIPCID_BYTES + sizeof(openair0_timestamp)) -#define ECPRIREV 16 // ECPRI Version 1, C=0 - single ECPRI message per OAI TX packet +#define ECPRIREV 1 // ECPRI Version 1, C=0 - single ECPRI message per OAI TX packet /*!\brief opaque ethernet data structure */ typedef struct {