Commit 2a24f809 authored by 111's avatar 111

add cap period

parent 3fcf6433
......@@ -265,7 +265,7 @@ int nr_cap_srs_signal(PHY_VARS_gNB *gNB,
ric_send_buf = ns_srs_cap->dmrsData;
ric_send_len = 273*12*ant_num*N_symb_SRS*4;//for test
sem_post(&ric_send_sem);
LOG_I(PHY,"sem_post(&ric_send_sem) buf %p, size %d, port %d, ant %d \n\n\n",ric_send_buf,ric_send_len, ns_srs_cap->num_ant_ports, ant_num);
LOG_I(PHY,"sem_post(&ric_send_sem) frame %d %d, buf%p, size %d, port %d, ant %d config %d\n\n\n",ric_send_buf,ric_send_len, ns_srs_cap->num_ant_ports, ant_num, ns_srs_cap->config_index);
g_dmrs_cnt++;
#else
......@@ -276,7 +276,7 @@ int nr_cap_srs_signal(PHY_VARS_gNB *gNB,
}
if (output_fd) {
LOG_I(PHY, "log srs data, ant %d, symbs %d, port %d, size %d\n", frame_parms->nb_antennas_rx, N_symb_SRS, N_ap, sizeof(nr_srs_cap_t)/2);
LOG_I(PHY, "log srs data, ant %d, symbs %d, port %d, size %d, config %d\n", frame_parms->nb_antennas_rx, N_symb_SRS, N_ap, sizeof(nr_srs_cap_t)/2, ns_srs_cap->config_index);
fwrite(&(ns_srs_cap->num_ant_ports),sizeof(int16_t),38+273*12*frame_parms->nb_antennas_rx*N_symb_SRS*2,output_fd);
fclose(output_fd);
}
......@@ -284,4 +284,4 @@ int nr_cap_srs_signal(PHY_VARS_gNB *gNB,
g_dmrs_caps_idx = (g_dmrs_caps_idx+1) % 2;
}
\ No newline at end of file
}
......@@ -104,9 +104,14 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
//printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]);
harq_process->B = A+24;
AssertFatal((A/8)+4 <= max_payload_bytes,"A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,max_payload_bytes);
if ((A/8)+4 <= max_payload_bytes)
{
LOG_I(PHY, "A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,max_payload_bytes);
return -1;
}
//AssertFatal((A/8)+4 <= max_payload_bytes,"A %d is too big (A/8+4 = %d > %d)\n",A,(A/8)+4,max_payload_bytes);
memcpy(harq_process->b,harq_process->a,(A/8)+4);
}
else {
......@@ -119,8 +124,13 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
harq_process->B = A+16;
AssertFatal((A/8)+3 <= max_payload_bytes,"A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,max_payload_bytes);
//AssertFatal((A/8)+3 <= max_payload_bytes,"A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,max_payload_bytes);
if ((A/8)+3 <= max_payload_bytes)
{
LOG_I(PHY, "A %d is too big (A/8+3 = %d > %d)\n",A,(A/8)+3,max_payload_bytes);
return -1;
}
memcpy(harq_process->b,harq_process->a,(A/8)+3); // using 3 bytes to mimic the case of 24 bit crc
}
///////////
......@@ -245,7 +255,8 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
//start_meas(rm_stats);
///////////////////////// d---->| Rate matching bit selection |---->e /////////////////////////
///////////
if (ulsch->pusch_pdu.nrOfLayers <=0)
return -1;
uint32_t E = nr_get_E(G, harq_process->C, mod_order, ulsch->pusch_pdu.nrOfLayers, r);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
......
......@@ -881,8 +881,34 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
generate_srs_nr(srs_pdu, frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, 0, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx);
int srs_est = nr_get_srs_signal(gNB, frame_rx, slot_rx, srs_pdu, gNB->nr_srs_info[i], srs_received_signal);
static int log_first = 0;
static int srs_period = 10;
//if ((log_first == 0) && ((1<<srs_pdu->num_ant_ports)== 2))
if ((log_first %20 == 0) && ((1<<srs_pdu->num_ant_ports) <= 2))
if(log_first == 0)
{
FILE *input_fd=NULL;
int readlen;
input_fd = fopen("output_period.txt","r");
if (input_fd==NULL)
{
LOG_I(PHY, "Error opening0 \n");
}
else
{
char c;
c=fgetc(input_fd);
srs_period = (c - '0')*2;
if (srs_period == 0)
srs_period = 1;
LOG_I(PHY, "srs_period %d\n", srs_period);
fclose(input_fd);
}
}
if (((log_first %srs_period) == 0) && ((1<<srs_pdu->num_ant_ports) <= 2))
{
nr_cap_srs_signal(gNB, frame_rx, slot_rx, srs_pdu, gNB->nr_srs_info[i]);
......
......@@ -775,6 +775,8 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
if (is_cw0_active != ACTIVE && is_cw1_active != ACTIVE)
return false;
if (dlsch[0].Nl <= 0)
return false;
// start ldpc decode for CW 0
dl_harq0->G = nr_get_G(dlsch[0].dlsch_config.number_rbs,
nb_symb_sch,
......
......@@ -599,6 +599,7 @@ void config_srs(const NR_ServingCellConfigCommon_t *scc,
srs_res0->freqHopping.b_SRS = 0;
srs_res0->freqHopping.b_hop = 0;
srs_res0->freqHopping.c_SRS = rrc_get_max_nr_csrs(curr_bwp, srs_res0->freqHopping.b_SRS);
//srs_res0->freqHopping.c_SRS = 9;
srs_res0->groupOrSequenceHopping = NR_SRS_Resource__groupOrSequenceHopping_neither;
if (do_srs) {
srs_res0->resourceType.present = NR_SRS_Resource__resourceType_PR_periodic;
......
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