p4lang / switch

Consolidated switch repo (API, SAI and Nettlink)
151 stars 72 forks source link

Will "switch" be rewritten as canonical p4_16? #96

Open technobilly opened 7 years ago

technobilly commented 7 years ago

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

jafingerhut commented 7 years ago

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.

technobilly commented 7 years ago

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

vgurevich commented 7 years ago

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

technobilly commented 7 years ago

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

fruffy commented 3 years ago

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?

jafingerhut commented 3 years ago

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.

fruffy commented 3 years ago

Thanks!