Compare commits

...

18 Commits

Author SHA1 Message Date
Florian Kaltenberger
c8ee87eda8 t-tracer: plotting rxdata_F_comp instead of rxdata_F and increasing size of plot 2021-02-26 11:26:57 +01:00
Florian Kaltenberger
4e6480396b Merge remote-tracking branch 'origin/t-gnb-tracer' into benetel_fixes
Conflicts:
	common/utils/T/T_defs.h
	openair1/SCHED_NR/phy_procedures_nr_gNB.c
2021-02-25 16:43:20 +01:00
Florian Kaltenberger
3a930a3f98 increasing initial[DL|UL]BWPlocationAndBandwidth for benetel config file to support newer handsets 2021-02-24 18:09:16 +01:00
Florian Kaltenberger
4b16c813e0 increasing buffer size for RRCConnectionReconfiguration message 2021-02-24 18:06:42 +01:00
Robert Schmidt
11dae81d35 Fixup sched_ul_bytes logic
1) Only count new transmission as scheduled bytes (which is then
compared against the BSR)

2) When subtracting scheduled bytes after successful reception, subtract
TBsize from correct HARQ process
2021-02-24 18:03:41 +01:00
Cedric Roux
bcb6f00620 T tracer: add gnb tracer
Minimalist gnb tracer to trace (for the moment) rxdataF when some
decoding for PUCCH or PUSCH has been done.

Important: T_BUFFER_MAX and T_CACHE_SIZE have been changed. T_BUFFER_MAX
is twice as big as before. T_CACHE_SIZE has been devided by two. Globally,
the memory usage of the T tracer is the same, but since we divided by two
the number of buffers in the cache, we may hit some realtime problems if
all the buffers are busy at some point. The simple solution would be to
use 8192*2 for T_CACHE_SIZE as it was, but then we double the memory usage
of the T tracer. This, or another solution, to be defined.
2021-02-24 16:21:36 +01:00
rmagueta
ca9366bba8 Fix RA preamble shift at gNB 2021-02-24 10:11:04 +01:00
Florian Kaltenberger
2651cd0cd3 removing dead code 2021-02-19 11:16:29 +01:00
Florian Kaltenberger
a51e3defa8 when PRACH config 4 is used (Benetel RRU) we only schedule UL slots 8 and 9 2021-02-19 11:15:59 +01:00
Florian Kaltenberger
30aaa0dc44 reducing UL target power for Benetel 5G RRU and adding missing parameter for PUSCH multi thread processing 2021-02-19 11:47:25 +01:00
Florian Kaltenberger
670c807a56 Merge remote-tracking branch 'origin/develop' into benetel_driver_update 2021-02-19 11:46:41 +01:00
Florian Kaltenberger
04a4a6f451 Merge remote-tracking branch 'origin/develop' into benetel_driver_update 2021-02-09 11:13:01 +01:00
Florian Kaltenberger
12517f02e2 Reverting shifting the TX 4 bits to the left to exploit dynamic range.
adapted ssb_block_power to measured value

This partially reverts commit 857f9179f3.

Conflicts:
	targets/ARCH/ETHERNET/benetel/5g/benetel.c
2021-02-09 11:10:58 +01:00
Cedric Roux
b7ea4e0f6d benetel 5g: support for two antennas 2021-02-05 16:48:30 +01:00
Cedric Roux
a9f57407c7 benetel 4g: support two antennas 2021-02-03 17:07:18 +01:00
Florian Kaltenberger
857f9179f3 shifting also the TX 4 bits to the left to exploit dynamic range. adapted ssb_block_power but proper calibration still necessary. 2021-02-01 10:24:22 +01:00
Florian Kaltenberger
a5b5d6f9b0 fixing RRC power levels at 5G side to avoid saturation 2021-02-01 10:24:22 +01:00
Florian Kaltenberger
0f57529b48 fixing benetel4g driver by setting ru->has_ctrl_prt =1 and thus starting the RU control thread, which is required for the 4G RRU. In the future we should revisit this and harmonize with the 5G version. 2021-02-01 10:24:22 +01:00
31 changed files with 565 additions and 255 deletions

View File

@@ -4,6 +4,7 @@ T_IDs.h
T_messages.txt.h
genids
tracer/enb
tracer/gnb
tracer/extract_config
tracer/record
tracer/replay

View File

@@ -44,7 +44,7 @@
/* let's have 100 RBs functional for the basic simulator */
# define T_BUFFER_MAX (1024*64*2)
#else
# define T_BUFFER_MAX (1024*64)
# define T_BUFFER_MAX (1024*128)
#endif
/* size of the local cache for messages (must be pow(2,something)) */
@@ -52,7 +52,7 @@
/* we don't need much space for the basic simulator */
# define T_CACHE_SIZE 1024
#else
# define T_CACHE_SIZE (8192 * 2)
# define T_CACHE_SIZE (8192)
#endif
/* maximum number of bytes a message can contain */

View File

@@ -1,3 +1,7 @@
ID = BENETEL
GROUP = ALL
FORMAT = int,frame : int,slot : buffer,rxdataF
#general logs
ID = ENB_MASTER_TICK
DESC = eNodeB master tick - one tick per ms, to be used as "reference clock", mostly for ticktime view
@@ -89,6 +93,10 @@ ID = GNB_PHY_MIB
DESC = NR MIB data
GROUP = ALL:PHY:GNB:WIRESHARK
FORMAT = int,gNB_ID : int,frame : int,slot : buffer,data
ID = GNB_PHY_PUCCH_PUSCH_IQ
DESC = gNodeB input data in the frequency domain for a slot where some PUCCH or PUSCH detection was done
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : buffer,rxdataF
#MAC logs
ID = ENB_MAC_UE_DL_SDU

View File

@@ -7,7 +7,8 @@ LIBS=-lm
XLIBS=-lX11 -lpng -lXft
all: record replay extract_config textlog enb ue vcd macpdu2wireshark \
extract_input_subframe extract_output_subframe to_vcd extract multi
extract_input_subframe extract_output_subframe to_vcd extract multi \
gnb
record: utils.o record.o database.o config.o
$(CC) $(CFLAGS) -o record $^ $(LIBS)
@@ -60,6 +61,11 @@ macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
multi: multi.o utils.o database.o config.o
$(CC) $(CFLAGS) -o multi $^ $(LIBS)
gnb: utils.o gnb.o database.o event.o handler.o config.o \
view/view.a gui/gui.a logger/logger.a \
filter/filter.a
$(CC) $(CFLAGS) -o gnb $^ $(LIBS) $(XLIBS)
multi.o: ../T_IDs.h
../T_IDs.h:
@@ -85,7 +91,7 @@ filter/filter.a:
clean:
rm -f *.o core tracer_remote textlog enb ue vcd record replay
rm -f extract_config macpdu2wireshark extract_input_subframe
rm -f extract_output_subframe to_vcd extract multi
rm -f extract_output_subframe to_vcd extract multi gnb
cd gui && $(MAKE) clean
cd view && $(MAKE) clean
cd logger && $(MAKE) clean

175
common/utils/T/tracer/gnb.c Normal file
View File

