@brief Setup the kernel @note The function will create an elf file from the ctrl_seq @note The function will also update the module, elf, and kernel
| 104 | ///@note The function will create an elf file from the ctrl_seq |
| 105 | ///@note The function will also update the module, elf, and kernel |
| 106 | void _setup_kernel(){ |
| 107 | char* elf_buf; |
| 108 | this->kernel.reset(); |
| 109 | this->module.reset(); |
| 110 | this->elf.reset(); |
| 111 | std::pair<uint32_t*, size_t> data = this->ctrl_seq->dump(); |
| 112 | assert(data.first != nullptr); |
| 113 | assert(data.second > 0); |
| 114 | uint32_t elf_buf_size = this->_gen_elf(&elf_buf, data); |
| 115 | if (this->module_valid){ |
| 116 | this->module.reset(); |
| 117 | this->elf.reset(); |
| 118 | this->kernel.reset(); |
| 119 | } |
| 120 | this->elf = std::make_unique<xrt::elf>(elf_buf, elf_buf_size); |
| 121 | this->module = std::make_unique<xrt::module>(*this->elf); |
| 122 | this->kernel = std::make_unique<xrt::ext::kernel>(*this->context, *this->module, this->kernel_name); |
| 123 | this->module_valid = true; |
| 124 | this->module_version = this->ctrl_seq->sequence_version(); |
| 125 | |
| 126 | free((void*)elf_buf); |
| 127 | } |
| 128 | |
| 129 | public: |
| 130 | // enum ert_cmd_state { |
no test coverage detected