-
Notifications
You must be signed in to change notification settings - Fork 111
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
Refactor address generation code in dataflow_api.h into seperate header #18257
base: main
Are you sure you want to change the base?
Conversation
853895c
to
194ba02
Compare
194ba02
to
4ab4c99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Please make sure device perf passes:
https://github.com/tenstorrent/tt-metal/actions/workflows/perf-device-models.yaml
It would also be great if you can make sure:
https://github.com/tenstorrent/tt-metal/actions/workflows/t3000-profiler-tests.yaml
https://github.com/tenstorrent/tt-metal/actions/workflows/blackhole-post-commit.yaml
stay green
…h --> dataflow_api_common.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for doing this.
Problem description
hw/inc/dataflow_api.h
currently interleaves address generation helper functions and classes (InterleavedAddrGen
, etc) and public async NoC APIS (e.g.noc_async_read
) together.This is specifically a blocker for writing profiling instrumentation macros within
dataflow_api.h
that need to write to DRAM via NoC themselves (#16494). The profiling macros use of InterleavedAddrGen must be fully defined before parsingdataflow_api.h
, either necessitating (A) duplicating address generation code's functionality or (B) refactoring to break the circular dependency.The degree of code duplication needed to implement (A) is very high and likely to be a maintenance burden/bug factory, so (B) seems the better option.
Absolutely open to changing naming, dir structure, you name it. I just need address generation
include
-able separately from the rest of thenoc_async_
API.What's changed
hw/inc/dataflow_api.h
code is now split into two parts:dataflow_api.h
anddataflow_api_addrgen.h
dataflow_api.h
now depends ondataflow_api_addrgen.h
noc_async_read
indataflow_api_addrgen.h
is required to make this split work. This requires code that usesInterleavedAddrGen::noc_async_read()
to also include `dataflow_api.h as well. This is not required within kernel_profiler.hpp for instance.dataflow_api_addrgen.h
. This wasn't strictly necessary to unblock Kernel profiler based NoC event tracing #16494, but I think its better structured.tools/profiler/kernel_profiler.hpp
no longer depends ondataflow_api.h
, but insteaddataflow_api_addrgen.h
! Some small, non-functional refactors in kernel profiler facilitate this.firmware code i.e.
hw/firmware/src/(brisc|ncrisc|erisc|...).cc
must now include dataflow_api.h explicitlytools/profiler/kernel_profiler.hpp
Checklist