Commit 3224616a authored by Sakthivel Velumani's avatar Sakthivel Velumani Committed by Sakthivel Velumani

modified dlsim to accept external signal

parent 401aae92
......@@ -209,6 +209,7 @@ int main(int argc, char **argv)
int pusch_tgt_snrx10 = 200;
int pucch_tgt_snrx10 = 200;
int loglvl=OAILOG_INFO;
int file_offset = 0;
//float target_error_rate = 0.01;
int css_flag=0;
......@@ -226,7 +227,7 @@ int main(int argc, char **argv)
FILE *scg_fd=NULL;
while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:e:m:w")) != -1) {
while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:s:S:t:x:y:z:M:N:F:G:R:dPIL:Ea:b:e:m:w")) != -1) {
switch (c) {
case 'f':
scg_fd = fopen(optarg,"r");
......@@ -362,9 +363,14 @@ int main(int argc, char **argv)
printf("Problem with filename %s\n",optarg);
exit(-1);
}
num_rounds = 1;
break;
case 'G':
file_offset = atoi(optarg);
break;
case 'P':
print_perf=1;
opp_enabled=1;
......@@ -677,7 +683,6 @@ int main(int argc, char **argv)
estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
// generate signal
AssertFatal(input_fd==NULL,"Not ready for input signal file\n");
gNB->pbch_configured = 1;
gNB->ssb_pdu.ssb_pdu_rel15.bchPayload=0x001234;
......@@ -714,6 +719,8 @@ int main(int argc, char **argv)
NR_UE_info_t *UE_info = &RC.nrmac[0]->UE_info;
//NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels;
snrRun = 0;
int slot_offset = 0;
int slot_length = 0;
for (SNR = snr0; SNR < snr1; SNR += .2) {
......@@ -793,6 +800,7 @@ int main(int argc, char **argv)
Sched_INFO.TX_req = &gNB_mac->TX_req[0];
nr_schedule_response(&Sched_INFO);
if (input_fd==NULL) {
if (run_initial_sync)
nr_common_signal_procedures(gNB,frame,slot);
else
......@@ -891,6 +899,13 @@ int main(int argc, char **argv)
((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
}
}
} else {
fseek(input_fd,file_offset*sizeof(int16_t)*2,SEEK_SET);
slot_offset = get_samples_slot_timestamp(slot,frame_parms,0);
slot_length = get_samples_per_slot(slot,frame_parms);
fread((void*)&UE->common_vars.rxdata[0][slot_offset],
sizeof(int16_t),slot_length<<1,input_fd);
}
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
nr_ue_scheduled_response(&scheduled_response);
......
......@@ -382,7 +382,7 @@ int configure_fapi_dl_pdu_phytest(int Mod_idP,
dci_pdu_rel15[0].antenna_ports.val = 0; // nb of cdm groups w/o data 1 and dmrs port 0
// dmrs sequence initialization
dci_pdu_rel15[0].dmrs_sequence_initialization.val = pdsch_pdu_rel15->SCID;
LOG_D(MAC, "[gNB scheduler phytest] DCI type 1 payload: freq_alloc %d (%d,%d,%d), time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d\n",
LOG_D(MAC, "[gNB scheduler phytest] DCI type 1 payload: freq_alloc %d (%d,%d,%d), time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d ndi %d rv %d dai %d tpc %d pucch_res_indi %d harq_timing_indi %d\n",
dci_pdu_rel15[0].frequency_domain_assignment.val,
pdsch_pdu_rel15->rbStart,
pdsch_pdu_rel15->rbSize,
......@@ -392,7 +392,11 @@ int configure_fapi_dl_pdu_phytest(int Mod_idP,
dci_pdu_rel15[0].mcs,
dci_pdu_rel15[0].tb_scaling,
dci_pdu_rel15[0].ndi,
dci_pdu_rel15[0].rv);
dci_pdu_rel15[0].rv,
dci_pdu_rel15[0].dai[0].val,
dci_pdu_rel15[0].tpc,
dci_pdu_rel15[0].pucch_resource_indicator,
dci_pdu_rel15[0].pdsch_to_harq_feedback_timing_indicator.val);
NR_SearchSpace_t *ss;
int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
......
......@@ -1002,6 +1002,7 @@ void fill_dci_pdu_rel15(NR_ServingCellConfigCommon_t *scc,
int bwp_id) {
uint8_t fsize=0, pos=0;
LOG_D(MAC,"Number of DL DCIs %d\n",pdcch_pdu_rel15->numDlDci);
for (int d=0;d<pdcch_pdu_rel15->numDlDci;d++) {
......
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