- fixing pmch file test for standard LTE rates

- adding special value for MTCH stop
- adding error messages for config values incompatible with MBMS
master
yagoda 6 years ago committed by Andre Puschmann
parent 4b01a2e4a0
commit 3842beab0f

@ -223,25 +223,27 @@ public:
typedef enum {
/* Values of LCID for DL-SCH */
SCELL_ACTIVATION = 0b11011,
CON_RES_ID = 0b11100,
TA_CMD = 0b11101,
DRX_CMD = 0b11110,
CON_RES_ID = 0b11100,
TA_CMD = 0b11101,
DRX_CMD = 0b11110,
/* Values of LCID for UL-SCH */
PHR_REPORT_EXT = 0b11001,
PHR_REPORT = 0b11010,
CRNTI = 0b11011,
TRUNC_BSR = 0b11100,
SHORT_BSR = 0b11101,
LONG_BSR = 0b11110,
PHR_REPORT = 0b11010,
CRNTI = 0b11011,
TRUNC_BSR = 0b11100,
SHORT_BSR = 0b11101,
LONG_BSR = 0b11110,
/* Values of LCID for MCH */
MTCH_MAX_LCID = 0b11100,
MTCH_MAX_LCID = 0b11100,
MCH_SCHED_INFO = 0b11110,
/*MTCH STOP Value*/
MTCH_STOP_EMPTY = 0b11111111111,
/* Common */
PADDING = 0b11111,
SDU = 0b00000
SDU = 0b00000
} cetype;
// Size of MAC CEs

