Skip to content

Commit

Permalink
Fixing AIE2PS patching issue (#8620)
Browse files Browse the repository at this point in the history
* fixing patching issue for aie2ps

* adding comments to the code

* adding comments to the code

---------

Co-authored-by: ch vamshi krishna <[email protected]>
  • Loading branch information
chvamshi-xilinx and ch vamshi krishna authored Nov 26, 2024
1 parent f093392 commit 81077cb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/runtime_src/core/common/api/xrt_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,20 @@ class module_elf : public module_impl
patcher::buf_type buf_type = patcher::buf_type::ctrltext;

auto symbol_type = static_cast<patcher::symbol_type>(rela->r_addend);
arg2patcher.emplace(std::move(generate_key_string(argnm, buf_type)), patcher{ symbol_type, {{ctrlcode_offset, 0}}, buf_type});
std::string key_string = generate_key_string(argnm, buf_type);

// One arg may need to be patched at multiple offsets of control code
// arg2patcher map contains a key & value pair of arg & patcher object
// patcher object uses m_ctrlcode_patchinfo vector to store multiple offsets
// this vector size would be equal to number of places which needs patching
// On first occurrence of arg, Create a new patcher object and
// Initialize the m_ctrlcode_patchinfo vector of the single patch_info structure
// On all further occurences of arg, add patch_info structure to existing vector

if (auto search = arg2patcher.find(key_string); search != arg2patcher.end())
search->second.m_ctrlcode_patchinfo.emplace_back(patcher::patch_info{ctrlcode_offset, 0, 0});
else
arg2patcher.emplace(std::move(key_string), patcher{ symbol_type, {{ctrlcode_offset, 0}}, buf_type});
}
}

Expand Down

0 comments on commit 81077cb

Please sign in to comment.