@@ -0,0 +1,175 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <unistd.h>
#include "database.h"
#include "handler.h"
#include "config.h"
#include "logger/logger.h"
#include "view/view.h"
#include "gui/gui.h"
typedef struct {
widget *pucch_pusch_iq_plot;
logger *pucch_pusch_iq_logger;
} gnb_gui;
typedef struct {
int socket;
int *is_on;
int nevents;
pthread_mutex_t lock;
gnb_gui *e;
void *database;
} gnb_data;
void is_on_changed(void *_d)
{
gnb_data *d = _d;
char t;
if (pthread_mutex_lock(&d->lock)) abort();
if (d->socket == -1) goto no_connection;
t = 1;
if (socket_send(d->socket, &t, 1) == -1 ||
socket_send(d->socket, &d->nevents, sizeof(int)) == -1 ||
socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1)
goto connection_dies;
no_connection:
if (pthread_mutex_unlock(&d->lock)) abort();
return;
connection_dies:
close(d->socket);
d->socket = -1;
if (pthread_mutex_unlock(&d->lock)) abort();
}
void usage(void)
{
printf(
"options:\n"
" -d <database file> this option is mandatory\n"
" -ip <host> connect to given IP address (default %s)\n"
" -p <port> connect to given port (default %d)\n",
DEFAULT_REMOTE_IP,
DEFAULT_REMOTE_PORT
);
exit(1);
}
static void *gui_thread(void *_g)
{
gui *g = _g;
gui_loop(g);
return NULL;
}
static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database,
gnb_data *ed)
{
widget *main_window;
widget *top_container;
widget *line;
widget *w;
logger *l;
view *v;
main_window = new_toplevel_window(g, 500, 300, "gNB tracer");
top_container = new_container(g, VERTICAL);
widget_add_child(g, main_window, top_container, -1);
line = new_container(g, HORIZONTAL);
widget_add_child(g, top_container, line, -1);
/* PUCCH/PUSCH IQ data */
w = new_xy_plot(g, 550, 550, "", 50);
e->pucch_pusch_iq_plot = w;
widget_add_child(g, line, w, -1);
xy_plot_set_range(g, w, -512, 512, -512, 512);
xy_plot_set_title(g, w, "rxdataF");
l = new_iqlog_full(h, database, "GNB_PHY_PUCCH_PUSCH_IQ", "rxdataF");
v = new_view_xy(300*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE);
logger_add_view(l, v);
e->pucch_pusch_iq_logger = l;
}
int main(int n, char **v)
{
char *database_filename = NULL;
void *database;
char *ip = DEFAULT_REMOTE_IP;
int port = DEFAULT_REMOTE_PORT;
int *is_on;
int number_of_events;
int i;
event_handler *h;
gnb_data gnb_data;
gui *g;
gnb_gui eg;
for (i = 1; i < n; i++) {
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
if (!strcmp(v[i], "-p"))
{ if (i > n-2) usage(); port = atoi(v[++i]); continue; }
if (!strcmp(v[i], "-d"))
{ if (i > n-2) usage(); database_filename = v[++i]; continue; }
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);
number_of_events = number_of_ids(database);
is_on = calloc(number_of_events, sizeof(int));
if (is_on == NULL) abort();
h = new_handler(database);
on_off(database, "GNB_PHY_PUCCH_PUSCH_IQ", is_on, 1);
gnb_data.database = database;
gnb_data.socket = -1;
gnb_data.is_on = is_on;
gnb_data.nevents = number_of_events;
if (pthread_mutex_init(&gnb_data.lock, NULL)) abort();
g = gui_init();
new_thread(gui_thread, g);
gnb_main_gui(&eg, g, h, database, &gnb_data);
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
restart:
clear_remote_config();
if (gnb_data.socket != -1) close(gnb_data.socket);
gnb_data.socket = connect_to(ip, port);
/* send the first message - activate selected traces */
is_on_changed(&gnb_data);
/* read messages */
while (1) {
event e;
e = get_event(gnb_data.socket, &ebuf, database);
if (e.type == -1) goto restart;
if (pthread_mutex_lock(&gnb_data.lock)) abort();
handle_event(h, e);
if (pthread_mutex_unlock(&gnb_data.lock)) abort();
}
return 0;
}

View File

@@ -74,6 +74,44 @@ static void _event(void *p, event e)
l->common.v[i]->append(l->common.v[i], l->i, l->q, count);
}
static void _event_full(void *p, event e)
{
struct iqlog *l = p;
int i;
void *buffer;
int bsize;
int nsamples;
float *idst, *qdst;
if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
return;
buffer = e.e[l->buffer_arg].b;
bsize = e.e[l->buffer_arg].bsize;
nsamples = bsize / 4;
if (nsamples > l->max_length) {
l->i = realloc(l->i, nsamples * sizeof(float));
if (l->i == NULL) abort();
l->q = realloc(l->q, nsamples * sizeof(float));
if (l->q == NULL) abort();
l->max_length = nsamples;
}
idst = l->i;
qdst = l->q;
for (i = 0; i < nsamples; i++) {
*idst = ((int16_t *)buffer)[i * 2];
*qdst = ((int16_t *)buffer)[i * 2 + 1];
idst++;
qdst++;
}
for (i = 0; i < l->common.vsize; i++)
l->common.v[i]->append(l->common.v[i], l->i, l->q, nsamples);
}
logger *new_iqlog(event_handler *h, void *database,
char *event_name, char *nb_rb, char *N_RB_UL, char *symbols_per_tti,
char *buffer_varname)
@@ -149,3 +187,43 @@ logger *new_iqlog(event_handler *h, void *database,
return ret;
}
logger *new_iqlog_full(event_handler *h, void *database, char *event_name,
char *buffer_varname)
{
struct iqlog *ret;
int event_id;
database_event_format f;
int i;
ret = calloc(1, sizeof(struct iqlog)); if (ret == NULL) abort();
ret->common.event_name = strdup(event_name);
if (ret->common.event_name == NULL) abort();
ret->database = database;
event_id = event_id_from_name(database, event_name);
ret->common.handler_id = register_handler_function(h, event_id, _event_full,
ret);
f = get_format(database, event_id);
/* look for args */
ret->buffer_arg = -1;
for (i = 0; i < f.count; i++) {
if (!strcmp(f.name[i], buffer_varname)) ret->buffer_arg = i;
}
if (ret->buffer_arg == -1) {
printf("%s:%d: buffer argument '%s' not found in event '%s'\n",
__FILE__, __LINE__, buffer_varname, event_name);
abort();
}
if (strcmp(f.type[ret->buffer_arg], "buffer") != 0) {
printf("%s:%d: argument '%s' has wrong type (should be 'buffer')\n",
__FILE__, __LINE__, buffer_varname);
abort();
}
return ret;
}

View File

