switch icon indicating copy to clipboard operation
switch copied to clipboard

Will "switch" be rewritten as canonical p4_16?

Open technobilly opened this issue 7 years ago • 7 comments

Would love to have this entire project available in p4_16, thanks.

technobilly avatar Jun 02 '17 00:06 technobilly

You can use the latest version of the P4 compiler in the p4lang/p4c Github repo to auto-translate any P4-14 program to P4-16 for you, although there are a few features not yet supported in such auto-translated versions.

A command to do this auto-translation, and the output file I obtained a few weeks ago, can be found here: https://github.com/jafingerhut/p4lang-tests/tree/master/v1.0.3/switch-2017-03-07/out1

I believe there are people working on writing a P4-16 version of switch.p4 by hand, but I don't know the expected date such a thing might be published.

jafingerhut avatar Jun 02 '17 01:06 jafingerhut

Andy, Thanks for responding. I was aware of the translation option and figured someone would have tried that. I just wondered if a new switch.p4 would ever be written on P4_16 "natively." Meanwhile I'll check out the one you posted, that is handy! - chris

technobilly avatar Jun 02 '17 01:06 technobilly

Hello @technobilly ,

I am sure it will be done at some point, but it takes time and effort.

Since this is a free community project, I would encourage you to start the effort. All the materials (i.e. the original P4_14 code, the new compiler, the language tutorial and the language spec) are available, not to mention the available advice and good vibes from the community. I am sure, others will happily join.

Happy hacking, Vladimir

vgurevich avatar Jun 03 '17 16:06 vgurevich

Vladimir, thanks for replying. Perhaps when I learn more I'll be able to contribute.

technobilly avatar Jun 03 '17 19:06 technobilly

So at this point, there is still no canonical version of switch.p4 in P4-16, right? Is fabric.p4 meant to be an alternative?

fruffy avatar Jul 20 '20 11:07 fruffy

There is no public version of switch.p4 written in P4_16 that I know of, nor has the P4_14 version been updated in years. I think it is best to treat it as a development snapshot at a semi-early point in time of its development, one that is likely to have at least a few bugs.

fabric.p4 that you linked is public, distributed under an open source license, and more actively developed. I don't think the feature set is the same as switch.p4, but I believe that it was never intended to be a feature-by-feature replacement for switch.p4.

jafingerhut avatar Jul 20 '20 18:07 jafingerhut

Thanks!

fruffy avatar Jul 20 '20 19:07 fruffy