AIESW-36100: fix 'default' as filename in dtrace probe for config elfs#306
AIESW-36100: fix 'default' as filename in dtrace probe for config elfs#306HimanshuChoudhary-Xilinx wants to merge 1 commit into
Conversation
Signed-off-by: Himanshu Choudhary <Himanshu.Choudhary@amd.com>
| constexpr uint32_t byte_to_bits = 8; | ||
| constexpr uint32_t shim_bd_len = 9; | ||
| constexpr opcode_type align_opcode = 0xA5; | ||
| const std::string default_source_filename = "default"; |
There was a problem hiding this comment.
warning: initialization of 'default_source_filename' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
const std::string default_source_filename = "default";
^Additional context
/usr/include/c++/13/bits/basic_string.h:640: possibly throwing constructor declared here
basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
^| const file_artifact* m_artifacts = nullptr; | ||
| uint32_t m_control_packet_index = 0xFFFFFFFF; | ||
| uint32_t m_control_packet_offset_correction = 8; | ||
| std::string m_source_filename = default_source_filename; |
There was a problem hiding this comment.
warning: member variable 'm_source_filename' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::string m_source_filename = default_source_filename;
^There was a problem hiding this comment.
Pull request overview
This PR fixes debug/dtrace metadata so that when building aie2ps_config (full ELF) inputs, the generated dump/debug map uses the actual ASM filename from ctrl_code_file (instead of the placeholder "default"). It threads a “source filename” through the aie2ps preprocessor into the ASM parser, and updates golden test artifacts accordingly.
Changes:
- Add a
source_filenamefield to aie2ps preprocessor inputs (populated fromctrl_code_filefor config flows) and pass it intoasm_parser::parse_lines(...). - Track the current parse file index in
asm_parserand use it when inserting syntheticeofentries so dumps map back to the correct file. - Add/adjust tests and golden outputs for both config and target flows (config should show real file path; target remains
"default").
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/aie4-ctrlcode/move_ddr_to_memtile_ctrlpkt/gold.md5 | Update golden hash for changed probe output. |
| test/aie4-ctrlcode/move_ddr_to_memtile_ctrlpkt/gold_trace_probe.txt | Golden probe output now shows actual filename (test.asm) instead of default. |
| test/aie4-ctrlcode/move_ddr_to_memtile_ctrlpkt/gold_opcode_info.txt | Golden opcode metadata updated to expected filename. |
| test/aie2ps-ctrlcode/ctrlcode_filename/target/gold_debug_map.json | New golden: target flow expects "default" filenames. |
| test/aie2ps-ctrlcode/ctrlcode_filename/target/CMakeLists.txt | New ctest targets for target-flow filename behavior. |
| test/aie2ps-ctrlcode/ctrlcode_filename/ml_asm/merged_control.asm | New minimal ASM source used by filename tests. |
| test/aie2ps-ctrlcode/ctrlcode_filename/config/gold_debug_map.json | New golden: config flow expects ctrl_code_file path in "file". |
| test/aie2ps-ctrlcode/ctrlcode_filename/config/config.json | New config fixture providing ctrl_code_file. |
| test/aie2ps-ctrlcode/ctrlcode_filename/config/CMakeLists.txt | New ctest targets for config-flow filename behavior. |
| test/aie2ps-ctrlcode/ctrlcode_filename/CMakeLists.txt | Adds config/target subdirectories to tests. |
| test/aie2ps-ctrlcode/CMakeLists.txt | Registers the new ctrlcode_filename test suite. |
| src/cpp/preprocessor/asm/asm_parser.h | API updates: pass source filename into parse_lines, store current parse file index. |
| src/cpp/preprocessor/asm/asm_parser.cpp | Implements parse_lines(source_filename) and uses current file idx for synthetic eof. |
| src/cpp/preprocessor/aie2ps/aie2ps_preprocessor.h | Passes input source filename into parser; updates pager default file idx. |
| src/cpp/preprocessor/aie2ps/aie2ps_preprocessor_input.h | Adds source_filename to inputs; populates it from config ctrl_code_file. |
| src/cpp/common/utils.h | Defines default_source_filename constant used as the fallback. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const uint32_t parse_file_idx = intern_filename(file); | ||
| m_current_parse_file_idx = parse_file_idx; | ||
| // Scan str for newlines directly instead of copying it into an istringstream |
Problem solved by the commit
fix: https://jira.xilinx.com/browse/AIESW-36100
aiebu dont know the filename for asm passed in buffer, so it put "default" as file in dump section.
But in case of full elf, user pass config.json in buffer. ASM filename is there in config.json which aiebu reads, so it knows the file name and should use this in dump section.
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
How problem was solved, alternative solutions (if any) and why they were rejected
Risks (if any) associated the changes in the commit
What has been tested and how, request additional testing if necessary
Documentation impact (if any)
TEST Added/fixed