limiting prach search space to number of prachs set in sib2

master
yagoda 5 years ago committed by Justin Tallon
parent 39680ffd26
commit faf1cf6975

@ -93,7 +93,7 @@ typedef struct SRSLTE_API {
uint32_t deadzone; uint32_t deadzone;
float peak_values[65]; float peak_values[65];
uint32_t peak_offsets[65]; uint32_t peak_offsets[65];
uint32_t num_ra_preambles;
srslte_tdd_config_t tdd_config; srslte_tdd_config_t tdd_config;
uint32_t current_prach_idx; uint32_t current_prach_idx;
@ -114,6 +114,7 @@ typedef struct {
uint32_t root_seq_idx; uint32_t root_seq_idx;
uint32_t zero_corr_zone; uint32_t zero_corr_zone;
uint32_t freq_offset; uint32_t freq_offset;
uint32_t num_ra_preambles;
bool hs_flag; bool hs_flag;
srslte_tdd_config_t tdd_config; srslte_tdd_config_t tdd_config;
} srslte_prach_cfg_t; } srslte_prach_cfg_t;

@ -52,7 +52,8 @@ int srslte_prach_set_cell_(srslte_prach_t* p,
uint32_t root_seq_index, uint32_t root_seq_index,
bool high_speed_flag, bool high_speed_flag,
uint32_t zero_corr_zone_config, uint32_t zero_corr_zone_config,
srslte_tdd_config_t* tdd_config); srslte_tdd_config_t* tdd_config,
uint32_t num_ra_preambles);
uint32_t srslte_prach_get_preamble_format(uint32_t config_idx) uint32_t srslte_prach_get_preamble_format(uint32_t config_idx)
{ {
@ -334,7 +335,8 @@ int srslte_prach_set_cfg(srslte_prach_t* p, srslte_prach_cfg_t* cfg, uint32_t no
cfg->root_seq_idx, cfg->root_seq_idx,
cfg->hs_flag, cfg->hs_flag,
cfg->zero_corr_zone, cfg->zero_corr_zone,
&cfg->tdd_config); &cfg->tdd_config,
cfg->num_ra_preambles);
} }
int srslte_prach_init(srslte_prach_t* p, uint32_t max_N_ifft_ul) int srslte_prach_init(srslte_prach_t* p, uint32_t max_N_ifft_ul)
@ -402,7 +404,8 @@ int srslte_prach_set_cell_(srslte_prach_t* p,
uint32_t root_seq_index, uint32_t root_seq_index,
bool high_speed_flag, bool high_speed_flag,
uint32_t zero_corr_zone_config, uint32_t zero_corr_zone_config,
srslte_tdd_config_t* tdd_config) srslte_tdd_config_t* tdd_config,
uint32_t num_ra_preambles)
{ {
int ret = SRSLTE_ERROR; int ret = SRSLTE_ERROR;
if (p != NULL && N_ifft_ul < 2049 && config_idx < 64 && root_seq_index < MAX_ROOTS) { if (p != NULL && N_ifft_ul < 2049 && config_idx < 64 && root_seq_index < MAX_ROOTS) {
@ -418,6 +421,7 @@ int srslte_prach_set_cell_(srslte_prach_t* p,
p->hs = high_speed_flag; p->hs = high_speed_flag;
p->zczc = zero_corr_zone_config; p->zczc = zero_corr_zone_config;
p->detect_factor = PRACH_DETECT_FACTOR; p->detect_factor = PRACH_DETECT_FACTOR;
p->num_ra_preambles = num_ra_preambles;
if (tdd_config) { if (tdd_config) {
p->tdd_config = *tdd_config; p->tdd_config = *tdd_config;
} }
@ -463,7 +467,10 @@ int srslte_prach_set_cell_(srslte_prach_t* p,
// Generate our 64 sequences // Generate our 64 sequences
p->N_roots = 0; p->N_roots = 0;
srslte_prach_gen_seqs(p); srslte_prach_gen_seqs(p);
// Ensure num_ra_preambles is valid, if not assign default value
if (p->num_ra_preambles < 4 || p->num_ra_preambles > 64) {
p->num_ra_preambles = p->N_roots;
}
// Generate sequence FFTs // Generate sequence FFTs
for (int i = 0; i < N_SEQS; i++) { for (int i = 0; i < N_SEQS; i++) {
srslte_dft_run(&p->zc_fft, p->seqs[i], p->dft_seqs[i]); srslte_dft_run(&p->zc_fft, p->seqs[i], p->dft_seqs[i]);
@ -597,7 +604,7 @@ int srslte_prach_detect_offset(srslte_prach_t* p,
memcpy(p->prach_bins, &p->signal_fft[begin], p->N_zc * sizeof(cf_t)); memcpy(p->prach_bins, &p->signal_fft[begin], p->N_zc * sizeof(cf_t));
for (int i = 0; i < p->N_roots; i++) { for (int i = 0; i < p->num_ra_preambles; i++) {
cf_t* root_spec = p->dft_seqs[p->root_seqs_idx[i]]; cf_t* root_spec = p->dft_seqs[p->root_seqs_idx[i]];
srslte_vec_prod_conj_ccc(p->prach_bins, root_spec, p->corr_spec, p->N_zc); srslte_vec_prod_conj_ccc(p->prach_bins, root_spec, p->corr_spec, p->N_zc);

@ -36,7 +36,7 @@ uint32_t nof_prb = 50;
uint32_t config_idx = 3; uint32_t config_idx = 3;
uint32_t root_seq_idx = 0; uint32_t root_seq_idx = 0;
uint32_t zero_corr_zone = 15; uint32_t zero_corr_zone = 15;
uint32_t num_ra_preambles = 0; // use default
void usage(char* prog) void usage(char* prog)
{ {
printf("Usage: %s\n", prog); printf("Usage: %s\n", prog);
@ -87,6 +87,7 @@ int main(int argc, char** argv)
prach_cfg.freq_offset = 0; prach_cfg.freq_offset = 0;
prach_cfg.root_seq_idx = root_seq_idx; prach_cfg.root_seq_idx = root_seq_idx;
prach_cfg.zero_corr_zone = zero_corr_zone; prach_cfg.zero_corr_zone = zero_corr_zone;
prach_cfg.num_ra_preambles = num_ra_preambles;
if (srslte_prach_init(&prach, srslte_symbol_sz(nof_prb))) { if (srslte_prach_init(&prach, srslte_symbol_sz(nof_prb))) {
return -1; return -1;

@ -37,6 +37,7 @@ uint32_t preamble_format = 0;
uint32_t root_seq_idx = 0; uint32_t root_seq_idx = 0;
uint32_t zero_corr_zone = 1; uint32_t zero_corr_zone = 1;
uint32_t n_seqs = 64; uint32_t n_seqs = 64;
uint32_t num_ra_preambles = 0; // use default
void usage(char* prog) void usage(char* prog)
{ {
@ -94,6 +95,7 @@ int main(int argc, char** argv)
prach_cfg.freq_offset = 0; prach_cfg.freq_offset = 0;
prach_cfg.root_seq_idx = root_seq_idx; prach_cfg.root_seq_idx = root_seq_idx;
prach_cfg.zero_corr_zone = zero_corr_zone; prach_cfg.zero_corr_zone = zero_corr_zone;
prach_cfg.num_ra_preambles = num_ra_preambles;
if (srslte_prach_init(&prach, srslte_symbol_sz(nof_prb))) { if (srslte_prach_init(&prach, srslte_symbol_sz(nof_prb))) {
return -1; return -1;

@ -40,6 +40,7 @@ uint32_t frequency_offset = 0;
uint32_t zero_corr_zone = 11; uint32_t zero_corr_zone = 11;
float timeadv = 0; float timeadv = 0;
uint32_t nof_frames = 20; uint32_t nof_frames = 20;
uint32_t num_ra_preambles = 0; // use default
float uhd_rx_gain = 40, uhd_tx_gain = 60, uhd_freq = 2.4e9; float uhd_rx_gain = 40, uhd_tx_gain = 60, uhd_freq = 2.4e9;
char* uhd_args = ""; char* uhd_args = "";
@ -135,6 +136,7 @@ int main(int argc, char** argv)
prach_cfg.freq_offset = 0; prach_cfg.freq_offset = 0;
prach_cfg.root_seq_idx = root_seq_idx; prach_cfg.root_seq_idx = root_seq_idx;
prach_cfg.zero_corr_zone = zero_corr_zone; prach_cfg.zero_corr_zone = zero_corr_zone;
prach_cfg.num_ra_preambles = num_ra_preambles;
if (srslte_prach_init(&prach, srslte_symbol_sz(nof_prb))) { if (srslte_prach_init(&prach, srslte_symbol_sz(nof_prb))) {
return -1; return -1;

@ -37,6 +37,7 @@ struct phy_cell_cfg_t {
double dl_freq_hz; double dl_freq_hz;
double ul_freq_hz; double ul_freq_hz;
uint32_t root_seq_idx; uint32_t root_seq_idx;
uint32_t num_ra_preambles;
}; };
typedef std::vector<phy_cell_cfg_t> phy_cell_cfg_list_t; typedef std::vector<phy_cell_cfg_t> phy_cell_cfg_list_t;

@ -916,6 +916,8 @@ int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_
phy_cell_cfg.cell_id = cfg.cell_id; phy_cell_cfg.cell_id = cfg.cell_id;
phy_cell_cfg.root_seq_idx = cfg.root_seq_idx; phy_cell_cfg.root_seq_idx = cfg.root_seq_idx;
phy_cell_cfg.rf_port = cfg.rf_port; phy_cell_cfg.rf_port = cfg.rf_port;
phy_cell_cfg.num_ra_preambles =
rrc_cfg_->sibs[1].sib2().rr_cfg_common.rach_cfg_common.preamb_info.nof_ra_preambs.to_number();
if (cfg.dl_freq_hz > 0) { if (cfg.dl_freq_hz > 0) {
phy_cell_cfg.dl_freq_hz = cfg.dl_freq_hz; phy_cell_cfg.dl_freq_hz = cfg.dl_freq_hz;

@ -67,7 +67,7 @@ void phy::parse_common_config(const phy_cfg_t& cfg)
prach_cfg.root_seq_idx = cfg.prach_cnfg.root_seq_idx; prach_cfg.root_seq_idx = cfg.prach_cnfg.root_seq_idx;
prach_cfg.zero_corr_zone = cfg.prach_cnfg.prach_cfg_info.zero_correlation_zone_cfg; prach_cfg.zero_corr_zone = cfg.prach_cnfg.prach_cfg_info.zero_correlation_zone_cfg;
prach_cfg.freq_offset = cfg.prach_cnfg.prach_cfg_info.prach_freq_offset; prach_cfg.freq_offset = cfg.prach_cnfg.prach_cfg_info.prach_freq_offset;
prach_cfg.num_ra_preambles = cfg.phy_cell_cfg.at(0).num_ra_preambles;
// DMRS // DMRS
workers_common.dmrs_pusch_cfg.cyclic_shift = cfg.pusch_cnfg.ul_ref_sigs_pusch.cyclic_shift; workers_common.dmrs_pusch_cfg.cyclic_shift = cfg.pusch_cnfg.ul_ref_sigs_pusch.cyclic_shift;
workers_common.dmrs_pusch_cfg.delta_ss = cfg.pusch_cnfg.ul_ref_sigs_pusch.group_assign_pusch; workers_common.dmrs_pusch_cfg.delta_ss = cfg.pusch_cnfg.ul_ref_sigs_pusch.group_assign_pusch;

Loading…
Cancel
Save