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

Lookahead does not work on bmv2 #355

Closed
mihaibudiu opened this issue Mar 9, 2017 · 0 comments
Closed

Lookahead does not work on bmv2 #355

mihaibudiu opened this issue Mar 9, 2017 · 0 comments

Comments

@mihaibudiu
Copy link
Contributor

The following program generates JSON which crashes BMv2:

#include <core.p4>
#include <v1model.p4>

header ethernet_t {
    bit<48> dstAddr;
    bit<48> srcAddr;
    bit<16> etherType;
}

struct M {
}

struct H {}

control DeparserI(packet_out packet, in H hdr) {
    apply {
    }
}

parser parserI(packet_in pkt, out H hdr, inout M meta, inout standard_metadata_t stdmeta) {
    state start {
        transition select(pkt.lookahead<ethernet_t>().etherType)
        {
            0x1000 &&& 0x1000 : accept;
        }
    }
}

control cIngress(inout H hdr, inout M meta, inout standard_metadata_t stdmeta) {
    apply {
    }
}

control cEgress(inout H hdr, inout M meta, inout standard_metadata_t stdmeta) {
    apply {
    }
}
control vc(in H hdr, inout M meta) {
    apply {
    }
}
control uc(inout H hdr, inout M meta) {
    apply {
    }
}

V1Switch(parserI(), vc(), cIngress(), cEgress(), uc(), DeparserI()) main;
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Mar 18, 2017
…m the language and the associated tests
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Mar 18, 2017
…m the language and the associated tests
mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Mar 24, 2017
…m the language and the associated tests
ChrisDodd pushed a commit that referenced this issue Mar 24, 2017
hanw pushed a commit to hanw/p4c that referenced this issue Apr 4, 2017
…m the language and the associated tests
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