@@ -23,6 +23,8 @@ logger *new_ticklog(void *event_handler, void *database,
logger *new_iqlog(void *event_handler, void *database,
char *event_name, char *nb_rb, char *N_RB_UL, char *symbols_per_tti,
char *buffer_varname);
logger *new_iqlog_full(void *event_handler, void *database, char *event_name,
char *buffer_varname);
logger *new_iqdotlog(void *event_handler, void *database,
char *event_name, char *I, char *Q);

View File

@@ -1000,7 +1000,13 @@ void init_eNB_afterRU(void) {
for (i=0; i<gNB->RU_list[ru_id]->nb_rx; aa++,i++) {
LOG_I(PHY,"Attaching RU %d antenna %d to gNB antenna %d\n",gNB->RU_list[ru_id]->idx,i,aa);
gNB->prach_vars.rxsigF[aa] = gNB->RU_list[ru_id]->prach_rxsigF[0][i];
#if 0
printf("before %p\n", gNB->common_vars.rxdataF[aa]);
#endif
gNB->common_vars.rxdataF[aa] = gNB->RU_list[ru_id]->common.rxdataF[i];
#if 0
printf("after %p\n", gNB->common_vars.rxdataF[aa]);
#endif
}
}

View File

@@ -681,7 +681,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
preamble_shift -= NCS;
if (preamble_shift < 0)
preamble_shift+=N_ZC;
preamble_shift+=((N_ZC/NCS)*NCS);
}
} else { // This is the high-speed case
new_dft = 0;

View File

@@ -542,6 +542,9 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
}
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
/* those variables to log T_GNB_PHY_PUCCH_PUSCH_IQ only when we try to decode */
int pucch_decode_done = 0;
int pusch_decode_done = 0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,1);
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx);
@@ -551,6 +554,11 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
gNB_I0_measurements(gNB);
// measure enegry in SS=10 L=4, nb_rb = 18, first_rb = 0 (corresponds to msg3)
int offset = 10*gNB->frame_parms.ofdm_symbol_size + gNB->frame_parms.first_carrier_offset;
int power_rxF = signal_energy_nodc(&gNB->common_vars.rxdataF[0][offset],12*18);
LOG_D(PHY,"frame %d, slot %d: UL signal energy %d\n",frame_rx,slot_rx,power_rxF);
for (int i=0;i<NUMBER_OF_NR_PUCCH_MAX;i++){
NR_gNB_PUCCH_t *pucch = gNB->pucch[i];
if (pucch) {
@@ -558,6 +566,8 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
(pucch->frame == frame_rx) &&
(pucch->slot == slot_rx) ) {
pucch_decode_done = 1;
nfapi_nr_pucch_pdu_t *pucch_pdu = &pucch->pucch_pdu;
uint16_t num_ucis;
switch (pucch_pdu->format_type) {
@@ -646,6 +656,8 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
}
#endif
pusch_decode_done = 1;
uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH,1);
@@ -673,5 +685,10 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
// figure out a better way to choose slot_rx, 19 is ok for a particular TDD configuration with 30kHz SCS
if ((frame_rx&127) == 0 && slot_rx==19) dump_pusch_stats(gNB);
if (pucch_decode_done || pusch_decode_done) {
//T(T_GNB_PHY_PUCCH_PUSCH_IQ, T_INT(frame_rx), T_INT(slot_rx), T_BUFFER(&gNB->common_vars.rxdataF[0][0], gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size * 4));
T(T_GNB_PHY_PUCCH_PUSCH_IQ, T_INT(frame_rx), T_INT(slot_rx), T_BUFFER(&gNB->pusch_vars[0]->rxdataF_comp[0][0], gNB->frame_parms.symbols_per_slot * gNB->frame_parms.N_RB_UL * 12 * 4));
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,0);
}

View File

