Commit d28419cf authored by laurent's avatar laurent

usage of setAllfromTS in also monolitic version, RACH detected to the cu,...

usage of setAllfromTS in also monolitic version, RACH detected to the cu, several bugs fixed, still no attach complete
parent b9079220
This diff is collapsed.
This diff is collapsed.
......@@ -58,13 +58,43 @@ typedef struct {
DCI_ALLOC_t dci_alloc[32];
int num_mdci;
int amp;
int8_t UE_ul_active[NUMBER_OF_UE_MAX];
int8_t UE_ul_first_rb[NUMBER_OF_UE_MAX]; //
int8_t UE_ul_last_rb[NUMBER_OF_UE_MAX]; //
LTE_eNB_PHICH phich_vars;
} fs6_dl_t;
enum pckType {
fs6UlConfig=25,
fs6DlConfig=26,
};
typedef struct {
enum pckType type:8;
uint16_t UE_id;
int8_t harq_pid;
UE_type_t ue_type;
uint16_t harq_mask;
uint16_t nb_rb;
uint8_t Qm;
uint16_t first_rb;
uint8_t V_UL_DAI;
uint8_t srs_active;
uint32_t TBS;
uint8_t Nsymb_pusch;
uint8_t Mlimit;
uint8_t max_turbo_iterations;
uint8_t bundling;
uint16_t beta_offset_cqi_times8;
uint16_t beta_offset_ri_times8;
uint16_t beta_offset_harqack_times8;
uint8_t Msg3_active;
uint16_t rnti;
uint8_t cyclicShift;
uint8_t cooperation_flag;
uint8_t num_active_cba_groups;
uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP];
} fs6_dl_ulsched_t;
typedef struct {
enum pckType type:8;
int UE_id;
int8_t harq_pid;
uint16_t rnti;
......@@ -76,10 +106,17 @@ typedef struct {
uint8_t pdsch_start;
uint8_t sib1_br_flag;
uint16_t i0;
uint32_t rb_alloc[4];
uint32_t rb_alloc[4];;
int dataLen;
} fs6_dl_uespec_t;
typedef struct {
short UE_id;
short harq_id;
short segment;
short segLen;
} fs6_ul_uespec_t;
bool createUDPsock (char *sourceIP, char *sourcePort, char *destIP, char *destPort, UDPsock_t *result);
int receiveSubFrame(UDPsock_t *sock, void *bufferZone, int bufferSize, uint16_t contentType);
int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, uint16_t contentType);
......@@ -92,6 +129,8 @@ int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, ui
#define hDL(xBuf) ((fs6_dl_t*)(((commonUDP_t *)xBuf)+1))
#define hUL(xBuf) ((fs6_ul_t*)(((commonUDP_t *)xBuf)+1))
#define hDLUE(xBuf) ((fs6_dl_uespec_t*) (((fs6_dl_t*)(((commonUDP_t *)xBuf)+1))+1))
#define hTxULUE(xBuf) ((fs6_dl_ulsched_t*) (((fs6_dl_t*)(((commonUDP_t *)xBuf)+1))+1))
#define hULUE(xBuf) ((fs6_ul_uespec_t*) (((fs6_ul_t*)(((commonUDP_t *)xBuf)+1))+1))
static inline size_t alignedSize(uint8_t *ptr) {
commonUDP_t *header=(commonUDP_t *) ptr;
......@@ -102,10 +141,11 @@ static inline void *commonUDPdata(uint8_t *ptr) {
return (void *) (((commonUDP_t *)ptr)+1);
}
void setAllfromTS(uint64_t TS);
void *cu_fs6(void *arg);
void *du_fs6(void *arg);
void fill_rf_config(RU_t *ru, char *rf_config_file);
void rx_rf(RU_t *ru,int *frame,int *subframe);
void rx_rf(RU_t *ru);
void tx_rf(RU_t *ru);
void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe);
void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc);
......@@ -128,5 +168,6 @@ void phy_init_RU(RU_t *);
void feptx_prec(RU_t *);
void feptx_ofdm(RU_t *);
void oai_subframe_ind(uint16_t sfn, uint16_t sf);
void fep_full(RU_t *ru);
extern uint16_t sf_ahead;
#endif
......@@ -649,7 +649,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC));
for (i=0; i<NCS2; i++) {
lev = (int32_t)prach_ifft[(preamble_shift2+i)];
lev = (int32_t)prach_ifft[(preamble_shift2+i)];
avg_en += lev;
levdB = dB_fixed_times10(lev);
......
......@@ -36,6 +36,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#define PRACH_DEBUG
uint16_t NCS_unrestricted[16] = {0,13,15,18,22,26,32,38,46,59,76,93,119,167,279,419};
uint16_t NCS_restricted[15] = {15,18,22,26,32,38,46,55,68,82,100,128,158,202,237}; // high-speed case
uint16_t NCS_4[7] = {2,4,6,8,10,12,15};
......
......@@ -266,15 +266,15 @@ typedef struct {
/// coded RI bits
int16_t q_RI[MAX_RI_PAYLOAD];
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
int16_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
int16_t eE[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Pointer to the payload
uint8_t *b;
uint8_t *bb;
/// Pointers to transport block segments
uint8_t *c[MAX_NUM_ULSCH_SEGMENTS];
/// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15)
uint32_t RTC[MAX_NUM_ULSCH_SEGMENTS];
uint32_t RTCC[MAX_NUM_ULSCH_SEGMENTS];
/// Current Number of Symbols
uint8_t Nsymb_pusch;
/// SRS active flag
......
......@@ -53,9 +53,9 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) {
if (ulsch) {
for (i=0; i<8; i++) {
if (ulsch->harq_processes[i]) {
if (ulsch->harq_processes[i]->b) {
free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
ulsch->harq_processes[i]->b = NULL;
if (ulsch->harq_processes[i]->bb) {
free16(ulsch->harq_processes[i]->bb,MAX_ULSCH_PAYLOAD_BYTES);
ulsch->harq_processes[i]->bb = NULL;
}
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
......@@ -114,10 +114,10 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin
if (ulsch->harq_processes[i]) {
memset(ulsch->harq_processes[i],0,sizeof(LTE_UL_eNB_HARQ_t));
ulsch->harq_processes[i]->b = (uint8_t *)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
ulsch->harq_processes[i]->bb = (uint8_t *)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
if (ulsch->harq_processes[i]->b)
memset(ulsch->harq_processes[i]->b,0,MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
if (ulsch->harq_processes[i]->bb)
memset(ulsch->harq_processes[i]->bb,0,MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
else
exit_flag=3;
......@@ -274,7 +274,7 @@ int ulsch_decoding_data_2thread0(td_params *tdp) {
Kr_bytes = Kr>>3;
memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short));
ulsch_harq->RTC[r] = generate_dummy_w(4+(Kr_bytes*8),
ulsch_harq->RTCC[r] = generate_dummy_w(4+(Kr_bytes*8),
(uint8_t *)&dummy_w[r][0],
(r==0) ? ulsch_harq->F : 0);
#ifdef DEBUG_ULSCH_DECODING
......@@ -286,11 +286,11 @@ int ulsch_decoding_data_2thread0(td_params *tdp) {
ulsch_harq->Nl);
#endif
if (lte_rate_matching_turbo_rx(ulsch_harq->RTC[r],
if (lte_rate_matching_turbo_rx(ulsch_harq->RTCC[r],
G,
ulsch_harq->w[r],
(uint8_t *) &dummy_w[r][0],
ulsch_harq->e+r_offset,
ulsch_harq->eE+r_offset,
ulsch_harq->C,
NSOFT,
0, //Uplink
......@@ -340,7 +340,7 @@ int ulsch_decoding_data_2thread0(td_params *tdp) {
Kr = ulsch_harq->Kplus;
Kr_bytes = Kr>>3;
memcpy(ulsch_harq->b+offset,
memcpy(ulsch_harq->bb+offset,
ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0));
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
......@@ -448,7 +448,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
Kr_bytes = Kr>>3;
memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short));
ulsch_harq->RTC[r] = generate_dummy_w(4+(Kr_bytes*8),
ulsch_harq->RTCC[r] = generate_dummy_w(4+(Kr_bytes*8),
(uint8_t *)&dummy_w[r][0],
(r==0) ? ulsch_harq->F : 0);
#ifdef DEBUG_ULSCH_DECODING
......@@ -461,11 +461,11 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
#endif
start_meas(&eNB->ulsch_rate_unmatching_stats);
if (lte_rate_matching_turbo_rx(ulsch_harq->RTC[r],
if (lte_rate_matching_turbo_rx(ulsch_harq->RTCC[r],
G,
ulsch_harq->w[r],
(uint8_t *) &dummy_w[r][0],
ulsch_harq->e+r_offset,
ulsch_harq->eE+r_offset,
ulsch_harq->C,
NSOFT,
0, //Uplink
......@@ -521,12 +521,12 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
Kr_bytes = Kr>>3;
if (r==0) {
memcpy(ulsch_harq->b,
memcpy(ulsch_harq->bb,
&ulsch_harq->c[0][(ulsch_harq->F>>3)],
Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
} else {
memcpy(ulsch_harq->b+offset,
memcpy(ulsch_harq->bb+offset,
ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0));
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
......@@ -553,7 +553,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
int G = ulsch_harq->G;
unsigned int E;
unsigned int EE;
decoder_if_t *tc;
if (llr8_flag == 0)
......@@ -571,7 +571,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
Kr_bytes = Kr>>3;
memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short));
ulsch_harq->RTC[r] = generate_dummy_w(4+(Kr_bytes*8),
ulsch_harq->RTCC[r] = generate_dummy_w(4+(Kr_bytes*8),
(uint8_t *)&dummy_w[r][0],
(r==0) ? ulsch_harq->F : 0);
#ifdef DEBUG_ULSCH_DECODING
......@@ -584,11 +584,11 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
#endif
start_meas(&eNB->ulsch_rate_unmatching_stats);
if (lte_rate_matching_turbo_rx(ulsch_harq->RTC[r],
if (lte_rate_matching_turbo_rx(ulsch_harq->RTCC[r],
G,
ulsch_harq->w[r],
(uint8_t *) &dummy_w[r][0],
ulsch_harq->e+r_offset,
ulsch_harq->eE+r_offset,
ulsch_harq->C,
NSOFT,
0, //Uplink
......@@ -598,13 +598,13 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
ulsch_harq->Qm,
1,
r,
&E)==-1) {
&EE)==-1) {
LOG_E(PHY,"ulsch_decoding.c: Problem in rate matching\n");
return(-1);
}
stop_meas(&eNB->ulsch_rate_unmatching_stats);
r_offset += E;
r_offset += EE;
start_meas(&eNB->ulsch_deinterleaving_stats);
sub_block_deinterleaving_turbo(4+Kr,
&ulsch_harq->d[r][96],
......@@ -616,6 +616,13 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
else
crc_type = CRC24_B;
if ( getenv("fs6") != NULL && strncasecmp( getenv("fs6"), "du", 2) == 0 ) {
// r is the segment id,
// Kr is the segment length in short
sendFs6Ul(eNB, UE_id, harq_pid, r, &ulsch_harq->d[r][96], Kr*sizeof(int16_t));
return 0;
}
start_meas(&eNB->ulsch_turbo_decoding_stats);
ret = tc(&ulsch_harq->d[r][96],
NULL,
......@@ -645,12 +652,12 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
Kr_bytes = Kr>>3;
if (r==0) {
memcpy(ulsch_harq->b,
memcpy(ulsch_harq->bb,
&ulsch_harq->c[0][(ulsch_harq->F>>3)],
Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
} else {
memcpy(ulsch_harq->b+offset,
memcpy(ulsch_harq->bb+offset,
ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0));
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
......@@ -1190,8 +1197,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
j2+=2;
}
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
}
break;
......@@ -1203,10 +1210,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
j2+=4;
}
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
}
break;
......@@ -1218,12 +1225,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
j2+=6;
}
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++];
}
break;
......@@ -1261,7 +1268,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
*/
int16_t *yp,*ep;
for (iprime=0,yp=&y[j2],ep=&ulsch_harq->e[0];
for (iprime=0,yp=&y[j2],ep=&ulsch_harq->eE[0];
iprime<G;
iprime+=8,j2+=8,ep+=8,yp+=8) {
ep[0] = yp[0];
......
......@@ -1253,6 +1253,7 @@ typedef struct PHY_VARS_eNB_s {
int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240];
int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240];
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
uint8_t *FS6bufferZone;
} PHY_VARS_eNB;
......
......@@ -1417,7 +1417,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) {
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3;
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->b;
pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->bb;
// estimate timing advance for MAC
sync_pos = lte_est_timing_advance_pusch(eNB,UE_id);
timing_advance_update = sync_pos; // - eNB->frame_parms.nb_prefix_samples/4; //to check
......
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