Commit 1fb76157 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/develop_integration_w34' into develop

Summary of changes:

- USRP driver improvements (GPSDO handling, GPIO for TDD)
- multi-UEs scenario improvements, mostly the MAC scheduler
- mobipass standalone driver
- bug fixes for VCD tracing code
- some cleanup in the installation scripts
- some work on the T tracer

To use the GPSDO with the USRP device (notably B210), use the
command line argument: --gpsdo-clock
parents 17b9a9e9 6f812f70
......@@ -532,6 +532,19 @@ set(TPLIB_ETHERNET_SOURCE
)
add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )
include_directories("${OPENAIR_TARGETS}/ARCH/mobipass/")
set(TPLIB_MOBIPASS_SOURCE
${OPENAIR_TARGETS}/ARCH/mobipass/interface.c
${OPENAIR_TARGETS}/ARCH/mobipass/mobipass.c
${OPENAIR_TARGETS}/ARCH/mobipass/queues.c
)
add_library(oai_mobipass MODULE ${TPLIB_MOBIPASS_SOURCE} )
# Hide all functions/variables in the mobipass library.
# Use __attribute__((__visibility__("default")))
# in the source code to unhide a function/variable.
get_target_property(mobipas_cflags oai_mobipass COMPILE_FLAGS)
set_target_properties(oai_mobipass PROPERTIES COMPILE_FLAGS "${mobipass_cflags} -fvisibility=hidden")
##########################################################
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -24;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -29;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -29;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -29;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -29;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -29;
......
......@@ -47,7 +47,7 @@ eNBs =
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nRB_CQI = 0;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -29;
......
......@@ -555,11 +555,7 @@ check_install_oai_software() {
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
#Remove old gnutls/nettle installation that was done from sources
remove_nettle_from_source
$SUDO apt-get install -y nettle-dev nettle-bin
remove_gnutls_from_source
$SUDO apt-get install -y libgnutls-dev
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
......@@ -647,56 +643,6 @@ check_install_oai_software() {
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
}
### Remove Nettle installation which was done from sources (only done for Ubuntu Distro)
remove_nettle_from_source() {
nettle_uninstall_log=$OPENAIR_DIR/cmake_targets/log/nettle_uninstall_log.txt
echo_info "\nUn-Installing Nettle from sources. The log file for nettle un-installation is here: $nettle_uninstall_log "
(
$SUDO apt-get remove -y nettle-dev nettle-bin
cd /tmp
echo "Downloading nettle archive"
$SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz
if [ $? -ne 0 ]; then
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
fi
if [ ! -f nettle-2.5.tar.gz ]; then
echo_error "Could not download nettle source files"
cd -
return
fi
tar -xzf nettle-2.5.tar.gz
cd nettle-2.5/
./configure --disable-openssl --enable-shared --prefix=/usr
$SUDO make uninstall || true
$SUDO ldconfig
) >& $nettle_uninstall_log
}
### Remove Gnutls from source (Only done for Ubuntu Distro)
remove_gnutls_from_source(){
gnutls_uninstall_log=$OPENAIR_DIR/cmake_targets/log/gnutls_uninstall_log.txt
echo_info "\nUn-Installing Gnutls. The log file for Gnutls un-installation is here: $gnutls_uninstall_log "
(
$SUDO apt-get remove -y libgnutls-dev
cd /tmp
echo "Downloading gnutls archive"
$SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz || \
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
if [ ! -f gnutls-3.1.23.tar.xz ]; then
echo_error "Could not download gnutls source files"
cd -
return
fi
tar -xJf gnutls-3.1.23.tar.xz
cd gnutls-3.1.23/
./configure --prefix=/usr
$SUDO make uninstall || true
$SUDO ldconfig
)>& $gnutls_uninstall_log
}
install_asn1c_from_source(){
asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
......
......@@ -29,10 +29,10 @@ typedef struct {
#define T_SHM_FILENAME "/T_shm_segment"
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_FUNCTIONS 142
#define VCD_NUM_FUNCTIONS 172
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES 107
#define VCD_NUM_VARIABLES 118
/* first VCD function (to be kept up to date! see in T_messages.txt) */
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
......
......@@ -45,6 +45,10 @@ ID = ENB_PHY_INPUT_SIGNAL
DESC = eNodeB received signal in the time domain for a duration of 1ms
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,rxdata
ID = ENB_PHY_OUTPUT_SIGNAL
DESC = eNodeB sent signal in the time domain for a duration of 1ms
GROUP = ALL:PHY:HEAVY:ENB
FORMAT = int,eNB_ID : int,CC_id : int,frame : int,subframe : int,antenna : buffer,txdata
ID = ENB_PHY_UL_CHANNEL_ESTIMATE
DESC = eNodeB channel estimation in the time domain
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
......@@ -111,6 +115,10 @@ ID = ENB_MAC_UE_DL_PDU_WITH_DATA
DESC = MAC downlink PDU for an UE
GROUP = ALL:MAC:ENB
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data
ID = ENB_MAC_SCHEDULING_REQUEST
DESC = MAC scheduling request detected for an UE
GROUP = ALL:MAC:ENB
FORMAT = int,eNB_ID : int,CC_id : int,frame : int,subframe : int,rnti
#RLC logs
ID = ENB_RLC_DL
......@@ -1350,6 +1358,22 @@ ID = VCD_VARIABLE_UE0_SFN7
DESC = VCD variable UE0_SFN7
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_SEND_IF4_SYMBOL
DESC = VCD variable SEND_IF4_SYMBOL
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_RECV_IF4_SYMBOL
DESC = VCD variable RECV_IF4_SYMBOL
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_SEND_IF5_PKT_ID
DESC = VCD variable SEND_IF5_PKT_ID
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_RECV_IF5_PKT_ID
DESC = VCD variable RECV_IF5_PKT_ID
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
ID = VCD_VARIABLE_UE_PDCP_FLUSH_SIZE
DESC = VCD variable UE_PDCP_FLUSH_SIZE
GROUP = ALL:VCD:ENB:UE:VCD_VARIABLE
......@@ -2061,3 +2085,11 @@ ID = VCD_FUNCTION_RECV_IF5
DESC = VCD function RECV_IF5
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_TRX_COMPR_IF
DESC = VCD function TRX_COMPR_IF
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
ID = VCD_FUNCTION_TRX_DECOMPR_IF
DESC = VCD function TRX_DECOMPR_IF
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
......@@ -5,7 +5,8 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I.
LIBS=-lX11 -lm -lpng -lXft
all: record replay extract_config textlog enb ue vcd macpdu2wireshark
all: record replay extract_config textlog enb ue vcd macpdu2wireshark \
extract_input_subframe
record: utils.o record.o database.o config.o
$(CC) $(CFLAGS) -o record $^ $(LIBS)
......@@ -16,6 +17,10 @@ replay: utils.o replay.o
extract_config: extract_config.o
$(CC) $(CFLAGS) -o extract_config $^ $(LIBS)
extract_input_subframe: extract_input_subframe.o database.o event.o utils.o \
config.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
textlog: utils.o textlog.o database.o event.o handler.o config.o \
event_selector.o view/view.a gui/gui.a logger/logger.a \
filter/filter.a
......@@ -59,7 +64,7 @@ filter/filter.a:
clean:
rm -f *.o core tracer_remote textlog enb ue vcd record replay
rm -f extract_config macpdu2wireshark
rm -f extract_config macpdu2wireshark extract_input_subframe
cd gui && make clean
cd view && make clean
cd logger && make clean
......
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include "database.h"
#include "event.h"
#include "config.h"
void usage(void)
{
printf(
"usage: [options] <file> <frame> <subframe>\n"
"options:\n"
" -d <database file> this option is mandatory\n"
" -v verbose\n"
);
exit(1);
}
int main(int n, char **v)
{
char *database_filename = NULL;
void *database;
int i;
int input_event_id;
database_event_format f;
char *file = NULL;
int fd;
int frame = -1, subframe = -1;
int frame_arg, subframe_arg, buffer_arg;
int verbose = 0;
for (i = 1; i < n; i++) {
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
if (!strcmp(v[i], "-d"))
{ if (i > n-2) usage(); database_filename = v[++i]; continue; }
if (!strcmp(v[i], "-v")) { verbose = 1; continue; }
if (file == NULL) { file = v[i]; continue; }
if (frame == -1) { frame = atoi(v[i]); continue; }
if (subframe == -1) { subframe = atoi(v[i]); continue; }
usage();
}
if (file == NULL || frame == -1 || subframe == -1) usage();
if (database_filename == NULL) {
printf("ERROR: provide a database file (-d)\n");
exit(1);
}
database = parse_database(database_filename);
load_config_file(database_filename);
input_event_id = event_id_from_name(database, "ENB_PHY_INPUT_SIGNAL");
f = get_format(database, input_event_id);
frame_arg = subframe_arg = buffer_arg = -1;
for (i = 0; i < f.count; i++) {
if (!strcmp(f.name[i], "frame")) {
if (frame_arg != -1) goto err;
if (strcmp(f.type[i], "int")) goto err;
frame_arg = i;
}
if (!strcmp(f.name[i], "subframe")) {
if (subframe_arg != -1) goto err;
if (strcmp(f.type[i], "int")) goto err;
subframe_arg = i;
}
if (!strcmp(f.name[i], "rxdata")) {
if (buffer_arg != -1) goto err;
if (strcmp(f.type[i], "buffer")) goto err;
buffer_arg = i;
}
continue;
err:
printf("cannot deal with ENB_PHY_INPUT_SIGNAL from database file\n");
exit(1);
}
if (frame_arg == -1 || subframe_arg == -1 || buffer_arg == -1) goto err;
fd = open(file, O_RDONLY);
if (fd == -1) { perror(file); exit(1); }
/* get wanted frame/subframe */
while (1) {
char v[T_BUFFER_MAX];
event e;
e = get_event(fd, v, database);
if (e.type == -1) break;
if (e.type != input_event_id) continue;
if (verbose)
printf("input frame %d subframe %d size %d\n",
e.e[frame_arg].i, e.e[subframe_arg].i, e.e[buffer_arg].bsize);
if (!(frame == e.e[frame_arg].i && subframe == e.e[subframe_arg].i))
continue;
#if 0
for (i = 0; i < e.e[buffer_arg].bsize/2; i++) {
short *x = e.e[buffer_arg].b;
x[i] *= 14;
}
#endif
fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, stdout);
fflush(stdout);
return 0;
}
printf("frame %d subframe %d not found\n", frame, subframe);
return 0;
}
......@@ -2176,6 +2176,7 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
// printf("dci_alloc[%d].L = %d\n",i,dci_alloc[i].L);
//}
//exit(-1);
exit(1);
return(0);
}
......
This diff is collapsed.
......@@ -2074,12 +2074,12 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
rxptr = (int16_t *)&common_vars->rxdataF[0][aa][symbol_offset];
for (i=0; i<12; i++,j+=2,re_offset++) {
rxcomp[aa][j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[j])>>15) - ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[1+j])>>15);
rxcomp[aa][1+j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[1+j])>>15) + ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[j])>>15);
if (re_offset==frame_parms->ofdm_symbol_size)
re_offset = 0;
rxcomp[aa][j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[j])>>15) - ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[1+j])>>15);
rxcomp[aa][1+j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[1+j])>>15) + ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[j])>>15);
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d,%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,i,re_offset,m,j,
rxptr[re_offset<<1],rxptr[1+(re_offset<<1)],
......@@ -2153,8 +2153,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
} //phase
stat_max *= nsymb; // normalize to energy per symbol
stat_max /= (frame_parms->N_RB_UL*12); //
// stat_max *= nsymb; // normalize to energy per symbol
// stat_max /= (frame_parms->N_RB_UL*12); //
stat_max /= (nsymb*12);
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max);
#endif
......@@ -2202,7 +2203,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
LOG_I(PHY,"Doing PUCCH detection for format 1a/1b\n");
#endif
for (phase=3;phase<4;phase++){ //phase=0; phase<7; phase++) {
for (phase=0; phase<7; phase++) {
stat=0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
......@@ -2339,8 +2340,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l);
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15)/4);
stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15)/4);
stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4;
stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4;
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
......
......@@ -165,8 +165,9 @@ typedef enum {
} eNB_func_t;
typedef enum {
synch_to_ext_device=0, // synch to RF or Ethernet device
synch_to_other // synch to another source (timer, other CC_id)
synch_to_ext_device=0, // synch to RF or Ethernet device
synch_to_other, // synch to another source (timer, other CC_id)
synch_to_mobipass_standalone // special case for mobipass in standalone mode
} eNB_timing_t;
#endif
......
......@@ -290,6 +290,30 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
return(0);
}
int get_ue_rbs(int Mod_id, int CC_id, int rnti, int frame, int subframe, int *start_rb, int *nb_rb)
{
LTE_eNB_ULSCH_t *ULSCH_ptr;
uint8_t ulsch_subframe,ulsch_frame;
int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
int harq_pid;
if (UE_id==-1) {
LOG_E(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
return(-1);
}
ULSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->ulsch[(uint32_t)UE_id];
ulsch_subframe = pdcch_alloc2ul_subframe(&PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms,subframe);
ulsch_frame = pdcch_alloc2ul_frame(&PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms,frame,subframe);
harq_pid = subframe2harq_pid(&PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms,
ulsch_frame,
ulsch_subframe);
*nb_rb = ULSCH_ptr->harq_processes[harq_pid]->nb_rb;
*start_rb = ULSCH_ptr->harq_processes[harq_pid]->first_rb;
return(0);
}
int16_t get_target_pusch_rx_power(const module_id_t module_idP, const uint8_t CC_id)
{
return PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.ul_power_control_config_common.p0_NominalPUSCH;
......
......@@ -947,6 +947,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_ext_device;
} else if (strcmp(cc_node_timing, "synch_to_other") == 0) {
enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_other;
} else if (strcmp(cc_node_timing, "synch_to_mobipass_standalone") == 0) {
enb_properties.properties[enb_properties_index]->cc_node_timing[j] = synch_to_mobipass_standalone;
} else {
AssertError (0, parse_errors ++,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for node_function choice: SYNCH_TO_DEVICE or SYNCH_TO_OTHER !\n",
......
......@@ -1087,7 +1087,13 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// Allocate CCEs for good after scheduling is done
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
allocate_CCEs(module_idP,CC_id,subframeP,0);
if (allocate_CCEs(module_idP,CC_id,subframeP,0)) {
LOG_D(MAC, "eNB %d CC_id %d frame %d subframe %d: CCE allocation failed\n",
module_idP, CC_id, frameP, subframeP);
printf("eNB %d CC_id %d frame %d subframe %d: CCE allocation failed\n",
module_idP, CC_id, frameP, subframeP);
abort();
}
#if defined(FLEXRAN_AGENT_SB_IF)
#ifndef DISABLE_CONT_STATS
......
......@@ -452,6 +452,7 @@ schedule_ue_spec(
static int32_t tpc_accumulated=0;
UE_sched_ctrl *ue_sched_ctl;
int i;
DCI_PDU saved_DCI_pdu[MAX_NUM_CCs];
#if 0
if (UE_list->head==-1) {
......@@ -462,6 +463,10 @@ schedule_ue_spec(
start_meas(&eNB->schedule_dlsch);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN);
/* save DCI_pdu size */
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
saved_DCI_pdu[CC_id].Num_dci = eNB->common_channels[CC_id].DCI_pdu.Num_dci;
//weight = get_ue_weight(module_idP,UE_id);
aggregation = 2;
......@@ -496,7 +501,6 @@ schedule_ue_spec(
stop_meas(&eNB->schedule_dlsch_preprocessor);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR,VCD_FUNCTION_OUT);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
LOG_D(MAC, "doing schedule_ue_spec for CC_id %d\n",CC_id);
......@@ -571,6 +575,18 @@ schedule_ue_spec(
continue;
}
/* add "fake" DCI to have CCE_allocation_infeasible work properly for next allocations */
/* if we don't add it, next allocations may succeed but overall allocations may fail */
/* will be removed at the end of this function */
add_ue_spec_dci(&eNB->common_channels[CC_id].DCI_pdu,
&(char[]){0},
rnti,
1,
aggregation,
1,
format1,
0);
nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id];
harq_pid = ue_sched_ctl->harq_pid[CC_id];
round = ue_sched_ctl->round[CC_id];
......@@ -632,6 +648,7 @@ schedule_ue_spec(
while((nb_rb_temp > 0) && (j<frame_parms[CC_id]->N_RBG)) {
if(ue_sched_ctl->rballoc_sub_UE[CC_id][j] == 1) {
if (UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j]) printf("WARN: rballoc_subband not free for retrans?\n");
UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = ue_sched_ctl->rballoc_sub_UE[CC_id][j];
if((j == frame_parms[CC_id]->N_RBG-1) &&
......@@ -798,7 +815,7 @@ schedule_ue_spec(
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=eNB_UE_stats->dlsch_mcs1;
UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2=eNB_UE_stats->dlsch_mcs1;
} else {
LOG_D(MAC,"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n",
LOG_E(MAC,"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have\n",
module_idP, frameP, CC_id, UE_id);
}
} else { /* This is a potentially new SDU opportunity */
......@@ -1645,6 +1662,10 @@ schedule_ue_spec(
} // UE_id loop
} // CC_id loop
/* restore DCI_pdu size */
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
eNB->common_channels[CC_id].DCI_pdu.Num_dci = saved_DCI_pdu[CC_id].Num_dci;
stop_meas(&eNB->schedule_dlsch);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_OUT);
......
......@@ -56,6 +56,8 @@
# include "intertask_interface.h"
#endif
#include "T.h"
#define ENABLE_MAC_PAYLOAD_DEBUG
#define DEBUG_eNB_SCHEDULER 1
......@@ -1157,6 +1159,7 @@ boolean_t CCE_allocation_infeasible(int module_idP,
void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP)
{
T(T_ENB_MAC_SCHEDULING_REQUEST, T_INT(mod_idP), T_INT(cc_idP), T_INT(frameP), T_INT(subframeP), T_INT(rntiP));
int UE_id = find_UE_id(mod_idP, rntiP);
UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
......
......@@ -670,6 +670,21 @@ void schedule_ulsch(module_id_t module_idP,
}
}
/* TODO: this is a hack to disable scheduling in the PRACH.
* We need to get the information from config/phy/wherever
* as done in the commented code below.
* For the moment, we hardcode for the config used by default.
* Only deals with FDD, PRACH config 0.
*/
LTE_DL_FRAME_PARMS *frame_parms;
frame_parms = mac_xface->get_lte_frame_parms(module_idP,CC_id);
if (frame_parms->frame_type == FDD &&
frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex == 0) {
int frame_ul = (frameP + (subframeP >= 6)) & 1023;
int subframe_ul = (subframeP + 4) % 10;
if ((frame_ul & 1) == 0 && subframe_ul == 1) first_rb[CC_id] = 8;
}
/*
if (mac_xface->is_prach_subframe(&(mac_xface->lte_frame_parms),frameP,subframeP)) {
first_rb[CC_id] = (mac_xface->get_prach_prb_offset(&(mac_xface->lte_frame_parms),
......@@ -677,6 +692,65 @@ void schedule_ulsch(module_id_t module_idP,
}
/* TODO: remove this hack which is to avoid scheduling new uplink where there is a
* retransmission. It increases first_rb to move after the retransmission RBs,
* which can skip a lot of free RBs (say the UE 2 has a retransmission
* in RBs 45..47, we would skip RBs 1..47, but RBs 1..44 are free and
* won't be used for scheduling)
*/
int UE_id;
int rnti;
UE_list_t *UE_list=&eNB->UE_list;
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
int drop_ue=0;
uint8_t harq_pid = 0;
uint8_t round = 0;
int n;
// loop over all UEs
for (UE_id=0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
rnti = UE_RNTI(module_idP,UE_id);
if (rnti==NOT_A_RNTI) continue;
if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) continue;
drop_ue = 0;
for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
CC_id = UE_list->ordered_ULCCids[n][UE_id];
if (mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti) == NULL) {
drop_ue = 1;
break;
}
}
if (drop_ue == 1) continue;