@@ -371,7 +371,13 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
#define BIT(x) (1 << (x))
const uint64_t dlsch_in_slot_bitmap = BIT( 1) | BIT( 2) | BIT( 3) | BIT( 4) | BIT( 5) | BIT( 6)
| BIT(11) | BIT(12) | BIT(13) | BIT(14) | BIT(15) | BIT(16);
const uint64_t ulsch_in_slot_bitmap = BIT( 8) | BIT(18);
uint8_t prach_config_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex;
uint64_t ulsch_in_slot_bitmap;
if (prach_config_index==4) //this is the PRACH config used in the Benetel RRU. TODO: make this generic for any PRACH config.
ulsch_in_slot_bitmap = BIT( 8) | BIT( 9);
else
ulsch_in_slot_bitmap = BIT( 8) | BIT(18);
memset(RC.nrmac[module_idP]->cce_list[bwp_id][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0
memset(RC.nrmac[module_idP]->cce_list[bwp_id][1],0,MAX_NUM_CCE*sizeof(int)); // coresetid 1

View File

@@ -395,7 +395,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
T_BUFFER(sduP, sdu_lenP));
UE_info->mac_stats[UE_id].ulsch_total_bytes_rx += sdu_lenP;
LOG_D(MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
LOG_D(MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d sduP %p\n",
gnb_mod_idP,
harq_pid,
CC_idP,
@@ -403,7 +403,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
slotP,
current_rnti,
UE_id,
ul_cqi);
ul_cqi,
sduP);
// if not missed detection (10dB threshold for now)
if (UE_scheduling_control->ul_rssi < (100+rssi)) {
@@ -432,7 +433,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if (sduP != NULL){
LOG_D(MAC, "Received PDU at MAC gNB \n");
UE_scheduling_control->sched_ul_bytes -= UE_info->mac_stats[UE_id].ulsch_current_bytes;
const uint32_t tb_size = UE_scheduling_control->ul_harq_processes[harq_pid].sched_pusch.tb_size;
UE_scheduling_control->sched_ul_bytes -= tb_size;
if (UE_scheduling_control->sched_ul_bytes < 0)
UE_scheduling_control->sched_ul_bytes = 0;
@@ -442,7 +444,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
NR_UE_ul_harq_t *cur_harq = &UE_scheduling_control->ul_harq_processes[harq_pid];
/* reduce sched_ul_bytes when cur_harq->round == 3 */
if (cur_harq->round == 3){
UE_scheduling_control->sched_ul_bytes -= UE_info->mac_stats[UE_id].ulsch_current_bytes;
const uint32_t tb_size = UE_scheduling_control->ul_harq_processes[harq_pid].sched_pusch.tb_size;
UE_scheduling_control->sched_ul_bytes -= tb_size;
if (UE_scheduling_control->sched_ul_bytes < 0)
UE_scheduling_control->sched_ul_bytes = 0;
}
@@ -916,6 +919,7 @@ void nr_schedule_ulsch(module_id_t module_id,
/* Save information on MCS, TBS etc for the current initial transmission
* so we have access to it when retransmitting */
cur_harq->sched_pusch = *sched_pusch;
sched_ctrl->sched_ul_bytes += sched_pusch->tb_size;
} else {
LOG_D(MAC,
"%d.%2d UL retransmission RNTI %04x sched %d.%2d HARQ PID %d round %d NDI %d\n",
@@ -929,7 +933,6 @@ void nr_schedule_ulsch(module_id_t module_id,
cur_harq->ndi);
}
UE_info->mac_stats[UE_id].ulsch_current_bytes = sched_pusch->tb_size;
sched_ctrl->sched_ul_bytes += sched_pusch->tb_size;
LOG_D(MAC,
"%4d.%2d RNTI %04x UL sched %4d.%2d start %d RBS %d MCS %d TBS %d HARQ PID %d round %d NDI %d\n",
@@ -1130,4 +1133,4 @@ void nr_schedule_ulsch(module_id_t module_id,
memset(sched_pusch, 0, sizeof(*sched_pusch));
}
}
}

View File

@@ -3718,7 +3718,7 @@ uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
NULL,
(void *)&dl_dcch_msg,
buffer,
RRC_BUF_SIZE);
8000);
if(enc_rval.encoded == -1) {
LOG_I(RRC, "[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",

View File

@@ -2907,7 +2907,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
const uint8_t ho_state)
//-----------------------------------------------------------------------------
{
uint8_t buffer[RRC_BUF_SIZE];
uint8_t buffer[8000]; //RRC_BUF_SIZE];
uint16_t size;
int i;
MessageDef *message_p = NULL;
@@ -3545,7 +3545,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 ||
RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports;
memset(buffer, 0, RRC_BUF_SIZE);
memset(buffer, 0, 8000);
size = do_RRCConnectionReconfiguration(ctxt_pP,
buffer,
xid, // Transaction_id,

View File

@@ -163,8 +163,8 @@ int trx_benetel_ctlrecv(openair0_device *device, void *msg, ssize_t msg_len)
cap->FH_fmt = OAI_IF4p5_only;
cap->num_bands = 1;
cap->band_list[0] = 7;
cap->nb_rx[0] = 1;
cap->nb_tx[0] = 1;
cap->nb_rx[0] = device->openair0_cfg->rx_num_channels;
cap->nb_tx[0] = device->openair0_cfg->tx_num_channels;
cap->max_pdschReferenceSignalPower[0] = -27;
cap->max_rxgain[0] = 90;
@@ -194,11 +194,12 @@ void benetel_fh_if4p5_south_in(RU_t *ru,
LTE_DL_FRAME_PARMS *fp;
int symbol;
int32_t *rxdata;
int antenna = 0;
int antenna;
lock_ul_buffer(&s->buffers, *subframe);
next:
while (!(s->buffers.ul_busy[*subframe] == 0x3fff ||
while (!((s->buffers.ul_busy[0][*subframe] == 0x3fff &&
s->buffers.ul_busy[1][*subframe] == 0x3fff) ||
s->buffers.prach_busy[*subframe] == 1))
wait_ul_buffer(&s->buffers, *subframe);
if (s->buffers.prach_busy[*subframe] == 1) {
@@ -217,24 +218,27 @@ next:
eNB = eNB_list[0];
fp = &eNB->frame_parms;
for (symbol = 0; symbol < 14; symbol++) {
int i;
uint16_t *p = (uint16_t *)(&s->buffers.ul[*subframe][symbol*1200*4]);
for (i = 0; i < 1200*2; i++) {
p[i] = htons(p[i]);
}
rxdata = &ru->common.rxdataF[antenna][symbol * fp->ofdm_symbol_size];
for (antenna = 0; antenna < ru->nb_rx; antenna++) {
for (symbol = 0; symbol < 14; symbol++) {
int i;
uint16_t *p = (uint16_t *)(&s->buffers.ul[antenna][*subframe][symbol*1200*4]);
for (i = 0; i < 1200*2; i++) {
p[i] = htons(p[i]);
}
rxdata = &ru->common.rxdataF[antenna][symbol * fp->ofdm_symbol_size];
#if 1
memcpy(rxdata + 2048 - 600,
&s->buffers.ul[*subframe][symbol*1200*4],
600 * 4);
memcpy(rxdata,
&s->buffers.ul[*subframe][symbol*1200*4] + 600*4,
600 * 4);
memcpy(rxdata + 2048 - 600,
&s->buffers.ul[antenna][*subframe][symbol*1200*4],
600 * 4);
memcpy(rxdata,
&s->buffers.ul[antenna][*subframe][symbol*1200*4] + 600*4,
600 * 4);
#endif
}
}
s->buffers.ul_busy[*subframe] = 0;
s->buffers.ul_busy[0][*subframe] = 0;
s->buffers.ul_busy[1][*subframe] = 0;
signal_ul_buffer(&s->buffers, *subframe);
unlock_ul_buffer(&s->buffers, *subframe);
@@ -272,45 +276,49 @@ void benetel_fh_if4p5_south_out(RU_t *ru,
LTE_DL_FRAME_PARMS *fp;
int symbol;
int32_t *txdata;
int aa = 0;
int aa;
//printf("BENETEL: %s (f.sf %d.%d ts %ld)\n", __FUNCTION__, frame, subframe, timestamp);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
lock_dl_buffer(&s->buffers, subframe);
if (s->buffers.dl_busy[subframe]) {
if (s->buffers.dl_busy[0][subframe] ||
s->buffers.dl_busy[1][subframe]) {
printf("%s: fatal: DL buffer busy for subframe %d\n", __FUNCTION__, subframe);
unlock_dl_buffer(&s->buffers, subframe);
return;
}
eNB = eNB_list[0];
fp = &eNB->frame_parms;
if (ru->num_eNB != 1 || ru->nb_tx != 1 || fp->ofdm_symbol_size != 2048 ||
if (ru->num_eNB != 1 || fp->ofdm_symbol_size != 2048 ||
fp->Ncp != NORMAL || fp->symbols_per_tti != 14) {
printf("%s:%d:%s: unsupported configuration\n",
__FILE__, __LINE__, __FUNCTION__);
exit(1);
}
for (symbol = 0; symbol < 14; symbol++) {
txdata = &ru->common.txdataF_BF[aa][symbol * fp->ofdm_symbol_size];
for (aa = 0; aa < ru->nb_tx; aa++) {
for (symbol = 0; symbol < 14; symbol++) {
txdata = &ru->common.txdataF_BF[aa][symbol * fp->ofdm_symbol_size];
#if 1
memcpy(&s->buffers.dl[subframe][symbol*1200*4],
txdata + 2048 - 600,
600 * 4);
memcpy(&s->buffers.dl[subframe][symbol*1200*4] + 600*4,
txdata + 1,
600 * 4);
memcpy(&s->buffers.dl[aa][subframe][symbol*1200*4],
txdata + 2048 - 600,
600 * 4);
memcpy(&s->buffers.dl[aa][subframe][symbol*1200*4] + 600*4,
txdata + 1,
600 * 4);
#endif
int i;
uint16_t *p = (uint16_t *)(&s->buffers.dl[subframe][symbol*1200*4]);
for (i = 0; i < 1200*2; i++) {
p[i] = htons(p[i]);
int i;
uint16_t *p = (uint16_t *)(&s->buffers.dl[aa][subframe][symbol*1200*4]);
for (i = 0; i < 1200*2; i++) {
p[i] = htons(p[i]);
}
}
}
s->buffers.dl_busy[subframe] = 0x3fff;
s->buffers.dl_busy[0][subframe] = 0x3fff;
s->buffers.dl_busy[1][subframe] = 0x3fff;
unlock_dl_buffer(&s->buffers, subframe);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_IF4P5_SOUTH_OUT_RU+ru->idx, ru->proc.frame_tx);

View File

@@ -233,19 +233,20 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs)
}
if(PAYLOAD_1 == 0x12 && PAYLOAD_2 == 0xce && ANT_NUM == 0x00) {
if(PAYLOAD_1 == 0x12 && PAYLOAD_2 == 0xce) {
p.frame = FRAME;
p.subframe = SUBFRAME >> 4;
p.slot = 0; /* unused */
p.symbol = SYMBOL;
p.antenna = 0;
p.antenna = ANT_NUM;
memcpy(p.iq, IQ_ptr, 4800);
store_ul(bs, &p);
}
// U-PLANE UL ANT_0 PROCESSING
if(PAYLOAD_1 == 0x12 && PAYLOAD_2 == 0xce && ANT_NUM == 0x00 && dl_start == 1)
// U-PLANE UL PROCESSING
if(PAYLOAD_1 == 0x12 && PAYLOAD_2 == 0xce && dl_start == 1)
{
int a = ANT_NUM;
int tx_frame = FRAME;
int tx_subframe = SUBFRAME >> 4;
int tx_symbol = SYMBOL + 5;
@@ -266,33 +267,20 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs)
SUBFRAME = tx_subframe << 4;
SYMBOL = tx_symbol;
/* antenna 0 - send actual DL data (if available) */
/* send actual DL data (if available) */
lock_dl_buffer(bs->buffers, tx_subframe);
if (!(bs->buffers->dl_busy[tx_subframe] & (1 << tx_symbol))) {
printf("%s: warning, DL underflow (sf.symbol %d.%d)\n", __FUNCTION__,
if (!(bs->buffers->dl_busy[a][tx_subframe] & (1 << tx_symbol))) {
printf("%s: warning, DL underflow (antenna %d sf.symbol %d.%d)\n",
__FUNCTION__,
a,
tx_subframe, tx_symbol);
memset(IQ_ptr, 0, 1200 * 4);
} else {
memcpy(IQ_ptr, bs->buffers->dl[tx_subframe] + tx_symbol * 1200*4,
memcpy(IQ_ptr, bs->buffers->dl[a][tx_subframe] + tx_symbol * 1200*4,
1200*4);
}
bs->buffers->dl_busy[tx_subframe] &= ~(1 << tx_symbol);
bs->buffers->dl_busy[a][tx_subframe] &= ~(1 << tx_symbol);
unlock_dl_buffer(bs->buffers, tx_subframe);
// fill DL Data for ant 0 with 0 value
// memset(IQ_ptr, 0, 4800);
}
// U-PLANE UL ANT_1 PROCESSING
else if(PAYLOAD_1 == 0x12 && PAYLOAD_2 == 0xce && ANT_NUM == 0x01 && dl_start == 1)
{
// ANT_NUM = 0x01;
SYMBOL = (SYMBOL + 5) % 14;
PAYLOAD_2 = 0xc8;
// fill DL Data for ant 1 with 0 value
memset(IQ_ptr, 0, 4800);
}
// U-PLANE PRACH PROCESSING

View File

@@ -27,37 +27,36 @@
void store_ul(benetel_t *bs, ul_packet_t *ul)
{
/* only antenna 0 for the moment */
if (ul->antenna != 0)
return;
int a = ul->antenna;
if (ul->subframe != bs->next_subframe ||
ul->symbol != bs->next_symbol) {
printf("%s: fatal, expected frame.sf.symbol %d.%d.%d, got %d.%d.%d\n",
if (ul->subframe != bs->next_subframe[a] ||
ul->symbol != bs->next_symbol[a]) {
printf("%s: fatal, antenna %d expected frame.sf.symbol %d.%d.%d, got %d.%d.%d\n",
__FUNCTION__,
bs->expected_benetel_frame, bs->next_subframe, bs->next_symbol,
a,
bs->expected_benetel_frame[a], bs->next_subframe[a], bs->next_symbol[a],
ul->frame, ul->subframe, ul->symbol);
exit(1);
}
lock_ul_buffer(bs->buffers, bs->next_subframe);
if (bs->buffers->ul_busy[bs->next_subframe] & (1 << bs->next_symbol)) {
lock_ul_buffer(bs->buffers, bs->next_subframe[a]);
if (bs->buffers->ul_busy[a][bs->next_subframe[a]] & (1 << bs->next_symbol[a])) {
printf("%s: warning, UL overflow (sf.symbol %d.%d)\n", __FUNCTION__,
bs->next_subframe, bs->next_symbol);
bs->next_subframe[a], bs->next_symbol[a]);
}
memcpy(bs->buffers->ul[bs->next_subframe] + bs->next_symbol * 1200*4,
memcpy(bs->buffers->ul[a][bs->next_subframe[a]] + bs->next_symbol[a] * 1200*4,
ul->iq, 1200*4);
bs->buffers->ul_busy[bs->next_subframe] |= (1 << bs->next_symbol);
signal_ul_buffer(bs->buffers, bs->next_subframe);
unlock_ul_buffer(bs->buffers, bs->next_subframe);
bs->buffers->ul_busy[a][bs->next_subframe[a]] |= (1 << bs->next_symbol[a]);
signal_ul_buffer(bs->buffers, bs->next_subframe[a]);
unlock_ul_buffer(bs->buffers, bs->next_subframe[a]);
bs->next_symbol++;
if (bs->next_symbol == 14) {
bs->next_symbol = 0;
bs->next_subframe = (bs->next_subframe + 1) % 10;
if (bs->next_subframe == 0) {
bs->expected_benetel_frame++;
bs->expected_benetel_frame &= 255;
bs->next_symbol[a]++;
if (bs->next_symbol[a] == 14) {
bs->next_symbol[a] = 0;
bs->next_subframe[a] = (bs->next_subframe[a] + 1) % 10;
if (bs->next_subframe[a] == 0) {
bs->expected_benetel_frame[a]++;
bs->expected_benetel_frame[a] &= 255;
}
}
}

View File

@@ -26,9 +26,10 @@
typedef struct {
shared_buffers *buffers;
int next_subframe;
int next_symbol;
int expected_benetel_frame;
/* [2] is for two antennas */
int next_subframe[2];
int next_symbol[2];
int expected_benetel_frame[2];
char *dpdk_main_command_line;
} benetel_t;

View File

@@ -68,7 +68,8 @@ void *benetel_start_dpdk(char *ifname, shared_buffers *buffers, char *dpdk_main_
bs->buffers = buffers;
bs->expected_benetel_frame = 255;
bs->expected_benetel_frame[0] = 255;
bs->expected_benetel_frame[1] = 255;
bs->dpdk_main_command_line = dpdk_main_command_line;

View File

@@ -44,9 +44,12 @@ void init_buffers(shared_buffers *s)
/* in FDD the eNB's first transmitted DL subframe is 4 but the device
* needs to have subframes 1, 2 and 3 ready. Let's pretend there are ready.
*/
s->dl_busy[1] = 0x3fff;
s->dl_busy[2] = 0x3fff;
s->dl_busy[3] = 0x3fff;
s->dl_busy[0][1] = 0x3fff;
s->dl_busy[0][2] = 0x3fff;
s->dl_busy[0][3] = 0x3fff;
s->dl_busy[1][1] = 0x3fff;
s->dl_busy[1][2] = 0x3fff;
s->dl_busy[1][3] = 0x3fff;
}
void lock_dl_buffer(shared_buffers *s, int subframe)

View File

@@ -26,10 +26,11 @@
#include <stdint.h>
typedef struct {
unsigned char dl[10][14*1200*4];
unsigned char ul[10][14*1200*4];
uint16_t dl_busy[10];
uint16_t ul_busy[10];
/* [2] is for two antennas */
unsigned char dl[2][10][14*1200*4];
unsigned char ul[2][10][14*1200*4];
uint16_t dl_busy[2][10];
uint16_t ul_busy[2][10];
pthread_mutex_t m_ul[10];
pthread_cond_t c_ul[10];

View File

@@ -162,8 +162,9 @@ int trx_benetel_ctlrecv(openair0_device *device, void *msg, ssize_t msg_len)
cap->FH_fmt = OAI_IF4p5_only;
cap->num_bands = 1;
cap->band_list[0] = 78;
cap->nb_rx[0] = 1;
cap->nb_tx[0] = 1;
/* TODO: hardcoded to 1 for the moment, get the real value somehow... */
cap->nb_rx[0] = 1; //device->openair0_cfg->rx_num_channels;
cap->nb_tx[0] = 1; //device->openair0_cfg->tx_num_channels;
cap->max_pdschReferenceSignalPower[0] = -27;
cap->max_rxgain[0] = 90;
@@ -201,12 +202,13 @@ void benetel_fh_if4p5_south_in(RU_t *ru,
NR_DL_FRAME_PARMS *fp;
int symbol;
int32_t *rxdata;
int antenna = 0;
int antenna;
lock_ul_buffer(&s->buffers, *slot);
#if 1
next:
while (!(s->buffers.ul_busy[*slot] == 0x3fff ||
while (!((s->buffers.ul_busy[0][*slot] == 0x3fff &&
s->buffers.ul_busy[1][*slot] == 0x3fff) ||
s->buffers.prach_busy[*slot] == 1))
wait_ul_buffer(&s->buffers, *slot);
if (s->buffers.prach_busy[*slot] == 1) {
@@ -226,24 +228,31 @@ next:
#endif
fp = ru->nr_frame_parms;
for (symbol = 0; symbol < 14; symbol++) {
int i;
uint16_t *p = (uint16_t *)(&s->buffers.ul[*slot][symbol*1272*4]);
for (i = 0; i < 1272*2; i++) {
p[i] = htons(p[i]);
}
rxdata = &ru->common.rxdataF[antenna][symbol * fp->ofdm_symbol_size];
#if 1
memcpy(rxdata + 2048 - 1272/2,
&s->buffers.ul[*slot][symbol*1272*4],
(1272/2) * 4);
memcpy(rxdata,
&s->buffers.ul[*slot][symbol*1272*4] + (1272/2)*4,
(1272/2) * 4);
for (antenna = 0; antenna < ru->nb_rx; antenna++) {
for (symbol = 0; symbol < 14; symbol++) {
int i;
int16_t *p = (int16_t *)(&s->buffers.ul[antenna][*slot][symbol*1272*4]);
for (i = 0; i < 1272*2; i++) {
p[i] = (int16_t)(ntohs(p[i])) / 16;
}
rxdata = &ru->common.rxdataF[antenna][symbol * fp->ofdm_symbol_size];
#if 0
if (*slot == 0 && symbol == 0)
printf("rxdata in benetel_fh_if4p5_south_in %p\n", &ru->common.rxdataF[antenna][0]);
#endif
#if 1
memcpy(rxdata + 2048 - 1272/2,
&s->buffers.ul[antenna][*slot][symbol*1272*4],
(1272/2) * 4);
memcpy(rxdata,
&s->buffers.ul[antenna][*slot][symbol*1272*4] + (1272/2)*4,
(1272/2) * 4);
#endif
}
}
s->buffers.ul_busy[*slot] = 0;
s->buffers.ul_busy[0][*slot] = 0;
s->buffers.ul_busy[1][*slot] = 0;
signal_ul_buffer(&s->buffers, *slot);
unlock_ul_buffer(&s->buffers, *slot);
@@ -281,43 +290,47 @@ void benetel_fh_if4p5_south_out(RU_t *ru,
NR_DL_FRAME_PARMS *fp;
int symbol;
int32_t *txdata;
int aa = 0;
int aa;
//printf("BENETEL: %s (f.sf %d.%d ts %ld)\n", __FUNCTION__, frame, slot, timestamp);
lock_dl_buffer(&s->buffers, slot);
if (s->buffers.dl_busy[slot]) {
if (s->buffers.dl_busy[0][slot] ||
s->buffers.dl_busy[1][slot]) {
printf("%s: fatal: DL buffer busy for subframe %d\n", __FUNCTION__, slot);
unlock_dl_buffer(&s->buffers, slot);
return;
}
fp = ru->nr_frame_parms;
if (ru->num_gNB != 1 || ru->nb_tx != 1 || fp->ofdm_symbol_size != 2048 ||
if (ru->num_gNB != 1 || fp->ofdm_symbol_size != 2048 ||
fp->Ncp != NORMAL || fp->symbols_per_slot != 14) {
printf("%s:%d:%s: unsupported configuration\n",
__FILE__, __LINE__, __FUNCTION__);
exit(1);
}
for (symbol = 0; symbol < 14; symbol++) {
txdata = &ru->common.txdataF_BF[aa][symbol * fp->ofdm_symbol_size];
for (aa = 0; aa < ru->nb_tx; aa++) {
for (symbol = 0; symbol < 14; symbol++) {
txdata = &ru->common.txdataF_BF[aa][symbol * fp->ofdm_symbol_size];
#if 1
memcpy(&s->buffers.dl[slot][symbol*1272*4],
txdata + 2048 - (1272/2),
(1272/2) * 4);
memcpy(&s->buffers.dl[slot][symbol*1272*4] + (1272/2)*4,
txdata,
(1272/2) * 4);
memcpy(&s->buffers.dl[aa][slot][symbol*1272*4],
txdata + 2048 - (1272/2),
(1272/2) * 4);
memcpy(&s->buffers.dl[aa][slot][symbol*1272*4] + (1272/2)*4,
txdata,
(1272/2) * 4);
#endif
int i;
uint16_t *p = (uint16_t *)(&s->buffers.dl[slot][symbol*1272*4]);
for (i = 0; i < 1272*2; i++) {
p[i] = htons(p[i]);
int i;
uint16_t *p = (uint16_t *)(&s->buffers.dl[aa][slot][symbol*1272*4]);
for (i = 0; i < 1272*2; i++) {
p[i] = htons(p[i]);
}
}
}
s->buffers.dl_busy[slot] = 0x3fff;
s->buffers.dl_busy[0][slot] = 0x3fff;
s->buffers.dl_busy[1][slot] = 0x3fff;
unlock_dl_buffer(&s->buffers, slot);
}

View File

@@ -243,21 +243,22 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs)
}
if(PAYLOAD_1 == 0x13 && PAYLOAD_2 == 0xe4 && ANT_NUM == 0x00) {
if(PAYLOAD_1 == 0x13 && PAYLOAD_2 == 0xe4) {
int subframe = SUBFRAME >> 4;
int slot = ((SUBFRAME & 0x0f) << 2) | ((SYMBOL >> 6) & 0x03);
p.frame = FRAME;
p.slot = subframe * 2 + slot;
p.symbol = SYMBOL & 0x3f;
p.antenna = 0;
p.antenna = ANT_NUM;
memcpy(p.iq, IQ_ptr, 5088);
store_ul(bs, &p);
// if (p.symbol==0) printf("store ul f.sl.sy %d.%d.%d\n", p.frame, p.slot, p.symbol);
}
// U-PLANE UL ANT_0 PROCESSING
if(PAYLOAD_1 == 0x13 && PAYLOAD_2 == 0xe4 && ANT_NUM == 0x00 && dl_start == 1)
// U-PLANE UL PROCESSING
if(PAYLOAD_1 == 0x13 && PAYLOAD_2 == 0xe4 && dl_start == 1)
{
int a = ANT_NUM & 0x01;
int frame = FRAME;
int subframe = SUBFRAME >> 4;
int slot = ((SUBFRAME & 0x0f) << 2) | ((SYMBOL >> 6) & 0x03);
@@ -282,66 +283,45 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid, benetel_t *bs)
}
}
ANT_NUM = 0x00;
// Mask the symbol bits from UL packet received and apply the shift.
SYMBOL = ((SYMBOL & 0b00111111) + 10) % 14;
ANT_NUM = 0x00;
ANT_NUM = a;
SUBFRAME = sf;
if (a == 1)
slot_id_ctrl++;
// Slot id control for DL
if(slot_id_ctrl > 13){
SYMBOL = SYMBOL | 0b01000000;
if (slot_id_ctrl > 13) {
SYMBOL = SYMBOL | 0b01000000;
if (a == 1) {
if (slot_id_ctrl > 27) {
slot_id_ctrl = 0;
sf = sf + 0x10;
if (sf > 0x90){
sf = 0;
}
}
}
}
/* antenna 0 - send actual DL data (if available) */
/* send actual DL data (if available) */
oai_slot = tx_subframe * 2 + tx_slot;
lock_dl_buffer(bs->buffers, oai_slot);
if (!(bs->buffers->dl_busy[oai_slot] & (1 << tx_symbol))) {
printf("%s: warning, DL underflow (sl.symbol %d.%d)\n", __FUNCTION__,
oai_slot, tx_symbol);
if (!(bs->buffers->dl_busy[a][oai_slot] & (1 << tx_symbol))) {
printf("%s: warning, DL underflow (antenna %d sl.symbol %d.%d)\n", __FUNCTION__,
a, oai_slot, tx_symbol);
memset(IQ_ptr, 0, 1272 * 4);
} else {
memcpy(IQ_ptr, bs->buffers->dl[oai_slot] + tx_symbol * 1272*4,
memcpy(IQ_ptr, bs->buffers->dl[a][oai_slot] + tx_symbol * 1272*4,
1272*4);
}
//printf("DL buffer f sf slot symbol %d %d %d %d (sf %d)\n", tx_frame, tx_subframe, tx_slot, tx_symbol, (int)sf);
bs->buffers->dl_busy[oai_slot] &= ~(1 << tx_symbol);
bs->buffers->dl_busy[a][oai_slot] &= ~(1 << tx_symbol);
unlock_dl_buffer(bs->buffers, oai_slot);
// fill DL Data for ant 0 with 0 value
// memset(IQ_ptr, 0, 5088);
}
// U-PLANE UL ANT_1 PROCESSING
if(PAYLOAD_1 == 0x13 && PAYLOAD_2 == 0xe4 && ANT_NUM == 0x01 && dl_start == 1)
{
// Mask the symbol bits from UL packet received and apply the shift.
SYMBOL = ((SYMBOL & 0b00111111) +10) % 14;
ANT_NUM = 0x01;
SUBFRAME = sf;
slot_id_ctrl++;
// Slot id control for DL
if(slot_id_ctrl > 13){
SYMBOL = SYMBOL | 0b01000000;
if(slot_id_ctrl > 27){
slot_id_ctrl = 0;
sf = sf + 0x10;
if (sf >0x90){
sf = 0;
}
}
}
// fill DL Data for ant 1 with 0 value
memset(IQ_ptr, 0, 5088);
}
// U-PLANE PRACH PROCESSING

View File

@@ -35,63 +35,61 @@ printf("store_ul %d.%ld (%ld)\n", (int)(t.tv_sec % 60), t.tv_nsec, t.tv_nsec - o
old = t;
#endif
/* only antenna 0 for the moment */
if (ul->antenna != 0)
return;
int a = ul->antenna;
if (ul->slot != bs->next_slot ||
ul->symbol != bs->next_symbol) {
printf("%s: error, expected frame.sl.symbol %d.%d.%d, got %d.%d.%d\n",
if (ul->slot != bs->next_slot[a] ||
ul->symbol != bs->next_symbol[a]) {
printf("%s: error, antenna %d expected frame.sl.symbol %d.%d.%d, got %d.%d.%d\n",
__FUNCTION__,
bs->expected_benetel_frame, bs->next_slot, bs->next_symbol,
a, bs->expected_benetel_frame[a], bs->next_slot[a], bs->next_symbol[a],
ul->frame, ul->slot, ul->symbol);
}
/* fill missing data with 0s */
while (ul->slot != bs->next_slot ||
ul->symbol != bs->next_symbol) {
lock_ul_buffer(bs->buffers, bs->next_slot);
if (bs->buffers->ul_busy[bs->next_slot] & (1 << bs->next_symbol)) {
printf("%s: warning, UL overflow (sl.symbol %d.%d)\n", __FUNCTION__,
bs->next_slot, bs->next_symbol);
while (ul->slot != bs->next_slot[a] ||
ul->symbol != bs->next_symbol[a]) {
lock_ul_buffer(bs->buffers, bs->next_slot[a]);
if (bs->buffers->ul_busy[a][bs->next_slot[a]] & (1 << bs->next_symbol[a])) {
printf("%s: warning, antenna %d UL overflow (sl.symbol %d.%d)\n", __FUNCTION__,
a, bs->next_slot[a], bs->next_symbol[a]);
}
memset(bs->buffers->ul[bs->next_slot] + bs->next_symbol * 1272*4,
memset(bs->buffers->ul[a][bs->next_slot[a]] + bs->next_symbol[a] * 1272*4,
0, 1272*4);
bs->buffers->ul_busy[bs->next_slot] |= (1 << bs->next_symbol);
signal_ul_buffer(bs->buffers, bs->next_slot);
unlock_ul_buffer(bs->buffers, bs->next_slot);
bs->buffers->ul_busy[a][bs->next_slot[a]] |= (1 << bs->next_symbol[a]);
signal_ul_buffer(bs->buffers, bs->next_slot[a]);
unlock_ul_buffer(bs->buffers, bs->next_slot[a]);
bs->next_symbol++;
if (bs->next_symbol == 14) {
bs->next_symbol = 0;
bs->next_slot = (bs->next_slot + 1) % 20;
if (bs->next_slot == 0) {
bs->expected_benetel_frame++;
bs->expected_benetel_frame &= 255;
bs->next_symbol[a]++;
if (bs->next_symbol[a] == 14) {
bs->next_symbol[a] = 0;
bs->next_slot[a] = (bs->next_slot[a] + 1) % 20;
if (bs->next_slot[a] == 0) {
bs->expected_benetel_frame[a]++;
bs->expected_benetel_frame[a] &= 255;
}
}
}
lock_ul_buffer(bs->buffers, bs->next_slot);
if (bs->buffers->ul_busy[bs->next_slot] & (1 << bs->next_symbol)) {
printf("%s: warning, UL overflow (sl.symbol %d.%d)\n", __FUNCTION__,
bs->next_slot, bs->next_symbol);
lock_ul_buffer(bs->buffers, bs->next_slot[a]);
if (bs->buffers->ul_busy[a][bs->next_slot[a]] & (1 << bs->next_symbol[a])) {
printf("%s: warning, antenna %d UL overflow (sl.symbol %d.%d)\n", __FUNCTION__,
a, bs->next_slot[a], bs->next_symbol[a]);
}
memcpy(bs->buffers->ul[bs->next_slot] + bs->next_symbol * 1272*4,
memcpy(bs->buffers->ul[a][bs->next_slot[a]] + bs->next_symbol[a] * 1272*4,
ul->iq, 1272*4);
bs->buffers->ul_busy[bs->next_slot] |= (1 << bs->next_symbol);
signal_ul_buffer(bs->buffers, bs->next_slot);
unlock_ul_buffer(bs->buffers, bs->next_slot);
bs->buffers->ul_busy[a][bs->next_slot[a]] |= (1 << bs->next_symbol[a]);
signal_ul_buffer(bs->buffers, bs->next_slot[a]);
unlock_ul_buffer(bs->buffers, bs->next_slot[a]);
bs->next_symbol++;
if (bs->next_symbol == 14) {
bs->next_symbol = 0;
bs->next_slot = (bs->next_slot + 1) % 20;
if (bs->next_slot == 0) {
bs->expected_benetel_frame++;
bs->expected_benetel_frame &= 255;
bs->next_symbol[a]++;
if (bs->next_symbol[a] == 14) {
bs->next_symbol[a] = 0;
bs->next_slot[a] = (bs->next_slot[a] + 1) % 20;
if (bs->next_slot[a] == 0) {
bs->expected_benetel_frame[a]++;
bs->expected_benetel_frame[a] &= 255;
}
}
}

View File

@@ -26,9 +26,10 @@
typedef struct {
shared_buffers *buffers;
int next_slot;
int next_symbol;
int expected_benetel_frame;
/* [2] is for two antennas */
int next_slot[2];
int next_symbol[2];
int expected_benetel_frame[2];
char *dpdk_main_command_line;
} benetel_t;

View File

@@ -68,7 +68,8 @@ void *benetel_start_dpdk(char *ifname, shared_buffers *buffers, char *dpdk_main_
bs->buffers = buffers;
bs->expected_benetel_frame = 255;
bs->expected_benetel_frame[0] = 255;
bs->expected_benetel_frame[1] = 255;
bs->dpdk_main_command_line = dpdk_main_command_line;

View File

@@ -45,11 +45,16 @@ void init_buffers(shared_buffers *s)
* needs to have slots 1, 2 and 3, 4 and 5 ready. Let's pretend
* they are ready.
*/
s->dl_busy[1] = 0x3fff;
s->dl_busy[2] = 0x3fff;
s->dl_busy[3] = 0x3fff;
s->dl_busy[4] = 0x3fff;
s->dl_busy[5] = 0x3fff;
s->dl_busy[0][1] = 0x3fff;
s->dl_busy[0][2] = 0x3fff;
s->dl_busy[0][3] = 0x3fff;
s->dl_busy[0][4] = 0x3fff;
s->dl_busy[0][5] = 0x3fff;
s->dl_busy[1][1] = 0x3fff;
s->dl_busy[1][2] = 0x3fff;
s->dl_busy[1][3] = 0x3fff;
s->dl_busy[1][4] = 0x3fff;
s->dl_busy[1][5] = 0x3fff;
}
void lock_dl_buffer(shared_buffers *s, int slot)

View File

@@ -26,10 +26,11 @@
#include <stdint.h>
typedef struct {
unsigned char dl[20][14*1272*4];
unsigned char ul[20][14*1272*4];
uint16_t dl_busy[20];
uint16_t ul_busy[20];
/* [2] is for two antennas */
unsigned char dl[2][20][14*1272*4];
unsigned char ul[2][20][14*1272*4];
uint16_t dl_busy[2][20];
uint16_t ul_busy[2][20];
pthread_mutex_t m_ul[20];
pthread_cond_t c_ul[20];

View File

@@ -230,12 +230,12 @@ RUs = (
local_if_name = "dpdk";
sdr_addrs = "softmodem -m 2048 -l 35 -n 2 -b 0000:81:00.3 --proc-type auto --file-prefix ggg -- -p 0x1";
#sdr_addrs = "softmodem -l 8 -n 2 -- -p 0x2";
remote_address = "127.0.0.2";
local_address = "127.0.0.1";
local_portc = 50000;
remote_portc = 50000;
local_portd = 50001;
remote_portd = 50001;
#remote_address = "127.0.0.2";
#local_address = "127.0.0.1";
#local_portc = 50000;
#remote_portc = 50000;
#local_portd = 50001;
#remote_portd = 50001;
local_rf = "no"
tr_preference = "raw_if4p5"
nb_tx = 1

View File

@@ -23,6 +23,8 @@ gNBs =
ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1;
#pusch_TargetSNRx10 = 200;
#pucch_TargetSNRx10 = 200;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
@@ -48,7 +50,7 @@ gNBs =
#initialDownlinkBWP
#genericParameters
# this is RBstart=84,L=13 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366; //28875; //6366; #6407; #3384;
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
@@ -90,7 +92,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6366; //28875; //6366; #6407; #3384;
initialULBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
@@ -102,8 +104,9 @@ gNBs =
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 74;
zeroCorrelationZoneConfig = 13;
#preambleReceivedTargetPower = -118;
preambleReceivedTargetPower = -104;
preambleReceivedTargetPower = -118;
#preambleReceivedTargetPower = -104;
#preambleReceivedTargetPower = -108;
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
preambleTransMax = 6;
#powerRampingStep
@@ -149,14 +152,16 @@ gNBs =
initialULBWPstartSymbolAndLength_2 = 52;
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
#p0_NominalWithGrant =-90;
p0_NominalWithGrant =-118;
# pucch-ConfigCommon setup :
# pucchGroupHopping
# 0 = neither, 1= group hopping, 2=sequence hopping
pucchGroupHopping = 0;
hoppingId = 40;
p0_nominal = -90;
#p0_nominal = -90;
p0_nominal = -118;
# ssb_PositionsInBurs_BitmapPR
# 1=short, 2=medium, 3=long
ssb_PositionsInBurst_PR = 2;
@@ -189,7 +194,7 @@ gNBs =
nrofUplinkSymbols = 4; //0; //4;
#ssPBCH_BlockPower = 10;
ssPBCH_BlockPower = 10;
ssPBCH_BlockPower = -35;
}
);
@@ -229,9 +234,9 @@ gNBs =
{
GNB_INTERFACE_NAME_FOR_S1_MME = "eth0";
GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.18.195/24";
GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.18.187/24";
GNB_INTERFACE_NAME_FOR_S1U = "eth0";
GNB_IPV4_ADDRESS_FOR_S1U = "192.168.18.195/24";
GNB_IPV4_ADDRESS_FOR_S1U = "192.168.18.187/24";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
GNB_IPV4_ADDRESS_FOR_X2C = "127.0.0.2/24";
GNB_PORT_FOR_X2C = 36422; # Spec 36422
@@ -251,6 +256,7 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
pusch_proc_threads = 8;
}
);

View File

@@ -2986,6 +2986,7 @@ void RCconfig_RU(void) {
RC.ru[j]->if_south = LOCAL_RF;
RC.ru[j]->function = NGFI_RRU_IF4p5;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
RC.ru[j]->has_ctrl_prt =1;
LOG_I(PHY,"Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j);
}
@@ -3039,6 +3040,7 @@ else {
RC.ru[j]->if_south = REMOTE_IF4p5;
RC.ru[j]->function = NGFI_RAU_IF4p5;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
RC.ru[j]->has_ctrl_prt = 1;
if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) RC.ru[j]->is_slave=1;
else RC.ru[j]->is_slave=0;