@@ -56,6 +56,15 @@ class ue_grid_allocator_tester : public ::testing::TestWithParam<duplex_mode>
5656 alloc.add_cell (to_du_cell_index (0 ), pdcch_alloc, uci_alloc, res_grid);
5757 }
5858
59+ slot_point get_next_ul_slot (const slot_point starting_slot) const
60+ {
61+ slot_point next_slot = starting_slot + cfg_builder_params.min_k2 ;
62+ while (not cell_cfg.is_fully_ul_enabled (next_slot)) {
63+ ++next_slot;
64+ }
65+ return next_slot;
66+ }
67+
5968 void run_slot ()
6069 {
6170 ++current_slot;
@@ -232,6 +241,7 @@ TEST_P(ue_grid_allocator_tester, allocates_pusch_restricted_to_recommended_max_n
232241 const ue_pusch_grant grant1{.user = &slice_ues[u1.ue_index ],
233242 .cell_index = to_du_cell_index (0 ),
234243 .h_id = to_harq_id (0 ),
244+ .pusch_slot = get_next_ul_slot (current_slot),
235245 .recommended_nof_bytes = recommended_nof_bytes_to_schedule,
236246 .max_nof_rbs = max_nof_rbs_to_schedule};
237247
@@ -255,6 +265,7 @@ TEST_P(ue_grid_allocator_tester, does_not_allocate_pusch_with_all_remaining_rbs_
255265 const ue_pusch_grant grant1{.user = &slice_ues[u1.ue_index ],
256266 .cell_index = to_du_cell_index (0 ),
257267 .h_id = to_harq_id (0 ),
268+ .pusch_slot = get_next_ul_slot (current_slot),
258269 .recommended_nof_bytes = u1.pending_ul_newtx_bytes ()};
259270
260271 const crb_interval cell_crbs = {cell_cfg.ul_cfg_common .init_ul_bwp .generic_params .crbs .start (),
@@ -307,16 +318,20 @@ TEST_P(ue_grid_allocator_tester, no_two_puschs_are_allocated_in_same_slot_for_a_
307318
308319 const ue& u = add_ue (ue_creation_req);
309320
321+ slot_point pusch_slot = get_next_ul_slot (current_slot);
322+
310323 // First PUSCH grant for the UE.
311324 const ue_pusch_grant grant1{.user = &slice_ues[u.ue_index ],
312325 .cell_index = to_du_cell_index (0 ),
313326 .h_id = to_harq_id (0 ),
327+ .pusch_slot = pusch_slot,
314328 .recommended_nof_bytes = nof_bytes_to_schedule};
315329
316330 // Second PUSCH grant for the UE.
317331 const ue_pusch_grant grant2{.user = &slice_ues[u.ue_index ],
318332 .cell_index = to_du_cell_index (0 ),
319333 .h_id = to_harq_id (1 ),
334+ .pusch_slot = pusch_slot,
320335 .recommended_nof_bytes = nof_bytes_to_schedule};
321336
322337 ASSERT_TRUE (run_until ([&]() {
@@ -338,29 +353,30 @@ TEST_P(ue_grid_allocator_tester, consecutive_puschs_for_a_ue_are_allocated_in_in
338353
339354 const ue& u = add_ue (ue_creation_req);
340355
356+ slot_point pusch_slot = get_next_ul_slot (current_slot);
357+
341358 // First PUSCH grant for the UE.
342359 const ue_pusch_grant grant1{.user = &slice_ues[u.ue_index ],
343360 .cell_index = to_du_cell_index (0 ),
344361 .h_id = to_harq_id (0 ),
362+ .pusch_slot = pusch_slot,
345363 .recommended_nof_bytes = nof_bytes_to_schedule};
346364
347365 ASSERT_TRUE (
348366 run_until ([&]() { return alloc.allocate_ul_grant (grant1, dummy_slice_id).status == alloc_status::success; }));
349367 ASSERT_TRUE (run_until ([&]() { return find_ue_pusch (u.crnti , res_grid[0 ].result .ul ) != nullptr ; }));
350- slot_point last_pusch_alloc_slot = current_slot;
351368
352369 run_slot ();
353370
354- // Second PUSCH grant for the UE.
371+ // Second PUSCH grant for the UE trying to allocate PUSCH in a slot previous to grant1 .
355372 const ue_pusch_grant grant2{.user = &slice_ues[u.ue_index ],
356373 .cell_index = to_du_cell_index (0 ),
357374 .h_id = to_harq_id (1 ),
375+ .pusch_slot = pusch_slot - 1 ,
358376 .recommended_nof_bytes = nof_bytes_to_schedule};
359377
360- ASSERT_TRUE (
378+ ASSERT_FALSE (
361379 run_until ([&]() { return alloc.allocate_ul_grant (grant2, dummy_slice_id).status == alloc_status::success; }));
362- ASSERT_TRUE (run_until ([&]() { return find_ue_pusch (u.crnti , res_grid[0 ].result .ul ) != nullptr ; }));
363- ASSERT_GT (current_slot, last_pusch_alloc_slot);
364380}
365381
366382TEST_P (ue_grid_allocator_tester, consecutive_pdschs_for_a_ue_are_allocated_in_increasing_order_of_time)
@@ -493,6 +509,7 @@ TEST_P(ue_grid_allocator_tester, successfully_allocated_pusch_even_with_large_ga
493509 const ue_pusch_grant grant1{.user = &slice_ues[u.ue_index ],
494510 .cell_index = to_du_cell_index (0 ),
495511 .h_id = to_harq_id (0 ),
512+ .pusch_slot = get_next_ul_slot (current_slot),
496513 .recommended_nof_bytes = nof_bytes_to_schedule};
497514
498515 ASSERT_TRUE (
@@ -509,6 +526,7 @@ TEST_P(ue_grid_allocator_tester, successfully_allocated_pusch_even_with_large_ga
509526 const ue_pusch_grant grant2{.user = &slice_ues[u.ue_index ],
510527 .cell_index = to_du_cell_index (0 ),
511528 .h_id = to_harq_id (1 ),
529+ .pusch_slot = get_next_ul_slot (current_slot),
512530 .recommended_nof_bytes = nof_bytes_to_schedule};
513531
514532 ASSERT_TRUE (
@@ -588,15 +606,18 @@ TEST_P(ue_grid_allocator_remaining_rbs_alloc_tester, remaining_ul_rbs_are_alloca
588606
589607 const unsigned recommended_nof_bytes_to_schedule = 200U ;
590608
591- const crb_interval cell_crbs = {cell_cfg.ul_cfg_common .init_ul_bwp .generic_params .crbs .start (),
592- cell_cfg.ul_cfg_common .init_ul_bwp .generic_params .crbs .stop ()};
609+ const crb_interval cell_crbs = {cell_cfg.ul_cfg_common .init_ul_bwp .generic_params .crbs .start (),
610+ cell_cfg.ul_cfg_common .init_ul_bwp .generic_params .crbs .stop ()};
611+ slot_point pusch_to_alloc_slot = get_next_ul_slot (current_slot);
593612 const ue_pusch_grant grant1{.user = &slice_ues[u1.ue_index ],
594613 .cell_index = to_du_cell_index (0 ),
595614 .h_id = to_harq_id (0 ),
615+ .pusch_slot = pusch_to_alloc_slot,
596616 .recommended_nof_bytes = recommended_nof_bytes_to_schedule};
597617 const ue_pusch_grant grant2{.user = &slice_ues[u2.ue_index ],
598618 .cell_index = to_du_cell_index (0 ),
599619 .h_id = to_harq_id (0 ),
620+ .pusch_slot = pusch_to_alloc_slot,
600621 .recommended_nof_bytes = recommended_nof_bytes_to_schedule};
601622
602623 ASSERT_TRUE (run_until ([&]() {
@@ -700,6 +721,7 @@ TEST_P(ue_grid_allocator_expert_cfg_pxsch_nof_rbs_limits_tester,
700721 const ue_pusch_grant grant1{.user = &slice_ues[u1.ue_index ],
701722 .cell_index = to_du_cell_index (0 ),
702723 .h_id = to_harq_id (0 ),
724+ .pusch_slot = get_next_ul_slot (current_slot),
703725 .recommended_nof_bytes = recommended_nof_bytes_to_schedule,
704726 .max_nof_rbs = max_nof_rbs_to_schedule};
705727
@@ -727,6 +749,7 @@ TEST_P(ue_grid_allocator_expert_cfg_pxsch_nof_rbs_limits_tester,
727749 const ue_pusch_grant grant1{.user = &slice_ues[u1.ue_index ],
728750 .cell_index = to_du_cell_index (0 ),
729751 .h_id = to_harq_id (0 ),
752+ .pusch_slot = get_next_ul_slot (current_slot),
730753 .recommended_nof_bytes = recommended_nof_bytes_to_schedule,
731754 .max_nof_rbs = max_nof_rbs_to_schedule};
732755
@@ -787,7 +810,7 @@ TEST_P(ue_grid_allocator_expert_cfg_pxsch_crb_limits_tester, allocates_pdsch_wit
787810 ASSERT_EQ (find_ue_pdsch (u1.crnti , res_grid[0 ].result .dl .ue_grants )->pdsch_cfg .rbs .type1 (), pdsch_vrb_limits);
788811}
789812
790- TEST_P (ue_grid_allocator_expert_cfg_pxsch_crb_limits_tester, allocates_pdsch_within_expert_cfg_pusch_rb_limits )
813+ TEST_P (ue_grid_allocator_expert_cfg_pxsch_crb_limits_tester, allocates_pusch_within_expert_cfg_pusch_rb_limits )
791814{
792815 sched_ue_creation_request_message ue_creation_req =
793816 test_helpers::create_default_sched_ue_creation_request (this ->cfg_builder_params );
@@ -802,6 +825,7 @@ TEST_P(ue_grid_allocator_expert_cfg_pxsch_crb_limits_tester, allocates_pdsch_wit
802825 const ue_pusch_grant grant1{.user = &slice_ues[u1.ue_index ],
803826 .cell_index = to_du_cell_index (0 ),
804827 .h_id = to_harq_id (0 ),
828+ .pusch_slot = get_next_ul_slot (current_slot),
805829 .recommended_nof_bytes = recommended_nof_bytes_to_schedule,
806830 .max_nof_rbs = max_nof_rbs_to_schedule};
807831
0 commit comments