@@ -384,6 +384,47 @@ elf_io_test_bo_set(device* dev, const std::string& xclbin_name) :
384384 }
385385}
386386
387+ elf_full_io_test_bo_set::
388+ elf_full_io_test_bo_set (device* dev, const std::string& xclbin_name)
389+ : io_test_bo_set_base(dev, xclbin_name)
390+ {
391+ auto elf_path = get_xclbin_path (dev, xclbin_name.c_str ());
392+ m_elf = xrt::elf (elf_path);
393+ auto mod = xrt::module {m_elf};
394+ auto kernel_name = get_kernel_name (dev, xclbin_name.c_str ());
395+
396+ try {
397+ m_kernel_index = module_int::get_ctrlcode_id (mod, kernel_name);
398+ } catch (const std::exception& e) {
399+ m_kernel_index = module_int::no_ctrl_code_id;
400+ }
401+
402+ for (int i = 0 ; i < IO_TEST_BO_MAX_TYPES; i++) {
403+ auto & ibo = m_bo_array[i];
404+ auto type = static_cast <io_test_bo_type>(i);
405+
406+ switch (type) {
407+ case IO_TEST_BO_CMD:
408+ alloc_cmd_bo (ibo, m_dev);
409+ break ;
410+ case IO_TEST_BO_INSTRUCTION:
411+ create_ctrl_bo_from_elf (ibo, patcher::buf_type::ctrltext);
412+ break ;
413+ case IO_TEST_BO_INPUT:
414+ create_data_bo_from_file (ibo, " ifm.bin" , m_FLAG_OPT);
415+ break ;
416+ case IO_TEST_BO_PARAMETERS:
417+ create_data_bo_from_file (ibo, " wts.bin" , m_FLAG_OPT);
418+ break ;
419+ case IO_TEST_BO_OUTPUT:
420+ create_data_bo_from_file (ibo, " ofm.bin" , m_FLAG_NO_FILL|m_FLAG_OPT);
421+ break ;
422+ default :
423+ break ;
424+ }
425+ }
426+ }
427+
387428elf_preempt_io_test_bo_set::
388429elf_preempt_io_test_bo_set (device* dev, const std::string& xclbin_name)
389430 : io_test_bo_set_base(dev, xclbin_name)
@@ -605,6 +646,30 @@ init_cmd(hw_ctx& hwctx, bool dump)
605646 patcher::buf_type::ctrltext, m_elf, module_int::no_ctrl_code_id);
606647}
607648
649+ void
650+ elf_full_io_test_bo_set::
651+ init_cmd (hw_ctx& hwctx, bool dump)
652+ {
653+ exec_buf ebuf (*m_bo_array[IO_TEST_BO_CMD].tbo .get (), ERT_START_DPU);
654+
655+ xrt_core::cuidx_type cu_idx{0 };
656+ ebuf.set_cu_idx (cu_idx);
657+
658+ if (m_bo_array[IO_TEST_BO_INPUT].tbo .get ()) {
659+ ebuf.add_arg_64 (3 );
660+ ebuf.add_arg_bo (*m_bo_array[IO_TEST_BO_INPUT].tbo .get (), " 0" );
661+ ebuf.add_arg_bo (*m_bo_array[IO_TEST_BO_PARAMETERS].tbo .get (), " 1" );
662+ ebuf.add_arg_bo (*m_bo_array[IO_TEST_BO_OUTPUT].tbo .get (), " 2" );
663+ }
664+
665+ if (dump)
666+ ebuf.dump ();
667+
668+ ebuf.add_ctrl_bo (*m_bo_array[IO_TEST_BO_INSTRUCTION].tbo .get ());
669+ ebuf.patch_ctrl_code (*m_bo_array[IO_TEST_BO_INSTRUCTION].tbo .get (),
670+ patcher::buf_type::ctrltext, m_elf, m_kernel_index);
671+ }
672+
608673void
609674elf_preempt_io_test_bo_set::
610675init_cmd (hw_ctx& hwctx, bool dump)
@@ -883,6 +948,32 @@ get_preemption_checkpoints()
883948 return 0 ;
884949}
885950
951+ void
952+ io_test_bo_set_base::
953+ cache_cmd_header ()
954+ {
955+ auto cbo = m_bo_array[IO_TEST_BO_CMD].tbo .get ();
956+ if (!cbo)
957+ return ;
958+ auto pkt = reinterpret_cast <ert_packet *>(cbo->map ());
959+ if (!m_cached_cmd_header)
960+ m_cached_cmd_header = pkt->header ;
961+ }
962+
963+ void
964+ io_test_bo_set_base::
965+ restore_cmd_header ()
966+ {
967+ auto cbo = m_bo_array[IO_TEST_BO_CMD].tbo .get ();
968+ if (!cbo || !m_cached_cmd_header)
969+ return ;
970+
971+ auto pkt = reinterpret_cast <ert_packet *>(cbo->map ());
972+ pkt->header = m_cached_cmd_header;
973+ pkt->state = ERT_CMD_STATE_NEW;
974+ std::atomic_thread_fence (std::memory_order_seq_cst);
975+ }
976+
886977unsigned long
887978elf_preempt_io_test_bo_set::
888979get_preemption_checkpoints ()
0 commit comments