Commit dd6e1f9d authored by Sandeep Kumar's avatar Sandeep Kumar

fixes for if4_tools for compilation

parent b70b2ac4
......@@ -138,7 +138,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
endif()
if (CPUINFO MATCHES "sse4_1")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mavx2")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
endif()
if (CPUINFO MATCHES "ssse3")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
......@@ -959,6 +959,7 @@ add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c
${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
......
......@@ -42,21 +42,22 @@
#include "if4_tools.h"
#include <stdint.h>
#else
#include <stdint.h>
#include "PHY/defs.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/TOOLS/ALAW/alaw_lut.h"
#endif
// Get device information
void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc) {
int frame = proc->frame_tx;
int subframe = proc->subframe_tx;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
int32_t **txdataF = eNB->common_vars.txdataF[0];
uint16_t symbol_id, element_id;
uint16_t db_fulllength = 12*fp->N_RB_DL;
uint16_t db_halflength = db_fulllength>>1;
int slotoffsetF = (subframe_tx)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
int slotoffsetF = (proc->subframe_tx)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
int blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength;
int16_t *data_block = (int16_t*)malloc(db_fulllength*sizeof(int16_t));
......@@ -72,15 +73,15 @@ void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc) {
// Do compression of the two parts and generate data blocks
for (element_id=0; element_id<db_halflength; element_id++) {
data_block[element_id] = lin2alaw[ (txdataF[0][blockoffsetF+element_id])&0xffff + 32768 ];
data_block[element_id] |= lin2alaw[ (txdataF[0][blockoffsetF+element_id])>>16 + 32768 ]<<8;
data_block[element_id] = lin2alaw[ (txdataF[0][blockoffsetF+element_id] & 0xffff) + 32768 ];
data_block[element_id] |= lin2alaw[ (txdataF[0][blockoffsetF+element_id]>>16) + 32768 ]<<8;
data_block[element_id+db_halflength] = lin2alaw[ (txdataF[0][slotoffsetF+element_id])&0xffff + 32768 ];
data_block[element_id+db_halflength] |= lin2alaw[ (txdataF[0][slotoffsetF+element_id])>>16 + 32768 ]<<8;
data_block[element_id+db_halflength] = lin2alaw[ (txdataF[0][slotoffsetF+element_id] & 0xffff) + 32768 ];
data_block[element_id+db_halflength] |= lin2alaw[ (txdataF[0][slotoffsetF+element_id]>>16) + 32768 ]<<8;
}
// Update information in generated packet
dl_packet->frame_status.sym_num = i;
dl_packet->frame_status.sym_num = symbol_id;
// Write the packet(s) to the fronthaul
//if ((bytes_sent = dev->eth_dev.trx_write_func (&dev->eth_dev,
......@@ -105,15 +106,15 @@ void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc) {
// Do compression of the two parts and generate data blocks
for (element_id=0; element_id<db_halflength; element_id++) {
data_block[element_id] = lin2alaw[ (txdataF[0][blockoffsetF+element_id])&0xffff + 32768 ];
data_block[element_id] |= lin2alaw[ (txdataF[0][blockoffsetF+element_id])>>16 + 32768 ]<<8;
data_block[element_id] = lin2alaw[ (txdataF[0][blockoffsetF+element_id] & 0xffff) + 32768 ];
data_block[element_id] |= lin2alaw[ (txdataF[0][blockoffsetF+element_id]>>16) + 32768 ]<<8;
data_block[element_id+db_halflength] = lin2alaw[ (txdataF[0][slotoffsetF+element_id])&0xffff + 32768 ];
data_block[element_id+db_halflength] |= lin2alaw[ (txdataF[0][slotoffsetF+element_id])>>16 + 32768 ]<<8;
data_block[element_id+db_halflength] = lin2alaw[ (txdataF[0][slotoffsetF+element_id] & 0xffff) + 32768 ];
data_block[element_id+db_halflength] |= lin2alaw[ (txdataF[0][slotoffsetF+element_id]>>16) + 32768 ]<<8;
}
// Update information in generated packet
ul_packet->frame_status.sym_num = i;
ul_packet->frame_status.sym_num = symbol_id;
// Write the packet(s) to the fronthaul
......@@ -129,23 +130,23 @@ void recv_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t *packet_type, u
// Caller: RRU - DL *** handle RCC case - UL and PRACH ***
if (eNB->node_function == NGFI_RRU_IF4) {
for(i=0; i<fp->symbols_per_tti; i++) {
// for(i=0; i<fp->symbols_per_tti; i++) {
// Read packet(s) from the fronthaul
if (dev->eth_dev.trx_read_func (&dev->eth_dev,
timestamp_rx,
rx_eNB,
spp_eth,
dev->eth_dev.openair0_cfg->rx_num_channels
) < 0) {
perror("RRU : ETHERNET read");
}
// if (dev->eth_dev.trx_read_func (&dev->eth_dev,
// timestamp_rx,
// rx_eNB,
// spp_eth,
// dev->eth_dev.openair0_cfg->rx_num_channels
// ) < 0) {
// perror("RRU : ETHERNET read");
// }
// Apply reverse processing - decompression
// txAlawtolinear( Datablock )
// Generate and return the OFDM symbols (txdataF)
txDataF
}
//txDataF
//}
}else {
}
......
......@@ -38,6 +38,8 @@
* \warning
*/
#include <stdint.h>
/// Macro for IF4 packet type
#define IF4_PACKET_TYPE 0x080A
#define IF4_PULFFT 0x0019
......@@ -105,7 +107,7 @@ struct IF4_dl_packet {
/// Frame Status
IF4_frame_status_t frame_status;
/// Data Blocks
uint16_t *data_block;
int16_t *data_block;
/// Frame Check Sequence
uint32_t fcs;
};
......@@ -143,7 +145,7 @@ struct IF4_ul_packet {
/// Gain 7
IF4_gain_t gain7;
/// Data Blocks
uint16_t *data_block;
int16_t *data_block;
/// Frame Check Sequence
uint32_t fcs;
};
......@@ -165,7 +167,7 @@ struct IF4_prach_packet {
/// LTE Prach Configuration
IF4_lte_prach_conf_t prach_conf;
/// Prach Data Block (one antenna)
uint16_t *data_block;
int16_t *data_block;
/// Frame Check Sequence
uint32_t fcs;
};
......
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