Commit a026c87b authored by Florian Kaltenberger's avatar Florian Kaltenberger

updating EXMIMO2 firmware (corresponding to r5585 of openair0) and driver

updating emos-raw (seperate thread for logfile, GPS supported again)
small cosmetic changes in openair1


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5241 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 2d1f1ef3
......@@ -44,6 +44,8 @@ phy_measurements_struct = struct(...
'n_adj_cells_id', uint32(zeros(1,6)),...
'rsrq', int32(zeros(1,7)),...
'rsrp', int32(zeros(1,7)),...
'rsrp_filtered', single(zeros(1,7)),...
'rsrq_filtered', single(zeros(1,7)),...
'n0_power', uint32(zeros(1,NB_ANTENNAS_RX)),...
'n0_power_dB', uint16(zeros(1,NB_ANTENNAS_RX)),...
'n0_power_tot', uint32(0),...
......
......@@ -1582,7 +1582,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) {
break;
case format1E_2A_M10PRB:
msg("DCI format1E_2A_M10PRB, rnti %x (%8x): harq_pid %d, rah %d, rb_alloc %x, mcs %d, rv %d, tpmi %d, ndi %d, dl_power_offset %d\n",
LOG_D(PHY,"DCI format1E_2A_M10PRB, rnti %x (%8x): harq_pid %d, rah %d, rb_alloc %x, mcs %d, rv %d, tpmi %d, ndi %d, dl_power_offset %d\n",
dci->rnti,
((uint32_t *)&dci->dci_pdu)[0],
((DCI1E_5MHz_2A_M10PRB_TDD_t *)&dci->dci_pdu[0])->harq_pid,
......
......@@ -44,8 +44,9 @@
#include "SCHED/extern.h"
#include "defs.h"
#include "extern.h"
#ifdef EXMIMO
#include "gain_control.h"
#endif
//#define DEBUG_INITIAL_SYNCH
......@@ -270,9 +271,12 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) {
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",phy_vars_ue->Mod_id,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] );
#endif
#ifdef EXMIMO
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
phy_adjust_gain(phy_vars_ue,0);
//phy_adjust_gain(phy_vars_ue,0);
gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
#endif
// SSS detection
......
......@@ -95,9 +95,9 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
#else
#ifdef EXMIMO
#ifdef DRIVER2013
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (rf_mode %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, phy_vars_ue->rx_gain_mode[0],p_exmimo_config->rf.rx_gain[0][0]);
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, (p_exmimo_config->rf.rf_mode[0]& LNAGAINMASK) >> 14,p_exmimo_config->rf.rx_gain[0][0]);
#else
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (rf_mode %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, phy_vars_ue->rx_gain_mode[0],exmimo_pci_interface->rf.rx_gain00);
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, (p_exmimo_config->rf.rf_mode[0]& LNAGAINMASK) >> 14,exmimo_pci_interface->rf.rx_gain00);
#endif
#else
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",phy_vars_ue->rx_total_gain_dB);
......@@ -199,6 +199,11 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %d, RSSI %d, RSRQ[0] %d\n",phy_vars_ue->PHY_measurements.rsrp[0], phy_vars_ue->PHY_measurements.rssi, phy_vars_ue->PHY_measurements.rsrq[0]);
len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d (mode1_flag %d)\n",phy_vars_ue->transmission_mode[eNB],phy_vars_ue->lte_frame_parms.mode1_flag);
len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n",
phy_vars_ue->lte_ue_pbch_vars[eNB]->pdu_errors_conseq,
phy_vars_ue->lte_ue_pbch_vars[eNB]->pdu_errors,
phy_vars_ue->lte_ue_pbch_vars[eNB]->pdu_fer);
if (phy_vars_ue->transmission_mode[eNB] == 6)
len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,phy_vars_ue->PHY_measurements.precoded_cqi_dB[eNB][0]);
if (phy_vars_ue->dlsch_ue[0] && phy_vars_ue->dlsch_ue[0][0] && phy_vars_ue->dlsch_ue[0][1]) {
......
......@@ -7,13 +7,8 @@
* @{
*/
#ifndef NO_OPENAIR1
#include "PHY/defs.h"
#else
#include <stdint.h>
#define msg printf
#endif
#ifdef __SSE2__
#include <emmintrin.h>
......
......@@ -171,9 +171,9 @@
#ifdef EXMIMO
#define TARGET_RX_POWER 40 // Target digital power for the AGC
#define TARGET_RX_POWER_MAX 65 // Maximum digital power, such that signal does not saturate (value found by simulation)
#define TARGET_RX_POWER_MIN 30 // Minimum digital power, anything below will be discarded (value found by simulation)
#define TARGET_RX_POWER 55 // Target digital power for the AGC
#define TARGET_RX_POWER_MAX 55 // Maximum digital power, such that signal does not saturate (value found by simulation)
#define TARGET_RX_POWER_MIN 50 // Minimum digital power, anything below will be discarded (value found by simulation)
#else
#define TARGET_RX_POWER 50 // Target digital power for the AGC
#define TARGET_RX_POWER_MAX 65 // Maximum digital power, such that signal does not saturate (value found by simulation)
......
......@@ -541,7 +541,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) {
BCCH_alloc_pdu.type = 1;
BCCH_alloc_pdu.vrb_type = 0;
BCCH_alloc_pdu.rballoc = computeRIV(25,10,3);
BCCH_alloc_pdu.ndi = 1;
BCCH_alloc_pdu.ndi = phy_vars_eNB->frame&1;
BCCH_alloc_pdu.rv = 1;
BCCH_alloc_pdu.mcs = 1;
BCCH_alloc_pdu.harq_pid = 0;
......@@ -586,7 +586,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) {
DLSCH_alloc_pdu.harq_pid = 0;
DLSCH_alloc_pdu.mcs = openair_daq_vars.target_ue_dl_mcs;
//DLSCH_alloc_pdu.mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
DLSCH_alloc_pdu.ndi = 1;
DLSCH_alloc_pdu.ndi = phy_vars_eNB->frame&1;
DLSCH_alloc_pdu.rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
......@@ -620,7 +620,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) {
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
DLSCH_alloc_pdu1E.rv = 0;
DLSCH_alloc_pdu1E.ndi = 1;
DLSCH_alloc_pdu1E.ndi = phy_vars_eNB->frame&1;
//DLSCH_alloc_pdu1E.mcs = cqi_to_mcs[phy_vars_eNB->eNB_UE_stats->DL_cqi[0]];
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
DLSCH_alloc_pdu1E.mcs = openair_daq_vars.target_ue_dl_mcs;
......@@ -687,7 +687,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) {
UL_alloc_pdu.hopping = 0;
UL_alloc_pdu.rballoc = computeRIV(25,2,openair_daq_vars.ue_ul_nb_rb);
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.ndi = phy_vars_eNB->frame&1;
UL_alloc_pdu.TPC = 0;
UL_alloc_pdu.cshift = 0;
UL_alloc_pdu.dai = 0;
......@@ -707,7 +707,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) {
else
UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
UL_alloc_pdu.mcs = openair_daq_vars.target_ue_ul_mcs;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.ndi = phy_vars_eNB->frame&1;
UL_alloc_pdu.TPC = 0;
if ((cooperation_flag==0) || (cooperation_flag==1))
UL_alloc_pdu.cshift = 0;
......@@ -1377,11 +1377,13 @@ void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,ui
#else
DCI_pdu = &DCI_pdu_tmp;
#ifdef EMOS
/*
if (((phy_vars_eNB->frame%1024)%3 == 0) && (next_slot == 0)) {
//openair_daq_vars.target_ue_dl_mcs = (openair_daq_vars.target_ue_dl_mcs+1)%28;
openair_daq_vars.target_ue_dl_mcs = taus()%28;
LOG_D(PHY,"[MYEMOS] frame %d, increasing MCS to %d\n",phy_vars_eNB->frame,openair_daq_vars.target_ue_dl_mcs);
}
*/
/*
if (phy_vars_eNB->frame > 28000) {
LOG_E(PHY,"More that 28000 frames reached! Exiting!\n");
......
......@@ -54,6 +54,7 @@
#ifdef EXMIMO
#ifdef DRIVER2013
#include "openair0_lib.h"
#include "gain_control.h"
extern int card;
#else
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
......@@ -1480,11 +1481,13 @@ void lte_ue_measurement_procedures(uint8_t last_slot, uint16_t l, PHY_VARS_UE *p
if ((last_slot==1) && (l==(4-frame_parms->Ncp))) {
// AGC
#ifdef EXMIMO
if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
(mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
phy_adjust_gain (phy_vars_ue,0);
//phy_adjust_gain (phy_vars_ue,0);
gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id],0);
#endif
eNB_id = 0;
if (abstraction_flag == 0)
......@@ -2284,7 +2287,11 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
openair_daq_vars.use_ia_receiver = 0;
else
openair_daq_vars.use_ia_receiver = (openair_daq_vars.use_ia_receiver+1)%3;
LOG_I(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n",phy_vars_ue->frame,openair_daq_vars.use_ia_receiver, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,phy_vars_ue->bitrate[eNB_id]);
LOG_I(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n",
phy_vars_ue->frame,
openair_daq_vars.use_ia_receiver,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->mcs,
phy_vars_ue->bitrate[eNB_id]);
}
#endif
......@@ -2405,7 +2412,7 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,uint8_t last_slot, PHY_VARS_UE *phy_v
if (phy_vars_ue->dlsch_ue[eNB_id][0]->active == 1) {
#ifndef DLSCH_THREAD //USER_MODE
harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid;
// printf("PDSCH active in subframe %d, harq_pid %d\n",(last_slot>>1)-1,harq_pid);
//printf("PDSCH active in subframe %d, harq_pid %d\n",(last_slot>>1)-1,harq_pid);
if ((phy_vars_ue->transmission_mode[eNB_id] == 5) &&
(phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->dl_power_off==0) &&
(openair_daq_vars.use_ia_receiver ==1)) {
......
#define DEBUG_DAC 1
#include <math.h>
#include <stdio.h>
#include "PHY/TOOLS/defs.h"
void dac(double **s_re,
......
#ifndef __SIMULATION_TOOLS_DEFS_H__
#define __SIMULATION_TOOLS_DEFS_H__
#include "PHY/TOOLS/defs.h"
#include "PHY/defs.h"
/** @defgroup _numerical_ Useful Numerical Functions
*@{
......
......@@ -4,8 +4,8 @@
// Maximum number of concurrently supported cards
//
#define MAX_CARDS 20
#define INIT_ZEROS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#define MAX_CARDS 8
#define INIT_ZEROS {0, 0, 0, 0, 0, 0, 0, 0};
/** PCIe subsystem configuration Space
......
......@@ -49,6 +49,7 @@ static int __init openair_init_module( void )
unsigned int readback;
unsigned int card, j;
unsigned int vid,did;
unsigned int val;
unsigned short vendor, subid;
exmimo_id_t exmimo_id_tmp[MAX_CARDS];
......@@ -94,15 +95,16 @@ static int __init openair_init_module( void )
// Now look for more cards on the same bus
while (card<MAX_CARDS)
{
{
pdev[card] = pci_get_device(vid,did, pdev[card-1]);
if(pdev[card])
{
// This print does not work for 64 bit kernels
// printk("[openair][INIT_MODULE][INFO]: openair card %d found, bus 0x%x, primary 0x%x, secondary 0x%x\n",card,
// pdev[card]->bus->number,pdev[card]->bus->primary,pdev[card]->bus->secondary);
pci_read_config_word(pdev[card], PCI_SUBSYSTEM_ID, &subid);
{
// This print does not work for 64 bit kernels
// printk("[openair][INIT_MODULE][INFO]: openair card %d found, bus 0x%x, primary 0x%x, secondary 0x%x\n",card,
// pdev[card]->bus->number,pdev[card]->bus->primary,pdev[card]->bus->secondary);
pci_read_config_word(pdev[card], PCI_SUBSYSTEM_ID, &subid);
pci_read_config_word(pdev[card], PCI_SUBSYSTEM_VENDOR_ID, &vendor);
exmimo_id_tmp[card].board_vendor = vendor;
......@@ -194,7 +196,13 @@ static int __init openair_init_module( void )
udelay(1000);
readback = ioread32( bar[card] +PCIE_CONTROL0);
printk("CONTROL0 readback %x\n",readback);
// This is for displaying the card number in the leds of the exmimo card
val = ioread32(bar[card]+PCIE_CONTROL0);
iowrite32(val| ((card & 0x1F) << 9),bar[card]+PCIE_CONTROL0);
//val = ioread32(bar[card]+PCIE_CONTROL0);
//printk("[openair][INIT_MODULE][INFO]: writing leds for card %d control0 %x\n",card,val);
// allocating buffers
if ( exmimo_memory_alloc( card ) ) {
printk("[openair][MODULE][ERROR] exmimo_memory_alloc() failed!\n");
......
#include "openair0_lib.h"
#include "gain_control.h"
//#define DEBUG_PHY
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
void gain_control_all (unsigned int rx_power_fil_dB, unsigned int card) {
unsigned int ant;
......
#define TARGET_RX_POWER 55 // Target digital power for the AGC
#define TARGET_RX_POWER_MAX 55 // Maximum digital power for AGC
#define TARGET_RX_POWER_MIN 50 // Minimum digital power for AGC
#define TARGET_RX_POWER 50 // Target digital power for the AGC
#define TARGET_RX_POWER_MAX 53 // Maximum digital power for AGC
#define TARGET_RX_POWER_MIN 48 // Minimum digital power for AGC
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
void gain_control_all (unsigned int rx_power_fil_dB, unsigned int card);
void gain_control (unsigned int rx_power_fil_dB, unsigned int ant, unsigned int card);
......@@ -156,15 +156,10 @@ CFLAGS += -DNAS_NETLINK -DLINUX
OBJ += $(NAS_OBJS)
endif
LDFLAGS += -lpthread -lm -lforms -lconfig
LDFLAGS += -lpthread -lm -lforms -lconfig -lrt
ifeq ($(RTAI),1)
RTAI_CFLAGS += $(shell rtai-config --lxrt-cflags) -DRTAI
LDFLAGS += $(shell rtai-config --lxrt-ldflags)
ifdef ENABLE_ITTI
LDFLAGS += -lrt
endif
else
LDFLAGS += -lrt
endif
ifeq ($(USRP),1)
......
This diff is collapsed.
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