Commit 874c165f authored by Florian Kaltenberger's avatar Florian Kaltenberger

WIP

parent 8c2df1d3
......@@ -22,7 +22,7 @@
#include "PHY/NR_TRANSPORT/nr_transport.h"
//#define NR_PSS_DEBUG
#define NR_PSS_DEBUG
int nr_generate_pss( int16_t *d_pss,
int32_t **txdataF,
......@@ -52,7 +52,7 @@ int nr_generate_pss( int16_t *d_pss,
}
#ifdef NR_PSS_DEBUG
write_output("d_pss.m", "d_pss", (void*)d_pss, NR_PSS_LENGTH, 1, 1);
write_output("d_pss.m", "d_pss", (void*)d_pss, NR_PSS_LENGTH, 1, 0);
#endif
/// Resource mapping
......@@ -75,7 +75,7 @@ int nr_generate_pss( int16_t *d_pss,
}
#ifdef NR_PSS_DEBUG
write_output("pss_0.m", "pss_0", (void*)txdataF[0][2*l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
write_output("pss_0.m", "pss_0", (void*)&txdataF[0][2*l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
#endif
return 0;
......
......@@ -197,13 +197,15 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
* sync_pos SS/PBCH block
*/
cnt++;
if (cnt >100){
cnt =0;
if (1){
cnt =0;
/* process pss search on received buffer */
sync_pos = pss_synchro_nr(ue, NO_RATE_CHANGE);
sync_pos_slot = (frame_parms->samples_per_tti>>1) - 3*(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples);
sync_pos = sync_pos_slot+frame_parms->nb_prefix_samples;
if (sync_pos >= frame_parms->nb_prefix_samples)
sync_pos2 = sync_pos - frame_parms->nb_prefix_samples;
else
......
......@@ -35,7 +35,7 @@
#include "PHY/sse_intrin.h"
//#include "SIMULATION/TOOLS/sim.h"
//#define DEBUG_PBCH 1
#define DEBUG_PBCH 1
//#define DEBUG_PBCH_ENCODING
#ifdef OPENAIR2
......@@ -247,6 +247,9 @@ void nr_pbch_channel_compensation(int **rxdataF_ext,
uint8_t output_shift)
{
short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
uint16_t rb,nb_rb=20;
uint8_t aatx,aarx;
#if defined(__x86_64__) || defined(__i386__)
......@@ -552,8 +555,10 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
for (symbol=5; symbol<8; symbol++) {
#ifdef DEBUG_PBCH
//printf("address dataf %p",nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF);
//write_output("rxdataF0_pbch.m","rxF0pbch",nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF,frame_parms->ofdm_symbol_size*4,2,1);
write_output("rxdataF0_pbch.m","rxF0pbch",nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF,frame_parms->ofdm_symbol_size*4,2,1);
#endif
nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF,
nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].dl_ch_estimates[eNB_id],
......@@ -583,8 +588,10 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
symbol,
log2_maxh); // log2_maxh+I0_shift
//write_output("rxdataF_comp.m","rxFcomp",nr_ue_pbch_vars->rxdataF_comp,180,2,1);
#ifdef DEBUG_PBCH
write_output("rxdataF_comp.m","rxFcomp",nr_ue_pbch_vars->rxdataF_comp,180,2,1);
#endif
/*if (frame_parms->nb_antennas_rx > 1)
pbch_detection_mrc(frame_parms,
nr_ue_pbch_vars->rxdataF_comp,
......
......@@ -57,6 +57,8 @@
*
*********************************************************************/
#define DBG_PSS_NR
void *get_idft(int ofdm_symbol_size)
{
void (*idft)(int16_t *,int16_t *, int);
......@@ -791,18 +793,6 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
/* Correlation computation is based on a a dot product which is realized thank to SIMS extensions */
for (n=0; n < length; n+=4) {
#ifdef RTAI_ENABLED
// This is necessary since the sync takes a long time and it seems to block all other threads thus screwing up RTAI. If we pause it for a little while during its execution we give RTAI a chance to catch up with its other tasks.
if ((n%frame_parms->samples_per_subframe == 0) && (n>0) && (openair_daq_vars.sync_state==0)) {
#ifdef DEBUG_PHY
msg("[SYNC TIME] pausing for 1000ns, n=%d\n",n);
#endif
rt_sleep(nano2count(1000));
}
#endif
for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) {
pss_corr_ue[pss_index][n] = 0; /* clean correlation for position n */
......
......@@ -32,7 +32,7 @@ extern char fmageren_name2[512];
extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
#include "PHY/LTE_TRANSPORT/transport_extern.h"
//#include "PHY/LTE_TRANSPORT/transport_extern.h"
extern int number_of_cards;
......
......@@ -117,6 +117,8 @@ int main(int argc, char **argv)
int frame_length_complex_samples_no_prefix;
NR_DL_FRAME_PARMS *frame_parms;
nfapi_nr_config_request_t *gNB_config;
int ret;
cpuf = get_cpu_freq_GHz();
......@@ -309,6 +311,9 @@ int main(int argc, char **argv)
}
}
if (snr1set==0)
snr1 = snr0+10;
gNB2UE = new_channel_desc_scm(n_tx,
n_rx,
channel_model,
......@@ -443,6 +448,9 @@ int main(int argc, char **argv)
if (gNB->frame_parms.nb_antennas_tx>1)
LOG_M("rxsig1.m","rxs1", UE->common_vars.rxdata[1],frame_length_complex_samples,1,1);
}
ret = nr_initial_sync(UE, normal_txrx);
printf("nr_initial_sync1 returns %d\n",ret);
} //noise trials
......
......@@ -806,10 +806,10 @@ void tx_rf(RU_t *ru) {
for (i=0; i<ru->nb_tx; i++)
txp[i] = (void*)&ru->common.txdata[i][(proc->subframe_tx*fp->samples_per_subframe)-sf_extension];
/*if (proc->subframe_tx == 0){
if (proc->subframe_tx == 0){
write_output("txdataF_frame.m","txdataF_frame",&ru->common.txdataF_BF[i],fp->samples_per_subframe_wCP, 1, 1);
write_output("txdata_frame.m","txdata_frame",&ru->common.txdata[i],fp->samples_per_subframe, 1, 1);
}*/
}
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_tx-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
......
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