Commit c2460cc4 authored by yilmazt's avatar yilmazt

executables are compiling

parent 94cf7de8
......@@ -280,10 +280,9 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
uint8_t harq_pid,
uint8_t is_crnti)
{
uint32_t A,E;
uint32_t G;
uint32_t ret,offset;
uint32_t ret, offset;
int32_t no_iteration_ldpc, length_dec;
uint32_t r,r_offset=0,Kr=8424,Kr_bytes,K_bytes_F,err_flag=0;
uint8_t crc_type;
......@@ -301,10 +300,10 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
int16_t z [68*384];
int8_t l [68*384];
uint8_t kc;
uint8_t Ilbrm = 0;
uint32_t Tbslbrm = 950984;
double Coderate = 0.0;
uint8_t kc = 0;
uint8_t Ilbrm = 0;
uint32_t Tbslbrm = 950984;
double Coderate = 0.0;
// ------------------------------------------------------------------
uint16_t nb_rb = nfapi_ulsch_pdu_rel15->number_rbs;
......@@ -521,7 +520,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
write_output("decoder_in.m","dec",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,0);
}
printf("decoder input(segment %d) :",r);
printf("decoder input(segment %u) :", r);
int i;
for (i=0;i<(3*8*Kr_bytes)+12;i++)
printf("%d : %d\n",i,harq_process->d[r][i]);
......@@ -607,7 +606,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
//printf("output decoder %d %d %d %d %d \n", harq_process->c[r][0], harq_process->c[r][1], harq_process->c[r][2],harq_process->c[r][3], harq_process->c[r][4]);
for (int k=0;k<A>>3;k++)
printf("output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]);
printf("no_iterations_ldpc %d (ret %d)\n",no_iteration_ldpc,ret);
printf("no_iterations_ldpc %d (ret %u)\n",no_iteration_ldpc,ret);
//write_output("dec_output.m","dec0",harq_process->c[0],Kr_bytes,1,4);
#endif
......@@ -695,7 +694,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
#ifdef DEBUG_ULSCH_DECODING
printf("Segment %d : Kr= %d bytes\n",r,Kr_bytes);
printf("Segment %u : Kr = %u bytes\n", r, Kr_bytes);
printf("copied %d bytes to b sequence (harq_pid %d)\n",
(Kr_bytes - (harq_process->F>>3)-((harq_process->C>1)?3:0)),harq_pid);
printf("b[0] = %x,c[%d] = %x\n",
......
......@@ -199,12 +199,12 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t eNB_offset,
unsigned char Ns,
unsigned char symbol,
int dmrss,
uint8_t ssb_index,
uint8_t n_hf)
uint8_t eNB_offset,
unsigned char Ns,
unsigned char symbol,
int dmrss,
uint8_t ssb_index,
uint8_t n_hf)
{
int pilot[200] __attribute__((aligned(16)));
unsigned char aarx,p;
......@@ -212,10 +212,10 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
unsigned int pilot_cnt;
int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr;
int ch_offset,symbol_offset;
int slot_pbch;
fapi_nr_pbch_config_t *pbch_config = &ue->nrUE_config.pbch_config;
//int slot_pbch;
//fapi_nr_pbch_config_t *pbch_config = &ue->nrUE_config.pbch_config;
// initialized to 5ms in nr_init_ue for scenarios where UE is not configured (otherwise acquired by cell configuration from gNB or LTE)
uint8_t ssb_periodicity = 10;// ue->ssb_periodicity;
//uint8_t ssb_periodicity = 10;// ue->ssb_periodicity;
//uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
......
......@@ -84,7 +84,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind( const module_id_t module_idP, co
,const uint32_t sourceL2Id
,const uint32_t destinationL2Id
#endif
){mac_rlc_status_resp_t mac_rlc_status_resp; return mac_rlc_status_resp;}
){mac_rlc_status_resp_t mac_rlc_status_resp = {0}; return mac_rlc_status_resp;}
tbs_size_t mac_rlc_data_req(
const module_id_t module_idP,
const rnti_t rntiP,
......@@ -862,7 +862,7 @@ int main(int argc, char **argv)
if (errors_scrambling > 0) {
if (n_trials == 1)
printf("errors_scrambling = %d (trial %d)\n", errors_scrambling, trial);
printf("errors_scrambling = %u (trial %d)\n", errors_scrambling, trial);
}
if (errors_bit > 0) {
......
......@@ -33,30 +33,23 @@
#ifndef __LAYER2_NR_MAC_DEFS_H__
#define __LAYER2_NR_MAC_DEFS_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "platform_types.h"
#include "NR_DRX-Config.h"
#include "NR_SchedulingRequestConfig.h"
#include "NR_BSR-Config.h"
#include "NR_TAG-Config.h"
#include "NR_PHR-Config.h"
#include "NR_RNTI-Value.h"
#include "NR_MIB.h"
#include "NR_MAC-CellGroupConfig.h"
#include "NR_PhysicalCellGroupConfig.h"
#include "NR_SpCellConfig.h"
#include "NR_ServingCellConfig.h"
#include "fapi_nr_ue_interface.h"
#include "NR_IF_Module.h"
#include "PHY/defs_nr_common.h"
#define NB_NR_UE_MAC_INST 1
......@@ -71,13 +64,13 @@ typedef enum {
typedef struct {
//// MAC config
NR_DRX_Config_t *drx_Config;
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
NR_BSR_Config_t *bsr_Config;
NR_TAG_Config_t *tag_Config;
NR_PHR_Config_t *phr_Config;
NR_RNTI_Value_t *cs_RNTI;
NR_MIB_t *mib;
NR_DRX_Config_t *drx_Config;
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
NR_BSR_Config_t *bsr_Config;
NR_TAG_Config_t *tag_Config;
NR_PHR_Config_t *phr_Config;
NR_RNTI_Value_t *cs_RNTI;
NR_MIB_t *mib;
/// Type0-PDCCH seach space
fapi_nr_dl_config_dci_dl_pdu_rel15_t type0_pdcch_dci_config;
......
......@@ -82,6 +82,8 @@ uint8_t table_9_2_2_1[16][8]={
{1,0, 14,4, 0,3,6,9},
{1,0, 14,26,0,3,0,0}
};
int8_t nr_ue_process_dlsch(module_id_t module_id,
int cc_id,
uint8_t gNB_index,
......@@ -217,17 +219,17 @@ int8_t nr_ue_process_dlsch(module_id_t module_id,
return 0;
}
int8_t nr_ue_decode_mib(
UE_nr_rxtx_proc_t *proc,
module_id_t module_id,
int cc_id,
uint8_t gNB_index,
uint8_t extra_bits, // 8bits 38.212 c7.1.1
uint32_t ssb_length,
uint32_t ssb_index,
void *pduP,
uint16_t cell_id ){
int8_t nr_ue_decode_mib(UE_nr_rxtx_proc_t *proc,
module_id_t module_id,
int cc_id,
uint8_t gNB_index,
uint8_t extra_bits, // 8bits 38.212 c7.1.1
uint32_t ssb_length,
uint32_t ssb_index,
void *pduP,
uint16_t cell_id)
{
LOG_I(MAC,"[L2][MAC] decode mib\n");
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
......@@ -435,18 +437,16 @@ int8_t nr_ue_decode_mib(
mac->type0_pdcch_dci_config.coreset.precoder_granularity = PRECODER_GRANULARITY_SAME_AS_REG_BUNDLE;
mac->type0_pdcch_dci_config.coreset.pdcch_dmrs_scrambling_id = cell_id;
// type0-pdcch search space
float big_o;
float big_m;
uint32_t temp;
SFN_C_TYPE sfn_c; // only valid for mux=1
uint32_t n_c;
uint32_t number_of_search_space_per_slot;
uint32_t first_symbol_index;
uint32_t search_space_duration; // element of search space
uint32_t coreset_duration; // element of coreset
SFN_C_TYPE sfn_c = SFN_C_MOD_2_EQ_0; // only valid for mux=1
uint32_t n_c = 0;
uint32_t number_of_search_space_per_slot = 0;
uint32_t first_symbol_index = 0;
uint32_t search_space_duration; // element of search space
uint32_t coreset_duration; // element of coreset
// 38.213 table 10.1-1
......@@ -496,7 +496,7 @@ int8_t nr_ue_decode_mib(
// 38.213 Table 13-13
AssertFatal(index_4lsb == 0, "38.213 Table 13-13 4 LSB out of range\n");
// PDCCH monitoring occasions (SFN and slot number) same as SSB frame-slot
// sfn_c = SFN_C_EQ_SFN_SSB;
//sfn_c = SFN_C_EQ_SFN_SSB;
n_c = get_ssb_slot(ssb_index);
switch(ssb_index & 0x3){ // ssb_index(i) mod 4
case 0:
......@@ -518,7 +518,7 @@ int8_t nr_ue_decode_mib(
// 38.213 Table 13-14
AssertFatal(index_4lsb == 0, "38.213 Table 13-14 4 LSB out of range\n");
// PDCCH monitoring occasions (SFN and slot number) same as SSB frame-slot
// sfn_c = SFN_C_EQ_SFN_SSB;
//sfn_c = SFN_C_EQ_SFN_SSB;
n_c = get_ssb_slot(ssb_index);
switch(ssb_index & 0x7){ // ssb_index(i) mod 8
case 0:
......@@ -560,7 +560,7 @@ int8_t nr_ue_decode_mib(
// 38.213 Table 13-15
AssertFatal(index_4lsb == 0, "38.213 Table 13-15 4 LSB out of range\n");
// PDCCH monitoring occasions (SFN and slot number) same as SSB frame-slot
// sfn_c = SFN_C_EQ_SFN_SSB;
//sfn_c = SFN_C_EQ_SFN_SSB;
n_c = get_ssb_slot(ssb_index);
switch(ssb_index & 0x3){ // ssb_index(i) mod 4
case 0:
......@@ -597,8 +597,8 @@ int8_t nr_ue_decode_mib(
mac->type0_pdcch_ss_n_c = n_c;
// fill in the elements in config request inside P5 message
mac->phy_config.Mod_id = module_id;
mac->phy_config.CC_id = cc_id;
mac->phy_config.Mod_id = module_id;
mac->phy_config.CC_id = cc_id;
mac->phy_config.config_req.pbch_config.system_frame_number = frame; // after calculation
mac->phy_config.config_req.pbch_config.subcarrier_spacing_common = mac->mib->subCarrierSpacingCommon;
......@@ -620,7 +620,6 @@ int8_t nr_ue_decode_mib(
}
// TODO: change to UE parameter, scs: 15KHz, slot duration: 1ms
uint32_t get_ssb_frame(uint32_t test){
return test;
......
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