-
Notifications
You must be signed in to change notification settings - Fork 455
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
Add the Barefoot Tofino Assembler to the Tofino back end. #5121
base: main
Are you sure you want to change the base?
Conversation
625c981
to
e9b53ca
Compare
Signed-off-by: fruffy <[email protected]>
Signed-off-by: fruffy <[email protected]>
Signed-off-by: fruffy <[email protected]>
Signed-off-by: fruffy <[email protected]>
a870fbf
to
e534899
Compare
Signed-off-by: fruffy <[email protected]>
e534899
to
d9c25e6
Compare
Signed-off-by: fruffy <[email protected]>
… missing. Signed-off-by: fruffy <[email protected]>
Signed-off-by: fruffy <[email protected]>
312dcaf
to
b9b092b
Compare
Signed-off-by: fruffy <[email protected]>
Signed-off-by: fruffy <[email protected]>
b9b092b
to
0abf784
Compare
Signed-off-by: fruffy <[email protected]>
aa8957c
to
a28a715
Compare
Signed-off-by: fruffy <[email protected]>
a28a715
to
a2c1c66
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.
@vlstill Feel free to give an actual detailed review (unlike this one, which is based on CI tests passing, the fact that these changes should affect ONLY the Tofino back end, and wanting to get the other parts of this working in the open-p4studio repo so we can leave it in a mostly-working state for others). However, as far as I can see right now, Fabian is the only one with the knowledge and interest to make these changes, and I'm the only other one interested in seeing that work move forward.
I have probably over-shared my qualifications on this approval :-)
Well, I guess as I originally wrote much of this code, I'm qualified to comment on it, if not review it. The stuff in bf-asm/test is an old broken (non-functional) test suite that is based on running the even older python-based P4_14 compiler, and should probably just be deleted (nothing in it is used, and I don't think any of it is useful) It looks like it does build fine (with just It does have additional dependencies to build (I noticed at least pyyaml -- needed |
Okay, I will remove that code.
Currently, compilation should be covered by the P4Testgen tests which runs the compiler with the following arguments: https://github.com/p4lang/p4c/blob/main/backends/p4tools/modules/testgen/targets/tofino/test/TestTemplate.cmake#L94 But it is not running packet-tests yet because the model isn't integrated. Most of them seem related to particular macro usage in the tables file. The expansion causes additional |
Most of the warning seem to come from base class virtual methods that have unused arguments -- these arguments are named for documentation/clarity (basically noting what the derived classes will do with them) even though they are not used in the base class method. Fixing the warnings by removing the arguments will make the code less self-documenting and harder to read/understand. I guess the arg names should be replaced by comments to both keep the info and silence the warnings. |
Signed-off-by: fruffy <[email protected]>
097b730
to
7229ed3
Compare
Slowly working my way through the warnings. There are a lot of warnings I can not fix because they are generated using |
9019795
to
c722d46
Compare
Signed-off-by: fruffy <[email protected]>
d200785
to
909a3fc
Compare
Signed-off-by: fruffy <[email protected]>
909a3fc
to
dedf4f1
Compare
That code is all generated by the python code in bf-asm/walle/csr.py -- I'll try to take a look at it this weekend. |
Signed-off-by: fruffy <[email protected]>
Currently disable these warnings using |
The Tofino compiler is not really useful without the assembler. Hence we add it directly. Now the assembler is always active when we use
bf-p4c
.The problem is that the assembler code is a little rough and does not pass many of the linting checks P4C has. This required a couple fixes and workarounds. I commented the remaining TODOs in the CMake files. Ideally, we gradually fix all the warnings that are thrown over time.