Commit deab4aa2 authored by Raymond Knopp's avatar Raymond Knopp

debugging with USRP

parent a60e7013
...@@ -2491,6 +2491,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2491,6 +2491,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
if (subframe==9) { if (subframe==9) {
subframe=0; subframe=0;
frame++; frame++;
frame&=1023;
} }
else subframe++; else subframe++;
...@@ -2512,62 +2513,34 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2512,62 +2513,34 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
rxs = openair0.trx_read_func(&openair0, rxs = openair0.trx_read_func(&openair0,
&proc->timestamp_rx, &proc->timestamp_rx,
rxp, rxp,
fp->samples_per_tti>>1, fp->samples_per_tti,
fp->nb_antennas_rx); fp->nb_antennas_rx);
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023; proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_tti*10))&1023;
proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10; proc->subframe_rx = (proc->timestamp_rx / fp->samples_per_tti)%10;
if (proc->first_rx == 0) if (proc->first_rx == 0) {
AssertFatal(proc->subframe_rx == subframe, "Received Timestamp doesn't correspond to the time we think it is"); AssertFatal(proc->subframe_rx == subframe, "Received Timestamp doesn't correspond to the time we think it is (proc->subframe_rx %d, subframe %d)",proc->subframe_rx,subframe);
AssertFatal(proc->frame_rx == frame, "Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)",proc->frame_rx,frame);
}
else else
proc->first_rx = 0; proc->first_rx = 0;
// printf("timestamp_rx %lu, frame %d(%d), subframe %d(%d)\n",proc->timestamp_rx,proc->frame_rx,frame,proc->subframe_rx,subframe);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, frame ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX_ENB, frame );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, subframe ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX_ENB, subframe );
if (frame > 20){
if (rxs != fp->samples_per_tti>>1)
exit_fun( "problem receiving samples" );
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
// wake up TX thread if (rxs != fp->samples_per_tti)
// lock the TX mutex and make sure the thread is ready exit_fun( "problem receiving samples" );
if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX thread %d (IC %d)\n", proc->instance_cnt_tx );
exit_fun( "error locking mutex_tx" );
return;
}
int cnt_tx = ++proc->instance_cnt_tx;
// We have just received and processed the common part of the first slot of a subframe, say n.
// TX_rx is the last received timestamp (start of 1st slot), TX_tx is the desired
// transmitted timestamp of the next TX slot (first).
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
// we want to generate subframe (n+3), so TS_tx = TX_rx+3*samples_per_tti,
// and proc->subframe_tx = proc->subframe_rx+3
proc->timestamp_tx = proc->timestamp_rx + (3*fp->samples_per_tti);
proc->frame_tx = (subframe > 6) ? (frame+1) : frame;
proc->subframe_tx = (subframe + 3)%10;
pthread_mutex_unlock( &proc->mutex_tx );
if (cnt_tx == 0){ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
// the thread was presumably waiting where it should and can now be woken up
if (pthread_cond_signal(&proc->cond_tx) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TX thread\n");
exit_fun( "ERROR pthread_cond_signal" );
return;
}
} else {
LOG_W( PHY,"[eNB] Frame %d, eNB TX thread busy!! (cnt_tx %i)\n", frame, cnt_tx );
exit_fun( "TX thread busy" );
return;
}
// now do common RX processing for first slot in subframe // now do common RX processing for first slot in subframe
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
remove_7_5_kHz(eNB,subframe<<1); remove_7_5_kHz(eNB,subframe<<1);
for (l=0; l<fp->symbols_per_tti/2; l++) remove_7_5_kHz(eNB,1+(subframe<<1));
for (l=0; l<fp->symbols_per_tti/2; l++) {
slot_fep_ul(fp, slot_fep_ul(fp,
&eNB->common_vars, &eNB->common_vars,
l, l,
...@@ -2575,35 +2548,18 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2575,35 +2548,18 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
0, 0,
0 0
); );
if (eNB->node_function == NGFI_RRU_IF4) {
//send_IF4(eNB,subframe<<1);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0);
for (i=0; i<fp->nb_antennas_rx; i++)
rxp[i] = (void*)&eNB->common_vars.rxdata[0][i][(fp->samples_per_tti>>1)+(subframe*fp->samples_per_tti)];
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
rxs = openair0.trx_read_func(&openair0,
&proc->timestamp_rx,
rxp,
fp->samples_per_tti>>1,
fp->nb_antennas_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,1);
remove_7_5_kHz(eNB,(subframe<<1)+1);
for (l=0; l<fp->symbols_per_tti/2; l++)
slot_fep_ul(fp, slot_fep_ul(fp,
&eNB->common_vars, &eNB->common_vars,
l, l,
(subframe<<1)+1, 1+(subframe<<1),
0, 0,
0 0
); );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0); }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_SLOT_FEP,0);
if (eNB->node_function == NGFI_RRU_IF4) { if (eNB->node_function == NGFI_RRU_IF4) {
//send_IF4(eNB,subframe<<1);
//send_IF4(eNB,(subframe<<1)+1); //send_IF4(eNB,(subframe<<1)+1);
} }
......
...@@ -174,6 +174,8 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -174,6 +174,8 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
{ {
usrp_state_t *s = (usrp_state_t*)device->priv; usrp_state_t *s = (usrp_state_t*)device->priv;
s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate); s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate);
if(flags) if(flags)
s->tx_md.has_time_spec = true; s->tx_md.has_time_spec = true;
else else
......
...@@ -28,7 +28,7 @@ eNBs = ...@@ -28,7 +28,7 @@ eNBs =
tdd_config_s = 0; tdd_config_s = 0;
prefix_type = "NORMAL"; prefix_type = "NORMAL";
eutra_band = 7; eutra_band = 7;
downlink_frequency = 2680000000L; downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
N_RB_DL = 25; N_RB_DL = 25;
...@@ -64,15 +64,15 @@ eNBs = ...@@ -64,15 +64,15 @@ eNBs =
srs_ackNackST =; srs_ackNackST =;
srs_MaxUpPts =;*/ srs_MaxUpPts =;*/
pusch_p0_Nominal = -90; pusch_p0_Nominal = -96;
pusch_alpha = "AL1"; pusch_alpha = "AL1";
pucch_p0_Nominal = -96; pucch_p0_Nominal = -103;
msg3_delta_Preamble = 6; msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3"; pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0"; pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0"; pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0"; pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64; rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE"; rach_preamblesGroupAConfig = "DISABLE";
...@@ -82,7 +82,7 @@ eNBs = ...@@ -82,7 +82,7 @@ eNBs =
rach_messagePowerOffsetGroupB = ; rach_messagePowerOffsetGroupB = ;
*/ */
rach_powerRampingStep = 4; rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -108; rach_preambleInitialReceivedTargetPower = -104;
rach_preambleTransMax = 10; rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10; rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48; rach_macContentionResolutionTimer = 48;
...@@ -130,7 +130,7 @@ eNBs = ...@@ -130,7 +130,7 @@ eNBs =
}; };
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.11"; mme_ip_address = ( { ipv4 = "127.0.0.3";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -139,11 +139,11 @@ eNBs = ...@@ -139,11 +139,11 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0"; ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
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