@ -454,13 +454,17 @@ int sch_subh::get_bsr(uint32_t buff_size[4])
bool sch_subh::get_next_mch_sched_info(uint8_t *lcid_, uint16_t *mtch_stop)
{
uint16_t mtch_stop_ce;
if(payload) {
nof_mch_sched_ce = nof_bytes/2;
if (cur_mch_sched_ce < nof_mch_sched_ce) {
*lcid_ = (payload[cur_mch_sched_ce * 2] & 0xF8) >> 3;
*mtch_stop = ((uint16_t)(payload[cur_mch_sched_ce * 2] & 0x07)) << 8;
*mtch_stop += payload[cur_mch_sched_ce * 2 + 1];
mtch_stop_ce = ((uint16_t)(payload[cur_mch_sched_ce * 2] & 0x07)) << 8;
mtch_stop_ce += payload[cur_mch_sched_ce * 2 + 1];
cur_mch_sched_ce++;
*mtch_stop = (mtch_stop_ce == srslte::mch_subh::MTCH_STOP_EMPTY)
? (0)
: (mtch_stop_ce);
return true;
}
}
@ -613,8 +617,11 @@ bool sch_subh::set_ta_cmd(uint8_t ta_cmd)
bool sch_subh::set_next_mch_sched_info(uint8_t lcid_, uint16_t mtch_stop)
{
if (((sch_pdu*)parent)->has_space_ce(2, true)) {
w_payload_ce[nof_mch_sched_ce*2] = (lcid_&0x1F) << 3 | (uint8_t) ((mtch_stop&0x0700)>>8);
w_payload_ce[nof_mch_sched_ce*2+1] = (uint8_t) (mtch_stop&0xff);
uint16_t mtch_stop_ce =
(mtch_stop) ? (mtch_stop) : (srslte::mch_subh::MTCH_STOP_EMPTY);
w_payload_ce[nof_mch_sched_ce * 2] =
(lcid_ & 0x1F) << 3 | (uint8_t)((mtch_stop_ce & 0x0700) >> 8);
w_payload_ce[nof_mch_sched_ce * 2 + 1] = (uint8_t)(mtch_stop_ce & 0xff);
nof_mch_sched_ce++;
lcid = MCH_SCHED_INFO;
((sch_pdu*)parent)->update_space_ce(2, true);

@ -159,7 +159,7 @@ int main(int argc, char **argv) {
exit(-1);
}
parse_args(argc,argv);
srslte_use_standard_symbol_size(false);
if (base_init()) {
ERROR("Error initializing memory\n");
exit(-1);
@ -215,9 +215,9 @@ int main(int argc, char **argv) {
srslte_pdsch_res_t pdsch_res;
pdsch_res.payload = data;
ret = srslte_ue_dl_decode_pmch(&ue_dl, &dl_sf, &pmch_cfg, &pdsch_res);
if (ret >= 0) {
if (pdsch_res.crc == 1) {
printf("PMCH Decoded OK!\n");
} else if (ret < 0) {
} else if (pdsch_res.crc == 0) {
printf("Error decoding PMCH\n");
}

@ -663,14 +663,14 @@ void mac::build_mch_sched(uint32_t tbs)
int last_mtch_stop = 0;
if(total_bytes_to_tx >= total_space_avail_bytes){
if (total_bytes_to_tx >= total_space_avail_bytes) {
for(uint32_t i = 0; i < mch.num_mtch_sched;i++){
double ratio = mch.mtch_sched[i].lcid_buffer_size/total_bytes_to_tx;
float assigned_sfs = floor(sfs_per_sched_period*ratio);
mch.mtch_sched[i].stop = last_mtch_stop + (uint32_t)assigned_sfs;
last_mtch_stop = mch.mtch_sched[i].stop;
}
}else {
} else {
for(uint32_t i = 0; i < mch.num_mtch_sched;i++){
float assigned_sfs = ceil(((float)mch.mtch_sched[i].lcid_buffer_size)/((float)bytes_per_sf));
mch.mtch_sched[i].stop = last_mtch_stop + (uint32_t)assigned_sfs;
@ -694,8 +694,10 @@ int mac::get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_t* dl_sched_res)
build_mch_sched(mcs_data.tbs);
mch.mcch_payload = mcch_payload_buffer;
mch.current_sf_allocation_num = 1;
Info("MCH Sched Info: LCID: %d, Stop: %d, tti is %d \n", mch.mtch_sched[0].lcid, mch.mtch_sched[0].stop, tti);
phy_h->set_mch_period_stop(mch.mtch_sched[0].stop);
Info("MCH Sched Info: LCID: %d, Stop: %d, tti is %d \n",
mch.mtch_sched[0].lcid, mch.mtch_sched[mch.num_mtch_sched - 1].stop,
tti);
phy_h->set_mch_period_stop(mch.mtch_sched[mch.num_mtch_sched - 1].stop);
for(uint32_t i = 0; i < mch.num_mtch_sched; i++) {
mch.pdu[i].lcid = srslte::sch_subh::MCH_SCHED_INFO;
// mch.mtch_sched[i].lcid = 1+i;

@ -536,6 +536,26 @@ int main(int argc, char* argv[])
exit(1);
}
if (args.expert.mbms_service > -1) {
if (!args.expert.phy.interpolate_subframe_enabled) {
fprintf(stderr, "interpolate_subframe_enabled = %d, While using MBMS, "
"please set interpolate_subframe_enabled to true\n",
args.expert.phy.interpolate_subframe_enabled);
exit(1);
}
if (args.expert.phy.nof_phy_threads > 2) {
fprintf(stderr, "nof_phy_threads = %d, While using MBMS, please set "
"number of phy threads to 1 or 2\n",
args.expert.phy.nof_phy_threads);
exit(1);
}
if ((0 == args.expert.phy.snr_estim_alg.find("refs"))) {
fprintf(stderr, "snr_estim_alg = refs, While using MBMS, please set "
"algorithm to pss or empty \n");
exit(1);
}
}
metricshub.init(ue, args.expert.metrics_period_secs);
metricshub.add_listener(&metrics_screen);
metrics_screen.set_ue_handle(ue);

Loading…
Cancel
Save