You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mihai Budiu disclosed that this was intentional, here. As it turns out, the problem with my code was not the .hit attribute, but tables having parameters. This has been removed from the language and the compiler has already been changed accordingly, but is still printing the bug in epigraph.
Here is the complete P4 code I used on the sandbox test.
#include"./p4include/v1model.p4"structMeta {
bit<1> hasmeta;
}
structParsed_packet {
bit<8> field;
}
parser TopParser(packet_in b, out Parsed_packet p, inout Meta m, inout standard_metadata_t metadata) {
state start {
transition accept;
}
}
control VeryChecksum(in Parsed_packet hdr, inout Meta meta) { apply {} }
control IngressP(inout Parsed_packet hdr,
inout Meta meta,
inout standard_metadata_t standard_metadata) {
action Update_face_list(out bit<32> portArray, bit<32> currentVector)
{ portArray = currentVector; }
table testtable(inout bit<32> portArray) {
key = { hdr.field : exact; } //hdr.field is bit<8>
actions = { Update_face_list(portArray); NoAction; }
default_action = NoAction;
}
apply {
bit<32> var = 0;
bool match = false;
match = testtable.apply(var).hit;
if (match) {
var = 5;
}
}
}
control EgressP(inout Parsed_packet hdr,
inout Meta meta,
inout standard_metadata_t standard_metadata) { apply {} }
control ChecksumComputer(inout Parsed_packet hdr,
inout Meta meta) { apply {} }
control TopDeparser(packet_out b, in Parsed_packet hdr) { apply {} }
V1Switch(TopParser(), VeryChecksum(), IngressP(), EgressP(), ChecksumComputer(), TopDeparser()) main;
Compiling with ./p4test --p4v 16 or ./p4c-bm2-ss --p4v 16 yields the following:
simple_switch.p4(78): error: testtable.apply: Passing 1 arguments when 0 expected
match = testtable.apply(var).hit;
------- ^^^^^^^^^^^^^^^^^^^^
terminate called after throwing an instance of 'Util::CompilerBug'
what(): COMPILER BUG: ../frontends/p4/typeChecking/typeChecker.h:100
simple_switch.p4(78): Could not find type of testtable.apply(var);
match = testtable.apply(var).hit;
------- ^^^^^^^^^^^^^^^^^^^^
(p4c-bm-ss also outputs a Segmentation Fault)
The text was updated successfully, but these errors were encountered:
I previously mentioned this on a P4-dev-lists topic: http://lists.p4.org/pipermail/p4-dev_lists.p4.org/2017-March/000858.html
Mihai Budiu disclosed that this was intentional, here. As it turns out, the problem with my code was not the
.hit
attribute, but tables having parameters. This has been removed from the language and the compiler has already been changed accordingly, but is still printing the bug in epigraph.Here is the complete P4 code I used on the sandbox test.
Compiling with
./p4test --p4v 16
or./p4c-bm2-ss --p4v 16
yields the following:(p4c-bm-ss also outputs a Segmentation Fault)
The text was updated successfully, but these errors were encountered: