-
Notifications
You must be signed in to change notification settings - Fork 14
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
P4 Compiler must invoke the assembler by default #54
Comments
Unless you know of code changes required in this repo that are relevant, I agree that this seems more like a p4lang/p4c issue. I guess it is likely that after such a change would be made to p4c, the p4lang/p4c submodule refpoint would need to be updated in order for building this repo's code to take advantage of it. |
@jafingerhut -- we have two options here:
I would prefer the second option, but that requires additional effort. At the very minimum, we need to make sure the changes are integrated into CI. More importantly, I do not understand how we can even maintain the compiler(specifically its Tofino backend) without the assembler. For example, how can we make sure that the code, compiled by it even fits into Tofino's 12 stages. As a result, the proper solution might be quite involved. @fruffy -- what are your thought? Let's decide on the course of action and then figure out how to get from point A to point B. |
If you want CI tests for the Tofino compiler back end, that include the assembler, the three primary choices seem to be:
I don't have a strong opinion of one of these choices over the other. The amount of work required for my option #1 definitely sounds significantly larger. That is a big disadvantage, unless you find (or are yourself) a volunteer to make it all work. |
There are currently no tests for the Tofino compiler, true. |
I think the second option is better -- and I think it should be set up to run the assembler by default if it is installed and not if it is not installed -- the python script should look to see if a bfas binary is there and run it if it is, but not crash or error out (perhaps a warning message) if it is not. |
p4lang/p4c#5070 introduced a new command-line parameter designed to prevent the compiler driver from running the Tofino assembler (
bfas
) by default.While @fruffy explained the technical reason behind it (
bfas
is not included in https://github.com/p4lang/p4c), it is critical to always run the assembler when compiling a P4 program for Tofino. Without doing it, it is not even possible to be sure that the program compiled successfully, since it is the assembler that checks that the compiler output can fit into the number of stages that is actually available on the device.I recommend replacing the flag
--enable-bf-asm
with--disable-bf-asm
and similarly replacing the environment variableENABLE_BF_ASM
withDISABLE_BF_ASM
.I know, this sounds like a compiler issue -- will be happy to move it to p4lang/p4c, but it definitely affects open-p4studio users a lot more.
The text was updated successfully, but these errors were encountered: