Skip to content
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

compiler bug: "unhandled case" #125

Closed
jnfoster opened this issue Oct 31, 2016 · 1 comment
Closed

compiler bug: "unhandled case" #125

jnfoster opened this issue Oct 31, 2016 · 1 comment

Comments

@jnfoster
Copy link
Contributor

While playing with a small example, I made a small typo that triggered a compiler bug. Note that in the deparser, I wrote h instead of hdr.

#include <v1model.p4>

header d_t {
  bit<32> f;
}

struct h {
  d_t d;
}

struct m { }

parser MyParser(packet_in b,
                out h hdr,
                inout m meta,
                inout standard_metadata_t standard_metadata) {
  state start {
    b.extract(hdr.d);
    transition accept;
  }
}

control MyVerifyChecksum(in h hdr,
                       inout m meta) {
  apply {}

}
control MyIngress(inout h hdr,
                  inout m meta,
                  inout standard_metadata_t standard_metadata) {
  apply {}
}
control MyEgress(inout h hdr,
               inout m meta,
               inout standard_metadata_t standard_metadata) {
  apply {}
}

control MyComputeChecksum(inout h hdr,
                          inout m meta) {
  apply {}
}
control MyDeparser(packet_out b, in h hdr) {
  apply {
    b.emit(h.d);
  }
}

V1Switch(MyParser(),
         MyVerifyChecksum(),
         MyIngress(),
         MyEgress(), 
         MyComputeChecksum(),
         MyDeparser()) main;
ChrisDodd pushed a commit that referenced this issue Nov 3, 2016
@jnfoster
Copy link
Contributor Author

Looks good to me. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant