Commit 848f7846 authored by Raymond Knopp's avatar Raymond Knopp

addition of IF4p5 ULTICK packet for TDD fronthaul

parent de8ab34d
...@@ -100,7 +100,8 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -100,7 +100,8 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
slotoffsetF += fp->ofdm_symbol_size; slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size; blockoffsetF += fp->ofdm_symbol_size;
} }
} else if (packet_type == IF4p5_PULFFT) { } else if ((packet_type == IF4p5_PULFFT)||
(packet_type == IF4p5_PULTICK)){
db_fulllength = 12*fp->N_RB_UL; db_fulllength = 12*fp->N_RB_UL;
db_halflength = (db_fulllength)>>1; db_halflength = (db_fulllength)>>1;
slotoffsetF = 1; slotoffsetF = 1;
...@@ -113,8 +114,9 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -113,8 +114,9 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
packet_header = (IF4p5_header_t *)(tx_buffer); packet_header = (IF4p5_header_t *)(tx_buffer);
data_block = (uint16_t*)(tx_buffer + sizeof_IF4p5_header_t); data_block = (uint16_t*)(tx_buffer + sizeof_IF4p5_header_t);
} }
gen_IF4p5_ul_header(packet_header, frame, subframe); gen_IF4p5_ul_header(packet_header, packet_type, frame, subframe);
if (packet_type == IF4p5_PULFFT) {
for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) { for (symbol_id=0; symbol_id<fp->symbols_per_tti; symbol_id++) {
LOG_D(PHY,"IF4p5_PULFFT: frame %d, subframe %d, symbol %d\n",frame,subframe,symbol_id); LOG_D(PHY,"IF4p5_PULFFT: frame %d, subframe %d, symbol %d\n",frame,subframe,symbol_id);
for (element_id=0; element_id<db_halflength; element_id++) { for (element_id=0; element_id<db_halflength; element_id++) {
...@@ -140,6 +142,17 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -140,6 +142,17 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
slotoffsetF += fp->ofdm_symbol_size; slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size; blockoffsetF += fp->ofdm_symbol_size;
} }
}
else {
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
0,
&tx_buffer,
0,
1,
IF4p5_PULTICK)) < 0) {
perror("ETHERNET write for IF4p5_PULFFT\n");
}
}
} else if (packet_type == IF4p5_PRACH) { } else if (packet_type == IF4p5_PRACH) {
// FIX: hard coded prach samples length // FIX: hard coded prach samples length
LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d\n",frame,subframe); LOG_D(PHY,"IF4p5_PRACH: frame %d, subframe %d\n",frame,subframe);
...@@ -303,10 +316,10 @@ void gen_IF4p5_dl_header(IF4p5_header_t *dl_packet, int frame, int subframe) { ...@@ -303,10 +316,10 @@ void gen_IF4p5_dl_header(IF4p5_header_t *dl_packet, int frame, int subframe) {
} }
void gen_IF4p5_ul_header(IF4p5_header_t *ul_packet, int frame, int subframe) { void gen_IF4p5_ul_header(IF4p5_header_t *ul_packet, uint16_t packet_subtype, int frame, int subframe) {
ul_packet->type = IF4p5_PACKET_TYPE; ul_packet->type = IF4p5_PACKET_TYPE;
ul_packet->sub_type = IF4p5_PULFFT; ul_packet->sub_type = packet_subtype;
ul_packet->rsvd = 0; ul_packet->rsvd = 0;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#define IF4p5_PULFFT 0x0019 #define IF4p5_PULFFT 0x0019
#define IF4p5_PDLFFT 0x0020 #define IF4p5_PDLFFT 0x0020
#define IF4p5_PRACH 0x0021 #define IF4p5_PRACH 0x0021
#define IF4p5_PULTICK 0x0022
struct IF4p5_header { struct IF4p5_header {
/// Type /// Type
...@@ -55,7 +56,7 @@ typedef struct IF4p5_header IF4p5_header_t; ...@@ -55,7 +56,7 @@ typedef struct IF4p5_header IF4p5_header_t;
void gen_IF4p5_dl_header(IF4p5_header_t*, int, int); void gen_IF4p5_dl_header(IF4p5_header_t*, int, int);
void gen_IF4p5_ul_header(IF4p5_header_t*, int, int); void gen_IF4p5_ul_header(IF4p5_header_t*, uint16_t, int, int);
void gen_IF4p5_prach_header(IF4p5_header_t*, int, int); void gen_IF4p5_prach_header(IF4p5_header_t*, int, int);
......
...@@ -198,6 +198,8 @@ int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestam ...@@ -198,6 +198,8 @@ int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestam
packet_size = RAW_IF4p5_PDLFFT_SIZE_BYTES(nblocks); packet_size = RAW_IF4p5_PDLFFT_SIZE_BYTES(nblocks);
} else if (flags == IF4p5_PULFFT) { } else if (flags == IF4p5_PULFFT) {
packet_size = RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks); packet_size = RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks);
} else if (flags == IF4p5_PULTICK) {
packet_size = RAW_IF4p5_PULTICK_SIZE_BYTES;
} else if (flags == IF5_MOBIPASS) { } else if (flags == IF5_MOBIPASS) {
packet_size = RAW_IF5_MOBIPASS_SIZE_BYTES; packet_size = RAW_IF5_MOBIPASS_SIZE_BYTES;
} else { } else {
......
...@@ -206,6 +206,8 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam ...@@ -206,6 +206,8 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
packet_size = UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks); packet_size = UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks);
} else if (flags == IF4p5_PULFFT) { } else if (flags == IF4p5_PULFFT) {
packet_size = UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks); packet_size = UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks);
} else if (flags == IF4p5_PULTICK) {
packet_size = UDP_IF4p5_PULTICK_SIZE_BYTES;
} else if (flags == IF4p5_PRACH) { } else if (flags == IF4p5_PRACH) {
packet_size = UDP_IF4p5_PRACH_SIZE_BYTES; packet_size = UDP_IF4p5_PRACH_SIZE_BYTES;
} else { } else {
......
...@@ -61,9 +61,11 @@ ...@@ -61,9 +61,11 @@
#define RAW_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) #define RAW_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) #define RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4p5_PULTICK_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t)
#define RAW_IF4p5_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES) #define RAW_IF4p5_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES)
#define UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) #define UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks) (sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) #define UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks) (sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define UDP_IF4p5_PULTICK_SIZE_BYTES (sizeof_IF4p5_header_t)
#define UDP_IF4p5_PRACH_SIZE_BYTES (sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES) #define UDP_IF4p5_PRACH_SIZE_BYTES (sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES)
// Mobipass packet sizes // Mobipass packet sizes
......
...@@ -182,6 +182,16 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -182,6 +182,16 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
else else
s->tx_md.has_time_spec = false; s->tx_md.has_time_spec = false;
if (device->openair0_cfg[0].tx_freq[0] == device->openair0_cfg[0].rx_freq[0]) {
// for TDD each write should be considered as a burst to trigger the switch on GPIO
s->tx_md.start_of_burst = true;
s->tx_md.end_of_burst = true;
}
else {
s->tx_md.start_of_burst = false;
s->tx_md.end_of_burst = false;
}
if (cc>1) { if (cc>1) {
std::vector<void *> buff_ptrs; std::vector<void *> buff_ptrs;
for (int i=0;i<cc;i++) buff_ptrs.push_back(buff[i]); for (int i=0;i<cc;i++) buff_ptrs.push_back(buff[i]);
...@@ -190,7 +200,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -190,7 +200,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
else else
ret = (int)s->tx_stream->send(buff[0], nsamps, s->tx_md,1e-3); ret = (int)s->tx_stream->send(buff[0], nsamps, s->tx_md,1e-3);
s->tx_md.start_of_burst = false;
if (ret != nsamps) { if (ret != nsamps) {
printf("[xmit] tx samples %d != %d\n",ret,nsamps); printf("[xmit] tx samples %d != %d\n",ret,nsamps);
......
...@@ -875,9 +875,12 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -875,9 +875,12 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
// Transmit TX buffer based on timestamp from RX // Transmit TX buffer based on timestamp from RX
// printf("trx_write -> USRP TS %llu (sf %d)\n", (proc->timestamp_rx+(3*fp->samples_per_tti)),(proc->subframe_rx+2)%10); // printf("trx_write -> USRP TS %llu (sf %d)\n", (proc->timestamp_rx+(3*fp->samples_per_tti)),(proc->subframe_rx+2)%10);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_rx+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance)&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_rx+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance)&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
// prepare tx buffer pointers // prepare tx buffer pointers
if ((subframe_select(fp,proc->subframe_rx+tx_sfoffset) == SF_DL) ||
(subframe_select(fp,proc->subframe_rx+tx_sfoffset) == SF_S)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
for (i=0; i<fp->nb_antennas_tx; i++) for (i=0; i<fp->nb_antennas_tx; i++)
txp[i] = (void*)&eNB->common_vars.txdata[0][i][((proc->subframe_rx+tx_sfoffset)%10)*fp->samples_per_tti]; txp[i] = (void*)&eNB->common_vars.txdata[0][i][((proc->subframe_rx+tx_sfoffset)%10)*fp->samples_per_tti];
...@@ -897,6 +900,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -897,6 +900,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
exit_fun( "problem transmitting samples" ); exit_fun( "problem transmitting samples" );
} }
} }
}
for (i=0; i<fp->nb_antennas_rx; i++) for (i=0; i<fp->nb_antennas_rx; i++)
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][*subframe*fp->samples_per_tti]; rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][*subframe*fp->samples_per_tti];
......
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