Commit ec4fce43 authored by Raymond Knopp's avatar Raymond Knopp

testing with aw2s jaguar

parent 6777c46b
...@@ -316,6 +316,8 @@ void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) ...@@ -316,6 +316,8 @@ void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
/* Input Fronthaul from south RCC/RAU */ /* Input Fronthaul from south RCC/RAU */
// Synchronous if5 from south // Synchronous if5 from south
uint64_t ts_rx[20];
void fh_if5_south_in(RU_t *ru, void fh_if5_south_in(RU_t *ru,
int *frame, int *frame,
int *tti) int *tti)
...@@ -323,9 +325,12 @@ void fh_if5_south_in(RU_t *ru, ...@@ -323,9 +325,12 @@ void fh_if5_south_in(RU_t *ru,
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL); recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL);
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023; if (proc->first_rx == 1) ru->ts_offset = proc->timestamp_rx;
uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe; proc->frame_rx = ((proc->timestamp_rx-ru->ts_offset) / (fp->samples_per_subframe*10))&1023;
proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame); proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx-ru->ts_offset,fp);
//(idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
ts_rx[*tti] = proc->timestamp_rx;
LOG_D(PHY,"IF5 %d.%d => RX %d.%d first_rx %d\n",*frame,*tti,proc->frame_rx,proc->tti_rx,proc->first_rx);
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->tti_rx != *tti) { if (proc->tti_rx != *tti) {
...@@ -334,7 +339,7 @@ void fh_if5_south_in(RU_t *ru, ...@@ -334,7 +339,7 @@ void fh_if5_south_in(RU_t *ru,
} }
if (proc->frame_rx != *frame) { if (proc->frame_rx != *frame) {
LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame); LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d proc->tti_rx %d tti %d)\n",proc->frame_rx,*frame,proc->tti_rx,*tti);
exit_fun("Exiting"); exit_fun("Exiting");
} }
} else { } else {
...@@ -1270,22 +1275,25 @@ void *ru_thread( void *param ) { ...@@ -1270,22 +1275,25 @@ void *ru_thread( void *param ) {
exit(-1); exit(-1);
} }
} else { } else {
nr_init_frame_parms(&ru->config, fp);
nr_dump_frame_parms(fp);
fill_rf_config(ru,ru->rf_config_file);
nr_phy_init_RU(ru);
// Start IF device if any // Start IF device if any
if (ru->nr_start_if) { if (ru->nr_start_if) {
LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx); LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx);
AssertFatal(ru->nr_start_if(ru,NULL) == 0, "Could not start the IF device\n"); AssertFatal(ru->nr_start_if(ru,NULL) == 0, "Could not start the IF device\n");
if (ru->has_ctrl_prt > 0) {
if (ru->if_south == LOCAL_RF) ret = connect_rau(ru); if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
else ret = attach_rru(ru); else ret = attach_rru(ru);
AssertFatal(ret==0,"Cannot connect to remote radio\n"); AssertFatal(ret==0,"Cannot connect to remote radio\n");
} }
if (ru->if_south == LOCAL_RF) { // configure RF parameters only }
nr_init_frame_parms(&ru->config, fp); else if (ru->if_south == LOCAL_RF) { // configure RF parameters only
nr_dump_frame_parms(fp);
fill_rf_config(ru,ru->rf_config_file);
nr_phy_init_RU(ru);
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
AssertFatal(ret==0,"Cannot connect to local radio\n"); AssertFatal(ret==0,"Cannot connect to local radio\n");
} }
...@@ -1453,6 +1461,11 @@ void *ru_thread( void *param ) { ...@@ -1453,6 +1461,11 @@ void *ru_thread( void *param ) {
return &ru_thread_status; return &ru_thread_status;
} }
int start_streaming(RU_t *ru) {
LOG_I(PHY,"Starting streaming on third-party RRU\n");
return(ru->ifdevice.thirdparty_startstreaming(&ru->ifdevice));
}
int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) { int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) {
return(ru->ifdevice.trx_start_func(&ru->ifdevice)); return(ru->ifdevice.trx_start_func(&ru->ifdevice));
} }
...@@ -1801,7 +1814,7 @@ void set_function_spec_param(RU_t *ru) { ...@@ -1801,7 +1814,7 @@ void set_function_spec_param(RU_t *ru) {
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
ru->fh_south_asynch_in = NULL; // no asynchronous UL ru->fh_south_asynch_in = NULL; // no asynchronous UL
ru->start_rf = NULL; // no local RF ru->start_rf = ru->eth_params.transp_preference == ETH_UDP_IF5_ECPRI_MODE ? start_streaming : NULL;
ru->stop_rf = NULL; ru->stop_rf = NULL;
ru->start_write_thread = NULL; ru->start_write_thread = NULL;
ru->nr_start_if = nr_start_if; // need to start if interface for IF5 ru->nr_start_if = nr_start_if; // need to start if interface for IF5
...@@ -2077,6 +2090,12 @@ void RCconfig_RU(void) ...@@ -2077,6 +2090,12 @@ void RCconfig_RU(void)
RC.ru[j]->if_south = REMOTE_IF5; RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; RC.ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF5_ECPRI_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
RC.ru[j]->if_south = REMOTE_IF5;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
RC.ru[j]->if_south = REMOTE_IF5; RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; RC.ru[j]->function = NGFI_RAU_IF5;
......
...@@ -87,7 +87,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL) ...@@ -87,7 +87,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
if (fp->nr_band == 5 || fp->nr_band == 66) if (fp->nr_band == 5 || fp->nr_band == 66)
fp->ssb_type = nr_ssb_type_B; fp->ssb_type = nr_ssb_type_B;
else{ else{
if (fp->nr_band == 41 || ( fp->nr_band > 76 && fp->nr_band < 80) ) if (fp->nr_band == 41 || fp->nr_band == 38 || ( fp->nr_band > 76 && fp->nr_band < 80) )
fp->ssb_type = nr_ssb_type_C; fp->ssb_type = nr_ssb_type_C;
else else
AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu); AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu);
......
...@@ -32,14 +32,12 @@ ...@@ -32,14 +32,12 @@
#include <time.h> #include <time.h>
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/defs_gNB.h"
#include "PHY/TOOLS/alaw_lut.h" #include "PHY/TOOLS/alaw_lut.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h" //#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include <intertask_interface.h> #include <intertask_interface.h>
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
//#define DEBUG_DL_MOBIPASS
//#define DEBUG_UL_MOBIPASS
#define SUBFRAME_SKIP_NUM_MOBIPASS 8
const uint8_t lin2alaw_if5[65536] = {213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 214, 214, 214, 214, const uint8_t lin2alaw_if5[65536] = {213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 214, 214, 214, 214,
214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
...@@ -1050,18 +1048,12 @@ static inline int64_t clock_difftime_ns(struct timespec start, struct timespec e ...@@ -1050,18 +1048,12 @@ static inline int64_t clock_difftime_ns(struct timespec start, struct timespec e
return temp_ns; return temp_ns;
} }
void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t *seqno, uint16_t packet_type) { void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seqno, uint16_t packet_type) {
LTE_DL_FRAME_PARMS *fp=ru->frame_parms; LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx]; int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
int32_t *tx_buffer=NULL; int32_t *tx_buffer=NULL;
#ifdef DEBUG_DL_MOBIPASS uint16_t packet_id=0, i=0;
int8_t dummy_buffer[fp->samples_per_tti*2];
#endif
void *alaw_buffer = ru->ifbuffer.tx[subframe&1];
uint16_t *data_block = NULL;
uint16_t *j = NULL;
uint16_t packet_id=0, i=0, element_id=0;
uint32_t spp_eth = (uint32_t) ru->ifdevice.openair0_cfg->samples_per_packet; uint32_t spp_eth = (uint32_t) ru->ifdevice.openair0_cfg->samples_per_packet;
uint32_t spsf = (uint32_t) ru->ifdevice.openair0_cfg->samples_per_frame/10; uint32_t spsf = (uint32_t) ru->ifdevice.openair0_cfg->samples_per_frame/10;
...@@ -1072,6 +1064,12 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t ...@@ -1072,6 +1064,12 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
if (eth->compression == ALAW_COMPRESS) { if (eth->compression == ALAW_COMPRESS) {
AssertFatal(1==0,"IF5 compression needs reworking\n"); AssertFatal(1==0,"IF5 compression needs reworking\n");
/* /*
void *alaw_buffer = ru->ifbuffer.tx[subframe&1];
int element_id=0;
uint16_t *data_block = NULL;
uint16_t *j = NULL;
if (eth->flags == ETH_RAW_MODE) { if (eth->flags == ETH_RAW_MODE) {
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES); data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES);
} else { } else {
...@@ -1105,10 +1103,22 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t ...@@ -1105,10 +1103,22 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
*/ */
} else if (eth->compression == NO_COMPRESS) { } else if (eth->compression == NO_COMPRESS) {
NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms;
int offset,siglen;
if (nrfp) {
offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0);
siglen = nrfp->get_samples_per_slot(tti,nrfp);
}
else {
offset = tti*fp->samples_per_subframe;
siglen = spsf;
}
for (i=0; i < ru->nb_tx; i++) for (i=0; i < ru->nb_tx; i++)
txp[i] = (int32_t*)&ru->common.txdata[i][subframe*fp->samples_per_tti]; txp[i] = (int32_t*)&ru->common.txdata[i][offset];
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) { for (packet_id=0; packet_id < siglen / spp_eth; packet_id++) {
for (int aid=0; aid<ru->nb_tx;aid++) { for (int aid=0; aid<ru->nb_tx;aid++) {
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id ); //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 ); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 );
...@@ -1119,9 +1129,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t ...@@ -1119,9 +1129,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
spp_eth, spp_eth,
aid, aid,
0); 0);
LOG_D(HW,"SF %d : packet %d, TS %llu\n",subframe,packet_id,(unsigned long long)(proc_timestamp+packet_id*spp_eth)); LOG_D(HW,"TTI %d : packet %d, TS %llu\n",tti,packet_id,(unsigned long long)(proc_timestamp-ru->ts_offset+packet_id*spp_eth));
clock_gettime( CLOCK_MONOTONIC, &end_comp); clock_gettime( CLOCK_MONOTONIC, &end_comp);
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp)); LOG_D(HW,"[TTI %d] IF_Write_Time: %"PRId64"\n",tti,clock_difftime_ns(start_comp, end_comp));
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 ); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
txp[aid] += spp_eth; txp[aid] += spp_eth;
...@@ -1130,7 +1140,8 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t ...@@ -1130,7 +1140,8 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
} }
} else if (packet_type == IF5_RRH_GW_UL) { } else if (packet_type == IF5_RRH_GW_UL) {
if (eth->compression == ALAW_COMPRESS) { if (eth->compression == ALAW_COMPRESS) {
if (eth->flags == ETH_RAW_MODE) { AssertFatal(1==0,"ALAW IF5 requires work\n");
/* if (eth->flags == ETH_RAW_MODE) {
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES); data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES);
} else { } else {
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES); data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES);
...@@ -1160,9 +1171,10 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t ...@@ -1160,9 +1171,10 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, 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 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
} }
*/
} else if (eth->compression == NO_COMPRESS) { } else if (eth->compression == NO_COMPRESS) {
for (i=0; i < fp->nb_antennas_rx; i++) for (i=0; i < fp->nb_antennas_rx; i++)
rxp[i] = (void*)&ru->common.rxdata[i][subframe*fp->samples_per_tti]; rxp[i] = (void*)&ru->common.rxdata[i][tti*fp->samples_per_tti];
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) { for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
...@@ -1175,153 +1187,28 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t ...@@ -1175,153 +1187,28 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
fp->nb_antennas_rx, fp->nb_antennas_rx,
0); 0);
clock_gettime( CLOCK_MONOTONIC, &end_comp); clock_gettime( CLOCK_MONOTONIC, &end_comp);
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp)); LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",tti,clock_difftime_ns(start_comp, end_comp));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
for (i=0; i < fp->nb_antennas_rx; i++) for (i=0; i < fp->nb_antennas_rx; i++)
rxp[i] += spp_eth; rxp[i] += spp_eth;
} }
} }
} else if (packet_type == IF5_MOBIPASS) {
/* the only difference between mobipass standalone and the other one
* is the timestamp in trx_write_func, but let's duplicate anyway
* (plus we don't call malloc for the standalone case)
*/
if (ru->if_timing == synch_to_mobipass_standalone) {
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
__m128i *data_block=NULL, *data_block_head=NULL;
__m128i *txp128;
__m128i t0, t1;
unsigned char _tx_buffer[MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)];
tx_buffer=(int32_t *)_tx_buffer;
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
header->flags = 0;
header->fifo_status = 0;
header->seqno = *seqno;
header->ack = 0;
header->word0 = 0;
txp[0] = (void*)&ru->common.txdata[0][subframe*ru->frame_parms->samples_per_tti];
txp128 = (__m128i *) txp[0];
for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) {
header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
data_block = data_block_head;
for (i=0; i<db_fulllength>>2; i+=2) {
t0 = _mm_srai_epi16(*txp128++, 4);
t1 = _mm_srai_epi16(*txp128++, 4);
_mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
}
// Write the packet to the fronthaul
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
proc_timestamp + packet_id*db_fulllength,
(void**)&tx_buffer,
db_fulllength,
1,
IF5_MOBIPASS)) < 0) {
perror("ETHERNET write for IF5_MOBIPASS\n");
}
header->seqno += 1;
}
*seqno = header->seqno;
tx_buffer = NULL;
} else {
uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
__m128i *data_block=NULL, *data_block_head=NULL;
__m128i *txp128;
__m128i t0, t1;
// tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
header->flags = 0;
header->fifo_status = 0;
header->seqno = *seqno;
header->ack = 0;
header->word0 = 0;
txp[0] = (void*)&ru->common.txdata[0][subframe*ru->frame_parms->samples_per_tti];
txp128 = (__m128i *) txp[0];
for (packet_id=0; packet_id<fp->samples_per_tti/db_fulllength; packet_id++) {
header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
data_block = data_block_head;
for (i=0; i<db_fulllength>>2; i+=2) {
t0 = _mm_srai_epi16(*txp128++, 4);
t1 = _mm_srai_epi16(*txp128++, 4);
// *data_block++ = _mm_packs_epi16(t0, t1);
_mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
}
// Write the packet to the fronthaul
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
packet_id,
(void**)&tx_buffer,
db_fulllength,
1,
IF5_MOBIPASS)) < 0) {
perror("ETHERNET write for IF5_MOBIPASS\n");
}
#ifdef DEBUG_DL_MOBIPASS
if ((subframe==0)&&(dummy_cnt == 100)) {
memcpy((void*)&dummy_buffer[packet_id*db_fulllength*2],(void*)data_block_head,db_fulllength*2);
}
#endif
header->seqno += 1;
}
*seqno = header->seqno;
#ifdef DEBUG_DL_MOBIPASS
uint8_t txe;
txe = dB_fixed(signal_energy(txp[0],fp->samples_per_tti));
if (txe > 0){
LOG_D(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, txe);
}
#endif
}
} else { } else {
AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type); AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type);
} }
free(tx_buffer); free(tx_buffer);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 );
#ifdef DEBUG_DL_MOBIPASS
if(subframe==0) {
if (dummy_cnt==100) {
LOG_M("txsigmb.m","txs",(void*)dummy_buffer, fp->samples_per_tti,1, 5);
exit(-1);
} else {
dummy_cnt++;
}
}
#endif
return; return;
} }
void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t packet_type) {
void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16_t packet_type) {
LTE_DL_FRAME_PARMS *fp=ru->frame_parms; LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
int32_t *txp[ru->nb_tx], *rxp[ru->nb_rx]; int32_t *txp[ru->nb_tx], *rxp[ru->nb_rx];
uint16_t packet_id=0, i=0; uint16_t packet_id=0, i=0;
#ifdef DEBUG_UL_MOBIPASS
//int8_t dummy_buffer_rx[fp->samples_per_tti*2];
uint8_t rxe;
#endif
int32_t spp_eth = (int32_t) ru->ifdevice.openair0_cfg->samples_per_packet; int32_t spp_eth = (int32_t) ru->ifdevice.openair0_cfg->samples_per_packet;
...@@ -1375,6 +1262,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16 ...@@ -1375,6 +1262,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
} }
*/ */
} else if (eth->compression == NO_COMPRESS) { } else if (eth->compression == NO_COMPRESS) {
int subframe = tti;
for (i=0; i < fp->nb_antennas_tx; i++) for (i=0; i < fp->nb_antennas_tx; i++)
txp[i] = (void*)&ru->common.txdata[i][subframe*fp->samples_per_tti]; txp[i] = (void*)&ru->common.txdata[i][subframe*fp->samples_per_tti];
...@@ -1434,13 +1322,24 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16 ...@@ -1434,13 +1322,24 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
*/ */
} else if (eth->compression == NO_COMPRESS) { } else if (eth->compression == NO_COMPRESS) {
int16_t temp_rx[spp_eth*2] __attribute__((aligned(32))); int16_t temp_rx[spp_eth*2] __attribute__((aligned(32)));
NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms;
int offset,siglen;
if (nrfp) {
offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0);
siglen = nrfp->get_samples_per_slot(tti,nrfp);
}
else {
offset = tti*fp->samples_per_subframe;
siglen = spsf;
}
for (i=0; i < ru->nb_rx; i++) for (i=0; i < ru->nb_rx; i++)
rxp[i] = &ru->common.rxdata[i][subframe*fp->samples_per_tti]; rxp[i] = &ru->common.rxdata[i][offset];
int aid; int aid;
int firstTS=1; int firstTS=1;
openair0_timestamp oldTS=0; openair0_timestamp oldTS=0;
for (packet_id=0; packet_id < ru->nb_rx*spsf / spp_eth; packet_id++) { for (packet_id=0; packet_id < ru->nb_rx*siglen / spp_eth; packet_id++) {
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id ); //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_READ_IF0, 1 ); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 1 );
clock_gettime( CLOCK_MONOTONIC, &if_time); clock_gettime( CLOCK_MONOTONIC, &if_time);
...@@ -1453,7 +1352,8 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16 ...@@ -1453,7 +1352,8 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
clock_gettime( CLOCK_MONOTONIC, &if_time); clock_gettime( CLOCK_MONOTONIC, &if_time);
timeout[packet_id] = if_time.tv_nsec; timeout[packet_id] = if_time.tv_nsec;
timestamp[packet_id] /= (30720/spsf); timestamp[packet_id] /= (30720/spsf);
LOG_D(PHY,"subframe %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",subframe,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0])); LOG_D(PHY,"TTI %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0]));
if (aid==0) { if (aid==0) {
if (firstTS==1) firstTS=0; if (firstTS==1) firstTS=0;
else if (oldTS + 256 != timestamp[packet_id]) { else if (oldTS + 256 != timestamp[packet_id]) {
...@@ -1474,7 +1374,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16 ...@@ -1474,7 +1374,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
(void*)temp_rx, (void*)temp_rx,
spp_eth<<2); spp_eth<<2);
clock_gettime( CLOCK_MONOTONIC, &end_decomp); clock_gettime( CLOCK_MONOTONIC, &end_decomp);
LOG_D(HW,"[SF %d] IF_Read_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_decomp, end_decomp)); LOG_D(HW,"[TTI %d] IF_Read_Time: %"PRId64"\n",tti,clock_difftime_ns(start_decomp, end_decomp));
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 0 ); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 0 );
} }
......
...@@ -318,7 +318,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts ...@@ -318,7 +318,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
scs_scaling = scs_scaling>>2; scs_scaling = scs_scaling>>2;
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA); uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
uint16_t sco = absolute_diff%(12*scs_scaling); uint16_t sco = absolute_diff%(12*scs_scaling);
AssertFatal(sco==0,"absoluteFrequencySSB has a subcarrier offset of %d while it should be alligned with CRBs\n",sco); AssertFatal(sco==(scs_scaling * ssb_SubcarrierOffset),"absoluteFrequencySSB has a subcarrier offset of %d while it should be %d\n",sco/scs_scaling,ssb_SubcarrierOffset);
cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total
cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG; cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG;
cfg->num_tlv++; cfg->num_tlv++;
......
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