File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010#include " core/common/config_reader.h"
1111#include " core/common/message.h"
12+ #include " core/common/query_requests.h"
1213#include " core/common/time.h"
1314#include " core/common/utils.h"
1415#include " core/include/xrt/xrt_hw_context.h"
@@ -494,6 +495,21 @@ class hw_context_impl : public std::enable_shared_from_this<hw_context_impl>
494495 msg.append (dump_file_name);
495496 xrt_core::message::send (xrt_core::message::severity_level::debug, " xrt_hw_context" , msg);
496497 }
498+
499+ std::vector<char >
500+ get_aie_coredump () const
501+ {
502+ try {
503+ return xrt_core::device_query<xrt_core::query::aie_coredump>(m_core_device,
504+ m_hdl->get_slotidx ());
505+ }
506+ catch (const xrt_core::query::no_such_key&) {
507+ throw std::runtime_error (" AIE coredump is not supported on this platform" );
508+ }
509+ catch (const std::exception& e) {
510+ throw std::runtime_error (" Failed to get AIE coredump: " + std::string (e.what ()));
511+ }
512+ }
497513};
498514
499515} // xrt
@@ -693,6 +709,13 @@ hw_context::
693709~hw_context ()
694710{}
695711
712+ std::vector<char >
713+ hw_context::
714+ get_aie_coredump () const
715+ {
716+ return get_handle ()->get_aie_coredump ();
717+ }
718+
696719} // xrt
697720
698721// //////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -348,7 +348,9 @@ enum class key_type
348348 noop,
349349
350350 xocl_errors_ex,
351- xocl_ex_error_code2string
351+ xocl_ex_error_code2string,
352+
353+ aie_coredump
352354};
353355
354356struct pcie_vendor : request
@@ -4374,6 +4376,16 @@ struct read_trace_data : request
43744376 virtual std::any
43754377 get (const device*, const std::any&) const override = 0 ;
43764378};
4379+
4380+ // Used for getting AIE coredump of all tiles within a ctx
4381+ struct aie_coredump : request
4382+ {
4383+ using result_type = std::vector<char >;
4384+ static const key_type key = key_type::aie_coredump;
4385+
4386+ std::any
4387+ get (const device*, const std::any&) const override = 0 ;
4388+ };
43774389} // query
43784390
43794391} // xrt_core
Original file line number Diff line number Diff line change @@ -262,6 +262,15 @@ class hw_context : public detail::pimpl<hw_context_impl>
262262 access_mode
263263 get_mode () const ;
264264
265+ /* *
266+ * get_aie_coredump() - Returns the coredump of AIE Array if available.
267+ * Coredump represents memory/register dump of AIE tiles in this ctx.
268+ * This function can throw.
269+ */
270+ XRT_API_EXPORT
271+ std::vector<char >
272+ get_aie_coredump () const ;
273+
265274public:
266275 // / @cond
267276 // Undocumented internal access to low level context handle
You can’t perform that action at this time.
0 commit comments