Commit d8ee1189 authored by Sakthivel Velumani's avatar Sakthivel Velumani

More updates

gNB and UE runs without crashing; PBCH not decoding though
parent 460a75db
...@@ -334,7 +334,7 @@ void fh_if5_south_in(RU_t *ru, ...@@ -334,7 +334,7 @@ void fh_if5_south_in(RU_t *ru,
recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL); recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL);
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023; proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe; uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe;
proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame); proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->tti_rx != *tti) { if (proc->tti_rx != *tti) {
...@@ -506,7 +506,7 @@ void fh_if5_north_asynch_in(RU_t *ru,int *frame,int *slot) { ...@@ -506,7 +506,7 @@ void fh_if5_north_asynch_in(RU_t *ru,int *frame,int *slot) {
// printf("Received subframe %d (TS %llu) from RCC\n",tti_tx,timestamp_tx); // printf("Received subframe %d (TS %llu) from RCC\n",tti_tx,timestamp_tx);
frame_tx = (timestamp_tx / (fp->samples_per_subframe*10))&1023; frame_tx = (timestamp_tx / (fp->samples_per_subframe*10))&1023;
uint32_t idx_sf = timestamp_tx / fp->samples_per_subframe; uint32_t idx_sf = timestamp_tx / fp->samples_per_subframe;
tti_tx = (idx_sf * fp->slots_per_subframe + (int)round((timestamp_tx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame); tti_tx = (idx_sf * fp->slots_per_subframe + (int)round((float)(timestamp_tx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
if (proc->first_tx != 0) { if (proc->first_tx != 0) {
*slot = tti_tx; *slot = tti_tx;
...@@ -667,7 +667,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { ...@@ -667,7 +667,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
ru->ts_offset = proc->timestamp_rx; ru->ts_offset = proc->timestamp_rx;
proc->timestamp_rx = 0; proc->timestamp_rx = 0;
} else { } else {
if (proc->timestamp_rx - old_ts != samples_per_slot) { if (proc->timestamp_rx - old_ts != fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp)) {
LOG_D(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - samples_per_slot,ru->ts_offset); LOG_D(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - samples_per_slot,ru->ts_offset);
ru->ts_offset += (proc->timestamp_rx - old_ts - samples_per_slot); ru->ts_offset += (proc->timestamp_rx - old_ts - samples_per_slot);
proc->timestamp_rx = ts-ru->ts_offset; proc->timestamp_rx = ts-ru->ts_offset;
...@@ -676,7 +676,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { ...@@ -676,7 +676,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023; proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe; uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe;
proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame); proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
// synchronize first reception to frame 0 subframe 0 // synchronize first reception to frame 0 subframe 0
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n", LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n",
ru->idx, ru->idx,
......
...@@ -240,7 +240,7 @@ static void UE_synch(void *arg) { ...@@ -240,7 +240,7 @@ static void UE_synch(void *arg) {
if (nr_initial_sync( &syncD->proc, UE, UE->mode,2) == 0) { if (nr_initial_sync( &syncD->proc, UE, UE->mode,2) == 0) {
freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync
hw_slot_offset = ((UE->rx_offset<<1) / UE->frame_parms.samples_per_subframe * UE->frame_parms.slots_per_subframe) + hw_slot_offset = ((UE->rx_offset<<1) / UE->frame_parms.samples_per_subframe * UE->frame_parms.slots_per_subframe) +
round(((UE->rx_offset<<1) % UE->frame_parms.samples_per_subframe)/UE->frame_parms.samples_per_slot0); round((float)((UE->rx_offset<<1) % UE->frame_parms.samples_per_subframe)/UE->frame_parms.samples_per_slot0);
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %d (DL %lu, UL %lu), UE_scan_carrier %d\n", LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %d (DL %lu, UL %lu), UE_scan_carrier %d\n",
hw_slot_offset, hw_slot_offset,
freq_offset, freq_offset,
......
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