Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracing improvements #1492

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Tracing improvements #1492

wants to merge 8 commits into from

Conversation

andrej
Copy link
Contributor

@andrej andrej commented May 16, 2024

image

This updates the tracing utilities in python/utils/trace.py as well as the tracing parse scripts in progamming_examples/utils.

  • When tracing stream switch "port active"-type events, it was not possible before to select which ports we want to generate events. Those events require additional configuration through another register, and we previously had no way to pass in those additional arguments. I adjusted things slightly, so if you wanted to trace Master Port 3 as stream switch event 2 and slave port 2 as stream switch event 1, you could do this like so now:
    from aie.utils.trace import CoreEvent, PortEvent, configure_simple_tracing_aie2
    # ...
    
    configure_simple_tracing_aie2(
        compute_tile, shim_tile, # ... etc
        events=[
                    PortEvent(CoreEvent.PORT_RUNNING_2, port_number=3, master=True),  
                        # PortEvent is a subclass for the PORT_XXX_0-7 events that configures which port generates events
                    PortEvent(CoreEvent.PORT_RUNNING_1, port_number=2, master=False),
                    CoreEvent.INSTR_LOAD,   
                        # Events that require no further configuration can just use the enum directly
                    22 # <- for backwards compatibility, passing in just the integer instead of enum should still work
                ]
    )
  • Automatically generated enum of all available trace events: python/utils/trace_events_enum.py contains an enumeration of all available tracing events. This is automatically generated from this header file in aie-rt using the new utils/generate_events_enum.py script.
  • I have replaced the enumeration of (a selection of) events in the parsing scripts and replaced it with a use of the above enum. This means all events should now be named correctly in the output trace JSON. This did change the spelling slightly, e.g. instead of "InstrLoad" it would now be called "INSTR_LOAD". If we're attached to CamelCase, I can adjust the script to automatically rename the enum values.

Please let me know what you think.

@fifield
Copy link
Collaborator

fifield commented May 16, 2024

  • Automatically generated enum of all available trace events: python/utils/trace_events_enum.py contains an enumeration of all available tracing events. This is automatically generated from this header file in aie-rt using the new utils/generate_events_enum.py script.

Can you make it work on https://github.com/Xilinx/aie-rt/blob/main-aie/driver/src/events/xaie_events_aieml.h? I think those are the aie2 events.

@andrej
Copy link
Contributor Author

andrej commented May 16, 2024

Good catch, fixed it. I got lucky that the event numbers were mostly the same between AIE1 and 2 but was clearly using the wrong header file

@andrej andrej requested a review from AndraBisca as a code owner May 16, 2024 21:20
@andrej
Copy link
Contributor Author

andrej commented May 16, 2024

Looks like there are some tests that need updating. I will look into this next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants