Commit 43258a0e authored by magounak's avatar magounak

experimental changes

parent e1a07c2f
......@@ -118,6 +118,58 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size;
}
} else if (packet_type == IF4p5_PULCALIB) {
LOG_D(PHY,"send UL_IF4p5: RU %d frame %d, subframe %d\n",ru->idx,frame,subframe);
if (subframe_select(fp,subframe)==SF_S) {
nsym=fp->ul_symbols_in_S_subframe;
db_fulllength = 12*fp->N_RB_UL;
db_halflength = (db_fulllength)>>1;
//slotoffsetF = 1;//(subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
//blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1;
slotoffsetF += (fp->ofdm_symbol_size*(fp->symbols_per_tti-nsym));
blockoffsetF += (fp->ofdm_symbol_size*(fp->symbols_per_tti-nsym));
}
if (eth->flags == ETH_RAW_IF4p5_MODE) {
packet_header = (IF4p5_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
data_block = (uint16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t);
} else {
packet_header = (IF4p5_header_t *)(tx_buffer);
data_block = (uint16_t*)(tx_buffer + sizeof_IF4p5_header_t);
}
gen_IF4p5_ul_header(packet_header, packet_type, frame, subframe);
AssertFatal(txdataF[0]!=NULL,"txdataF_BF[0] is null\n");
for (symbol_id=0; symbol_id<nsym; symbol_id++) {
for (int antenna_id=0; antenna_id<ru->nb_tx; antenna_id++) {
for (element_id=0; element_id<db_halflength; element_id++) {
i = (uint16_t*) &txdataF[antenna_id][blockoffsetF+element_id];
data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8);
i = (uint16_t*) &txdataF[antenna_id][slotoffsetF+element_id];
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8);
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
packet_header->frame_status &= ~(0x7);
packet_header->frame_status |= (ru->nb_rx-1);
packet_header->frame_status &= ~(0x000f<<26);
packet_header->frame_status |= (symbol_id&0x000f)<<26;
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0+ru->idx, 1 );
if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
symbol_id,
&tx_buffer,
db_fulllength*ru->nb_rx,
1,
IF4p5_PULCALIB)) < 0) {
perror("ETHERNET write for IF4p5_PULCALIB\n");
}
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0+ru->idx, 0 );
slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size;
}
} else if ((packet_type == IF4p5_PULFFT)||
(packet_type == IF4p5_PULTICK)){
db_fulllength = 12*fp->N_RB_UL;
......
......@@ -44,6 +44,7 @@
#define IF4p5_PRACH_BR_CE2 0x0024
#define IF4p5_PRACH_BR_CE3 0x0025
#define IF4p5_PULTICK 0x0026
#define IF4p5_PULCALIB 0x0027
struct IF4p5_header {
/// Type
......
......@@ -314,9 +314,13 @@ typedef enum {
} rru_cmd_t;
typedef struct RU_t_s{
/// tag of this ru
uint32_t tag;
/// number of slave RRUs
uint32_t p;
/// index of this ru
uint32_t idx;
/// Pointer to configuration file
/// Pointer to configuration file
char *rf_config_file;
/// southbound interface
RU_if_south_t if_south;
......@@ -529,6 +533,10 @@ typedef struct RRU_capabilities_s {
typedef struct RRU_config_s {
/// tag of an RU
uint32_t tag;
/// number of slave RRUs
uint32_t p;
/// Fronthaul format
RU_if_south_t FH_fmt;
/// number of EUTRA bands (<=4) configured in RRU
......
......@@ -97,10 +97,7 @@ void feptx0(RU_t *ru,int slot) {
*/
if (ru->generate_dmrs_sync == 1 && slot == 0 && subframe == 1 && aa==0) {
//int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
//int32_t *dmrsp[2] ={dmrs,NULL}; //{&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
generate_drs_pusch((PHY_VARS_UE *)NULL,
generate_drs_pusch((PHY_VARS_UE *)NULL,
(UE_rxtx_proc_t*)NULL,
fp,
ru->common.txdataF_BF,
......@@ -110,6 +107,19 @@ void feptx0(RU_t *ru,int slot) {
0,
fp->N_RB_DL,
aa);
}
if (ru->is_slave==1 && ru->generate_dmrs_sync == 1 && slot == 1 && subframe == 1 && aa==0) {
generate_drs_pusch((PHY_VARS_UE *)NULL,
(UE_rxtx_proc_t*)NULL,
fp,
ru->common.txdataF_BF,
0,
AMP,
0,
0,
fp->N_RB_DL,
aa);
}
normal_prefix_mod(&ru->common.txdataF_BF[aa][slot*slot_sizeF],
(int*)&ru->common.txdata[aa][slot_offset],
......@@ -703,6 +713,17 @@ void ru_fep_full_2thread(RU_t *ru) {
printf("delay in fep wait on condition in frame_rx: %d subframe_rx: %d \n",proc->frame_rx,proc->subframe_rx);
}
if (proc->subframe_rx==1 && ru->is_slave==0) {
ulsch_extract_rbs_single(ru->common.rxdataF,
calibration->rxdataF_ext,
0,
fp->N_RB_DL,
3%(fp->symbols_per_tti/2),// l = symbol within slot
10/(fp->symbols_per_tti/2),// Ns = slot number
fp);
}
if (proc->subframe_rx==1 && ru->is_slave==1/* && ru->state == RU_CHECK_SYNC*/) {
//LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
......
......@@ -228,6 +228,8 @@ int trx_eth_write_raw_IF4p5(openair0_device *device, openair0_timestamp timestam
packet_size = RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks);
} else if (flags == IF4p5_PULTICK) {
packet_size = RAW_IF4p5_PULTICK_SIZE_BYTES;
} else if (flags == IF4p5_PULCALIB) {
packet_size = RAW_IF4p5_PULCALIB_SIZE_BYTES(nblocks);
} else if (flags == IF5_MOBIPASS) {
packet_size = RAW_IF5_MOBIPASS_SIZE_BYTES;
} else {
......
......@@ -235,7 +235,9 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
} else if (flags == IF4p5_PULFFT) {
packet_size = UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks);
} else if (flags == IF4p5_PULTICK) {
packet_size = UDP_IF4p5_PULTICK_SIZE_BYTES;
packet_size = UDP_IF4p5_PULTICK_SIZE_BYTES;
} else if (flags == IF4p5_PULCALIB) {
packet_size = UDP_IF4p5_PULCALIB_SIZE_BYTES(nblocks);
} else if ((flags >= IF4p5_PRACH)&&
(flags <= (IF4p5_PRACH+4))) {
packet_size = UDP_IF4p5_PRACH_SIZE_BYTES;
......
......@@ -75,10 +75,12 @@
#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_PULCALIB_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks) (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define UDP_IF4p5_PULTICK_SIZE_BYTES (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t)
#define UDP_IF4p5_PRACH_SIZE_BYTES (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES)
#define UDP_IF4p5_PULCALIB_SIZE_BYTES(nblocks) (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
// Mobipass packet sizes
#define RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES 1280
......
......@@ -473,7 +473,7 @@ void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *subframe) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_IF4P5_NORTH_ASYNCH_IN,subframe_tx);
}
if (ru->is_slave==1 && ru->state==RU_RUN && frame_tx%ru->p==ru->tag-1) ru->generate_dmrs_sync = 1;
if (ru->feptx_ofdm) ru->feptx_ofdm(ru);
if (ru->fh_south_out) ru->fh_south_out(ru);
......@@ -504,7 +504,8 @@ void fh_if4p5_north_out(RU_t *ru) {
LOG_D(PHY,"fh_if4p5_north_out: Sending IF4p5_PULFFT SFN.SF %d.%d\n",proc->frame_rx,proc->subframe_rx);
if ((fp->frame_type == TDD) && (subframe_select(fp,subframe)!=SF_UL)) {
/// **** in TDD during DL send_IF4 of ULTICK to RCC **** ///
send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK);
//send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULTICK);
send_IF4p5(ru, proc->frame_rx, proc->subframe_rx, IF4p5_PULCALIB);
ru->north_out_cnt++;
return;
}
......@@ -719,7 +720,7 @@ void tx_rf(RU_t *ru) {
int siglen=fp->samples_per_tti,flags=1;
if (SF_type == SF_S) {
int txsymb = fp->dl_symbols_in_S_subframe+(ru->is_slave==0 ? 1 : 0);
int txsymb = fp->dl_symbols_in_S_subframe+(ru->is_slave==0 ? 1 : -1);
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
siglen = fp->nb_prefix_samples0 + (txsymb*fp->ofdm_symbol_size) + (txsymb-1)*fp->nb_prefix_samples;
//siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0);
......@@ -798,6 +799,17 @@ void tx_rf(RU_t *ru) {
siglen+sf_extension,
ru->nb_tx,
flags);
LOG_I(PHY,"RU_id %d,RU_tag %d,timestamp %d,offset %d,extension %d,olo %d\n",ru->idx,ru->tag,proc->timestamp_tx,ru->ts_offset,sf_extension,
proc->timestamp_tx+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension);
if (ru->is_slave==1 && ru->state==RU_RUN && proc->frame_tx%ru->p==ru->tag-1) {
txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
proc->timestamp_tx+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
txp,
siglen+sf_extension,
ru->nb_tx,
flags);
}
ru->south_out_cnt++;
LOG_D(PHY,"south_out_cnt %d, frame %d, subframe %d\n",ru->south_out_cnt,proc->frame_tx,proc->subframe_tx);
int se = dB_fixed(signal_energy(txp[0],siglen+sf_extension));
......
......@@ -131,7 +131,9 @@ int send_config(RU_t *ru, RRU_CONFIG_msg_t rru_config_msg){
rru_config_msg.type = RRU_config;
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
LOG_I(PHY,"Sending Configuration to RRU %d (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d\n",ru->idx,
LOG_I(PHY,"Sending Configuration to RRU %d (RRU p %d,RRU tag %d,num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d\n",ru->idx,
((RRU_config_t *)&rru_config_msg.msg[0])->p,
((RRU_config_t *)&rru_config_msg.msg[0])->tag,
((RRU_config_t *)&rru_config_msg.msg[0])->num_bands,
((RRU_config_t *)&rru_config_msg.msg[0])->band_list[0],
((RRU_config_t *)&rru_config_msg.msg[0])->tx_freq[0],
......@@ -239,7 +241,9 @@ int attach_rru(RU_t *ru) {
rru_config_msg.type = RRU_config;
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t)-MAX_RRU_CONFIG_SIZE+sizeof(RRU_config_t);
LOG_I(PHY,"Sending Configuration to RRU %d (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",ru->idx,
LOG_I(PHY,"Sending Configuration to RRU %d (RRU p %d,RRU tag %d,num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",ru->idx,
((RRU_config_t *)&rru_config_msg.msg[0])->p,
((RRU_config_t *)&rru_config_msg.msg[0])->tag,
((RRU_config_t *)&rru_config_msg.msg[0])->num_bands,
((RRU_config_t *)&rru_config_msg.msg[0])->band_list[0],
((RRU_config_t *)&rru_config_msg.msg[0])->tx_freq[0],
......@@ -430,12 +434,14 @@ void configure_ru(int idx,
config->N_RB_DL[0] = ru->frame_parms.N_RB_DL;
config->N_RB_UL[0] = ru->frame_parms.N_RB_UL;
config->threequarter_fs[0] = ru->frame_parms.threequarter_fs;
config->tag = idx;
config->p = RC.nb_RU-1;
if (ru->if_south==REMOTE_IF4p5) {
config->prach_FreqOffset[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset;
config->prach_ConfigIndex[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
LOG_I(PHY,"REMOTE_IF4p5: prach_FrequOffset %d, prach_ConfigIndex %d\n",
config->prach_FreqOffset[0],config->prach_ConfigIndex[0]);
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
int i;
for (i=0;i<4;i++) {
......@@ -456,6 +462,8 @@ void configure_rru(int idx,
RRU_config_t *config = (RRU_config_t *)arg;
RU_t *ru = RC.ru[idx];
ru->tag = config->tag;
ru->p = config->p;
ru->frame_parms.eutra_band = config->band_list[0];
ru->frame_parms.dl_CarrierFreq = config->tx_freq[0];
ru->frame_parms.ul_CarrierFreq = config->rx_freq[0];
......@@ -574,7 +582,9 @@ void* ru_thread_control( void* param ) {
case RRU_config: // RRU
if (ru->if_south == LOCAL_RF){
LOG_I(PHY,"Configuration received from RAU (num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",
LOG_I(PHY,"Configuration received from RAU (RRU p %d,RRU tag %d,num_bands %d,band0 %d,txfreq %u,rxfreq %u,att_tx %d,att_rx %d,N_RB_DL %d,N_RB_UL %d,3/4FS %d, prach_FO %d, prach_CI %d)\n",
((RRU_config_t *)&rru_config_msg.msg[0])->p,
((RRU_config_t *)&rru_config_msg.msg[0])->tag,
((RRU_config_t *)&rru_config_msg.msg[0])->num_bands,
((RRU_config_t *)&rru_config_msg.msg[0])->band_list[0],
((RRU_config_t *)&rru_config_msg.msg[0])->tx_freq[0],
......
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