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

p4c-ss-bmv2 generates loop #150

Closed
jnfoster opened this issue Nov 17, 2016 · 1 comment
Closed

p4c-ss-bmv2 generates loop #150

jnfoster opened this issue Nov 17, 2016 · 1 comment
Assignees
Labels
fixed This topic is considered to be fixed.

Comments

@jnfoster
Copy link
Contributor

The following program should be rejected as it contains a loop, however p4c-ss-bmv2 accepts it and generates a JSON output in which t occurs twice.

#include <v1model.p4>

header p_t {
  bit<8> fst;
  bit<8> snd;
}

struct h { 
  p_t p;
}

struct m { }

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

control MyVerifyChecksum(in h hdr, inout m meta) {
  apply {}
}
control MyIngress(inout h hdr, inout m meta, inout standard_metadata_t std) {
  action Nop() { }
  table t(inout bit<8> b) {
    key = { b : exact; }
    actions = { Nop; }
    default_action = Nop;
  }
  apply { 
      t.apply(hdr.pfst.);
      t.apply(hdr.p.snd);
  }
}

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

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

V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main;

-N

@ChrisDodd ChrisDodd added the fixed This topic is considered to be fixed. label Dec 13, 2016
@jnfoster
Copy link
Contributor Author

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed This topic is considered to be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants