Compare commits

...

6 Commits

Author SHA1 Message Date
Florian Kaltenberger
98e7558dce timestamp should be int64_t 2019-12-18 17:03:51 +01:00
Florian Kaltenberger
2def2ee405 fixing return value 2019-12-18 16:11:15 +01:00
Florian Kaltenberger
fa7fd716ca quering events of tx streamer after trx_write and writing them to a new VCD variable 2019-12-18 14:02:08 +01:00
Florian Kaltenberger
31429d5d02 trx_usrp_stats can now be used to query the tx streamer for events (this function existed already but was not implemented). with this we can now query from the softmodem the error codes that UHD writes on the screen (U,L,O,S,...) 2019-12-18 14:02:08 +01:00
Florian Kaltenberger
d3f380138f fixing comment 2019-12-18 14:02:08 +01:00
Florian Kaltenberger
7f9c483ffe increasing DL slots to 11 2019-12-18 11:55:17 +01:00
12 changed files with 78 additions and 37 deletions

View File

@@ -248,7 +248,8 @@ const char* eurecomVariablesNames[] = {
"slot_number_TX1_gNB",
"slot_number_RX0_gNB",
"slot_number_RX1_gNB",
"ru_tx_ofdm_mask"
"ru_tx_ofdm_mask",
"trx_write_event"
};
const char* eurecomFunctionsNames[] = {

View File

@@ -226,6 +226,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK,
VCD_SIGNAL_DUMPER_VARIABLES_RU_TRX_WRITE_EVENT,
VCD_SIGNAL_DUMPER_VARIABLES_END

View File

@@ -76,7 +76,7 @@ typedef struct {
#define VCD_NUM_FUNCTIONS (245)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (186)
#define VCD_NUM_VARIABLES (187)
/* 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)

View File

@@ -2055,6 +2055,11 @@ ID = VCD_VARIABLE_RU_TX_OFDM_MASK
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = ru_tx_ofdm_mask
ID = VCD_VARIABLE_RU_TRX_WRITE_EVENT
DESC = VCD variable RU_TRX_WRITE_EVENT
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = trx_write_event
#functions

View File

@@ -555,8 +555,8 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
abstime.tv_sec += 1;
}
// wake up TX for subframe n+sl_ahead
// lock the TX mutex and make sure the thread is ready
// wake up RX for subframe n
// lock the RX mutex and make sure the thread is ready
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe

View File

@@ -300,7 +300,7 @@ int connect_rau(RU_t *ru)
/* Southbound Fronthaul functions, RCC/RAU */
// southbound IF5 fronthaul for 16-bit OAI format
static inline void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
static inline void fh_if5_south_out(RU_t *ru, int frame, int slot, int64_t timestamp)
{
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
@@ -308,7 +308,7 @@ static inline void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t time
}
// southbound IF5 fronthaul for Mobipass packet format
static inline void fh_if5_mobipass_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
static inline void fh_if5_mobipass_south_out(RU_t *ru, int frame, int slot, int64_t timestamp)
{
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
@@ -316,7 +316,7 @@ static inline void fh_if5_mobipass_south_out(RU_t *ru, int frame, int slot, uint
}
// southbound IF4p5 fronthaul
static inline void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
static inline void fh_if4p5_south_out(RU_t *ru, int frame, int slot, int64_t timestamp)
{
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
@@ -716,7 +716,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
}
void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
void tx_rf(RU_t *ru,int frame,int slot, int64_t timestamp) {
RU_proc_t *proc = &ru->proc;
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
//nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config;
@@ -728,16 +728,16 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
int sf_extension = 0;
//nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame,frame);
if ((slot == 0) ||
(slot == 1) || IS_SOFTMODEM_RFSIM ) {
if (((slot >= 0) &&
(slot <= 10)) || IS_SOFTMODEM_RFSIM ) {
int siglen=fp->samples_per_slot;
int flags;
if (slot==0)
flags = 2;
else if (slot==1)
else if (slot==10)
flags=3;
else
flags=4;
flags=1;
/*
if (SF_type == SF_S) {
@@ -782,6 +782,9 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %u/%d)\n", txs, siglen);
int event = ru->rfdevice.trx_get_stats_func(&ru->rfdevice);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RU_TRX_WRITE_EVENT, event );
}
}

View File

@@ -278,7 +278,7 @@ int nr_dlsch_encoding(unsigned char *a,
unsigned int G;
unsigned int crc=1;
uint8_t harq_pid = dlsch->harq_ids[frame&2][slot];
uint8_t harq_pid = dlsch->harq_ids[frame%2][slot];
AssertFatal(harq_pid<8 && harq_pid>=0,"illegal harq_pid %d\b",harq_pid);
nfapi_nr_dl_config_dlsch_pdu_rel15_t rel15 = dlsch->harq_processes[harq_pid]->dlsch_pdu.dlsch_pdu_rel15;
uint16_t nb_rb = rel15.n_prb;
@@ -339,7 +339,7 @@ int nr_dlsch_encoding(unsigned char *a,
dlsch->harq_processes[harq_pid]->B = A+24;
// dlsch->harq_processes[harq_pid]->b = a;
AssertFatal((A/8)+4 <= MAX_DLSCH_PAYLOAD_BYTES,"A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,MAX_DLSCH_PAYLOAD_BYTES);
AssertFatal((A/8)+4 <= MAX_NR_DLSCH_PAYLOAD_BYTES,"A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,MAX_NR_DLSCH_PAYLOAD_BYTES);
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4); // why is this +4 if the CRC is only 3 bytes?
}
@@ -354,7 +354,7 @@ int nr_dlsch_encoding(unsigned char *a,
dlsch->harq_processes[harq_pid]->B = A+16;
// dlsch->harq_processes[harq_pid]->b = a;
AssertFatal((A/8)+3 <= MAX_DLSCH_PAYLOAD_BYTES,"A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,MAX_DLSCH_PAYLOAD_BYTES);
AssertFatal((A/8)+3 <= MAX_NR_DLSCH_PAYLOAD_BYTES,"A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,MAX_NR_DLSCH_PAYLOAD_BYTES);
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+3); // using 3 bytes to mimic the case of 24 bit crc
}

View File

@@ -508,7 +508,7 @@ typedef struct RU_t_s {
/// function pointer to synchronous RX fronthaul function (RRU,3GPP_eNB/3GPP_gNB)
void (*fh_south_in)(struct RU_t_s *ru, int *frame, int *subframe);
/// function pointer to synchronous TX fronthaul function
void (*fh_south_out)(struct RU_t_s *ru, int frame_tx, int tti_tx, uint64_t timestamp_tx);
void (*fh_south_out)(struct RU_t_s *ru, int frame_tx, int tti_tx, int64_t timestamp_tx);
/// function pointer to synchronous RX fronthaul function (RRU)
void (*fh_north_in)(struct RU_t_s *ru, int *frame, int *subframe);
/// function pointer to synchronous RX fronthaul function (RRU)

View File

@@ -376,10 +376,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
// Phytest scheduling
if (slot_rxP==2){
nr_schedule_uss_ulsch_phytest(&RC.nrmac[module_idP]->UL_tti_req[0], frame_rxP, slot_rxP);
//nr_schedule_uss_ulsch_phytest(&RC.nrmac[module_idP]->UL_tti_req[0], frame_rxP, slot_rxP);
}
if (slot_txP==1){
if (slot_txP>=1 && slot_txP<=10){
nr_schedule_uss_dlsch_phytest(module_idP, frame_txP, slot_txP,NULL);
}

View File

@@ -178,13 +178,13 @@ int configure_fapi_dl_Tx(nfapi_nr_dl_config_request_body_t *dl_req,
nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &dl_config_dci_pdu->dci_dl_pdu.pdcch_params_rel15;
nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_pdu_rel15 = &dl_config_dlsch_pdu->dlsch_pdu.dlsch_pdu_rel15;
dlsch_pdu_rel15->start_prb = 0;
dlsch_pdu_rel15->n_prb = 50;
dlsch_pdu_rel15->n_prb = 100;
dlsch_pdu_rel15->start_symbol = 2;
dlsch_pdu_rel15->nb_symbols = 9;
dlsch_pdu_rel15->rnti = rnti;
dlsch_pdu_rel15->nb_layers =1;
dlsch_pdu_rel15->nb_codewords = 1;
dlsch_pdu_rel15->mcs_idx = 9;
dlsch_pdu_rel15->mcs_idx = 26;
dlsch_pdu_rel15->ndi = 1;
dlsch_pdu_rel15->redundancy_version = 0;

View File

@@ -36,6 +36,7 @@
#endif
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/version.hpp>
#include <uhd/types/metadata.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/thread.hpp>
@@ -923,7 +924,42 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_
* \returns 0 on success
*/
int trx_usrp_get_stats(openair0_device *device) {
return(0);
usrp_state_t *s = (usrp_state_t*) device->priv;
uhd::async_metadata_t async_metadata;
if(s->tx_stream->recv_async_msg(async_metadata,0.0001))
{
switch(async_metadata.event_code) {
case uhd::async_metadata_t::EVENT_CODE_BURST_ACK:
//A burst was successfully transmitted.
return(0);
case uhd::async_metadata_t::EVENT_CODE_UNDERFLOW:
//An internal send buffer has emptied.
return(1);
case uhd::async_metadata_t::EVENT_CODE_SEQ_ERROR:
//Packet loss between host and device.
return(2);
case uhd::async_metadata_t::EVENT_CODE_TIME_ERROR:
//Packet had time that was late.
return(3);
case uhd::async_metadata_t::EVENT_CODE_UNDERFLOW_IN_PACKET:
//Underflow occurred inside a packet.
return(4);
case uhd::async_metadata_t::EVENT_CODE_SEQ_ERROR_IN_BURST:
//Packet loss within a burst.
return(5);
case uhd::async_metadata_t::EVENT_CODE_USER_PAYLOAD:
//Some kind of custom user payload.
return(6);
default:
return(-1);
}
}
else
{
return(-1);
}
}
/*! \brief Reset the USRP statistics

View File

@@ -1,15 +1,15 @@
[*]
[*] GTKWave Analyzer v3.3.61 (w)1999-2014 BSI
[*] Tue Dec 17 15:31:51 2019
[*] Wed Dec 18 15:51:03 2019
[*]
[dumpfile] "/tmp/gNB.vcd"
[dumpfile_mtime] "Tue Dec 17 15:25:49 2019"
[dumpfile_size] 6343431
[savefile] "/home/wangts/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw"
[timestart] 1517712000
[size] 1920 1018
[pos] -9 -33
*-19.276148 1518358451 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[dumpfile] "/tmp/gnb.vcd"
[dumpfile_mtime] "Wed Dec 18 15:47:52 2019"
[dumpfile_size] 135231061
[savefile] "/home/kaltenbe/openairinterface5g_ue/targets/RT/USER/gNB_usrp.gtkw"
[timestart] 85978147000
[size] 1853 904
[pos] -1 -1
*-20.180098 85981340000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[sst_width] 386
[signals_width] 344
[sst_expanded] 1
@@ -17,13 +17,8 @@
@28
functions.trx_read
functions.trx_write
@420
variables.frame_number_TX0_UE[63:0]
variables.frame_number_TX1_UE[63:0]
@28
functions.ue_gain_control
@420
variables.frame_number_RX1_UE[63:0]
@8420
variables.trx_write_event[63:0]
@24
variables.trx_ts_ue[63:0]
variables.trx_ts[63:0]