p4lang / p4c

P4_16 reference compiler
https://p4.org/
Apache License 2.0
666 stars 441 forks source link

P4::ToP4 is not language agnostic #1778

Closed suriyakode closed 5 years ago

suriyakode commented 5 years ago

When I read a tofino-16 P4 program and build the IR using the open source P4C compiler, the output using P4::ToP4 is always appearing as normal P4-16 code rather than being architecture dependant. I tried this by adding both a ToP4 visitor pass as well as using --top4 option included on some of the executables. My understanding is that the outputted program should be for the same architecture as the inputted program, which doesn't seem to be the case.

mihaibudiu commented 5 years ago

How is normal code supposed to differ from architecture-specific code?

suriyakode commented 5 years ago

Ahh okay, basically there were a round of frontend passes that modified the structure before I called ToP4. I have resolved my problem and will close the issue.